fix(app): Experience sharing: Adding 'features' to agent_config parameters
This commit is contained in:
@@ -425,8 +425,8 @@ class MultimodalService:
|
|||||||
Dict: 根据 provider 返回不同格式的图片内容
|
Dict: 根据 provider 返回不同格式的图片内容
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
url = await self.get_file_url(file)
|
# url = await self.get_file_url(file)
|
||||||
return await strategy.format_image(url, content=file.get_content())
|
return await strategy.format_image(file.url, content=file.get_content())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"处理图片失败: {e}", exc_info=True)
|
logger.error(f"处理图片失败: {e}", exc_info=True)
|
||||||
return {
|
return {
|
||||||
@@ -476,20 +476,20 @@ class MultimodalService:
|
|||||||
Dict: 根据 provider 返回不同格式的音频内容
|
Dict: 根据 provider 返回不同格式的音频内容
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
url = await self.get_file_url(file)
|
# url = await self.get_file_url(file)
|
||||||
|
|
||||||
# 如果启用音频转文本且有 API Key
|
# 如果启用音频转文本且有 API Key
|
||||||
transcription = None
|
transcription = None
|
||||||
if self.enable_audio_transcription and self.audio_api_key:
|
if self.enable_audio_transcription and self.audio_api_key:
|
||||||
logger.info(f"开始音频转文本: {url}")
|
logger.info(f"开始音频转文本: {file.url}")
|
||||||
if self.provider == "dashscope":
|
if self.provider == "dashscope":
|
||||||
transcription = await AudioTranscriptionService.transcribe_dashscope(url, self.audio_api_key)
|
transcription = await AudioTranscriptionService.transcribe_dashscope(file.url, self.audio_api_key)
|
||||||
elif self.provider == "openai":
|
elif self.provider == "openai":
|
||||||
transcription = await AudioTranscriptionService.transcribe_openai(url, self.audio_api_key)
|
transcription = await AudioTranscriptionService.transcribe_openai(file.url, self.audio_api_key)
|
||||||
else:
|
else:
|
||||||
logger.warning(f"Provider {self.provider} 不支持音频转文本")
|
logger.warning(f"Provider {self.provider} 不支持音频转文本")
|
||||||
|
|
||||||
return await strategy.format_audio(file.file_type, url, file.get_content(), transcription)
|
return await strategy.format_audio(file.file_type, file.url, file.get_content(), transcription)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"处理音频失败: {e}", exc_info=True)
|
logger.error(f"处理音频失败: {e}", exc_info=True)
|
||||||
return {
|
return {
|
||||||
@@ -509,8 +509,8 @@ class MultimodalService:
|
|||||||
Dict: 根据 provider 返回不同格式的视频内容
|
Dict: 根据 provider 返回不同格式的视频内容
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
url = await self.get_file_url(file)
|
# url = await self.get_file_url(file)
|
||||||
return await strategy.format_video(url)
|
return await strategy.format_video(file.url)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"处理视频失败: {e}", exc_info=True)
|
logger.error(f"处理视频失败: {e}", exc_info=True)
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -100,7 +100,8 @@ def agent_config_4_app_release(release: AppRelease) -> AgentConfig:
|
|||||||
memory=config_dict.get("memory"),
|
memory=config_dict.get("memory"),
|
||||||
variables=config_dict.get("variables", []),
|
variables=config_dict.get("variables", []),
|
||||||
tools=config_dict.get("tools", []),
|
tools=config_dict.get("tools", []),
|
||||||
skills=config_dict.get("skills", {})
|
skills=config_dict.get("skills", {}),
|
||||||
|
features=config_dict.get("features", {})
|
||||||
)
|
)
|
||||||
|
|
||||||
return agent_config
|
return agent_config
|
||||||
|
|||||||
Reference in New Issue
Block a user