Use A2A DeepAgents model resolver

This commit is contained in:
2026-06-06 20:30:09 -03:00
parent dfb65e705f
commit b6830caa71

View File

@@ -7,10 +7,9 @@ from pathlib import Path
from typing import Any from typing import Any
import httpx import httpx
from deepagents import create_deep_agent from a2a_pack.deepagents import create_a2a_deep_agent
from langchain_core.messages import BaseMessage from langchain_core.messages import BaseMessage
from langchain_core.tools import StructuredTool from langchain_core.tools import StructuredTool
from langchain_openai import ChatOpenAI
from pydantic import BaseModel, Field from pydantic import BaseModel, Field
from a2a_pack import ( from a2a_pack import (
@@ -97,20 +96,11 @@ class ApifyApi(A2AAgent):
), ),
"messages": [], "messages": [],
} }
model_kwargs: dict[str, Any] = {
"model": creds.model,
"base_url": creds.base_url,
"api_key": creds.api_key,
}
if creds.temperature_mode != "omit" and creds.temperature is not None:
model_kwargs["temperature"] = creds.temperature
if creds.extra_body:
model_kwargs["extra_body"] = dict(creds.extra_body)
model = ChatOpenAI(**model_kwargs)
backend = ctx.workspace_backend() backend = ctx.workspace_backend()
skills_root = _seed_runtime_skills(backend, ctx) skills_root = _seed_runtime_skills(backend, ctx)
graph = create_deep_agent( graph = create_a2a_deep_agent(
model=model, ctx,
creds=creds,
backend=backend, backend=backend,
tools=[], tools=[],
subagents=self._operation_subagents(ctx, skills_root), subagents=self._operation_subagents(ctx, skills_root),