refactor(schemas, custom_tools): remove commented-out legacy code and clean up parameter handling

This commit is contained in:
Davidson Gomes 2025-05-09 21:20:33 -03:00
parent c93fe6a8db
commit 2b370a2a4d
2 changed files with 0 additions and 15 deletions

View File

@ -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":

View File

@ -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)