Use DeepAgents model resolver in reviewer graph
All checks were successful
build / build (push) Successful in 14s
All checks were successful
build / build (push) Successful in 14s
This commit is contained in:
@@ -7,11 +7,11 @@ typed :class:`ReviewReport` through the ``submit_review_report`` tool.
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
from types import SimpleNamespace
|
||||
from typing import Any
|
||||
|
||||
from a2a_pack import GiteaBackend
|
||||
from deepagents import create_deep_agent
|
||||
from langchain_openai import ChatOpenAI
|
||||
from a2a_pack.deepagents import create_a2a_deep_agent
|
||||
|
||||
from .config import Settings, load_settings
|
||||
from .tools import ReviewReport, ToolContext, build_tools
|
||||
@@ -132,22 +132,19 @@ def build_reviewer_graph(
|
||||
+ ", ".join(missing_llm_fields)
|
||||
)
|
||||
|
||||
model_kwargs: dict[str, Any] = {
|
||||
"model": ctx.llm_model,
|
||||
"base_url": ctx.llm_base_url,
|
||||
"api_key": ctx.llm_api_key,
|
||||
"stream_usage": True,
|
||||
}
|
||||
if ctx.llm_temperature_mode != "omit":
|
||||
model_kwargs["temperature"] = (
|
||||
ctx.llm_temperature if ctx.llm_temperature is not None else 0.0
|
||||
)
|
||||
if ctx.llm_extra_body:
|
||||
model_kwargs["extra_body"] = dict(ctx.llm_extra_body)
|
||||
model = ChatOpenAI(**model_kwargs)
|
||||
llm_creds = SimpleNamespace(
|
||||
model=ctx.llm_model,
|
||||
base_url=ctx.llm_base_url,
|
||||
api_key=ctx.llm_api_key,
|
||||
temperature_mode=ctx.llm_temperature_mode or "default",
|
||||
temperature=ctx.llm_temperature,
|
||||
extra_body=dict(ctx.llm_extra_body or {}),
|
||||
)
|
||||
|
||||
return create_deep_agent(
|
||||
model=model,
|
||||
return create_a2a_deep_agent(
|
||||
ctx,
|
||||
creds=llm_creds,
|
||||
default_temperature=0.0,
|
||||
tools=tools,
|
||||
system_prompt=SYSTEM_PROMPT,
|
||||
backend=backend,
|
||||
|
||||
Reference in New Issue
Block a user