Use A2A DeepAgents model resolver
This commit is contained in:
18
agent.py
18
agent.py
@@ -16,10 +16,9 @@ import ssl
|
||||
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 (
|
||||
@@ -136,18 +135,9 @@ class MailuOpenapiAgent(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)
|
||||
graph = create_deep_agent(
|
||||
model=model,
|
||||
graph = create_a2a_deep_agent(
|
||||
ctx,
|
||||
creds=creds,
|
||||
tools=self._operation_tools(ctx),
|
||||
system_prompt=self._system_prompt(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user