fix(1.0): unexpected error raise (#12812)

This commit is contained in:
非法操作
2025-01-21 10:04:56 +08:00
committed by GitHub
parent 60427f1adf
commit de4752a16b
2 changed files with 7 additions and 3 deletions

View File

@ -48,8 +48,10 @@ class PluginToolManager(BasePluginManager):
tool_provider_id = GenericProviderID(provider)
def transformer(json_response: dict[str, Any]) -> dict:
for tool in json_response.get("data", {}).get("declaration", {}).get("tools", []):
tool["identity"]["provider"] = tool_provider_id.provider_name
data = json_response.get("data")
if data:
for tool in data.get("declaration", {}).get("tools", []):
tool["identity"]["provider"] = tool_provider_id.provider_name
return json_response