From be0517cc7102de631dd822852777c4fd2b7449e8 Mon Sep 17 00:00:00 2001 From: <> Date: Sat, 24 May 2025 09:11:33 +0000 Subject: [PATCH] Deployed 6e078bf with MkDocs version: 1.6.1 --- .nojekyll | 0 404.html | 942 ++ agents/index.html | 2620 +++++ assets/_mkdocstrings.css | 171 + assets/images/favicon-platform.svg | 16 + assets/images/favicon.png | Bin 0 -> 1870 bytes assets/images/graph.png | Bin 0 -> 95039 bytes assets/images/mcp-tracing.jpg | Bin 0 -> 407851 bytes assets/images/orchestration.png | Bin 0 -> 432783 bytes assets/javascripts/bundle.c8b220af.min.js | 16 + assets/javascripts/bundle.c8b220af.min.js.map | 7 + assets/javascripts/lunr/min/lunr.ar.min.js | 1 + assets/javascripts/lunr/min/lunr.da.min.js | 18 + assets/javascripts/lunr/min/lunr.de.min.js | 18 + assets/javascripts/lunr/min/lunr.du.min.js | 18 + assets/javascripts/lunr/min/lunr.el.min.js | 1 + assets/javascripts/lunr/min/lunr.es.min.js | 18 + assets/javascripts/lunr/min/lunr.fi.min.js | 18 + assets/javascripts/lunr/min/lunr.fr.min.js | 18 + assets/javascripts/lunr/min/lunr.he.min.js | 1 + assets/javascripts/lunr/min/lunr.hi.min.js | 1 + assets/javascripts/lunr/min/lunr.hu.min.js | 18 + assets/javascripts/lunr/min/lunr.hy.min.js | 1 + assets/javascripts/lunr/min/lunr.it.min.js | 18 + assets/javascripts/lunr/min/lunr.ja.min.js | 1 + assets/javascripts/lunr/min/lunr.jp.min.js | 1 + assets/javascripts/lunr/min/lunr.kn.min.js | 1 + assets/javascripts/lunr/min/lunr.ko.min.js | 1 + assets/javascripts/lunr/min/lunr.multi.min.js | 1 + assets/javascripts/lunr/min/lunr.nl.min.js | 18 + assets/javascripts/lunr/min/lunr.no.min.js | 18 + assets/javascripts/lunr/min/lunr.pt.min.js | 18 + assets/javascripts/lunr/min/lunr.ro.min.js | 18 + assets/javascripts/lunr/min/lunr.ru.min.js | 18 + assets/javascripts/lunr/min/lunr.sa.min.js | 1 + .../lunr/min/lunr.stemmer.support.min.js | 1 + assets/javascripts/lunr/min/lunr.sv.min.js | 18 + assets/javascripts/lunr/min/lunr.ta.min.js | 1 + assets/javascripts/lunr/min/lunr.te.min.js | 1 + assets/javascripts/lunr/min/lunr.th.min.js | 1 + assets/javascripts/lunr/min/lunr.tr.min.js | 18 + assets/javascripts/lunr/min/lunr.vi.min.js | 1 + assets/javascripts/lunr/min/lunr.zh.min.js | 1 + assets/javascripts/lunr/tinyseg.js | 206 + assets/javascripts/lunr/wordcut.js | 6708 +++++++++++++ .../workers/search.f8cc74c7.min.js | 42 + .../workers/search.f8cc74c7.min.js.map | 7 + assets/logo.svg | 15 + assets/stylesheets/main.4af4bdda.min.css | 1 + assets/stylesheets/main.4af4bdda.min.css.map | 1 + assets/stylesheets/palette.06af60db.min.css | 1 + .../stylesheets/palette.06af60db.min.css.map | 1 + config/index.html | 2474 +++++ context/index.html | 2448 +++++ examples/index.html | 2399 +++++ guardrails/index.html | 2580 +++++ handoffs/index.html | 2561 +++++ index.html | 2422 +++++ ja/agents/index.html | 1315 +++ ja/config/index.html | 1169 +++ ja/context/index.html | 1143 +++ ja/examples/index.html | 1093 ++ ja/guardrails/index.html | 1275 +++ ja/handoffs/index.html | 1256 +++ ja/index.html | 1117 +++ ja/mcp/index.html | 1157 +++ ja/models/index.html | 1263 +++ ja/models/litellm/index.html | 1123 +++ ja/multi_agent/index.html | 1093 ++ ja/quickstart/index.html | 1399 +++ ja/ref/agent/index.html | 2920 ++++++ ja/ref/agent_output/index.html | 2136 ++++ ja/ref/exceptions/index.html | 1528 +++ ja/ref/extensions/handoff_filters/index.html | 1097 ++ ja/ref/extensions/handoff_prompt/index.html | 1092 ++ ja/ref/extensions/litellm/index.html | 1642 +++ ja/ref/function_schema/index.html | 2447 +++++ ja/ref/guardrail/index.html | 2473 +++++ ja/ref/handoffs/index.html | 2196 ++++ ja/ref/index.html | 1451 +++ ja/ref/items/index.html | 4455 +++++++++ ja/ref/lifecycle/index.html | 1644 +++ ja/ref/mcp/server/index.html | 4489 +++++++++ ja/ref/mcp/util/index.html | 1717 ++++ ja/ref/model_settings/index.html | 1852 ++++ ja/ref/models/interface/index.html | 2256 +++++ .../models/openai_chatcompletions/index.html | 1797 ++++ ja/ref/models/openai_responses/index.html | 2052 ++++ ja/ref/result/index.html | 3543 +++++++ ja/ref/run/index.html | 4835 +++++++++ ja/ref/run_context/index.html | 1199 +++ ja/ref/stream_events/index.html | 1540 +++ ja/ref/tool/index.html | 3790 +++++++ ja/ref/tracing/create/index.html | 3891 ++++++++ ja/ref/tracing/index.html | 7010 +++++++++++++ ja/ref/tracing/processor_interface/index.html | 1766 ++++ ja/ref/tracing/processors/index.html | 2409 +++++ ja/ref/tracing/scope/index.html | 1134 +++ ja/ref/tracing/setup/index.html | 2330 +++++ ja/ref/tracing/span_data/index.html | 2481 +++++ ja/ref/tracing/spans/index.html | 1836 ++++ ja/ref/tracing/traces/index.html | 1832 ++++ ja/ref/tracing/util/index.html | 1171 +++ ja/ref/usage/index.html | 1368 +++ ja/ref/voice/events/index.html | 1529 +++ ja/ref/voice/exceptions/index.html | 1086 ++ ja/ref/voice/input/index.html | 1546 +++ ja/ref/voice/model/index.html | 3001 ++++++ .../voice/models/openai_provider/index.html | 1637 +++ ja/ref/voice/models/openai_stt/index.html | 2430 +++++ ja/ref/voice/models/openai_tts/index.html | 1439 +++ ja/ref/voice/pipeline/index.html | 1687 ++++ ja/ref/voice/pipeline_config/index.html | 1490 +++ ja/ref/voice/result/index.html | 1882 ++++ ja/ref/voice/utils/index.html | 1173 +++ ja/ref/voice/workflow/index.html | 1694 ++++ ja/results/index.html | 1309 +++ ja/running_agents/index.html | 1307 +++ ja/streaming/index.html | 1165 +++ ja/tools/index.html | 1486 +++ ja/tracing/index.html | 1306 +++ ja/visualization/index.html | 1237 +++ ja/voice/pipeline/index.html | 1232 +++ ja/voice/quickstart/index.html | 1302 +++ ja/voice/tracing/index.html | 1035 ++ mcp/index.html | 2462 +++++ models/index.html | 2619 +++++ models/litellm/index.html | 2428 +++++ multi_agent/index.html | 2398 +++++ objects.inv | Bin 0 -> 6767 bytes quickstart/index.html | 2704 +++++ ref/agent/index.html | 4568 +++++++++ ref/agent_output/index.html | 3637 +++++++ ref/exceptions/index.html | 2975 ++++++ ref/extensions/handoff_filters/index.html | 2469 +++++ ref/extensions/handoff_prompt/index.html | 2473 +++++ ref/extensions/litellm/index.html | 3012 ++++++ ref/function_schema/index.html | 3957 ++++++++ ref/guardrail/index.html | 4037 ++++++++ ref/handoffs/index.html | 3697 +++++++ ref/index.html | 2877 ++++++ ref/items/index.html | 6439 ++++++++++++ ref/lifecycle/index.html | 3127 ++++++ ref/mcp/server/index.html | 6353 ++++++++++++ ref/mcp/util/index.html | 3131 ++++++ ref/model_settings/index.html | 3374 +++++++ ref/models/interface/index.html | 3718 +++++++ ref/models/openai_chatcompletions/index.html | 3184 ++++++ ref/models/openai_responses/index.html | 3448 +++++++ ref/result/index.html | 5302 ++++++++++ ref/run/index.html | 6363 ++++++++++++ ref/run_context/index.html | 2595 +++++ ref/stream_events/index.html | 3002 ++++++ ref/tool/index.html | 5621 +++++++++++ ref/tracing/create/index.html | 5380 ++++++++++ ref/tracing/index.html | 8847 +++++++++++++++++ ref/tracing/processor_interface/index.html | 3222 ++++++ ref/tracing/processors/index.html | 3883 ++++++++ ref/tracing/scope/index.html | 2506 +++++ ref/tracing/setup/index.html | 3858 +++++++ ref/tracing/span_data/index.html | 3976 ++++++++ ref/tracing/spans/index.html | 3250 ++++++ ref/tracing/traces/index.html | 3273 ++++++ ref/tracing/util/index.html | 2570 +++++ ref/usage/index.html | 2800 ++++++ ref/voice/events/index.html | 3000 ++++++ ref/voice/exceptions/index.html | 2458 +++++ ref/voice/input/index.html | 3002 ++++++ ref/voice/model/index.html | 4643 +++++++++ ref/voice/models/openai_provider/index.html | 3042 ++++++ ref/voice/models/openai_stt/index.html | 3844 +++++++ ref/voice/models/openai_tts/index.html | 2835 ++++++ ref/voice/pipeline/index.html | 3083 ++++++ ref/voice/pipeline_config/index.html | 2949 ++++++ ref/voice/result/index.html | 3278 ++++++ ref/voice/utils/index.html | 2545 +++++ ref/voice/workflow/index.html | 3153 ++++++ results/index.html | 2614 +++++ running_agents/index.html | 2611 +++++ scripts/translate_docs.py | 288 + search/search_index.json | 1 + sitemap.xml | 947 ++ sitemap.xml.gz | Bin 0 -> 2011 bytes streaming/index.html | 2470 +++++ stylesheets/extra.css | 194 + tools/index.html | 2791 ++++++ tracing/index.html | 2611 +++++ visualization/index.html | 2542 +++++ voice/pipeline/index.html | 2535 +++++ voice/quickstart/index.html | 2607 +++++ voice/tracing/index.html | 2342 +++++ 191 files changed, 361600 insertions(+) create mode 100644 .nojekyll create mode 100644 404.html create mode 100644 agents/index.html create mode 100644 assets/_mkdocstrings.css create mode 100644 assets/images/favicon-platform.svg create mode 100644 assets/images/favicon.png create mode 100644 assets/images/graph.png create mode 100644 assets/images/mcp-tracing.jpg create mode 100644 assets/images/orchestration.png create mode 100644 assets/javascripts/bundle.c8b220af.min.js create mode 100644 assets/javascripts/bundle.c8b220af.min.js.map create mode 100644 assets/javascripts/lunr/min/lunr.ar.min.js create mode 100644 assets/javascripts/lunr/min/lunr.da.min.js create mode 100644 assets/javascripts/lunr/min/lunr.de.min.js create mode 100644 assets/javascripts/lunr/min/lunr.du.min.js create mode 100644 assets/javascripts/lunr/min/lunr.el.min.js create mode 100644 assets/javascripts/lunr/min/lunr.es.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.he.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hu.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hy.min.js create mode 100644 assets/javascripts/lunr/min/lunr.it.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ja.min.js create mode 100644 assets/javascripts/lunr/min/lunr.jp.min.js create mode 100644 assets/javascripts/lunr/min/lunr.kn.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ko.min.js create mode 100644 assets/javascripts/lunr/min/lunr.multi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.nl.min.js create mode 100644 assets/javascripts/lunr/min/lunr.no.min.js create mode 100644 assets/javascripts/lunr/min/lunr.pt.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ro.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ru.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sa.min.js create mode 100644 assets/javascripts/lunr/min/lunr.stemmer.support.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sv.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ta.min.js create mode 100644 assets/javascripts/lunr/min/lunr.te.min.js create mode 100644 assets/javascripts/lunr/min/lunr.th.min.js create mode 100644 assets/javascripts/lunr/min/lunr.tr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.vi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.zh.min.js create mode 100644 assets/javascripts/lunr/tinyseg.js create mode 100644 assets/javascripts/lunr/wordcut.js create mode 100644 assets/javascripts/workers/search.f8cc74c7.min.js create mode 100644 assets/javascripts/workers/search.f8cc74c7.min.js.map create mode 100644 assets/logo.svg create mode 100644 assets/stylesheets/main.4af4bdda.min.css create mode 100644 assets/stylesheets/main.4af4bdda.min.css.map create mode 100644 assets/stylesheets/palette.06af60db.min.css create mode 100644 assets/stylesheets/palette.06af60db.min.css.map create mode 100644 config/index.html create mode 100644 context/index.html create mode 100644 examples/index.html create mode 100644 guardrails/index.html create mode 100644 handoffs/index.html create mode 100644 index.html create mode 100644 ja/agents/index.html create mode 100644 ja/config/index.html create mode 100644 ja/context/index.html create mode 100644 ja/examples/index.html create mode 100644 ja/guardrails/index.html create mode 100644 ja/handoffs/index.html create mode 100644 ja/index.html create mode 100644 ja/mcp/index.html create mode 100644 ja/models/index.html create mode 100644 ja/models/litellm/index.html create mode 100644 ja/multi_agent/index.html create mode 100644 ja/quickstart/index.html create mode 100644 ja/ref/agent/index.html create mode 100644 ja/ref/agent_output/index.html create mode 100644 ja/ref/exceptions/index.html create mode 100644 ja/ref/extensions/handoff_filters/index.html create mode 100644 ja/ref/extensions/handoff_prompt/index.html create mode 100644 ja/ref/extensions/litellm/index.html create mode 100644 ja/ref/function_schema/index.html create mode 100644 ja/ref/guardrail/index.html create mode 100644 ja/ref/handoffs/index.html create mode 100644 ja/ref/index.html create mode 100644 ja/ref/items/index.html create mode 100644 ja/ref/lifecycle/index.html create mode 100644 ja/ref/mcp/server/index.html create mode 100644 ja/ref/mcp/util/index.html create mode 100644 ja/ref/model_settings/index.html create mode 100644 ja/ref/models/interface/index.html create mode 100644 ja/ref/models/openai_chatcompletions/index.html create mode 100644 ja/ref/models/openai_responses/index.html create mode 100644 ja/ref/result/index.html create mode 100644 ja/ref/run/index.html create mode 100644 ja/ref/run_context/index.html create mode 100644 ja/ref/stream_events/index.html create mode 100644 ja/ref/tool/index.html create mode 100644 ja/ref/tracing/create/index.html create mode 100644 ja/ref/tracing/index.html create mode 100644 ja/ref/tracing/processor_interface/index.html create mode 100644 ja/ref/tracing/processors/index.html create mode 100644 ja/ref/tracing/scope/index.html create mode 100644 ja/ref/tracing/setup/index.html create mode 100644 ja/ref/tracing/span_data/index.html create mode 100644 ja/ref/tracing/spans/index.html create mode 100644 ja/ref/tracing/traces/index.html create mode 100644 ja/ref/tracing/util/index.html create mode 100644 ja/ref/usage/index.html create mode 100644 ja/ref/voice/events/index.html create mode 100644 ja/ref/voice/exceptions/index.html create mode 100644 ja/ref/voice/input/index.html create mode 100644 ja/ref/voice/model/index.html create mode 100644 ja/ref/voice/models/openai_provider/index.html create mode 100644 ja/ref/voice/models/openai_stt/index.html create mode 100644 ja/ref/voice/models/openai_tts/index.html create mode 100644 ja/ref/voice/pipeline/index.html create mode 100644 ja/ref/voice/pipeline_config/index.html create mode 100644 ja/ref/voice/result/index.html create mode 100644 ja/ref/voice/utils/index.html create mode 100644 ja/ref/voice/workflow/index.html create mode 100644 ja/results/index.html create mode 100644 ja/running_agents/index.html create mode 100644 ja/streaming/index.html create mode 100644 ja/tools/index.html create mode 100644 ja/tracing/index.html create mode 100644 ja/visualization/index.html create mode 100644 ja/voice/pipeline/index.html create mode 100644 ja/voice/quickstart/index.html create mode 100644 ja/voice/tracing/index.html create mode 100644 mcp/index.html create mode 100644 models/index.html create mode 100644 models/litellm/index.html create mode 100644 multi_agent/index.html create mode 100644 objects.inv create mode 100644 quickstart/index.html create mode 100644 ref/agent/index.html create mode 100644 ref/agent_output/index.html create mode 100644 ref/exceptions/index.html create mode 100644 ref/extensions/handoff_filters/index.html create mode 100644 ref/extensions/handoff_prompt/index.html create mode 100644 ref/extensions/litellm/index.html create mode 100644 ref/function_schema/index.html create mode 100644 ref/guardrail/index.html create mode 100644 ref/handoffs/index.html create mode 100644 ref/index.html create mode 100644 ref/items/index.html create mode 100644 ref/lifecycle/index.html create mode 100644 ref/mcp/server/index.html create mode 100644 ref/mcp/util/index.html create mode 100644 ref/model_settings/index.html create mode 100644 ref/models/interface/index.html create mode 100644 ref/models/openai_chatcompletions/index.html create mode 100644 ref/models/openai_responses/index.html create mode 100644 ref/result/index.html create mode 100644 ref/run/index.html create mode 100644 ref/run_context/index.html create mode 100644 ref/stream_events/index.html create mode 100644 ref/tool/index.html create mode 100644 ref/tracing/create/index.html create mode 100644 ref/tracing/index.html create mode 100644 ref/tracing/processor_interface/index.html create mode 100644 ref/tracing/processors/index.html create mode 100644 ref/tracing/scope/index.html create mode 100644 ref/tracing/setup/index.html create mode 100644 ref/tracing/span_data/index.html create mode 100644 ref/tracing/spans/index.html create mode 100644 ref/tracing/traces/index.html create mode 100644 ref/tracing/util/index.html create mode 100644 ref/usage/index.html create mode 100644 ref/voice/events/index.html create mode 100644 ref/voice/exceptions/index.html create mode 100644 ref/voice/input/index.html create mode 100644 ref/voice/model/index.html create mode 100644 ref/voice/models/openai_provider/index.html create mode 100644 ref/voice/models/openai_stt/index.html create mode 100644 ref/voice/models/openai_tts/index.html create mode 100644 ref/voice/pipeline/index.html create mode 100644 ref/voice/pipeline_config/index.html create mode 100644 ref/voice/result/index.html create mode 100644 ref/voice/utils/index.html create mode 100644 ref/voice/workflow/index.html create mode 100644 results/index.html create mode 100644 running_agents/index.html create mode 100644 scripts/translate_docs.py create mode 100644 search/search_index.json create mode 100644 sitemap.xml create mode 100644 sitemap.xml.gz create mode 100644 streaming/index.html create mode 100644 stylesheets/extra.css create mode 100644 tools/index.html create mode 100644 tracing/index.html create mode 100644 visualization/index.html create mode 100644 voice/pipeline/index.html create mode 100644 voice/quickstart/index.html create mode 100644 voice/tracing/index.html diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/404.html b/404.html new file mode 100644 index 00000000..bf925d2d --- /dev/null +++ b/404.html @@ -0,0 +1,942 @@ + + + +
+ + + + + + + + + + + + + + +Agents are the core building block in your apps. An agent is a large language model (LLM), configured with instructions and tools.
+The most common properties of an agent you'll configure are:
+instructions
: also known as a developer message or system prompt.model
: which LLM to use, and optional model_settings
to configure model tuning parameters like temperature, top_p, etc.tools
: Tools that the agent can use to achieve its tasks.from agents import Agent, ModelSettings, function_tool
+
+@function_tool
+def get_weather(city: str) -> str:
+ return f"The weather in {city} is sunny"
+
+agent = Agent(
+ name="Haiku agent",
+ instructions="Always respond in haiku form",
+ model="o3-mini",
+ tools=[get_weather],
+)
+
Agents are generic on their context
type. Context is a dependency-injection tool: it's an object you create and pass to Runner.run()
, that is passed to every agent, tool, handoff etc, and it serves as a grab bag of dependencies and state for the agent run. You can provide any Python object as the context.
@dataclass
+class UserContext:
+ uid: str
+ is_pro_user: bool
+
+ async def fetch_purchases() -> list[Purchase]:
+ return ...
+
+agent = Agent[UserContext](
+ ...,
+)
+
By default, agents produce plain text (i.e. str
) outputs. If you want the agent to produce a particular type of output, you can use the output_type
parameter. A common choice is to use Pydantic objects, but we support any type that can be wrapped in a Pydantic TypeAdapter - dataclasses, lists, TypedDict, etc.
from pydantic import BaseModel
+from agents import Agent
+
+
+class CalendarEvent(BaseModel):
+ name: str
+ date: str
+ participants: list[str]
+
+agent = Agent(
+ name="Calendar extractor",
+ instructions="Extract calendar events from text",
+ output_type=CalendarEvent,
+)
+
Note
+When you pass an output_type
, that tells the model to use structured outputs instead of regular plain text responses.
Handoffs are sub-agents that the agent can delegate to. You provide a list of handoffs, and the agent can choose to delegate to them if relevant. This is a powerful pattern that allows orchestrating modular, specialized agents that excel at a single task. Read more in the handoffs documentation.
+from agents import Agent
+
+booking_agent = Agent(...)
+refund_agent = Agent(...)
+
+triage_agent = Agent(
+ name="Triage agent",
+ instructions=(
+ "Help the user with their questions."
+ "If they ask about booking, handoff to the booking agent."
+ "If they ask about refunds, handoff to the refund agent."
+ ),
+ handoffs=[booking_agent, refund_agent],
+)
+
In most cases, you can provide instructions when you create the agent. However, you can also provide dynamic instructions via a function. The function will receive the agent and context, and must return the prompt. Both regular and async
functions are accepted.
def dynamic_instructions(
+ context: RunContextWrapper[UserContext], agent: Agent[UserContext]
+) -> str:
+ return f"The user's name is {context.context.name}. Help them with their questions."
+
+
+agent = Agent[UserContext](
+ name="Triage agent",
+ instructions=dynamic_instructions,
+)
+
Sometimes, you want to observe the lifecycle of an agent. For example, you may want to log events, or pre-fetch data when certain events occur. You can hook into the agent lifecycle with the hooks
property. Subclass the AgentHooks
class, and override the methods you're interested in.
Guardrails allow you to run checks/validations on user input, in parallel to the agent running. For example, you could screen the user's input for relevance. Read more in the guardrails documentation.
+By using the clone()
method on an agent, you can duplicate an Agent, and optionally change any properties you like.
pirate_agent = Agent(
+ name="Pirate",
+ instructions="Write like a pirate",
+ model="o3-mini",
+)
+
+robot_agent = pirate_agent.clone(
+ name="Robot",
+ instructions="Write like a robot",
+)
+
Supplying a list of tools doesn't always mean the LLM will use a tool. You can force tool use by setting ModelSettings.tool_choice
. Valid values are:
auto
, which allows the LLM to decide whether or not to use a tool.required
, which requires the LLM to use a tool (but it can intelligently decide which tool).none
, which requires the LLM to not use a tool.my_tool
, which requires the LLM to use that specific tool.Note
+To prevent infinite loops, the framework automatically resets tool_choice
to "auto" after a tool call. This behavior is configurable via agent.reset_tool_choice
. The infinite loop is because tool results are sent to the LLM, which then generates another tool call because of tool_choice
, ad infinitum.
If you want the Agent to completely stop after a tool call (rather than continuing with auto mode), you can set [Agent.tool_use_behavior="stop_on_first_tool"
] which will directly use the tool output as the final response without further LLM processing.
Mb=_(&FK}I^!cSqjGWS8!#if zcCG7^quphiFE4LaBxOz54{yFQ?fejA8Z~V8Lj+2V0-_}S0Fy`|Qraaq)3tlMo+Tpw zsI9w0dh5C!oL5v;gaDl0ytLPWcBdjm(kO6#DNf>Z8Igzm$baFucAAFEq}!|7bpr|V zwZ5@O6wT=5yGZdy4fm+g_CmK!fQe4EK%Z-i=GQD$LCZwg}E9UOHwml)YQoKkzMW7Y|td8!2+Q~5yM%k7=7N+keDg$39A z8eEIw1ih*qS4ULjlljg0Dt5o nWBTuVt7jAra66Um+w*?{hhcoplPdy_MqJSbDWCtj@cfR%X#3{jPY3D>H^Qs_A(d z2N*AOr&M(1>8?||t#v+)D0+M=FX%cvkizy;Y7T9+rFfuq*2h0;ZrBtQ-c0Jz@tgcV zs_X}%SClky9bhBsQ{yg^(dQ=%Lgm| W)te}DDoAU*+s; k5C^ubqOSrP&999i&mM`>}aszikcxRI?b55x4gcJ$Qu;MCwEC8(ZL z+3dM%hY*k1a0prS-*-D&%qsBWyrNtilD>@{_o$XYU?7a7lqnky)KzoAs3S@mHRx0^ zx4+QzH)Eea)E_-6+uAa`*^-0PTrl4pLP9@Y?NqWie8t~Ed4NvLKIaaBTW3cctLR$Q z0_iBvwI*+}vb&tc(I4SP^8Athmo_{Jv%S>B;{}_%H$c+bq@EihmML&?{9#lCJe+v+ z((uBB!0D21-j`YKpzGz6*xyhW{~y2mk@CE?$eCSy9y2vJYw3LZ_Dve3H~If=kV;s8 zUM9dEF1b{Ym=s%&^Dft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