fix: generate agents with platform LLM grants
All checks were successful
build / build (push) Successful in 21s
All checks were successful
build / build (push) Successful in 21s
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
---
|
||||
name: deepagents-implementation-patterns
|
||||
description: Implement DeepAgents inside a2a-pack agents with real deterministic tools, project skills, custom subagents, workspace-backed files, and caller-provided 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 ChatOpenAI models. Use when editing create_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: caller-provided `ChatOpenAI`, A2A workspace backend, project DeepAgents
|
||||
skills, and a small number of exact tools.
|
||||
is: `ctx.llm`-backed `ChatOpenAI`, 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.
|
||||
|
||||
## Implementation Shape
|
||||
|
||||
@@ -32,6 +34,11 @@ stable output paths only when that is one of the grant write prefixes.
|
||||
|
||||
def build_graph(ctx: Any) -> Any:
|
||||
creds = ctx.llm
|
||||
if not creds.api_key:
|
||||
raise RuntimeError(
|
||||
"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,
|
||||
|
||||
Reference in New Issue
Block a user