Use sandbox client for builder validation
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:
@@ -1,12 +1,12 @@
|
||||
---
|
||||
name: deepagents-implementation-patterns
|
||||
description: Implement DeepAgents inside a2a-pack agents with real deterministic tools, project skills, custom subagents, workspace-backed files, and ctx.llm-backed ChatOpenAI models. Use when editing create_deep_agent calls or deciding what belongs in tools, skills, or subagents.
|
||||
description: Implement DeepAgents inside a2a-pack agents with real deterministic tools, project skills, custom subagents, workspace-backed files, and ctx.llm-backed model resolution. Use when editing create_a2a_deep_agent calls or deciding what belongs in tools, skills, or subagents.
|
||||
---
|
||||
# DeepAgents Implementation Patterns
|
||||
|
||||
DeepAgents supplies the inner agent loop. In this platform, the reliable shape
|
||||
is: `ctx.llm`-backed `ChatOpenAI`, A2A workspace backend, project DeepAgents
|
||||
skills, and a small number of exact tools. Hosted generated agents should
|
||||
is: `ctx.llm`-backed `create_a2a_deep_agent`, A2A workspace backend, project
|
||||
DeepAgents skills, and a small number of exact tools. Hosted generated agents should
|
||||
declare `LLMProvisioning.PLATFORM`; explicit BYOK agents can declare
|
||||
`CALLER_PROVIDED`, but both modes still read the same `ctx.llm` object.
|
||||
|
||||
@@ -20,8 +20,7 @@ from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from langchain_core.tools import tool
|
||||
from langchain_openai import ChatOpenAI
|
||||
from deepagents import create_deep_agent
|
||||
from a2a_pack.deepagents import create_a2a_deep_agent
|
||||
|
||||
RUNTIME_SKILLS_DIR = "research-agent/.deepagents/skills/"
|
||||
|
||||
@@ -39,13 +38,6 @@ def build_graph(ctx: Any) -> Any:
|
||||
"LLM credentials were not available; declare PLATFORM for hosted "
|
||||
"generated agents or configure caller-provided credentials."
|
||||
)
|
||||
model = ChatOpenAI(
|
||||
model=creds.model,
|
||||
base_url=creds.base_url,
|
||||
api_key=creds.api_key,
|
||||
temperature=0.0,
|
||||
)
|
||||
|
||||
@tool
|
||||
def validate_citations(items_json: str) -> str:
|
||||
"""Validate that each citation has title, url, and claim fields."""
|
||||
@@ -58,8 +50,9 @@ def build_graph(ctx: Any) -> Any:
|
||||
|
||||
backend = ctx.workspace_backend()
|
||||
skill_sources = seed_runtime_skills(backend, ctx)
|
||||
return create_deep_agent(
|
||||
model=model,
|
||||
return create_a2a_deep_agent(
|
||||
ctx,
|
||||
creds=creds,
|
||||
backend=backend,
|
||||
skills=skill_sources or None,
|
||||
tools=[validate_citations],
|
||||
|
||||
Reference in New Issue
Block a user