fix(singleagent): multi input support audio (#362)
This commit is contained in:
parent
3f782d728f
commit
716ec0cba8
|
|
@ -455,7 +455,7 @@ func (c *ConversationApplicationService) parseMultiContent(ctx context.Context,
|
|||
mc[index].File.FileURL = resourceUrl
|
||||
|
||||
multiContents = append(multiContents, &crossDomainMessage.InputMetaData{
|
||||
Type: crossDomainMessage.InputType(item.Type),
|
||||
Type: c.getType(item.File.FileType),
|
||||
FileData: []*crossDomainMessage.FileData{
|
||||
{
|
||||
Url: resourceUrl,
|
||||
|
|
@ -468,10 +468,20 @@ func (c *ConversationApplicationService) parseMultiContent(ctx context.Context,
|
|||
|
||||
return multiContents, mc
|
||||
}
|
||||
func (c *ConversationApplicationService) getType(fileType string) crossDomainMessage.InputType {
|
||||
switch fileType {
|
||||
case string(crossDomainMessage.InputTypeAudio):
|
||||
return crossDomainMessage.InputTypeAudio
|
||||
case string(crossDomainMessage.InputTypeVideo):
|
||||
return crossDomainMessage.InputTypeVideo
|
||||
default:
|
||||
return crossDomainMessage.InputTypeFile
|
||||
}
|
||||
}
|
||||
|
||||
func (s *ConversationApplicationService) getUrlByUri(ctx context.Context, uri string) (string, error) {
|
||||
func (c *ConversationApplicationService) getUrlByUri(ctx context.Context, uri string) (string, error) {
|
||||
|
||||
url, err := s.appContext.ImageX.GetResourceURL(ctx, uri)
|
||||
url, err := c.appContext.ImageX.GetResourceURL(ctx, uri)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ func (dao *MessageDAO) buildModelContent(msgDO *entity.Message) (string, error)
|
|||
URL: contentData.FileData[0].Url,
|
||||
}
|
||||
case message.InputTypeAudio:
|
||||
one.Type = schema.ChatMessagePartTypeFileURL
|
||||
one.Type = schema.ChatMessagePartTypeAudioURL
|
||||
one.AudioURL = &schema.ChatMessageAudioURL{
|
||||
URL: contentData.FileData[0].Url,
|
||||
URI: contentData.FileData[0].URI,
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ require (
|
|||
github.com/tidwall/gjson v1.18.0 // indirect
|
||||
github.com/tidwall/match v1.1.1 // indirect
|
||||
github.com/tidwall/pretty v1.2.1 // indirect
|
||||
github.com/tidwall/sjson v1.2.5 // indirect
|
||||
github.com/tidwall/sjson v1.2.5
|
||||
github.com/tklauser/go-sysconf v0.3.12 // indirect
|
||||
github.com/tklauser/numcpus v0.6.1 // indirect
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 // indirect
|
||||
|
|
|
|||
|
|
@ -940,8 +940,6 @@ github.com/cloudwego/eino-ext/components/model/deepseek v0.0.0-20250715055739-0d
|
|||
github.com/cloudwego/eino-ext/components/model/deepseek v0.0.0-20250715055739-0d0e28441a2f/go.mod h1:3XV+kHvG6IrVj4WXlquihx8i7a8fUKa09PzuS7IvF2k=
|
||||
github.com/cloudwego/eino-ext/components/model/gemini v0.1.2 h1:bt9xftOQhP0Nuh1Po6ZNljSzBvv11Aw6hFLR7V1sLd8=
|
||||
github.com/cloudwego/eino-ext/components/model/gemini v0.1.2/go.mod h1:1tv89uZ9hR/4AyQ+9yxFWLn52GaJDKtPXdEY7WZdyZc=
|
||||
github.com/cloudwego/eino-ext/components/model/ollama v0.0.0-20250610035057-2c4e7c8488a5 h1:GkAAQHQkb1cOTwm6uRokj4lM//wrt/3AkMwTxyFJUg4=
|
||||
github.com/cloudwego/eino-ext/components/model/ollama v0.0.0-20250610035057-2c4e7c8488a5/go.mod h1:giNUFqA+V7xrm/EDvH7JFnDqoWI+e2m1SVAnReU+Fd8=
|
||||
github.com/cloudwego/eino-ext/components/model/ollama v0.1.0 h1:FW067iMfg3EZbUaZIo8v3i2ILBAZDzY23/9pbprvE0M=
|
||||
github.com/cloudwego/eino-ext/components/model/ollama v0.1.0/go.mod h1:+qA5kkUCM0mIrXGSNzxLcjxh6K1AghPNigtEyyMdkOc=
|
||||
github.com/cloudwego/eino-ext/components/model/openai v0.0.0-20250715055739-0d0e28441a2f h1:ovS39vuN2JW+C/O9jtEmOUuLEY4fw0yYh8//yhMfJNM=
|
||||
|
|
|
|||
Loading…
Reference in New Issue