pydantic-ai-slim 1.0.16__tar.gz → 1.0.17__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pydantic-ai-slim might be problematic. Click here for more details.
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/PKG-INFO +3 -3
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/agent/__init__.py +15 -2
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/agent/abstract.py +27 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/agent/wrapper.py +6 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/builtin_tools.py +4 -1
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/durable_exec/dbos/_agent.py +31 -2
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/durable_exec/temporal/_agent.py +26 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/messages.py +5 -1
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/.gitignore +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/LICENSE +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/README.md +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/__init__.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/__main__.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/_a2a.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/_agent_graph.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/_cli.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/_function_schema.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/_griffe.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/_instrumentation.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/_json_schema.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/_mcp.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/_otel_messages.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/_output.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/_parts_manager.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/_run_context.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/_system_prompt.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/_thinking_part.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/_tool_manager.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/_utils.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/ag_ui.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/common_tools/__init__.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/common_tools/duckduckgo.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/common_tools/tavily.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/direct.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/durable_exec/__init__.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/durable_exec/dbos/__init__.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/durable_exec/dbos/_mcp_server.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/durable_exec/dbos/_model.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/durable_exec/dbos/_utils.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/durable_exec/temporal/__init__.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/durable_exec/temporal/_function_toolset.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/durable_exec/temporal/_logfire.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/durable_exec/temporal/_mcp_server.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/durable_exec/temporal/_model.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/durable_exec/temporal/_run_context.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/durable_exec/temporal/_toolset.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/exceptions.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/ext/__init__.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/ext/aci.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/ext/langchain.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/format_prompt.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/mcp.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/models/__init__.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/models/anthropic.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/models/bedrock.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/models/cohere.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/models/fallback.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/models/function.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/models/gemini.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/models/google.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/models/groq.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/models/huggingface.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/models/instrumented.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/models/mcp_sampling.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/models/mistral.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/models/openai.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/models/test.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/models/wrapper.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/output.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/profiles/__init__.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/profiles/amazon.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/profiles/anthropic.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/profiles/cohere.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/profiles/deepseek.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/profiles/google.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/profiles/grok.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/profiles/groq.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/profiles/harmony.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/profiles/meta.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/profiles/mistral.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/profiles/moonshotai.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/profiles/openai.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/profiles/qwen.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/__init__.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/anthropic.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/azure.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/bedrock.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/cerebras.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/cohere.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/deepseek.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/fireworks.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/gateway.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/github.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/google.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/google_gla.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/google_vertex.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/grok.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/groq.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/heroku.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/huggingface.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/litellm.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/mistral.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/moonshotai.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/ollama.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/openai.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/openrouter.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/together.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/providers/vercel.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/py.typed +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/result.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/retries.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/run.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/settings.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/tools.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/toolsets/__init__.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/toolsets/_dynamic.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/toolsets/abstract.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/toolsets/approval_required.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/toolsets/combined.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/toolsets/external.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/toolsets/filtered.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/toolsets/function.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/toolsets/prefixed.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/toolsets/prepared.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/toolsets/renamed.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/toolsets/wrapper.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pydantic_ai/usage.py +0 -0
- {pydantic_ai_slim-1.0.16 → pydantic_ai_slim-1.0.17}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pydantic-ai-slim
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.17
|
|
4
4
|
Summary: Agent Framework / shim to use Pydantic with LLMs, slim package
|
|
5
5
|
Project-URL: Homepage, https://github.com/pydantic/pydantic-ai/tree/main/pydantic_ai_slim
|
|
6
6
|
Project-URL: Source, https://github.com/pydantic/pydantic-ai/tree/main/pydantic_ai_slim
|
|
@@ -33,7 +33,7 @@ Requires-Dist: genai-prices>=0.0.30
|
|
|
33
33
|
Requires-Dist: griffe>=1.3.2
|
|
34
34
|
Requires-Dist: httpx>=0.27
|
|
35
35
|
Requires-Dist: opentelemetry-api>=1.28.0
|
|
36
|
-
Requires-Dist: pydantic-graph==1.0.
|
|
36
|
+
Requires-Dist: pydantic-graph==1.0.17
|
|
37
37
|
Requires-Dist: pydantic>=2.10
|
|
38
38
|
Requires-Dist: typing-inspection>=0.4.0
|
|
39
39
|
Provides-Extra: a2a
|
|
@@ -57,7 +57,7 @@ Requires-Dist: dbos>=1.14.0; extra == 'dbos'
|
|
|
57
57
|
Provides-Extra: duckduckgo
|
|
58
58
|
Requires-Dist: ddgs>=9.0.0; extra == 'duckduckgo'
|
|
59
59
|
Provides-Extra: evals
|
|
60
|
-
Requires-Dist: pydantic-evals==1.0.
|
|
60
|
+
Requires-Dist: pydantic-evals==1.0.17; extra == 'evals'
|
|
61
61
|
Provides-Extra: google
|
|
62
62
|
Requires-Dist: google-genai>=1.31.0; extra == 'google'
|
|
63
63
|
Provides-Extra: groq
|
|
@@ -426,6 +426,7 @@ class Agent(AbstractAgent[AgentDepsT, OutputDataT]):
|
|
|
426
426
|
usage: _usage.RunUsage | None = None,
|
|
427
427
|
infer_name: bool = True,
|
|
428
428
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
429
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
429
430
|
) -> AbstractAsyncContextManager[AgentRun[AgentDepsT, OutputDataT]]: ...
|
|
430
431
|
|
|
431
432
|
@overload
|
|
@@ -443,6 +444,7 @@ class Agent(AbstractAgent[AgentDepsT, OutputDataT]):
|
|
|
443
444
|
usage: _usage.RunUsage | None = None,
|
|
444
445
|
infer_name: bool = True,
|
|
445
446
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
447
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
446
448
|
) -> AbstractAsyncContextManager[AgentRun[AgentDepsT, RunOutputDataT]]: ...
|
|
447
449
|
|
|
448
450
|
@asynccontextmanager
|
|
@@ -460,6 +462,7 @@ class Agent(AbstractAgent[AgentDepsT, OutputDataT]):
|
|
|
460
462
|
usage: _usage.RunUsage | None = None,
|
|
461
463
|
infer_name: bool = True,
|
|
462
464
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
465
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
463
466
|
) -> AsyncIterator[AgentRun[AgentDepsT, Any]]:
|
|
464
467
|
"""A contextmanager which can be used to iterate over the agent graph's nodes as they are executed.
|
|
465
468
|
|
|
@@ -532,6 +535,7 @@ class Agent(AbstractAgent[AgentDepsT, OutputDataT]):
|
|
|
532
535
|
usage: Optional usage to start with, useful for resuming a conversation or agents used in tools.
|
|
533
536
|
infer_name: Whether to try to infer the agent name from the call frame if it's not set.
|
|
534
537
|
toolsets: Optional additional toolsets for this run.
|
|
538
|
+
builtin_tools: Optional additional builtin tools for this run.
|
|
535
539
|
|
|
536
540
|
Returns:
|
|
537
541
|
The result of the run.
|
|
@@ -603,7 +607,16 @@ class Agent(AbstractAgent[AgentDepsT, OutputDataT]):
|
|
|
603
607
|
else:
|
|
604
608
|
instrumentation_settings = None
|
|
605
609
|
tracer = NoOpTracer()
|
|
606
|
-
|
|
610
|
+
if builtin_tools:
|
|
611
|
+
# Deduplicate builtin tools passed to the agent and the run based on type
|
|
612
|
+
builtin_tools = list(
|
|
613
|
+
{
|
|
614
|
+
**({type(tool): tool for tool in self._builtin_tools or []}),
|
|
615
|
+
**({type(tool): tool for tool in builtin_tools}),
|
|
616
|
+
}.values()
|
|
617
|
+
)
|
|
618
|
+
else:
|
|
619
|
+
builtin_tools = list(self._builtin_tools)
|
|
607
620
|
graph_deps = _agent_graph.GraphAgentDeps[AgentDepsT, RunOutputDataT](
|
|
608
621
|
user_deps=deps,
|
|
609
622
|
prompt=user_prompt,
|
|
@@ -616,7 +629,7 @@ class Agent(AbstractAgent[AgentDepsT, OutputDataT]):
|
|
|
616
629
|
output_schema=output_schema,
|
|
617
630
|
output_validators=output_validators,
|
|
618
631
|
history_processors=self.history_processors,
|
|
619
|
-
builtin_tools=
|
|
632
|
+
builtin_tools=builtin_tools,
|
|
620
633
|
tool_manager=tool_manager,
|
|
621
634
|
tracer=tracer,
|
|
622
635
|
get_instructions=get_instructions,
|
|
@@ -25,6 +25,7 @@ from .. import (
|
|
|
25
25
|
usage as _usage,
|
|
26
26
|
)
|
|
27
27
|
from .._tool_manager import ToolManager
|
|
28
|
+
from ..builtin_tools import AbstractBuiltinTool
|
|
28
29
|
from ..output import OutputDataT, OutputSpec
|
|
29
30
|
from ..result import AgentStream, FinalResult, StreamedRunResult
|
|
30
31
|
from ..run import AgentRun, AgentRunResult, AgentRunResultEvent
|
|
@@ -137,6 +138,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
137
138
|
usage: _usage.RunUsage | None = None,
|
|
138
139
|
infer_name: bool = True,
|
|
139
140
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
141
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
140
142
|
event_stream_handler: EventStreamHandler[AgentDepsT] | None = None,
|
|
141
143
|
) -> AgentRunResult[OutputDataT]: ...
|
|
142
144
|
|
|
@@ -155,6 +157,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
155
157
|
usage: _usage.RunUsage | None = None,
|
|
156
158
|
infer_name: bool = True,
|
|
157
159
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
160
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
158
161
|
event_stream_handler: EventStreamHandler[AgentDepsT] | None = None,
|
|
159
162
|
) -> AgentRunResult[RunOutputDataT]: ...
|
|
160
163
|
|
|
@@ -172,6 +175,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
172
175
|
usage: _usage.RunUsage | None = None,
|
|
173
176
|
infer_name: bool = True,
|
|
174
177
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
178
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
175
179
|
event_stream_handler: EventStreamHandler[AgentDepsT] | None = None,
|
|
176
180
|
) -> AgentRunResult[Any]:
|
|
177
181
|
"""Run the agent with a user prompt in async mode.
|
|
@@ -205,6 +209,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
205
209
|
infer_name: Whether to try to infer the agent name from the call frame if it's not set.
|
|
206
210
|
toolsets: Optional additional toolsets for this run.
|
|
207
211
|
event_stream_handler: Optional handler for events from the model's streaming response and the agent's execution of tools to use for this run.
|
|
212
|
+
builtin_tools: Optional additional builtin tools for this run.
|
|
208
213
|
|
|
209
214
|
Returns:
|
|
210
215
|
The result of the run.
|
|
@@ -225,6 +230,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
225
230
|
usage_limits=usage_limits,
|
|
226
231
|
usage=usage,
|
|
227
232
|
toolsets=toolsets,
|
|
233
|
+
builtin_tools=builtin_tools,
|
|
228
234
|
) as agent_run:
|
|
229
235
|
async for node in agent_run:
|
|
230
236
|
if event_stream_handler is not None and (
|
|
@@ -251,6 +257,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
251
257
|
usage: _usage.RunUsage | None = None,
|
|
252
258
|
infer_name: bool = True,
|
|
253
259
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
260
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
254
261
|
event_stream_handler: EventStreamHandler[AgentDepsT] | None = None,
|
|
255
262
|
) -> AgentRunResult[OutputDataT]: ...
|
|
256
263
|
|
|
@@ -269,6 +276,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
269
276
|
usage: _usage.RunUsage | None = None,
|
|
270
277
|
infer_name: bool = True,
|
|
271
278
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
279
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
272
280
|
event_stream_handler: EventStreamHandler[AgentDepsT] | None = None,
|
|
273
281
|
) -> AgentRunResult[RunOutputDataT]: ...
|
|
274
282
|
|
|
@@ -286,6 +294,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
286
294
|
usage: _usage.RunUsage | None = None,
|
|
287
295
|
infer_name: bool = True,
|
|
288
296
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
297
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
289
298
|
event_stream_handler: EventStreamHandler[AgentDepsT] | None = None,
|
|
290
299
|
) -> AgentRunResult[Any]:
|
|
291
300
|
"""Synchronously run the agent with a user prompt.
|
|
@@ -318,6 +327,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
318
327
|
infer_name: Whether to try to infer the agent name from the call frame if it's not set.
|
|
319
328
|
toolsets: Optional additional toolsets for this run.
|
|
320
329
|
event_stream_handler: Optional handler for events from the model's streaming response and the agent's execution of tools to use for this run.
|
|
330
|
+
builtin_tools: Optional additional builtin tools for this run.
|
|
321
331
|
|
|
322
332
|
Returns:
|
|
323
333
|
The result of the run.
|
|
@@ -338,6 +348,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
338
348
|
usage=usage,
|
|
339
349
|
infer_name=False,
|
|
340
350
|
toolsets=toolsets,
|
|
351
|
+
builtin_tools=builtin_tools,
|
|
341
352
|
event_stream_handler=event_stream_handler,
|
|
342
353
|
)
|
|
343
354
|
)
|
|
@@ -357,6 +368,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
357
368
|
usage: _usage.RunUsage | None = None,
|
|
358
369
|
infer_name: bool = True,
|
|
359
370
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
371
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
360
372
|
event_stream_handler: EventStreamHandler[AgentDepsT] | None = None,
|
|
361
373
|
) -> AbstractAsyncContextManager[result.StreamedRunResult[AgentDepsT, OutputDataT]]: ...
|
|
362
374
|
|
|
@@ -375,6 +387,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
375
387
|
usage: _usage.RunUsage | None = None,
|
|
376
388
|
infer_name: bool = True,
|
|
377
389
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
390
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
378
391
|
event_stream_handler: EventStreamHandler[AgentDepsT] | None = None,
|
|
379
392
|
) -> AbstractAsyncContextManager[result.StreamedRunResult[AgentDepsT, RunOutputDataT]]: ...
|
|
380
393
|
|
|
@@ -393,6 +406,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
393
406
|
usage: _usage.RunUsage | None = None,
|
|
394
407
|
infer_name: bool = True,
|
|
395
408
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
409
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
396
410
|
event_stream_handler: EventStreamHandler[AgentDepsT] | None = None,
|
|
397
411
|
) -> AsyncIterator[result.StreamedRunResult[AgentDepsT, Any]]:
|
|
398
412
|
"""Run the agent with a user prompt in async streaming mode.
|
|
@@ -432,6 +446,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
432
446
|
usage: Optional usage to start with, useful for resuming a conversation or agents used in tools.
|
|
433
447
|
infer_name: Whether to try to infer the agent name from the call frame if it's not set.
|
|
434
448
|
toolsets: Optional additional toolsets for this run.
|
|
449
|
+
builtin_tools: Optional additional builtin tools for this run.
|
|
435
450
|
event_stream_handler: Optional handler for events from the model's streaming response and the agent's execution of tools to use for this run.
|
|
436
451
|
It will receive all the events up until the final result is found, which you can then read or stream from inside the context manager.
|
|
437
452
|
Note that it does _not_ receive any events after the final result is found.
|
|
@@ -459,6 +474,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
459
474
|
usage=usage,
|
|
460
475
|
infer_name=False,
|
|
461
476
|
toolsets=toolsets,
|
|
477
|
+
builtin_tools=builtin_tools,
|
|
462
478
|
) as agent_run:
|
|
463
479
|
first_node = agent_run.next_node # start with the first node
|
|
464
480
|
assert isinstance(first_node, _agent_graph.UserPromptNode) # the first node should be a user prompt node
|
|
@@ -568,6 +584,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
568
584
|
usage: _usage.RunUsage | None = None,
|
|
569
585
|
infer_name: bool = True,
|
|
570
586
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
587
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
571
588
|
) -> AsyncIterator[_messages.AgentStreamEvent | AgentRunResultEvent[OutputDataT]]: ...
|
|
572
589
|
|
|
573
590
|
@overload
|
|
@@ -585,6 +602,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
585
602
|
usage: _usage.RunUsage | None = None,
|
|
586
603
|
infer_name: bool = True,
|
|
587
604
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
605
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
588
606
|
) -> AsyncIterator[_messages.AgentStreamEvent | AgentRunResultEvent[RunOutputDataT]]: ...
|
|
589
607
|
|
|
590
608
|
def run_stream_events(
|
|
@@ -601,6 +619,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
601
619
|
usage: _usage.RunUsage | None = None,
|
|
602
620
|
infer_name: bool = True,
|
|
603
621
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
622
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
604
623
|
) -> AsyncIterator[_messages.AgentStreamEvent | AgentRunResultEvent[Any]]:
|
|
605
624
|
"""Run the agent with a user prompt in async mode and stream events from the run.
|
|
606
625
|
|
|
@@ -646,6 +665,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
646
665
|
usage: Optional usage to start with, useful for resuming a conversation or agents used in tools.
|
|
647
666
|
infer_name: Whether to try to infer the agent name from the call frame if it's not set.
|
|
648
667
|
toolsets: Optional additional toolsets for this run.
|
|
668
|
+
builtin_tools: Optional additional builtin tools for this run.
|
|
649
669
|
|
|
650
670
|
Returns:
|
|
651
671
|
An async iterable of stream events `AgentStreamEvent` and finally a `AgentRunResultEvent` with the final
|
|
@@ -666,6 +686,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
666
686
|
usage=usage,
|
|
667
687
|
infer_name=infer_name,
|
|
668
688
|
toolsets=toolsets,
|
|
689
|
+
builtin_tools=builtin_tools,
|
|
669
690
|
)
|
|
670
691
|
|
|
671
692
|
async def _run_stream_events(
|
|
@@ -682,6 +703,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
682
703
|
usage: _usage.RunUsage | None = None,
|
|
683
704
|
infer_name: bool = True,
|
|
684
705
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
706
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
685
707
|
) -> AsyncIterator[_messages.AgentStreamEvent | AgentRunResultEvent[Any]]:
|
|
686
708
|
send_stream, receive_stream = anyio.create_memory_object_stream[
|
|
687
709
|
_messages.AgentStreamEvent | AgentRunResultEvent[Any]
|
|
@@ -707,6 +729,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
707
729
|
usage=usage,
|
|
708
730
|
infer_name=infer_name,
|
|
709
731
|
toolsets=toolsets,
|
|
732
|
+
builtin_tools=builtin_tools,
|
|
710
733
|
event_stream_handler=event_stream_handler,
|
|
711
734
|
)
|
|
712
735
|
|
|
@@ -734,6 +757,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
734
757
|
usage: _usage.RunUsage | None = None,
|
|
735
758
|
infer_name: bool = True,
|
|
736
759
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
760
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
737
761
|
) -> AbstractAsyncContextManager[AgentRun[AgentDepsT, OutputDataT]]: ...
|
|
738
762
|
|
|
739
763
|
@overload
|
|
@@ -751,6 +775,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
751
775
|
usage: _usage.RunUsage | None = None,
|
|
752
776
|
infer_name: bool = True,
|
|
753
777
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
778
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
754
779
|
) -> AbstractAsyncContextManager[AgentRun[AgentDepsT, RunOutputDataT]]: ...
|
|
755
780
|
|
|
756
781
|
@asynccontextmanager
|
|
@@ -769,6 +794,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
769
794
|
usage: _usage.RunUsage | None = None,
|
|
770
795
|
infer_name: bool = True,
|
|
771
796
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
797
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
772
798
|
) -> AsyncIterator[AgentRun[AgentDepsT, Any]]:
|
|
773
799
|
"""A contextmanager which can be used to iterate over the agent graph's nodes as they are executed.
|
|
774
800
|
|
|
@@ -841,6 +867,7 @@ class AbstractAgent(Generic[AgentDepsT, OutputDataT], ABC):
|
|
|
841
867
|
usage: Optional usage to start with, useful for resuming a conversation or agents used in tools.
|
|
842
868
|
infer_name: Whether to try to infer the agent name from the call frame if it's not set.
|
|
843
869
|
toolsets: Optional additional toolsets for this run.
|
|
870
|
+
builtin_tools: Optional additional builtin tools for this run.
|
|
844
871
|
|
|
845
872
|
Returns:
|
|
846
873
|
The result of the run.
|
|
@@ -10,6 +10,7 @@ from .. import (
|
|
|
10
10
|
models,
|
|
11
11
|
usage as _usage,
|
|
12
12
|
)
|
|
13
|
+
from ..builtin_tools import AbstractBuiltinTool
|
|
13
14
|
from ..output import OutputDataT, OutputSpec
|
|
14
15
|
from ..run import AgentRun
|
|
15
16
|
from ..settings import ModelSettings
|
|
@@ -81,6 +82,7 @@ class WrapperAgent(AbstractAgent[AgentDepsT, OutputDataT]):
|
|
|
81
82
|
usage: _usage.RunUsage | None = None,
|
|
82
83
|
infer_name: bool = True,
|
|
83
84
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
85
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
84
86
|
) -> AbstractAsyncContextManager[AgentRun[AgentDepsT, OutputDataT]]: ...
|
|
85
87
|
|
|
86
88
|
@overload
|
|
@@ -98,6 +100,7 @@ class WrapperAgent(AbstractAgent[AgentDepsT, OutputDataT]):
|
|
|
98
100
|
usage: _usage.RunUsage | None = None,
|
|
99
101
|
infer_name: bool = True,
|
|
100
102
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
103
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
101
104
|
) -> AbstractAsyncContextManager[AgentRun[AgentDepsT, RunOutputDataT]]: ...
|
|
102
105
|
|
|
103
106
|
@asynccontextmanager
|
|
@@ -115,6 +118,7 @@ class WrapperAgent(AbstractAgent[AgentDepsT, OutputDataT]):
|
|
|
115
118
|
usage: _usage.RunUsage | None = None,
|
|
116
119
|
infer_name: bool = True,
|
|
117
120
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
121
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
118
122
|
) -> AsyncIterator[AgentRun[AgentDepsT, Any]]:
|
|
119
123
|
"""A contextmanager which can be used to iterate over the agent graph's nodes as they are executed.
|
|
120
124
|
|
|
@@ -187,6 +191,7 @@ class WrapperAgent(AbstractAgent[AgentDepsT, OutputDataT]):
|
|
|
187
191
|
usage: Optional usage to start with, useful for resuming a conversation or agents used in tools.
|
|
188
192
|
infer_name: Whether to try to infer the agent name from the call frame if it's not set.
|
|
189
193
|
toolsets: Optional additional toolsets for this run.
|
|
194
|
+
builtin_tools: Optional additional builtin tools for this run.
|
|
190
195
|
|
|
191
196
|
Returns:
|
|
192
197
|
The result of the run.
|
|
@@ -203,6 +208,7 @@ class WrapperAgent(AbstractAgent[AgentDepsT, OutputDataT]):
|
|
|
203
208
|
usage=usage,
|
|
204
209
|
infer_name=infer_name,
|
|
205
210
|
toolsets=toolsets,
|
|
211
|
+
builtin_tools=builtin_tools,
|
|
206
212
|
) as run:
|
|
207
213
|
yield run
|
|
208
214
|
|
|
@@ -2,10 +2,13 @@ from __future__ import annotations as _annotations
|
|
|
2
2
|
|
|
3
3
|
from abc import ABC
|
|
4
4
|
from dataclasses import dataclass
|
|
5
|
-
from typing import Literal
|
|
5
|
+
from typing import TYPE_CHECKING, Literal
|
|
6
6
|
|
|
7
7
|
from typing_extensions import TypedDict
|
|
8
8
|
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from .builtin_tools import AbstractBuiltinTool
|
|
11
|
+
|
|
9
12
|
__all__ = (
|
|
10
13
|
'AbstractBuiltinTool',
|
|
11
14
|
'WebSearchTool',
|
|
@@ -15,8 +15,9 @@ from pydantic_ai import (
|
|
|
15
15
|
models,
|
|
16
16
|
usage as _usage,
|
|
17
17
|
)
|
|
18
|
-
from pydantic_ai.agent import AbstractAgent, AgentRun, AgentRunResult, EventStreamHandler,
|
|
19
|
-
from pydantic_ai.agent.abstract import Instructions
|
|
18
|
+
from pydantic_ai.agent import AbstractAgent, AgentRun, AgentRunResult, EventStreamHandler, WrapperAgent
|
|
19
|
+
from pydantic_ai.agent.abstract import Instructions, RunOutputDataT
|
|
20
|
+
from pydantic_ai.builtin_tools import AbstractBuiltinTool
|
|
20
21
|
from pydantic_ai.exceptions import UserError
|
|
21
22
|
from pydantic_ai.models import Model
|
|
22
23
|
from pydantic_ai.output import OutputDataT, OutputSpec
|
|
@@ -121,6 +122,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
121
122
|
usage: _usage.RunUsage | None = None,
|
|
122
123
|
infer_name: bool = True,
|
|
123
124
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
125
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
124
126
|
event_stream_handler: EventStreamHandler[AgentDepsT] | None = None,
|
|
125
127
|
**_deprecated_kwargs: Never,
|
|
126
128
|
) -> AgentRunResult[Any]:
|
|
@@ -137,6 +139,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
137
139
|
usage=usage,
|
|
138
140
|
infer_name=infer_name,
|
|
139
141
|
toolsets=toolsets,
|
|
142
|
+
builtin_tools=builtin_tools,
|
|
140
143
|
event_stream_handler=event_stream_handler,
|
|
141
144
|
**_deprecated_kwargs,
|
|
142
145
|
)
|
|
@@ -158,6 +161,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
158
161
|
usage: _usage.RunUsage | None = None,
|
|
159
162
|
infer_name: bool = True,
|
|
160
163
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
164
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
161
165
|
event_stream_handler: EventStreamHandler[AgentDepsT] | None = None,
|
|
162
166
|
**_deprecated_kwargs: Never,
|
|
163
167
|
) -> AgentRunResult[Any]:
|
|
@@ -174,6 +178,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
174
178
|
usage=usage,
|
|
175
179
|
infer_name=infer_name,
|
|
176
180
|
toolsets=toolsets,
|
|
181
|
+
builtin_tools=builtin_tools,
|
|
177
182
|
event_stream_handler=event_stream_handler,
|
|
178
183
|
**_deprecated_kwargs,
|
|
179
184
|
)
|
|
@@ -246,6 +251,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
246
251
|
usage: _usage.RunUsage | None = None,
|
|
247
252
|
infer_name: bool = True,
|
|
248
253
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
254
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
249
255
|
event_stream_handler: EventStreamHandler[AgentDepsT] | None = None,
|
|
250
256
|
) -> AgentRunResult[OutputDataT]: ...
|
|
251
257
|
|
|
@@ -264,6 +270,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
264
270
|
usage: _usage.RunUsage | None = None,
|
|
265
271
|
infer_name: bool = True,
|
|
266
272
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
273
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
267
274
|
event_stream_handler: EventStreamHandler[AgentDepsT] | None = None,
|
|
268
275
|
) -> AgentRunResult[RunOutputDataT]: ...
|
|
269
276
|
|
|
@@ -281,6 +288,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
281
288
|
usage: _usage.RunUsage | None = None,
|
|
282
289
|
infer_name: bool = True,
|
|
283
290
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
291
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
284
292
|
event_stream_handler: EventStreamHandler[AgentDepsT] | None = None,
|
|
285
293
|
**_deprecated_kwargs: Never,
|
|
286
294
|
) -> AgentRunResult[Any]:
|
|
@@ -314,6 +322,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
314
322
|
usage: Optional usage to start with, useful for resuming a conversation or agents used in tools.
|
|
315
323
|
infer_name: Whether to try to infer the agent name from the call frame if it's not set.
|
|
316
324
|
toolsets: Optional additional toolsets for this run.
|
|
325
|
+
builtin_tools: Optional additional builtin tools for this run.
|
|
317
326
|
event_stream_handler: Optional event stream handler to use for this run.
|
|
318
327
|
|
|
319
328
|
Returns:
|
|
@@ -331,6 +340,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
331
340
|
usage=usage,
|
|
332
341
|
infer_name=infer_name,
|
|
333
342
|
toolsets=toolsets,
|
|
343
|
+
builtin_tools=builtin_tools,
|
|
334
344
|
event_stream_handler=event_stream_handler,
|
|
335
345
|
**_deprecated_kwargs,
|
|
336
346
|
)
|
|
@@ -350,6 +360,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
350
360
|
usage: _usage.RunUsage | None = None,
|
|
351
361
|
infer_name: bool = True,
|
|
352
362
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
363
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
353
364
|
event_stream_handler: EventStreamHandler[AgentDepsT] | None = None,
|
|
354
365
|
) -> AgentRunResult[OutputDataT]: ...
|
|
355
366
|
|
|
@@ -368,6 +379,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
368
379
|
usage: _usage.RunUsage | None = None,
|
|
369
380
|
infer_name: bool = True,
|
|
370
381
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
382
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
371
383
|
event_stream_handler: EventStreamHandler[AgentDepsT] | None = None,
|
|
372
384
|
) -> AgentRunResult[RunOutputDataT]: ...
|
|
373
385
|
|
|
@@ -385,6 +397,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
385
397
|
usage: _usage.RunUsage | None = None,
|
|
386
398
|
infer_name: bool = True,
|
|
387
399
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
400
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
388
401
|
event_stream_handler: EventStreamHandler[AgentDepsT] | None = None,
|
|
389
402
|
**_deprecated_kwargs: Never,
|
|
390
403
|
) -> AgentRunResult[Any]:
|
|
@@ -417,6 +430,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
417
430
|
usage: Optional usage to start with, useful for resuming a conversation or agents used in tools.
|
|
418
431
|
infer_name: Whether to try to infer the agent name from the call frame if it's not set.
|
|
419
432
|
toolsets: Optional additional toolsets for this run.
|
|
433
|
+
builtin_tools: Optional additional builtin tools for this run.
|
|
420
434
|
event_stream_handler: Optional event stream handler to use for this run.
|
|
421
435
|
|
|
422
436
|
Returns:
|
|
@@ -434,6 +448,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
434
448
|
usage=usage,
|
|
435
449
|
infer_name=infer_name,
|
|
436
450
|
toolsets=toolsets,
|
|
451
|
+
builtin_tools=builtin_tools,
|
|
437
452
|
event_stream_handler=event_stream_handler,
|
|
438
453
|
**_deprecated_kwargs,
|
|
439
454
|
)
|
|
@@ -453,6 +468,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
453
468
|
usage: _usage.RunUsage | None = None,
|
|
454
469
|
infer_name: bool = True,
|
|
455
470
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
471
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
456
472
|
event_stream_handler: EventStreamHandler[AgentDepsT] | None = None,
|
|
457
473
|
) -> AbstractAsyncContextManager[StreamedRunResult[AgentDepsT, OutputDataT]]: ...
|
|
458
474
|
|
|
@@ -471,6 +487,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
471
487
|
usage: _usage.RunUsage | None = None,
|
|
472
488
|
infer_name: bool = True,
|
|
473
489
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
490
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
474
491
|
event_stream_handler: EventStreamHandler[AgentDepsT] | None = None,
|
|
475
492
|
) -> AbstractAsyncContextManager[StreamedRunResult[AgentDepsT, RunOutputDataT]]: ...
|
|
476
493
|
|
|
@@ -489,6 +506,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
489
506
|
usage: _usage.RunUsage | None = None,
|
|
490
507
|
infer_name: bool = True,
|
|
491
508
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
509
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
492
510
|
event_stream_handler: EventStreamHandler[AgentDepsT] | None = None,
|
|
493
511
|
**_deprecated_kwargs: Never,
|
|
494
512
|
) -> AsyncIterator[StreamedRunResult[AgentDepsT, Any]]:
|
|
@@ -519,6 +537,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
519
537
|
usage: Optional usage to start with, useful for resuming a conversation or agents used in tools.
|
|
520
538
|
infer_name: Whether to try to infer the agent name from the call frame if it's not set.
|
|
521
539
|
toolsets: Optional additional toolsets for this run.
|
|
540
|
+
builtin_tools: Optional additional builtin tools for this run.
|
|
522
541
|
event_stream_handler: Optional event stream handler to use for this run. It will receive all the events up until the final result is found, which you can then read or stream from inside the context manager.
|
|
523
542
|
|
|
524
543
|
Returns:
|
|
@@ -542,6 +561,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
542
561
|
usage=usage,
|
|
543
562
|
infer_name=infer_name,
|
|
544
563
|
toolsets=toolsets,
|
|
564
|
+
builtin_tools=builtin_tools,
|
|
545
565
|
event_stream_handler=event_stream_handler,
|
|
546
566
|
**_deprecated_kwargs,
|
|
547
567
|
) as result:
|
|
@@ -562,6 +582,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
562
582
|
usage: _usage.RunUsage | None = None,
|
|
563
583
|
infer_name: bool = True,
|
|
564
584
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
585
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
565
586
|
) -> AsyncIterator[_messages.AgentStreamEvent | AgentRunResultEvent[OutputDataT]]: ...
|
|
566
587
|
|
|
567
588
|
@overload
|
|
@@ -579,6 +600,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
579
600
|
usage: _usage.RunUsage | None = None,
|
|
580
601
|
infer_name: bool = True,
|
|
581
602
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
603
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
582
604
|
) -> AsyncIterator[_messages.AgentStreamEvent | AgentRunResultEvent[RunOutputDataT]]: ...
|
|
583
605
|
|
|
584
606
|
def run_stream_events(
|
|
@@ -595,6 +617,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
595
617
|
usage: _usage.RunUsage | None = None,
|
|
596
618
|
infer_name: bool = True,
|
|
597
619
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
620
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
598
621
|
) -> AsyncIterator[_messages.AgentStreamEvent | AgentRunResultEvent[Any]]:
|
|
599
622
|
"""Run the agent with a user prompt in async mode and stream events from the run.
|
|
600
623
|
|
|
@@ -640,6 +663,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
640
663
|
usage: Optional usage to start with, useful for resuming a conversation or agents used in tools.
|
|
641
664
|
infer_name: Whether to try to infer the agent name from the call frame if it's not set.
|
|
642
665
|
toolsets: Optional additional toolsets for this run.
|
|
666
|
+
builtin_tools: Optional additional builtin tools for this run.
|
|
643
667
|
|
|
644
668
|
Returns:
|
|
645
669
|
An async iterable of stream events `AgentStreamEvent` and finally a `AgentRunResultEvent` with the final
|
|
@@ -665,6 +689,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
665
689
|
usage: _usage.RunUsage | None = None,
|
|
666
690
|
infer_name: bool = True,
|
|
667
691
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
692
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
668
693
|
**_deprecated_kwargs: Never,
|
|
669
694
|
) -> AbstractAsyncContextManager[AgentRun[AgentDepsT, OutputDataT]]: ...
|
|
670
695
|
|
|
@@ -683,6 +708,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
683
708
|
usage: _usage.RunUsage | None = None,
|
|
684
709
|
infer_name: bool = True,
|
|
685
710
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
711
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
686
712
|
**_deprecated_kwargs: Never,
|
|
687
713
|
) -> AbstractAsyncContextManager[AgentRun[AgentDepsT, RunOutputDataT]]: ...
|
|
688
714
|
|
|
@@ -701,6 +727,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
701
727
|
usage: _usage.RunUsage | None = None,
|
|
702
728
|
infer_name: bool = True,
|
|
703
729
|
toolsets: Sequence[AbstractToolset[AgentDepsT]] | None = None,
|
|
730
|
+
builtin_tools: Sequence[AbstractBuiltinTool] | None = None,
|
|
704
731
|
**_deprecated_kwargs: Never,
|
|
705
732
|
) -> AsyncIterator[AgentRun[AgentDepsT, Any]]:
|
|
706
733
|
"""A contextmanager which can be used to iterate over the agent graph's nodes as they are executed.
|
|
@@ -774,6 +801,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
774
801
|
usage: Optional usage to start with, useful for resuming a conversation or agents used in tools.
|
|
775
802
|
infer_name: Whether to try to infer the agent name from the call frame if it's not set.
|
|
776
803
|
toolsets: Optional additional toolsets for this run.
|
|
804
|
+
builtin_tools: Optional additional builtin tools for this run.
|
|
777
805
|
|
|
778
806
|
Returns:
|
|
779
807
|
The result of the run.
|
|
@@ -796,6 +824,7 @@ class DBOSAgent(WrapperAgent[AgentDepsT, OutputDataT], DBOSConfiguredInstance):
|
|
|
796
824
|
usage=usage,
|
|
797
825
|
infer_name=infer_name,
|
|
798
826
|
toolsets=toolsets,
|
|
827
|
+
builtin_tools=builtin_tools,
|
|
799
828
|
**_deprecated_kwargs,
|
|
800
829
|
) as run:
|
|
801
830
|
yield run
|