feat(agent): complete music workflow support

This commit is contained in:
jxxghp
2026-08-10 08:11:54 +08:00
parent 1fc255b8a7
commit b3b376f2b1
40 changed files with 2224 additions and 266 deletions
+6 -1
View File
@@ -30,11 +30,16 @@ class MediaType(Enum):
def media_type_to_agent(value) -> Optional[str]:
""" MediaType 枚举或字符串统一转换为 Agent 媒体类型。"""
"""枚举、Agent 键或数据库枚举值统一转换为 Agent 媒体类型。"""
if isinstance(value, MediaType):
return value.to_agent()
if isinstance(value, str):
mt = MediaType.from_agent(value)
if not mt:
try:
mt = MediaType(value)
except ValueError:
pass
return mt.to_agent() if mt else value
return None