将所有agent工具的explanation字段改为可选

修复Pydantic验证错误:QueryTransferHistoryInput的explanation字段为必需,但用户未提供。
修改了74个工具文件,将explanation字段从必需改为可选,默认值为None。
This commit is contained in:
jxxghp
2026-05-25 16:40:43 +08:00
parent ca01b8ec3f
commit d940373f6b
74 changed files with 128 additions and 236 deletions

View File

@@ -15,7 +15,7 @@ from app.schemas.types import media_type_to_agent
class RecognizeMediaInput(BaseModel):
"""识别媒体信息工具的输入参数模型"""
explanation: str = Field(..., description="Clear explanation of why this tool is being used in the current context")
explanation: Optional[str] = Field(None, description="Clear explanation of why this tool is being used in the current context")
title: Optional[str] = Field(None, description="The title of the torrent/media to recognize (required for torrent recognition)")
subtitle: Optional[str] = Field(None, description="The subtitle or description of the torrent (optional, helps improve recognition accuracy)")
path: Optional[str] = Field(None, description="The file path to recognize (required for file recognition, mutually exclusive with title)")