feat(agent): add support for workflow agents with updated constraints and configuration

This commit is contained in:
Davidson Gomes
2025-05-06 18:37:13 -03:00
parent 64e483533d
commit 0fc47aaa57
5 changed files with 97 additions and 8 deletions

View File

@@ -147,6 +147,16 @@ async def create_agent(db: Session, agent: AgentCreate) -> Agent:
detail=f"Failed to process agent card: {str(e)}",
)
# Para agentes workflow, não fazemos nenhuma validação específica
# apenas garantimos que config é um dicionário
elif agent.type == "workflow":
if not isinstance(agent.config, dict):
agent.config = {}
# Garantir a API key
if "api_key" not in agent.config or not agent.config["api_key"]:
agent.config["api_key"] = generate_api_key()
# Additional sub-agent validation (for non-llm and non-a2a types)
elif agent.type != "llm":
if not isinstance(agent.config, dict):