fix(singleagent): multi input support audio (#362)

This commit is contained in:
junwen-lee
2025-07-31 00:16:43 +08:00
committed by GitHub
parent 3f782d728f
commit 716ec0cba8
4 changed files with 15 additions and 7 deletions

View File

@@ -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
}