Use A2A DeepAgents model resolver
This commit is contained in:
18
agent.py
18
agent.py
@@ -7,10 +7,9 @@ from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
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.tools import StructuredTool
|
||||
from langchain_openai import ChatOpenAI
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from a2a_pack import (
|
||||
@@ -97,20 +96,11 @@ class ApifyApi(A2AAgent):
|
||||
),
|
||||
"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()
|
||||
skills_root = _seed_runtime_skills(backend, ctx)
|
||||
graph = create_deep_agent(
|
||||
model=model,
|
||||
graph = create_a2a_deep_agent(
|
||||
ctx,
|
||||
creds=creds,
|
||||
backend=backend,
|
||||
tools=[],
|
||||
subagents=self._operation_subagents(ctx, skills_root),
|
||||
|
||||
Reference in New Issue
Block a user