diff --git a/src/schemas/schemas.py b/src/schemas/schemas.py index 95d6aafc..01409b6d 100644 --- a/src/schemas/schemas.py +++ b/src/schemas/schemas.py @@ -122,18 +122,6 @@ class AgentBase(BaseModel): def validate_api_key_id(cls, v, values): return v - # Código anterior (comentado temporariamente) - # # Se o tipo for llm, api_key_id é obrigatório - # if "type" in values and values["type"] == "llm" and not v: - # # Verifica se tem api_key no config (retrocompatibilidade) - # if "config" in values and values["config"] and "api_key" in values["config"]: - # # Tem api_key no config, então aceita - # return v - # raise ValueError( - # "api_key_id é obrigatório para agentes do tipo llm" - # ) - # return v - @validator("config") def validate_config(cls, v, values): if "type" in values and values["type"] == "a2a": diff --git a/src/services/custom_tools.py b/src/services/custom_tools.py index 002a4c7b..ad2f8639 100644 --- a/src/services/custom_tools.py +++ b/src/services/custom_tools.py @@ -22,7 +22,6 @@ class CustomToolBuilder: values = tool_config.get("values", {}) error_handling = tool_config.get("error_handling", {}) - # Garante que todos os parâmetros são dicts path_params = parameters.get("path_params") or {} query_params = parameters.get("query_params") or {} body_params = parameters.get("body_params") or {} @@ -149,7 +148,6 @@ class CustomToolBuilder: """Builds a list of tools based on the provided configuration. Accepts both 'tools' and 'custom_tools' (with http_tools).""" self.tools = [] - # Permite receber tanto 'tools' quanto 'custom_tools' (com http_tools) http_tools = [] if tools_config.get("http_tools"): http_tools = tools_config.get("http_tools", []) @@ -157,7 +155,6 @@ class CustomToolBuilder: "http_tools" ): http_tools = tools_config["custom_tools"].get("http_tools", []) - # Suporte para caso tools seja um dict com http_tools elif ( tools_config.get("tools") and isinstance(tools_config["tools"], dict)