diff --git a/docs/api-reference/agent.md b/docs/api-reference/agent.md deleted file mode 100644 index 5eccd889..00000000 --- a/docs/api-reference/agent.md +++ /dev/null @@ -1,29 +0,0 @@ -::: strands.agent - options: - heading_level: 1 - members: false -::: strands.agent.agent - options: - heading_level: 2 -::: strands.agent.agent_result - options: - heading_level: 2 -::: strands.agent.conversation_manager - options: - heading_level: 2 - members: false -::: strands.agent.conversation_manager.conversation_manager - options: - heading_level: 3 -::: strands.agent.conversation_manager.null_conversation_manager - options: - heading_level: 3 -::: strands.agent.conversation_manager.sliding_window_conversation_manager - options: - heading_level: 3 -::: strands.agent.conversation_manager.summarizing_conversation_manager - options: - heading_level: 3 -::: strands.agent.state - options: - heading_level: 2 diff --git a/docs/api-reference/event-loop.md b/docs/api-reference/event-loop.md deleted file mode 100644 index 712d9b6f..00000000 --- a/docs/api-reference/event-loop.md +++ /dev/null @@ -1,10 +0,0 @@ -::: strands.event_loop - options: - heading_level: 1 - members: false -::: strands.event_loop.event_loop - options: - heading_level: 2 -::: strands.event_loop.streaming - options: - heading_level: 2 diff --git a/docs/api-reference/experimental/agent_config.md b/docs/api-reference/experimental/agent_config.md deleted file mode 100644 index 6f3a0927..00000000 --- a/docs/api-reference/experimental/agent_config.md +++ /dev/null @@ -1,3 +0,0 @@ -::: strands.experimental.agent_config - options: - heading_level: 1 diff --git a/docs/api-reference/experimental/bidi/agent.md b/docs/api-reference/experimental/bidi/agent.md deleted file mode 100644 index cb3cb1d8..00000000 --- a/docs/api-reference/experimental/bidi/agent.md +++ /dev/null @@ -1,3 +0,0 @@ -::: strands.experimental.bidi.agent.agent - options: - heading_level: 1 diff --git a/docs/api-reference/experimental/bidi/io.md b/docs/api-reference/experimental/bidi/io.md deleted file mode 100644 index 7b2ff3de..00000000 --- a/docs/api-reference/experimental/bidi/io.md +++ /dev/null @@ -1,10 +0,0 @@ -::: strands.experimental.bidi.io - options: - heading_level: 1 - members: false -::: strands.experimental.bidi.io.audio - options: - heading_level: 2 -::: strands.experimental.bidi.io.text - options: - heading_level: 2 diff --git a/docs/api-reference/experimental/bidi/models.md b/docs/api-reference/experimental/bidi/models.md deleted file mode 100644 index 48d534cc..00000000 --- a/docs/api-reference/experimental/bidi/models.md +++ /dev/null @@ -1,16 +0,0 @@ -::: strands.experimental.bidi.models - options: - heading_level: 1 - members: false -::: strands.experimental.bidi.models.model - options: - heading_level: 2 -::: strands.experimental.bidi.models.gemini_live - options: - heading_level: 2 -::: strands.experimental.bidi.models.nova_sonic - options: - heading_level: 2 -::: strands.experimental.bidi.models.openai_realtime - options: - heading_level: 2 diff --git a/docs/api-reference/experimental/bidi/tools.md b/docs/api-reference/experimental/bidi/tools.md deleted file mode 100644 index 6e9b637b..00000000 --- a/docs/api-reference/experimental/bidi/tools.md +++ /dev/null @@ -1,7 +0,0 @@ -::: strands.experimental.bidi.tools - options: - heading_level: 1 - members: false -::: strands.experimental.bidi.tools.stop_conversation - options: - heading_level: 2 diff --git a/docs/api-reference/experimental/bidi/types.md b/docs/api-reference/experimental/bidi/types.md deleted file mode 100644 index 4fb394db..00000000 --- a/docs/api-reference/experimental/bidi/types.md +++ /dev/null @@ -1,16 +0,0 @@ -::: strands.experimental.bidi.types - options: - heading_level: 1 - members: false -::: strands.experimental.bidi.types.agent - options: - heading_level: 2 -::: strands.experimental.bidi.types.model - options: - heading_level: 2 -::: strands.experimental.bidi.types.events - options: - heading_level: 2 -::: strands.experimental.bidi.types.io - options: - heading_level: 2 diff --git a/docs/api-reference/experimental/hooks.md b/docs/api-reference/experimental/hooks.md deleted file mode 100644 index 819defa6..00000000 --- a/docs/api-reference/experimental/hooks.md +++ /dev/null @@ -1,14 +0,0 @@ -::: strands.experimental.hooks - options: - heading_level: 1 - members: false -::: strands.experimental.hooks.events - options: - heading_level: 2 -::: strands.experimental.hooks.multiagent - options: - heading_level: 2 - members: false -::: strands.experimental.hooks.multiagent.events - options: - heading_level: 3 diff --git a/docs/api-reference/handlers.md b/docs/api-reference/handlers.md deleted file mode 100644 index 1b9694f2..00000000 --- a/docs/api-reference/handlers.md +++ /dev/null @@ -1,7 +0,0 @@ -::: strands.handlers - options: - heading_level: 1 - members: false -::: strands.handlers.callback_handler - options: - heading_level: 2 diff --git a/docs/api-reference/hooks.md b/docs/api-reference/hooks.md deleted file mode 100644 index cf09deef..00000000 --- a/docs/api-reference/hooks.md +++ /dev/null @@ -1,10 +0,0 @@ -::: strands.hooks - options: - heading_level: 1 - members: false -::: strands.hooks.events - options: - heading_level: 2 -::: strands.hooks.registry - options: - heading_level: 2 diff --git a/docs/api-reference/interrupt.md b/docs/api-reference/interrupt.md deleted file mode 100644 index 31e001aa..00000000 --- a/docs/api-reference/interrupt.md +++ /dev/null @@ -1,3 +0,0 @@ -::: strands.interrupt - options: - heading_level: 1 diff --git a/docs/api-reference/models.md b/docs/api-reference/models.md deleted file mode 100644 index a1ac435d..00000000 --- a/docs/api-reference/models.md +++ /dev/null @@ -1,34 +0,0 @@ -::: strands.models - options: - heading_level: 1 - members: false -::: strands.models.model - options: - heading_level: 2 -::: strands.models.bedrock - options: - heading_level: 2 -::: strands.models.anthropic - options: - heading_level: 2 -::: strands.models.gemini - options: - heading_level: 2 -::: strands.models.litellm - options: - heading_level: 2 -::: strands.models.llamaapi - options: - heading_level: 2 -::: strands.models.mistral - options: - heading_level: 2 -::: strands.models.ollama - options: - heading_level: 2 -::: strands.models.openai - options: - heading_level: 2 -::: strands.models.writer - options: - heading_level: 2 diff --git a/docs/api-reference/multiagent.md b/docs/api-reference/multiagent.md deleted file mode 100644 index 72c9491a..00000000 --- a/docs/api-reference/multiagent.md +++ /dev/null @@ -1,23 +0,0 @@ -::: strands.multiagent - options: - heading_level: 1 - members: false -::: strands.multiagent.base - options: - heading_level: 2 -::: strands.multiagent.graph - options: - heading_level: 2 -::: strands.multiagent.swarm - options: - heading_level: 2 -::: strands.multiagent.a2a - options: - heading_level: 2 - members: false -::: strands.multiagent.a2a.executor - options: - heading_level: 3 -::: strands.multiagent.a2a.server - options: - heading_level: 3 diff --git a/docs/api-reference/session.md b/docs/api-reference/session.md deleted file mode 100644 index 2b20a869..00000000 --- a/docs/api-reference/session.md +++ /dev/null @@ -1,20 +0,0 @@ -::: strands.session - options: - heading_level: 1 - members: false -::: strands.session.file_session_manager - options: - heading_level: 2 -::: strands.session.repository_session_manager - options: - heading_level: 2 -::: strands.session.s3_session_manager - options: - heading_level: 2 -::: strands.session.session_manager - options: - heading_level: 2 - members: false -::: strands.session.session_repository - options: - heading_level: 2 diff --git a/docs/api-reference/telemetry.md b/docs/api-reference/telemetry.md deleted file mode 100644 index 4827a0c0..00000000 --- a/docs/api-reference/telemetry.md +++ /dev/null @@ -1,16 +0,0 @@ -::: strands.telemetry - options: - heading_level: 1 - members: false -::: strands.telemetry.config - options: - heading_level: 2 -::: strands.telemetry.metrics - options: - heading_level: 2 -::: strands.telemetry.metrics_constants - options: - heading_level: 2 -::: strands.telemetry.tracer - options: - heading_level: 2 diff --git a/docs/api-reference/tools.md b/docs/api-reference/tools.md deleted file mode 100644 index 2744782f..00000000 --- a/docs/api-reference/tools.md +++ /dev/null @@ -1,45 +0,0 @@ -::: strands.tools - options: - heading_level: 1 - members: false -::: strands.tools.tools - options: - heading_level: 2 -::: strands.tools.decorator - options: - heading_level: 2 -::: strands.tools.loader - options: - heading_level: 2 -::: strands.tools.registry - options: - heading_level: 2 -::: strands.tools.structured_output - options: - heading_level: 2 -::: strands.tools.watcher - options: - heading_level: 2 -::: strands.tools.executors - options: - heading_level: 2 - members: false -::: strands.tools.executors.concurrent - options: - heading_level: 3 -::: strands.tools.executors.sequential - options: - heading_level: 3 -::: strands.tools.mcp - options: - heading_level: 2 - members: false -::: strands.tools.mcp.mcp_agent_tool - options: - heading_level: 3 -::: strands.tools.mcp.mcp_client - options: - heading_level: 3 -::: strands.tools.mcp.mcp_types - options: - heading_level: 3 diff --git a/docs/api-reference/types.md b/docs/api-reference/types.md deleted file mode 100644 index 193fc113..00000000 --- a/docs/api-reference/types.md +++ /dev/null @@ -1,34 +0,0 @@ -::: strands.types - options: - heading_level: 1 - members: false -::: strands.types.content - options: - heading_level: 2 -::: strands.types.event_loop - options: - heading_level: 2 -::: strands.types.exceptions - options: - heading_level: 2 -::: strands.types.guardrails - options: - heading_level: 2 -::: strands.types.interrupt - options: - heading_level: 2 -::: strands.types.media - options: - heading_level: 2 -::: strands.types.session - options: - heading_level: 2 -::: strands.types.streaming - options: - heading_level: 2 -::: strands.types.tools - options: - heading_level: 2 -::: strands.types.traces - options: - heading_level: 2 diff --git a/docs/community/model-providers/fireworksai.md b/docs/community/model-providers/fireworksai.md index 5c063265..c1cf8006 100644 --- a/docs/community/model-providers/fireworksai.md +++ b/docs/community/model-providers/fireworksai.md @@ -80,4 +80,4 @@ Ensure you're using a model ID compatible with Fireworks AI (e.g., `accounts/fir * [Fireworks AI API Reference](https://docs.fireworks.ai/api-reference) * [Fireworks AI Models](https://fireworks.ai/models) * [OpenAI Python SDK](https://github.com/openai/openai-python) -* [Strands Agents API](../../api-reference/models.md) \ No newline at end of file +* [Strands Agents API](../../api-reference/models/model.md) \ No newline at end of file diff --git a/docs/examples/python/multi_agent_example/multi_agent_example.md b/docs/examples/python/multi_agent_example/multi_agent_example.md index 2b665635..cd449b9a 100644 --- a/docs/examples/python/multi_agent_example/multi_agent_example.md +++ b/docs/examples/python/multi_agent_example/multi_agent_example.md @@ -72,7 +72,7 @@ teacher_agent = Agent( ) ``` -- The orchestrator suppresses its intermediate output by setting `callback_handler` to `None`. Without this suppression, the default [`PrintingStreamHandler`](../../../api-reference/handlers.md#strands.handlers.callback_handler.PrintingCallbackHandler) would print all outputs to stdout, creating a cluttered experience with duplicate information from each agent's thinking process and tool calls. +- The orchestrator suppresses its intermediate output by setting `callback_handler` to `None`. Without this suppression, the default [`PrintingStreamHandler`](../../../api-reference/handlers/callback_handler.md#strands.handlers.callback_handler.PrintingCallbackHandler) would print all outputs to stdout, creating a cluttered experience with duplicate information from each agent's thinking process and tool calls. ### 2. Specialized Agents diff --git a/docs/user-guide/concepts/agents/conversation-management.md b/docs/user-guide/concepts/agents/conversation-management.md index 89263a88..1edcd3ee 100644 --- a/docs/user-guide/concepts/agents/conversation-management.md +++ b/docs/user-guide/concepts/agents/conversation-management.md @@ -27,7 +27,7 @@ or [build your own manager](#creating-a-conversationmanager) that matches your r #### NullConversationManager -The [`NullConversationManager`](../../../api-reference/agent.md#strands.agent.conversation_manager.null_conversation_manager.NullConversationManager) is a simple implementation that does not modify the conversation history. It's useful for: +The [`NullConversationManager`](../../../api-reference/agent/conversation_manager/null_conversation_manager.md#strands.agent.conversation_manager.null_conversation_manager.NullConversationManager) is a simple implementation that does not modify the conversation history. It's useful for: - Short conversations that won't exceed context limits - Debugging purposes @@ -54,7 +54,7 @@ The [`NullConversationManager`](../../../api-reference/agent.md#strands.agent.co #### SlidingWindowConversationManager -The [`SlidingWindowConversationManager`](../../../api-reference/agent.md#strands.agent.conversation_manager.sliding_window_conversation_manager.SlidingWindowConversationManager) implements a sliding window strategy that maintains a fixed number of recent messages. This is the default conversation manager used by the Agent class. +The [`SlidingWindowConversationManager`](../../../api-reference/agent/conversation_manager/sliding_window_conversation_manager.md#strands.agent.conversation_manager.sliding_window_conversation_manager.SlidingWindowConversationManager) implements a sliding window strategy that maintains a fixed number of recent messages. This is the default conversation manager used by the Agent class. === "Python" @@ -93,7 +93,7 @@ Key features of the `SlidingWindowConversationManager`: {{ ts_not_supported("") }} -The [`SummarizingConversationManager`](../../../api-reference/agent.md#strands.agent.conversation_manager.summarizing_conversation_manager.SummarizingConversationManager) implements intelligent conversation context management by summarizing older messages instead of simply discarding them. This approach preserves important information while staying within context limits. +The [`SummarizingConversationManager`](../../../api-reference/agent/conversation_manager/summarizing_conversation_manager.md#strands.agent.conversation_manager.summarizing_conversation_manager.SummarizingConversationManager) implements intelligent conversation context management by summarizing older messages instead of simply discarding them. This approach preserves important information while staying within context limits. Configuration parameters: @@ -217,11 +217,11 @@ Key features of the `SummarizingConversationManager`: === "Python" - To create a custom conversation manager, implement the [`ConversationManager`](../../../api-reference/agent.md#strands.agent.conversation_manager.conversation_manager.ConversationManager) interface, which is composed of three key elements: + To create a custom conversation manager, implement the [`ConversationManager`](../../../api-reference/agent/conversation_manager/conversation_manager.md#strands.agent.conversation_manager.conversation_manager.ConversationManager) interface, which is composed of three key elements: - 1. [`apply_management`](../../../api-reference/agent.md#strands.agent.conversation_manager.conversation_manager.ConversationManager.apply_management): This method is called after each event loop cycle completes to manage the conversation history. It's responsible for applying your management strategy to the messages array, which may have been modified with tool results and assistant responses. The agent runs this method automatically after processing each user input and generating a response. + 1. [`apply_management`](../../../api-reference/agent/conversation_manager/conversation_manager.md#strands.agent.conversation_manager.conversation_manager.ConversationManager.apply_management): This method is called after each event loop cycle completes to manage the conversation history. It's responsible for applying your management strategy to the messages array, which may have been modified with tool results and assistant responses. The agent runs this method automatically after processing each user input and generating a response. - 2. [`reduce_context`](../../../api-reference/agent.md#strands.agent.conversation_manager.conversation_manager.ConversationManager.reduce_context): This method is called when the model's context window is exceeded (typically due to token limits). It implements the specific strategy for reducing the window size when necessary. The agent calls this method when it encounters a context window overflow exception, giving your implementation a chance to trim the conversation history before retrying. + 2. [`reduce_context`](../../../api-reference/agent/conversation_manager/conversation_manager.md#strands.agent.conversation_manager.conversation_manager.ConversationManager.reduce_context): This method is called when the model's context window is exceeded (typically due to token limits). It implements the specific strategy for reducing the window size when necessary. The agent calls this method when it encounters a context window overflow exception, giving your implementation a chance to trim the conversation history before retrying. 3. `removed_messages_count`: This attribute is tracked by conversation managers, and utilized by [Session Management](./session-management.md) to efficiently load messages from the session storage. The count represents messages provided by the user or LLM that have been removed from the agent's messages, but not messages included by the conversation manager through something like summarization. diff --git a/docs/user-guide/concepts/agents/prompts.md b/docs/user-guide/concepts/agents/prompts.md index 6bfa2f72..83b9227a 100644 --- a/docs/user-guide/concepts/agents/prompts.md +++ b/docs/user-guide/concepts/agents/prompts.md @@ -76,7 +76,7 @@ The SDK supports multi-modal prompts, allowing you to include images, documents, --8<-- "user-guide/concepts/agents/prompts.ts:multimodalPrompt" ``` -For a complete list of supported content types, please refer to the [API Reference](../../../api-reference/types.md#strands.types.content.ContentBlock). +For a complete list of supported content types, please refer to the [API Reference](../../../api-reference/types/content.md#strands.types.content.ContentBlock). ### Direct Tool Calls diff --git a/docs/user-guide/concepts/agents/session-management.md b/docs/user-guide/concepts/agents/session-management.md index 0e266abc..6e7b03d1 100644 --- a/docs/user-guide/concepts/agents/session-management.md +++ b/docs/user-guide/concepts/agents/session-management.md @@ -85,12 +85,12 @@ result = graph("Research and write about AI") Strands offers two built-in session managers for persisting agent sessions: -1. [**FileSessionManager**](../../../api-reference/session.md#strands.session.file_session_manager.FileSessionManager): Stores sessions in the local filesystem -2. [**S3SessionManager**](../../../api-reference/session.md#strands.session.s3_session_manager.S3SessionManager): Stores sessions in Amazon S3 buckets +1. [**FileSessionManager**](../../../api-reference/session/file_session_manager.md#strands.session.file_session_manager.FileSessionManager): Stores sessions in the local filesystem +2. [**S3SessionManager**](../../../api-reference/session/s3_session_manager.md#strands.session.s3_session_manager.S3SessionManager): Stores sessions in Amazon S3 buckets ### FileSessionManager -The [`FileSessionManager`](../../../api-reference/session.md#strands.session.file_session_manager.FileSessionManager) provides a simple way to persist both single agent and multi-agent sessions to the local filesystem: +The [`FileSessionManager`](../../../api-reference/session/file_session_manager.md#strands.session.file_session_manager.FileSessionManager) provides a simple way to persist both single agent and multi-agent sessions to the local filesystem: ```python from strands import Agent @@ -122,7 +122,7 @@ graph = Graph( #### File Storage Structure -When using [`FileSessionManager`](../../../api-reference/session.md#strands.session.file_session_manager.FileSessionManager), sessions are stored in the following directory structure: +When using [`FileSessionManager`](../../../api-reference/session/file_session_manager.md#strands.session.file_session_manager.FileSessionManager), sessions are stored in the following directory structure: ``` // @@ -141,7 +141,7 @@ When using [`FileSessionManager`](../../../api-reference/session.md#strands.sess ### S3SessionManager -For cloud-based persistence, especially in distributed environments, use the [`S3SessionManager`](../../../api-reference/session.md#strands.session.s3_session_manager.S3SessionManager): +For cloud-based persistence, especially in distributed environments, use the [`S3SessionManager`](../../../api-reference/session/s3_session_manager.md#strands.session.s3_session_manager.S3SessionManager): ```python from strands import Agent @@ -176,7 +176,7 @@ result = swarm("Coordinate the task across agents") ``` #### S3 Storage Structure -Just like in the [`FileSessionManager`](../../../api-reference/session.md#strands.session.file_session_manager.FileSessionManager), sessions are stored with the following structure in the s3 bucket: +Just like in the [`FileSessionManager`](../../../api-reference/session/file_session_manager.md#strands.session.file_session_manager.FileSessionManager), sessions are stored with the following structure in the s3 bucket: ``` / @@ -195,7 +195,7 @@ Just like in the [`FileSessionManager`](../../../api-reference/session.md#strand #### Required S3 Permissions -To use the [`S3SessionManager`](../../../api-reference/session.md#strands.session.s3_session_manager.S3SessionManager), your AWS credentials must have the following S3 permissions: +To use the [`S3SessionManager`](../../../api-reference/session/s3_session_manager.md#strands.session.s3_session_manager.S3SessionManager), your AWS credentials must have the following S3 permissions: - `s3:PutObject` - To create and update session data - `s3:GetObject` - To retrieve session data @@ -256,7 +256,7 @@ Session data is stored using these key data models: **Session** -The [`Session`](../../../api-reference/types.md#strands.types.session.Session) model is the top-level container for session data: +The [`Session`](../../../api-reference/types/session.md#strands.types.session.Session) model is the top-level container for session data: - **Purpose**: Provides a namespace for organizing multiple agents and their interactions - **Key Fields**: @@ -267,7 +267,7 @@ The [`Session`](../../../api-reference/types.md#strands.types.session.Session) m **SessionAgent** -The [`SessionAgent`](../../../api-reference/types.md#strands.types.session.SessionAgent) model stores agent-specific data: +The [`SessionAgent`](../../../api-reference/types/session.md#strands.types.session.SessionAgent) model stores agent-specific data: - **Purpose**: Maintains the state and configuration of a specific agent within a session - **Key Fields**: @@ -279,7 +279,7 @@ The [`SessionAgent`](../../../api-reference/types.md#strands.types.session.Sessi **SessionMessage** -The [`SessionMessage`](../../../api-reference/types.md#strands.types.session.SessionMessage) model stores individual messages in the conversation: +The [`SessionMessage`](../../../api-reference/types/session.md#strands.types.session.SessionMessage) model stores individual messages in the conversation: - **Purpose**: Preserves the conversation history with support for message redaction - **Key Fields**: diff --git a/docs/user-guide/concepts/agents/state.md b/docs/user-guide/concepts/agents/state.md index 10398bf6..7748e4e2 100644 --- a/docs/user-guide/concepts/agents/state.md +++ b/docs/user-guide/concepts/agents/state.md @@ -93,7 +93,7 @@ Direct tool calls are (by default) recorded in the conversation history: ### Conversation Manager -Strands uses a conversation manager to handle conversation history effectively. The default is the [`SlidingWindowConversationManager`](../../../api-reference/agent.md#strands.agent.conversation_manager.sliding_window_conversation_manager.SlidingWindowConversationManager), which keeps recent messages and removes older ones when needed: +Strands uses a conversation manager to handle conversation history effectively. The default is the [`SlidingWindowConversationManager`](../../../api-reference/agent/conversation_manager/sliding_window_conversation_manager.md#strands.agent.conversation_manager.sliding_window_conversation_manager.SlidingWindowConversationManager), which keeps recent messages and removes older ones when needed: === "Python" diff --git a/docs/user-guide/concepts/agents/structured-output.md b/docs/user-guide/concepts/agents/structured-output.md index 46bfa81f..71e04b7a 100644 --- a/docs/user-guide/concepts/agents/structured-output.md +++ b/docs/user-guide/concepts/agents/structured-output.md @@ -25,7 +25,7 @@ Key benefits: ## Basic Usage -Define an output structure using a Pydantic model. Then, assign the model to the `structured_output_model` parameter when invoking the [`agent`](../../../api-reference/agent.md#strands.agent.agent). Then, access the Structured Output from the [`AgentResult`](../../../api-reference/agent.md#strands.agent.agent_result). +Define an output structure using a Pydantic model. Then, assign the model to the `structured_output_model` parameter when invoking the [`agent`](../../../api-reference/agent/agent.md#strands.agent.agent). Then, access the Structured Output from the [`AgentResult`](../../../api-reference/agent/agent_result.md#strands.agent.agent_result). === "Python" @@ -83,7 +83,7 @@ Define an output structure using a Pydantic model. Then, assign the model to the The structured output system converts your Pydantic models into tool specifications that guide the language model to produce correctly formatted responses. All of the model providers supported in Strands can work with Structured Output. -Strands handles this by accepting the `structured_output_model` parameter in [`agent`](../../../api-reference/agent.md#strands.agent.agent) invocations, which manages the conversion, validation, and response processing automatically. The validated result is available in the `AgentResult.structured_output` field. +Strands handles this by accepting the `structured_output_model` parameter in [`agent`](../../../api-reference/agent/agent.md#strands.agent.agent) invocations, which manages the conversion, validation, and response processing automatically. The validated result is available in the `AgentResult.structured_output` field. ### Error Handling diff --git a/docs/user-guide/concepts/experimental/agent-config.md b/docs/user-guide/concepts/experimental/agent-config.md index f4ec49f6..6c317512 100644 --- a/docs/user-guide/concepts/experimental/agent-config.md +++ b/docs/user-guide/concepts/experimental/agent-config.md @@ -143,7 +143,7 @@ agent.model = OpenAIModel( The `config_to_agent` function accepts: - `config`: Either a file path (string) or configuration dictionary -- `**kwargs`: Additional [Agent constructor parameters](../../../api-reference/agent.md#strands.agent.agent.Agent.__init__) that override config values +- `**kwargs`: Additional [Agent constructor parameters](../../../api-reference/agent/agent.md#strands.agent.agent.Agent.__init__) that override config values ```python # Override config values with valid Agent parameters diff --git a/docs/user-guide/concepts/experimental/bidirectional-streaming/agent.md b/docs/user-guide/concepts/experimental/bidirectional-streaming/agent.md index 594b30f4..3ffdd4aa 100644 --- a/docs/user-guide/concepts/experimental/bidirectional-streaming/agent.md +++ b/docs/user-guide/concepts/experimental/bidirectional-streaming/agent.md @@ -443,4 +443,4 @@ The agent automatically cleans up background tasks, model connections, I/O chann - [I/O Channels](io.md) - Building custom input/output channels - [Model Providers](models/nova_sonic.md) - Provider-specific configuration - [Quickstart](quickstart.md) - Getting started guide -- [API Reference](../../../../api-reference/experimental/bidi/agent.md) - Complete API documentation \ No newline at end of file +- [API Reference](../../../../api-reference/experimental/bidi/agent/agent.md) - Complete API documentation \ No newline at end of file diff --git a/docs/user-guide/concepts/experimental/bidirectional-streaming/hooks.md b/docs/user-guide/concepts/experimental/bidirectional-streaming/hooks.md index 36849126..f63ca3e8 100644 --- a/docs/user-guide/concepts/experimental/bidirectional-streaming/hooks.md +++ b/docs/user-guide/concepts/experimental/bidirectional-streaming/hooks.md @@ -347,4 +347,4 @@ For additional best practices on performance considerations, error handling, com - [Agent](agent.md) - Learn about BidiAgent configuration and lifecycle - [Session Management](session-management.md) - Persist conversations across sessions - [Events](events.md) - Complete guide to bidirectional streaming events -- [API Reference](../../../../api-reference/experimental/bidi/agent.md) - Complete API documentation +- [API Reference](../../../../api-reference/experimental/bidi/agent/agent.md) - Complete API documentation diff --git a/docs/user-guide/concepts/experimental/bidirectional-streaming/models/gemini_live.md b/docs/user-guide/concepts/experimental/bidirectional-streaming/models/gemini_live.md index 524b0213..f9305785 100644 --- a/docs/user-guide/concepts/experimental/bidirectional-streaming/models/gemini_live.md +++ b/docs/user-guide/concepts/experimental/bidirectional-streaming/models/gemini_live.md @@ -74,7 +74,7 @@ For details on the supported client configs, see [here](https://googleapis.githu | Parameter | Description | Example | Options | | --------- | ----------- | ------- | ------- | -| `audio` | `AudioConfig` instance. | `{"voice": "Kore"}` | [reference](../../../../../api-reference/experimental/bidi/types.md#strands.experimental.bidi.types.model.AudioConfig) | +| `audio` | `AudioConfig` instance. | `{"voice": "Kore"}` | [reference](../../../../../api-reference/experimental/bidi/types/model.md#strands.experimental.bidi.types.model.AudioConfig) | | `inference` | Dict of inference fields specified in the Gemini `LiveConnectConfig`. | `{"temperature": 0.7}` | [reference](https://googleapis.github.io/python-genai/genai.html#genai.types.LiveConnectConfig) For the list of supported voices and languages, see [here](https://docs.cloud.google.com/text-to-speech/docs/list-voices-and-types). @@ -97,4 +97,4 @@ Make sure your Google AI API key is properly set in `client_config` or as the `G - [Gemini Live API](https://ai.google.dev/gemini-api/docs/live) - [Gemini API Reference](https://googleapis.github.io/python-genai/genai.html#) -- [Provider API Reference](../../../../../api-reference/experimental/bidi/models.md#strands.experimental.bidi.models.gemini_live.BidiGeminiLiveModel) +- [Provider API Reference](../../../../../api-reference/experimental/bidi/models/model.md#strands.experimental.bidi.models.gemini_live.BidiGeminiLiveModel) diff --git a/docs/user-guide/concepts/experimental/bidirectional-streaming/models/nova_sonic.md b/docs/user-guide/concepts/experimental/bidirectional-streaming/models/nova_sonic.md index 40da762b..2ec4a301 100644 --- a/docs/user-guide/concepts/experimental/bidirectional-streaming/models/nova_sonic.md +++ b/docs/user-guide/concepts/experimental/bidirectional-streaming/models/nova_sonic.md @@ -111,7 +111,7 @@ For more details on this approach, please refer to the [boto3 session docs](http | Parameter | Description | Example | Options | | --------- | ----------- | ------- | ------- | -| `audio` | `AudioConfig` instance. | `{"voice": "tiffany"}` | [reference](../../../../../api-reference/experimental/bidi/types.md#strands.experimental.bidi.types.model.AudioConfig) | +| `audio` | `AudioConfig` instance. | `{"voice": "tiffany"}` | [reference](../../../../../api-reference/experimental/bidi/types/model.md#strands.experimental.bidi.types.model.AudioConfig) | | `inference` | Session start `inferenceConfiguration`'s (as snake_case). | `{"top_p": 0.9}` | [reference](https://docs.aws.amazon.com/nova/latest/userguide/input-events.html) ## Troubleshooting @@ -133,4 +133,4 @@ As a reminder, Nova Sonic is only available in us-east-1, eu-north-1, and ap-nor - [Nova Sonic](https://docs.aws.amazon.com/nova/latest/userguide/speech.html) - [Experimental Bedrock Client](https://github.com/awslabs/aws-sdk-python/tree/develop/clients/aws-sdk-bedrock-runtime) -- [Provider API Reference](../../../../../api-reference/experimental/bidi/models.md#strands.experimental.bidi.models.nova_sonic.BidiNovaSonicModel) +- [Provider API Reference](../../../../../api-reference/experimental/bidi/models/model.md#strands.experimental.bidi.models.nova_sonic.BidiNovaSonicModel) diff --git a/docs/user-guide/concepts/experimental/bidirectional-streaming/models/openai_realtime.md b/docs/user-guide/concepts/experimental/bidirectional-streaming/models/openai_realtime.md index 25c2cf80..d0614cce 100644 --- a/docs/user-guide/concepts/experimental/bidirectional-streaming/models/openai_realtime.md +++ b/docs/user-guide/concepts/experimental/bidirectional-streaming/models/openai_realtime.md @@ -78,7 +78,7 @@ if __name__ == "__main__": | Parameter | Description | Example | Options | | --------- | ----------- | ------- | ------- | -| `audio` | `AudioConfig` instance. | `{"voice": "coral"}` | [reference](../../../../../api-reference/experimental/bidi/types.md#strands.experimental.bidi.types.model.AudioConfig) | +| `audio` | `AudioConfig` instance. | `{"voice": "coral"}` | [reference](../../../../../api-reference/experimental/bidi/types/model.md#strands.experimental.bidi.types.model.AudioConfig) | | `inference` | Dict of inference fields supported in the OpenAI `session.update` event. | `{"max_output_tokens": 4096}` | [reference](https://platform.openai.com/docs/api-reference/realtime-client-events/session/update) For the list of supported voices, see [here](https://platform.openai.com/docs/guides/realtime-conversations#voice-options). @@ -97,4 +97,4 @@ Ensure your OpenAI API key is properly configured. Set the `OPENAI_API_KEY` envi - [OpenAI Realtime API](https://platform.openai.com/docs/guides/realtime) - [OpenAI API Reference](https://platform.openai.com/docs/api-reference/realtime) -- [Provider API Reference](../../../../../api-reference/experimental/bidi/models.md#strands.experimental.bidi.models.openai_realtime.BidiOpenAIRealtimeModel) +- [Provider API Reference](../../../../../api-reference/experimental/bidi/models/model.md#strands.experimental.bidi.models.openai_realtime.BidiOpenAIRealtimeModel) diff --git a/docs/user-guide/concepts/experimental/bidirectional-streaming/quickstart.md b/docs/user-guide/concepts/experimental/bidirectional-streaming/quickstart.md index df7b7174..2fb9081d 100644 --- a/docs/user-guide/concepts/experimental/bidirectional-streaming/quickstart.md +++ b/docs/user-guide/concepts/experimental/bidirectional-streaming/quickstart.md @@ -507,5 +507,5 @@ Ready to learn more? Check out these resources: - [Nova Sonic](models/nova_sonic.md) - Amazon Bedrock's bidirectional streaming model - [OpenAI Realtime](models/openai_realtime.md) - OpenAI's Realtime API - [Gemini Live](models/gemini_live.md) - Google's Gemini Live API -- [API Reference](../../../../api-reference/experimental/bidi/agent.md) - Complete API documentation +- [API Reference](../../../../api-reference/experimental/bidi/agent/agent.md) - Complete API documentation diff --git a/docs/user-guide/concepts/experimental/bidirectional-streaming/session-management.md b/docs/user-guide/concepts/experimental/bidirectional-streaming/session-management.md index d30073e7..a78488a3 100644 --- a/docs/user-guide/concepts/experimental/bidirectional-streaming/session-management.md +++ b/docs/user-guide/concepts/experimental/bidirectional-streaming/session-management.md @@ -212,4 +212,4 @@ For best practices on session ID management, session cleanup, error handling, st - [Agent](agent.md) - Learn about BidiAgent configuration and lifecycle - [Hooks](hooks.md) - Extend agent functionality with hooks - [Events](events.md) - Complete guide to bidirectional streaming events -- [API Reference](../../../../api-reference/experimental/bidi/agent.md) - Complete API documentation +- [API Reference](../../../../api-reference/experimental/bidi/agent/agent.md) - Complete API documentation diff --git a/docs/user-guide/concepts/interrupts.md b/docs/user-guide/concepts/interrupts.md index 3bef3d61..ee4c0d9b 100644 --- a/docs/user-guide/concepts/interrupts.md +++ b/docs/user-guide/concepts/interrupts.md @@ -101,7 +101,7 @@ Interrupts in Strands are comprised of the following components: - `event.cancel_tool` - Cancel tool execution based on interrupt response - You can either set `cancel_tool` to `True` or provide a custom cancellation message. -For additional details on each of these components, please refer to the [API Reference](../../api-reference/types.md#strands.types.interrupt) pages. +For additional details on each of these components, please refer to the [API Reference](../../api-reference/types/interrupt.md#strands.types.interrupt) pages. ### Rules diff --git a/docs/user-guide/concepts/model-providers/amazon-bedrock.md b/docs/user-guide/concepts/model-providers/amazon-bedrock.md index 8d7ac628..7bc5f5ba 100644 --- a/docs/user-guide/concepts/model-providers/amazon-bedrock.md +++ b/docs/user-guide/concepts/model-providers/amazon-bedrock.md @@ -145,7 +145,7 @@ For more details, see the [Amazon Bedrock documentation on modifying model acces === "Python" - The [`BedrockModel`](../../../api-reference/models.md#strands.models.bedrock) provider is used by default when creating a basic Agent, and uses the [Claude Sonnet 4](https://aws.amazon.com/blogs/aws/claude-opus-4-anthropics-most-powerful-model-for-coding-is-now-in-amazon-bedrock/) model by default. This basic example creates an agent using this default setup: + The [`BedrockModel`](../../../api-reference/models/bedrock.md#strands.models.bedrock) provider is used by default when creating a basic Agent, and uses the [Claude Sonnet 4](https://aws.amazon.com/blogs/aws/claude-opus-4-anthropics-most-powerful-model-for-coding-is-now-in-amazon-bedrock/) model by default. This basic example creates an agent using this default setup: ```python from strands import Agent @@ -190,7 +190,7 @@ For more details, see the [Amazon Bedrock documentation on modifying model acces === "Python" - For more control over model configuration, you can create an instance of the [`BedrockModel`](../../../api-reference/models.md#strands.models.bedrock) class: + For more control over model configuration, you can create an instance of the [`BedrockModel`](../../../api-reference/models/bedrock.md#strands.models.bedrock) class: ```python from strands import Agent @@ -222,7 +222,7 @@ For more details, see the [Amazon Bedrock documentation on modifying model acces === "Python" - The [`BedrockModel`](../../../api-reference/models.md#strands.models.bedrock) supports various configuration parameters. For a complete list of available options, see the [BedrockModel API reference](../../../api-reference/models.md#strands.models.bedrock). + The [`BedrockModel`](../../../api-reference/models/bedrock.md#strands.models.bedrock) supports various configuration parameters. For a complete list of available options, see the [BedrockModel API reference](../../../api-reference/models/bedrock.md#strands.models.bedrock). Common configuration parameters include: @@ -361,13 +361,13 @@ Some Bedrock models support multimodal inputs (Documents, Images, etc.). Here's --8<-- "user-guide/concepts/model-providers/amazon-bedrock.ts:multimodal_full" ``` -For a complete list of input types, please refer to the [API Reference](../../../api-reference/types.md). +For a complete list of input types, please refer to the [API Reference](../../../api-reference/types/content.md). ### Guardrails === "Python" - Amazon Bedrock supports guardrails to help ensure model outputs meet your requirements. Strands allows you to configure guardrails with your [`BedrockModel`](../../../api-reference/models.md#strands.models.bedrock): + Amazon Bedrock supports guardrails to help ensure model outputs meet your requirements. Strands allows you to configure guardrails with your [`BedrockModel`](../../../api-reference/models/bedrock.md#strands.models.bedrock): ```python from strands import Agent @@ -525,7 +525,7 @@ Tool caching allows you to reuse a cached tool definition across multiple reques === "Python" - Messages caching allows you to reuse a cached conversation across multiple requests. This is not enabled via a configuration in the [`BedrockModel`](../../../api-reference/models.md#strands.models.bedrock) class, but instead by including a `cachePoint` in the Agent's Messages array: + Messages caching allows you to reuse a cached conversation across multiple requests. This is not enabled via a configuration in the [`BedrockModel`](../../../api-reference/models/bedrock.md#strands.models.bedrock) class, but instead by including a `cachePoint` in the Agent's Messages array: ```python from strands import Agent @@ -694,7 +694,7 @@ Amazon Bedrock models can provide detailed reasoning steps when generating respo === "Python" - Strands allows you to enable and configure reasoning capabilities with your [`BedrockModel`](../../../api-reference/models.md#strands.models.bedrock): + Strands allows you to enable and configure reasoning capabilities with your [`BedrockModel`](../../../api-reference/models/bedrock.md#strands.models.bedrock): ```python from strands import Agent diff --git a/docs/user-guide/concepts/model-providers/anthropic.md b/docs/user-guide/concepts/model-providers/anthropic.md index 9264fc5d..959a1957 100644 --- a/docs/user-guide/concepts/model-providers/anthropic.md +++ b/docs/user-guide/concepts/model-providers/anthropic.md @@ -65,7 +65,7 @@ If you encounter the error `ModuleNotFoundError: No module named 'anthropic'`, t ### Structured Output -Anthropic's Claude models support structured output through their tool calling capabilities. When you use [`Agent.structured_output()`](../../../api-reference/agent.md#strands.agent.agent.Agent.structured_output), the Strands SDK converts your Pydantic models to Anthropic's tool specification format. +Anthropic's Claude models support structured output through their tool calling capabilities. When you use [`Agent.structured_output()`](../../../api-reference/agent/agent.md#strands.agent.agent.Agent.structured_output), the Strands SDK converts your Pydantic models to Anthropic's tool specification format. ```python from pydantic import BaseModel, Field @@ -110,6 +110,6 @@ print(f"Rating: {result.rating}") ## References -- [API](../../../api-reference/models.md) +- [API](../../../api-reference/models/model.md) - [Anthropic](https://docs.anthropic.com/en/home) diff --git a/docs/user-guide/concepts/model-providers/custom_model_provider.md b/docs/user-guide/concepts/model-providers/custom_model_provider.md index 902b3819..67825239 100644 --- a/docs/user-guide/concepts/model-providers/custom_model_provider.md +++ b/docs/user-guide/concepts/model-providers/custom_model_provider.md @@ -184,8 +184,8 @@ The core of the model interface is the `stream` method that serves as the single The `stream` method accepts three parameters: - - [`Messages`](../../../api-reference/types.md#strands.types.content.Messages): A list of Strands Agents messages, containing a [Role](../../../api-reference/types.md#strands.types.content.Role) and a list of [ContentBlocks](../../../api-reference/types.md#strands.types.content.ContentBlock). - - [`list[ToolSpec]`](../../../api-reference/types.md#strands.types.tools.ToolSpec): List of tool specifications that the model can decide to use. + - [`Messages`](../../../api-reference/types/content.md#strands.types.content.Messages): A list of Strands Agents messages, containing a [Role](../../../api-reference/types/content.md#strands.types.content.Role) and a list of [ContentBlocks](../../../api-reference/types/content.md#strands.types.content.ContentBlock). + - [`list[ToolSpec]`](../../../api-reference/types/tools.md#strands.types.tools.ToolSpec): List of tool specifications that the model can decide to use. - `SystemPrompt`: A system prompt string given to the Model to prompt it how to answer the user. ```python @@ -310,9 +310,9 @@ Your custom model provider needs to convert your model's response events to Stra === "Python" - The Python SDK uses dictionary-based [StreamEvent](../../../api-reference/types.md#strands.types.streaming.StreamEvent) format: + The Python SDK uses dictionary-based [StreamEvent](../../../api-reference/types/streaming.md#strands.types.streaming.StreamEvent) format: - * [`messageStart`](../../../api-reference/types.md#strands.types.streaming.MessageStartEvent): Event signaling the start of a message in a streaming response. This should have the `role`: `assistant` + * [`messageStart`](../../../api-reference/types/streaming.md#strands.types.streaming.MessageStartEvent): Event signaling the start of a message in a streaming response. This should have the `role`: `assistant` ```python { "messageStart": { @@ -320,7 +320,7 @@ Your custom model provider needs to convert your model's response events to Stra } } ``` - * [`contentBlockStart`](../../../api-reference/types.md#strands.types.streaming.ContentBlockStartEvent): Event signaling the start of a content block. If this is the first event of a tool use request, then set the `toolUse` key to have the value [ContentBlockStartToolUse](../../../api-reference/types.md#strands.types.content.ContentBlockStartToolUse) + * [`contentBlockStart`](../../../api-reference/types/streaming.md#strands.types.streaming.ContentBlockStartEvent): Event signaling the start of a content block. If this is the first event of a tool use request, then set the `toolUse` key to have the value [ContentBlockStartToolUse](../../../api-reference/types/content.md#strands.types.content.ContentBlockStartToolUse) ```python { "contentBlockStart": { @@ -331,7 +331,7 @@ Your custom model provider needs to convert your model's response events to Stra } } ``` - * [`contentBlockDelta`](../../../api-reference/types.md#strands.types.streaming.ContentBlockDeltaEvent): Event continuing a content block. This event can be sent several times, and each piece of content will be appended to the previously sent content. + * [`contentBlockDelta`](../../../api-reference/types/streaming.md#strands.types.streaming.ContentBlockDeltaEvent): Event continuing a content block. This event can be sent several times, and each piece of content will be appended to the previously sent content. ```python { "contentBlockDelta": { @@ -349,13 +349,13 @@ Your custom model provider needs to convert your model's response events to Stra } } ``` - * [`contentBlockStop`](../../../api-reference/types.md#strands.types.streaming.ContentBlockStopEvent): Event marking the end of a content block. Once this event is sent, all previous events between the previous [ContentBlockStartEvent](../../../api-reference/types.md#strands.types.streaming.ContentBlockStartEvent) and this one can be combined to create a [ContentBlock](../../../api-reference/types.md#strands.types.content.ContentBlock) + * [`contentBlockStop`](../../../api-reference/types/streaming.md#strands.types.streaming.ContentBlockStopEvent): Event marking the end of a content block. Once this event is sent, all previous events between the previous [ContentBlockStartEvent](../../../api-reference/types/streaming.md#strands.types.streaming.ContentBlockStartEvent) and this one can be combined to create a [ContentBlock](../../../api-reference/types/content.md#strands.types.content.ContentBlock) ```python { "contentBlockStop": {} } ``` - * [`messageStop`](../../../api-reference/types.md#strands.types.streaming.MessageStopEvent): Event marking the end of a streamed response, and the [StopReason](../../../api-reference/types.md#strands.types.event_loop.StopReason). No more content block events are expected after this event is returned. + * [`messageStop`](../../../api-reference/types/streaming.md#strands.types.streaming.MessageStopEvent): Event marking the end of a streamed response, and the [StopReason](../../../api-reference/types/event_loop.md#strands.types.event_loop.StopReason). No more content block events are expected after this event is returned. ```python { "messageStop": { @@ -363,7 +363,7 @@ Your custom model provider needs to convert your model's response events to Stra } } ``` - * [`metadata`](../../../api-reference/types.md#strands.types.streaming.MetadataEvent): Event representing the metadata of the response. This contains the input, output, and total token count, along with the latency of the request. + * [`metadata`](../../../api-reference/types/streaming.md#strands.types.streaming.MetadataEvent): Event representing the metadata of the response. This contains the input, output, and total token count, along with the latency of the request. ```python { "metrics": { @@ -376,7 +376,7 @@ Your custom model provider needs to convert your model's response events to Stra } } ``` - * [`redactContent`](../../../api-reference/types.md#strands.types.streaming.RedactContentEvent): Event that is used to redact the users input message, or the generated response of a model. This is useful for redacting content if a guardrail gets triggered. + * [`redactContent`](../../../api-reference/types/streaming.md#strands.types.streaming.RedactContentEvent): Event that is used to redact the users input message, or the generated response of a model. This is useful for redacting content if a guardrail gets triggered. ```python { "redactContent": { diff --git a/docs/user-guide/concepts/model-providers/gemini.md b/docs/user-guide/concepts/model-providers/gemini.md index 476fccf5..4d06fbd2 100644 --- a/docs/user-guide/concepts/model-providers/gemini.md +++ b/docs/user-guide/concepts/model-providers/gemini.md @@ -129,7 +129,7 @@ except ModelThrottledException as e: ### Structured Output -Gemini models support structured output through their native JSON schema capabilities. When you use [`Agent.structured_output()`](../../../api-reference/agent.md#strands.agent.agent.Agent.structured_output), the Strands SDK automatically converts your Pydantic models to Gemini's JSON schema format. +Gemini models support structured output through their native JSON schema capabilities. When you use [`Agent.structured_output()`](../../../api-reference/agent/agent.md#strands.agent.agent.Agent.structured_output), the Strands SDK automatically converts your Pydantic models to Gemini's JSON schema format. ```python from pydantic import BaseModel, Field @@ -224,7 +224,7 @@ response = agent([ ## References -- [API](../../../api-reference/models.md) +- [API](../../../api-reference/models/model.md) - [Google Gemini](https://ai.google.dev/api) - [Google GenAI SDK documentation](https://googleapis.github.io/python-genai/) - [Google AI Studio](https://aistudio.google.com/) \ No newline at end of file diff --git a/docs/user-guide/concepts/model-providers/litellm.md b/docs/user-guide/concepts/model-providers/litellm.md index f0576274..01fccd31 100644 --- a/docs/user-guide/concepts/model-providers/litellm.md +++ b/docs/user-guide/concepts/model-providers/litellm.md @@ -178,5 +178,5 @@ print(f"Rating: {result.rating}") ## References -- [API](../../../api-reference/models.md) +- [API](../../../api-reference/models/model.md) - [LiteLLM](https://docs.litellm.ai/docs/) diff --git a/docs/user-guide/concepts/model-providers/llamaapi.md b/docs/user-guide/concepts/model-providers/llamaapi.md index 6000598d..508337c5 100644 --- a/docs/user-guide/concepts/model-providers/llamaapi.md +++ b/docs/user-guide/concepts/model-providers/llamaapi.md @@ -70,7 +70,7 @@ If you encounter the error `ModuleNotFoundError: No module named 'llamaapi'`, th ### Structured Output -Llama API models support structured output through their tool calling capabilities. When you use [`Agent.structured_output()`](../../../api-reference/agent.md#strands.agent.agent.Agent.structured_output), the Strands SDK converts your Pydantic models to tool specifications that Llama models can understand. +Llama API models support structured output through their tool calling capabilities. When you use [`Agent.structured_output()`](../../../api-reference/agent/agent.md#strands.agent.agent.Agent.structured_output), the Strands SDK converts your Pydantic models to tool specifications that Llama models can understand. ```python from pydantic import BaseModel, Field @@ -109,5 +109,5 @@ print(f"Rating: {result.rating}") ## References -- [API](../../../api-reference/models.md) +- [API](../../../api-reference/models/model.md) - [LlamaAPI](https://llama.developer.meta.com/docs/) diff --git a/docs/user-guide/concepts/model-providers/llamacpp.md b/docs/user-guide/concepts/model-providers/llamacpp.md index 166fc893..7f41658c 100644 --- a/docs/user-guide/concepts/model-providers/llamacpp.md +++ b/docs/user-guide/concepts/model-providers/llamacpp.md @@ -107,7 +107,7 @@ If you get context overflow errors: ### Structured Output -llama.cpp models support structured output through native JSON schema validation. When you use [`Agent.structured_output()`](../../../api-reference/agent.md#strands.agent.agent.Agent.structured_output), the SDK uses llama.cpp's json_schema parameter to constrain output: +llama.cpp models support structured output through native JSON schema validation. When you use [`Agent.structured_output()`](../../../api-reference/agent/agent.md#strands.agent.agent.Agent.structured_output), the SDK uses llama.cpp's json_schema parameter to constrain output: ```python from pydantic import BaseModel, Field @@ -212,7 +212,7 @@ response = agent([image_message]) ## References -- [API](../../../api-reference/models.md) +- [API](../../../api-reference/models/model.md) - [llama.cpp](https://github.com/ggml-org/llama.cpp) - [llama.cpp Server Documentation](https://github.com/ggml-org/llama.cpp/tree/master/tools/server) - [GGUF Models on Hugging Face](https://huggingface.co/models?search=gguf) diff --git a/docs/user-guide/concepts/model-providers/mistral.md b/docs/user-guide/concepts/model-providers/mistral.md index 7edbcb68..44d541fb 100644 --- a/docs/user-guide/concepts/model-providers/mistral.md +++ b/docs/user-guide/concepts/model-providers/mistral.md @@ -88,5 +88,5 @@ If you encounter the error `ModuleNotFoundError: No module named 'mistralai'`, t ## References -- [API Reference](../../../api-reference/models.md) +- [API Reference](../../../api-reference/models/model.md) - [Mistral AI Documentation](https://docs.mistral.ai/) \ No newline at end of file diff --git a/docs/user-guide/concepts/model-providers/ollama.md b/docs/user-guide/concepts/model-providers/ollama.md index e098eadb..aeffece4 100644 --- a/docs/user-guide/concepts/model-providers/ollama.md +++ b/docs/user-guide/concepts/model-providers/ollama.md @@ -5,7 +5,7 @@ Ollama is a framework for running open-source large language models locally. Strands provides native support for Ollama, allowing you to use locally-hosted models in your agents. -The [`OllamaModel`](../../../api-reference/models.md#strands.models.ollama) class in Strands enables seamless integration with Ollama's API, supporting: +The [`OllamaModel`](../../../api-reference/models/ollama.md#strands.models.ollama) class in Strands enables seamless integration with Ollama's API, supporting: - Text generation - Image understanding @@ -83,7 +83,7 @@ agent("Tell me about Strands agents.") # Prints model output to stdout by defaul ## Configuration Options -The [`OllamaModel`](../../../api-reference/models.md#strands.models.ollama) supports various [configuration parameters](../../../api-reference/models.md#strands.models.ollama.OllamaModel.OllamaConfig): +The [`OllamaModel`](../../../api-reference/models/ollama.md#strands.models.ollama) supports various [configuration parameters](../../../api-reference/models/ollama.md#strands.models.ollama.OllamaModel.OllamaConfig): | Parameter | Description | Default | |-----------|-------------|---------| @@ -196,7 +196,7 @@ factual_agent = Agent(model=factual_model) ### Structured Output -Ollama supports structured output for models that have tool calling capabilities. When you use [`Agent.structured_output()`](../../../api-reference/agent.md#strands.agent.agent.Agent.structured_output), the Strands SDK converts your Pydantic models to tool specifications that compatible Ollama models can understand. +Ollama supports structured output for models that have tool calling capabilities. When you use [`Agent.structured_output()`](../../../api-reference/agent/agent.md#strands.agent.agent.Agent.structured_output), the Strands SDK converts your Pydantic models to tool specifications that compatible Ollama models can understand. ```python from pydantic import BaseModel, Field diff --git a/docs/user-guide/concepts/model-providers/openai.md b/docs/user-guide/concepts/model-providers/openai.md index 616c0360..a08552eb 100644 --- a/docs/user-guide/concepts/model-providers/openai.md +++ b/docs/user-guide/concepts/model-providers/openai.md @@ -163,5 +163,5 @@ OpenAI models support structured output through their native tool calling capabi ## References -- [API](../../../api-reference/models.md) +- [API](../../../api-reference/models/model.md) - [OpenAI](https://platform.openai.com/docs/overview) diff --git a/docs/user-guide/concepts/model-providers/sagemaker.md b/docs/user-guide/concepts/model-providers/sagemaker.md index 9918702f..0d2cdcea 100644 --- a/docs/user-guide/concepts/model-providers/sagemaker.md +++ b/docs/user-guide/concepts/model-providers/sagemaker.md @@ -102,6 +102,6 @@ Ensure your deployed model supports OpenAI-compatible chat completion APIs and v ## References -- [API Reference](../../../api-reference/models.md) +- [API Reference](../../../api-reference/models/model.md) - [Amazon SageMaker Documentation](https://docs.aws.amazon.com/sagemaker/) - [SageMaker Runtime API](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_runtime_InvokeEndpoint.html) diff --git a/docs/user-guide/concepts/model-providers/writer.md b/docs/user-guide/concepts/model-providers/writer.md index d113cb12..8c105dff 100644 --- a/docs/user-guide/concepts/model-providers/writer.md +++ b/docs/user-guide/concepts/model-providers/writer.md @@ -283,7 +283,7 @@ Ensure your Writer API key is valid and has the necessary permissions. You can g ## References -- [API Reference](../../../api-reference/models.md) +- [API Reference](../../../api-reference/models/model.md) - [Writer Documentation](https://dev.writer.com/) - [Writer Models Guide](https://dev.writer.com/home/models) - [Writer API Reference](https://dev.writer.com/api-reference) diff --git a/docs/user-guide/concepts/multi-agent/graph.md b/docs/user-guide/concepts/multi-agent/graph.md index 7e8baa1d..83716711 100644 --- a/docs/user-guide/concepts/multi-agent/graph.md +++ b/docs/user-guide/concepts/multi-agent/graph.md @@ -35,7 +35,7 @@ graph TD ### 1. GraphNode -A [`GraphNode`](../../../api-reference/multiagent.md#strands.multiagent.graph.GraphNode) represents a node in the graph with: +A [`GraphNode`](../../../api-reference/multiagent/graph.md#strands.multiagent.graph.GraphNode) represents a node in the graph with: - **node_id**: Unique identifier for the node - **executor**: The Agent or MultiAgentBase instance to execute @@ -46,7 +46,7 @@ A [`GraphNode`](../../../api-reference/multiagent.md#strands.multiagent.graph.Gr ### 2. GraphEdge -A [`GraphEdge`](../../../api-reference/multiagent.md#strands.multiagent.graph.GraphEdge) represents a connection between nodes with: +A [`GraphEdge`](../../../api-reference/multiagent/graph.md#strands.multiagent.graph.GraphEdge) represents a connection between nodes with: - **from_node**: Source node - **to_node**: Target node @@ -54,7 +54,7 @@ A [`GraphEdge`](../../../api-reference/multiagent.md#strands.multiagent.graph.Gr ### 3. GraphBuilder -The [`GraphBuilder`](../../../api-reference/multiagent.md#strands.multiagent.graph.GraphBuilder) provides a simple interface for constructing graphs: +The [`GraphBuilder`](../../../api-reference/multiagent/graph.md#strands.multiagent.graph.GraphBuilder) provides a simple interface for constructing graphs: - **add_node()**: Add an agent or multi-agent system as a node - **add_edge()**: Create a dependency between nodes @@ -67,7 +67,7 @@ The [`GraphBuilder`](../../../api-reference/multiagent.md#strands.multiagent.gra ## Creating a Graph -To create a [`Graph`](../../../api-reference/multiagent.md#strands.multiagent.graph.Graph), you use the [`GraphBuilder`](../../../api-reference/multiagent.md#strands.multiagent.graph.GraphBuilder) to define nodes, edges, and entry points: +To create a [`Graph`](../../../api-reference/multiagent/graph.md#strands.multiagent.graph.Graph), you use the [`GraphBuilder`](../../../api-reference/multiagent/graph.md#strands.multiagent.graph.GraphBuilder) to define nodes, edges, and entry points: ```python import logging @@ -163,7 +163,7 @@ builder.add_edge("C", "Z", condition=all_dependencies_complete(["A", "B", "C"])) ## Nested Multi-Agent Patterns -You can use a [`Graph`](../../../api-reference/multiagent.md#strands.multiagent.graph.Graph) or [`Swarm`](../../../api-reference/multiagent.md#strands.multiagent.swarm.Swarm) as a node within another Graph: +You can use a [`Graph`](../../../api-reference/multiagent/graph.md#strands.multiagent.graph.Graph) or [`Swarm`](../../../api-reference/multiagent/swarm.md#strands.multiagent.swarm.Swarm) as a node within another Graph: ```python from strands import Agent @@ -196,7 +196,7 @@ print(f"\n{result}") ## Custom Node Types -You can create custom node types by extending [`MultiAgentBase`](../../../api-reference/multiagent.md#strands.multiagent.base.MultiAgentBase) to implement deterministic business logic, data processing pipelines, and hybrid workflows. +You can create custom node types by extending [`MultiAgentBase`](../../../api-reference/multiagent/base.md#strands.multiagent.base.MultiAgentBase) to implement deterministic business logic, data processing pipelines, and hybrid workflows. ```python from strands.multiagent.base import MultiAgentBase, NodeResult, Status, MultiAgentResult @@ -247,7 +247,7 @@ Custom nodes enable: ## Multi-Modal Input Support -Graphs support multi-modal inputs like text and images using [`ContentBlocks`](../../../api-reference/types.md#strands.types.content.ContentBlock): +Graphs support multi-modal inputs like text and images using [`ContentBlocks`](../../../api-reference/types/content.md#strands.types.content.ContentBlock): ```python from strands import Agent @@ -279,7 +279,7 @@ result = graph(content_blocks) ## Asynchronous Execution -You can also execute a Graph asynchronously by calling the [`invoke_async`](../../../api-reference/multiagent.md#strands.multiagent.graph.Graph.invoke_async) function: +You can also execute a Graph asynchronously by calling the [`invoke_async`](../../../api-reference/multiagent/graph.md#strands.multiagent.graph.Graph.invoke_async) function: ```python import asyncio @@ -293,7 +293,7 @@ result = asyncio.run(run_graph()) ## Streaming Events -Graphs support real-time streaming of events during execution using [`stream_async`](../../../api-reference/multiagent.md#strands.multiagent.graph.Graph.stream_async). This provides visibility into node execution, parallel processing, and nested multi-agent systems. +Graphs support real-time streaming of events during execution using [`stream_async`](../../../api-reference/multiagent/graph.md#strands.multiagent.graph.Graph.stream_async). This provides visibility into node execution, parallel processing, and nested multi-agent systems. ```python from strands import Agent @@ -338,7 +338,7 @@ See the [streaming overview](../streaming/index.md#multi-agent-events) for detai ## Graph Results -When a Graph completes execution, it returns a [`GraphResult`](../../../api-reference/multiagent.md#strands.multiagent.graph.GraphResult) object with detailed information: +When a Graph completes execution, it returns a [`GraphResult`](../../../api-reference/multiagent/graph.md#strands.multiagent.graph.GraphResult) object with detailed information: ```python result = graph("Research and analyze...") diff --git a/docs/user-guide/concepts/multi-agent/swarm.md b/docs/user-guide/concepts/multi-agent/swarm.md index 7bed43c8..fa62dd2d 100644 --- a/docs/user-guide/concepts/multi-agent/swarm.md +++ b/docs/user-guide/concepts/multi-agent/swarm.md @@ -81,7 +81,7 @@ In this example: ## Swarm Configuration -The [`Swarm`](../../../api-reference/multiagent.md#strands.multiagent.swarm.Swarm) constructor allows you to control the behavior and safety parameters: +The [`Swarm`](../../../api-reference/multiagent/swarm.md#strands.multiagent.swarm.Swarm) constructor allows you to control the behavior and safety parameters: | Parameter | Description | Default | |-----------|-------------|---------| @@ -95,7 +95,7 @@ The [`Swarm`](../../../api-reference/multiagent.md#strands.multiagent.swarm.Swar ## Multi-Modal Input Support -Swarms support multi-modal inputs like text and images using [`ContentBlocks`](../../../api-reference/types.md#strands.types.content.ContentBlock): +Swarms support multi-modal inputs like text and images using [`ContentBlocks`](../../../api-reference/types/content.md#strands.types.content.ContentBlock): ```python from strands import Agent @@ -174,7 +174,7 @@ For detailed information about shared state, including examples and best practic ## Asynchronous Execution -You can also execute a Swarm asynchronously by calling the [`invoke_async`](../../../api-reference/multiagent.md#strands.multiagent.swarm.Swarm.invoke_async) function: +You can also execute a Swarm asynchronously by calling the [`invoke_async`](../../../api-reference/multiagent/swarm.md#strands.multiagent.swarm.Swarm.invoke_async) function: ```python import asyncio @@ -188,7 +188,7 @@ result = asyncio.run(run_swarm()) ## Streaming Events -Swarms support real-time streaming of events during execution using [`stream_async`](../../../api-reference/multiagent.md#strands.multiagent.swarm.Swarm.stream_async). This provides visibility into agent collaboration, handoffs, and autonomous coordination. +Swarms support real-time streaming of events during execution using [`stream_async`](../../../api-reference/multiagent/swarm.md#strands.multiagent.swarm.Swarm.stream_async). This provides visibility into agent collaboration, handoffs, and autonomous coordination. ```python from strands import Agent @@ -229,7 +229,7 @@ See the [streaming overview](../streaming/index.md#multi-agent-events) for detai ## Swarm Results -When a Swarm completes execution, it returns a [`SwarmResult`](../../../api-reference/multiagent.md#strands.multiagent.swarm.SwarmResult) object with detailed information: +When a Swarm completes execution, it returns a [`SwarmResult`](../../../api-reference/multiagent/swarm.md#strands.multiagent.swarm.SwarmResult) object with detailed information: ```python result = swarm("Design a system architecture for...") diff --git a/docs/user-guide/concepts/streaming/async-iterators.md b/docs/user-guide/concepts/streaming/async-iterators.md index 0cef378f..a5e66d66 100644 --- a/docs/user-guide/concepts/streaming/async-iterators.md +++ b/docs/user-guide/concepts/streaming/async-iterators.md @@ -8,7 +8,7 @@ For a complete list of available events including text generation, tool usage, l === "Python" - Python uses the [`stream_async`](../../../api-reference/agent.md#strands.agent.agent.Agent.stream_async), which is a streaming counterpart to the [`invoke_async`](../../../api-reference/agent.md#strands.agent.agent.Agent.invoke_async) method, for asynchronous streaming. This is ideal for frameworks like FastAPI, aiohttp, or Django Channels. + Python uses the [`stream_async`](../../../api-reference/agent/agent.md#strands.agent.agent.Agent.stream_async), which is a streaming counterpart to the [`invoke_async`](../../../api-reference/agent/agent.md#strands.agent.agent.Agent.invoke_async) method, for asynchronous streaming. This is ideal for frameworks like FastAPI, aiohttp, or Django Channels. > **Note**: Python also supports synchronous event handling via [callback handlers](./callback-handlers.md). @@ -35,7 +35,7 @@ For a complete list of available events including text generation, tool usage, l === "TypeScript" - TypeScript uses the [`stream`](../../../api-reference/agent.md) method for streaming, which is async by default. This is ideal for frameworks like Express.js or NestJS. + TypeScript uses the [`stream`](../../../api-reference/agent/agent.md) method for streaming, which is async by default. This is ideal for frameworks like Express.js or NestJS. ```typescript --8<-- "user-guide/concepts/streaming/async-iterators.ts:basic_usage" diff --git a/docs/user-guide/concepts/streaming/index.md b/docs/user-guide/concepts/streaming/index.md index f63bd997..213fa6c7 100644 --- a/docs/user-guide/concepts/streaming/index.md +++ b/docs/user-guide/concepts/streaming/index.md @@ -23,7 +23,7 @@ All streaming methods yield the same set of events: - **`event`**: Raw event from the model stream - **`force_stop`**: True if the event loop was forced to stop - **`force_stop_reason`**: Reason for forced stop - - **`result`**: The final [`AgentResult`](../../../api-reference/agent.md#strands.agent.agent_result.AgentResult) + - **`result`**: The final [`AgentResult`](../../../api-reference/agent/agent_result.md#strands.agent.agent_result.AgentResult) === "TypeScript" @@ -71,7 +71,7 @@ All streaming methods yield the same set of events: - **`name`**: Name of the tool - **`input`**: Tool input parameters (accumulated as streaming occurs) - **`tool_stream_event`**: Information about [an event streamed from a tool](../tools/custom-tools.md#tool-streaming), including: - - **`tool_use`**: The [`ToolUse`](../../../api-reference/types.md#strands.types.tools.ToolUse) for the tool that streamed the event + - **`tool_use`**: The [`ToolUse`](../../../api-reference/types/tools.md#strands.types.tools.ToolUse) for the tool that streamed the event - **`data`**: The data streamed from the tool === "TypeScript" - **`BeforeToolsEvent`**: Information about the current tool being used, including: @@ -272,4 +272,4 @@ Utilizing both [agents as a tool](../multi-agent/agents-as-tools.md) and [tool s - Learn about [Async Iterators](async-iterators.md) for asynchronous streaming - Explore [Callback Handlers](callback-handlers.md) for synchronous event processing -- See the [Agent API Reference](../../../api-reference/agent.md) for complete method documentation \ No newline at end of file +- See the [Agent API Reference](../../../api-reference/agent/agent.md) for complete method documentation \ No newline at end of file diff --git a/docs/user-guide/concepts/tools/custom-tools.md b/docs/user-guide/concepts/tools/custom-tools.md index 9c6a3ff3..cb401359 100644 --- a/docs/user-guide/concepts/tools/custom-tools.md +++ b/docs/user-guide/concepts/tools/custom-tools.md @@ -6,9 +6,9 @@ There are multiple approaches to defining custom tools in Strands, with differen Python supports three approaches to defining tools: - * **Python functions with the [`@tool`](../../../api-reference/tools.md#strands.tools.decorator.tool) decorator**: Transform regular Python functions into tools by adding a simple decorator. This approach leverages Python's docstrings and type hints to automatically generate tool specifications. + * **Python functions with the [`@tool`](../../../api-reference/tools/tools.md#strands.tools.decorator.tool) decorator**: Transform regular Python functions into tools by adding a simple decorator. This approach leverages Python's docstrings and type hints to automatically generate tool specifications. - * **Class-based tools with the [`@tool`](../../../api-reference/tools.md#strands.tools.decorator.tool) decorator**: Create tools within classes to maintain state and leverage object-oriented programming patterns. + * **Class-based tools with the [`@tool`](../../../api-reference/tools/tools.md#strands.tools.decorator.tool) decorator**: Create tools within classes to maintain state and leverage object-oriented programming patterns. * **Python modules following a specific format**: Define tools by creating Python modules that contain a tool specification and a matching function. This approach gives you more control over the tool's definition and is useful for dependency-free implementations of tools. @@ -237,7 +237,7 @@ Function tools may also be defined async. Strands will invoke all async tools co ### ToolContext -Tools can access their execution context to interact with the invoking agent, current tool use data, and invocation state. The [`ToolContext`](../../../api-reference/types.md#strands.types.tools.ToolContext) provides this access: +Tools can access their execution context to interact with the invoking agent, current tool use data, and invocation state. The [`ToolContext`](../../../api-reference/types/tools.md#strands.types.tools.ToolContext) provides this access: === "Python" @@ -451,7 +451,7 @@ You can define multiple tools within the same class to create a cohesive set of ) ``` - When you use the [`@tool`](../../../api-reference/tools.md#strands.tools.decorator.tool) decorator on a class method, the method becomes bound to the class instance when instantiated. This means the tool function has access to the instance's attributes and can maintain state between invocations. + When you use the [`@tool`](../../../api-reference/tools/tools.md#strands.tools.decorator.tool) decorator on a class method, the method becomes bound to the class instance when instantiated. This means the tool function has access to the instance's attributes and can maintain state between invocations. @@ -470,13 +470,13 @@ You can define multiple tools within the same class to create a cohesive set of ## Tool Response Format -Tools can return responses in various formats using the [`ToolResult`](../../../api-reference/types.md#strands.types.tools.ToolResult) structure. This structure provides flexibility for returning different types of content while maintaining a consistent interface. +Tools can return responses in various formats using the [`ToolResult`](../../../api-reference/types/tools.md#strands.types.tools.ToolResult) structure. This structure provides flexibility for returning different types of content while maintaining a consistent interface. #### ToolResult Structure === "Python" - The [`ToolResult`](../../../api-reference/types.md#strands.types.tools.ToolResult) dictionary has the following structure: + The [`ToolResult`](../../../api-reference/types/tools.md#strands.types.tools.ToolResult) dictionary has the following structure: ```python { @@ -582,10 +582,10 @@ The `content` field is a list of content blocks, where each block can contain: === "Python" - When using the [`@tool`](../../../api-reference/tools.md#strands.tools.decorator.tool) decorator, your function's return value is automatically converted to a proper [`ToolResult`](../../../api-reference/types.md#strands.types.tools.ToolResult): + When using the [`@tool`](../../../api-reference/tools/tools.md#strands.tools.decorator.tool) decorator, your function's return value is automatically converted to a proper [`ToolResult`](../../../api-reference/types/tools.md#strands.types.tools.ToolResult): 1. If you return a string or other simple value, it's wrapped as `{"text": str(result)}` - 2. If you return a dictionary with the proper [`ToolResult`](../../../api-reference/types.md#strands.types.tools.ToolResult) structure, it's used directly + 2. If you return a dictionary with the proper [`ToolResult`](../../../api-reference/types/tools.md#strands.types.tools.ToolResult) structure, it's used directly 3. If an exception occurs, it's converted to an error response === "TypeScript" diff --git a/docs/user-guide/concepts/tools/index.md b/docs/user-guide/concepts/tools/index.md index 7b8378c4..fa39e672 100644 --- a/docs/user-guide/concepts/tools/index.md +++ b/docs/user-guide/concepts/tools/index.md @@ -211,7 +211,7 @@ Build your own tools using the Strands SDK's tool interfaces. Both Python and Ty === "Python" - Define any Python function as a tool by using the [`@tool`](../../../api-reference/tools.md#strands.tools.decorator.tool) decorator. Function decorated tools can be placed anywhere in your codebase and imported in to your agent's list of tools. + Define any Python function as a tool by using the [`@tool`](../../../api-reference/tools/tools.md#strands.tools.decorator.tool) decorator. Function decorated tools can be placed anywhere in your codebase and imported in to your agent's list of tools. ```python import asyncio diff --git a/docs/user-guide/observability-evaluation/metrics.md b/docs/user-guide/observability-evaluation/metrics.md index 9b8701a8..f2981a54 100644 --- a/docs/user-guide/observability-evaluation/metrics.md +++ b/docs/user-guide/observability-evaluation/metrics.md @@ -13,7 +13,7 @@ Metrics are essential for understanding agent performance, optimizing behavior, - **Tool usage**: Call counts, success rates, and execution times for each tool - **Event loop cycles**: Number of reasoning cycles and their durations - All these metrics are accessible through the [`AgentResult`](../../api-reference/agent.md#strands.agent.agent_result.AgentResult) object that's returned whenever you invoke an agent: + All these metrics are accessible through the [`AgentResult`](../../api-reference/agent/agent_result.md#strands.agent.agent_result.AgentResult) object that's returned whenever you invoke an agent: ```python from strands import Agent @@ -31,7 +31,7 @@ Metrics are essential for understanding agent performance, optimizing behavior, print(f"Tools used: {list(result.metrics.tool_metrics.keys())}") ``` - The `metrics` attribute of `AgentResult` (an instance of [`EventLoopMetrics`](../../api-reference/telemetry.md#strands.telemetry.metrics)) provides comprehensive performance metric data about the agent's execution, while other attributes like `stop_reason`, `message`, and `state` provide context about the agent's response. This document explains the metrics available in the agent's response and how to interpret them. + The `metrics` attribute of `AgentResult` (an instance of [`EventLoopMetrics`](../../api-reference/telemetry/metrics.md#strands.telemetry.metrics)) provides comprehensive performance metric data about the agent's execution, while other attributes like `stop_reason`, `message`, and `state` provide context about the agent's response. This document explains the metrics available in the agent's response and how to interpret them. === "TypeScript" @@ -73,7 +73,7 @@ Metrics are essential for understanding agent performance, optimizing behavior, === "Python" - The [`EventLoopMetrics`](../../api-reference/telemetry.md#strands.telemetry.metrics.EventLoopMetrics) class aggregates metrics across the entire event loop execution cycle, providing a complete picture of your agent's performance. It tracks cycle counts, tool usage, execution durations, and token consumption across all model invocations. + The [`EventLoopMetrics`](../../api-reference/telemetry/metrics.md#strands.telemetry.metrics.EventLoopMetrics) class aggregates metrics across the entire event loop execution cycle, providing a complete picture of your agent's performance. It tracks cycle counts, tool usage, execution durations, and token consumption across all model invocations. Key metrics include: @@ -83,7 +83,7 @@ Metrics are essential for understanding agent performance, optimizing behavior, - **Accumulated metrics**: Latency measurements in milliseconds for all model requests - **Execution traces**: Detailed trace information for performance analysis - For a complete list of attributes and their types, see the [`EventLoopMetrics` API reference](../../api-reference/telemetry.md#strands.telemetry.metrics.EventLoopMetrics). + For a complete list of attributes and their types, see the [`EventLoopMetrics` API reference](../../api-reference/telemetry/metrics.md#strands.telemetry.metrics.EventLoopMetrics). {{ ts_not_supported_code() }} @@ -91,7 +91,7 @@ Metrics are essential for understanding agent performance, optimizing behavior, === "Python" - For each tool used by the agent, detailed metrics are collected in the `tool_metrics` dictionary. Each entry is an instance of [`ToolMetrics`](../../api-reference/telemetry.md#strands.telemetry.metrics.ToolMetrics) that tracks the tool's performance throughout the agent's execution. + For each tool used by the agent, detailed metrics are collected in the `tool_metrics` dictionary. Each entry is an instance of [`ToolMetrics`](../../api-reference/telemetry/metrics.md#strands.telemetry.metrics.ToolMetrics) that tracks the tool's performance throughout the agent's execution. Tool metrics provide insights into: @@ -100,7 +100,7 @@ Metrics are essential for understanding agent performance, optimizing behavior, - **Success rate**: Percentage of successful tool invocations - **Tool reference**: Information about the specific tool being tracked - These metrics help you identify performance bottlenecks, tools with high error rates, and opportunities for optimization. For complete details on all available properties, see the [`ToolMetrics` API reference](../../api-reference/telemetry.md#strands.telemetry.metrics.ToolMetrics). + These metrics help you identify performance bottlenecks, tools with high error rates, and opportunities for optimization. For complete details on all available properties, see the [`ToolMetrics` API reference](../../api-reference/telemetry/metrics.md#strands.telemetry.metrics.ToolMetrics). {{ ts_not_supported_code() }} diff --git a/docs/user-guide/quickstart.md b/docs/user-guide/quickstart.md index 1e2a0218..0c167785 100644 --- a/docs/user-guide/quickstart.md +++ b/docs/user-guide/quickstart.md @@ -171,9 +171,9 @@ And that's it! We now have a running agent with powerful tools and abilities in ## Understanding What Agents Did -After running an agent, you can understand what happened during execution through traces and metrics. Every agent invocation returns an [`AgentResult`](../api-reference/agent.md#strands.agent.agent_result.AgentResult) object with comprehensive observability data. +After running an agent, you can understand what happened during execution through traces and metrics. Every agent invocation returns an [`AgentResult`](../api-reference/agent/agent_result.md#strands.agent.agent_result.AgentResult) object with comprehensive observability data. -Traces provide detailed insight into the agent's reasoning process. You can access in-memory traces and metrics directly from the [`AgentResult`](../api-reference/agent.md#strands.agent.agent_result.AgentResult), or export them using [OpenTelemetry](observability-evaluation/traces.md) to observability platforms. +Traces provide detailed insight into the agent's reasoning process. You can access in-memory traces and metrics directly from the [`AgentResult`](../api-reference/agent/agent_result.md#strands.agent.agent_result.AgentResult), or export them using [OpenTelemetry](observability-evaluation/traces.md) to observability platforms. ??? code "Example result.metrics.get_summary() output" @@ -379,7 +379,7 @@ See the [Logs documentation](observability-evaluation/logs.md) for more informat ### Identifying a configured model -Strands defaults to the Bedrock model provider using Claude 4 Sonnet. The model your agent is using can be retrieved by accessing [`model.config`](../api-reference/models.md#strands.models.model.Model.get_config): +Strands defaults to the Bedrock model provider using Claude 4 Sonnet. The model your agent is using can be retrieved by accessing [`model.config`](../api-reference/models/model.md#strands.models.model.Model.get_config): ```python from strands import Agent @@ -454,7 +454,7 @@ Strands provides two main approaches to capture streaming events from an agent: ### Async Iterators -For asynchronous applications (like web servers or APIs), Strands provides an async iterator approach using [`stream_async()`](../api-reference/agent.md#strands.agent.agent.Agent.stream_async). This is particularly useful with async frameworks like FastAPI or Django Channels. +For asynchronous applications (like web servers or APIs), Strands provides an async iterator approach using [`stream_async()`](../api-reference/agent/agent.md#strands.agent.agent.Agent.stream_async). This is particularly useful with async frameworks like FastAPI or Django Channels. ```python import asyncio @@ -491,7 +491,7 @@ The async iterator yields the same event types as the callback handler callbacks See the [Async Iterators](concepts/streaming/async-iterators.md) documentation for full details. -> Note, Strands also offers an [`invoke_async()`](../api-reference/agent.md#strands.agent.agent.Agent.invoke_async) method for non-iterative async invocations. +> Note, Strands also offers an [`invoke_async()`](../api-reference/agent/agent.md#strands.agent.agent.Agent.invoke_async) method for non-iterative async invocations. ### Callback Handlers (Callbacks) diff --git a/docs/user-guide/quickstart/python.md b/docs/user-guide/quickstart/python.md index da58a61d..eba83d13 100644 --- a/docs/user-guide/quickstart/python.md +++ b/docs/user-guide/quickstart/python.md @@ -171,9 +171,9 @@ And that's it! We now have a running agent with powerful tools and abilities in ## Understanding What Agents Did -After running an agent, you can understand what happened during execution through traces and metrics. Every agent invocation returns an [`AgentResult`](../../api-reference/agent.md#strands.agent.agent_result.AgentResult) object with comprehensive observability data. +After running an agent, you can understand what happened during execution through traces and metrics. Every agent invocation returns an [`AgentResult`](../../api-reference/agent/agent_result.md#strands.agent.agent_result.AgentResult) object with comprehensive observability data. -Traces provide detailed insight into the agent's reasoning process. You can access in-memory traces and metrics directly from the [`AgentResult`](../../api-reference/agent.md#strands.agent.agent_result.AgentResult), or export them using [OpenTelemetry](../observability-evaluation/traces.md) to observability platforms. +Traces provide detailed insight into the agent's reasoning process. You can access in-memory traces and metrics directly from the [`AgentResult`](../../api-reference/agent/agent_result.md#strands.agent.agent_result.AgentResult), or export them using [OpenTelemetry](../observability-evaluation/traces.md) to observability platforms. ??? code "Example result.metrics.get_summary() output" @@ -379,7 +379,7 @@ See the [Logs documentation](../observability-evaluation/logs.md) for more infor ### Identifying a configured model -Strands defaults to the Bedrock model provider using Claude 4 Sonnet. The model your agent is using can be retrieved by accessing [`model.config`](../../api-reference/models.md#strands.models.model.Model.get_config): +Strands defaults to the Bedrock model provider using Claude 4 Sonnet. The model your agent is using can be retrieved by accessing [`model.config`](../../api-reference/models/model.md#strands.models.model.Model.get_config): ```python from strands import Agent @@ -453,7 +453,7 @@ Strands provides two main approaches to capture streaming events from an agent: ### Async Iterators -For asynchronous applications (like web servers or APIs), Strands provides an async iterator approach using [`stream_async()`](../../api-reference/agent.md#strands.agent.agent.Agent.stream_async). This is particularly useful with async frameworks like FastAPI or Django Channels. +For asynchronous applications (like web servers or APIs), Strands provides an async iterator approach using [`stream_async()`](../../api-reference/agent/agent.md#strands.agent.agent.Agent.stream_async). This is particularly useful with async frameworks like FastAPI or Django Channels. ```python import asyncio @@ -490,7 +490,7 @@ The async iterator yields the same event types as the callback handler callbacks See the [Async Iterators](../concepts/streaming/async-iterators.md) documentation for full details. -> Note, Strands also offers an [`invoke_async()`](../../api-reference/agent.md#strands.agent.agent.Agent.invoke_async) method for non-iterative async invocations. +> Note, Strands also offers an [`invoke_async()`](../../api-reference/agent/agent.md#strands.agent.agent.Agent.invoke_async) method for non-iterative async invocations. ### Callback Handlers (Callbacks) diff --git a/mkdocs.yml b/mkdocs.yml index 046d5265..daa5cd11 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -230,27 +230,7 @@ nav: - telegram-listener: community/tools/strands-telegram-listener.md - Contribute ❤️: https://github.com/strands-agents/sdk-python/blob/main/CONTRIBUTING.md - - Python API: - - Agent: api-reference/agent.md - - Event Loop: api-reference/event-loop.md - - Handlers: api-reference/handlers.md - - Hooks: api-reference/hooks.md - - Interrupt: api-reference/interrupt.md - - Models: api-reference/models.md - - Multiagent: api-reference/multiagent.md - - Session: api-reference/session.md - - Telemetry: api-reference/telemetry.md - - Tools: api-reference/tools.md - - Types: api-reference/types.md - - Experimental: - - Agent Config: api-reference/experimental/agent_config.md - - Hooks: api-reference/experimental/hooks.md - - Bidirectional Streaming: - - Agent: api-reference/experimental/bidi/agent.md - - IO: api-reference/experimental/bidi/io.md - - Models: api-reference/experimental/bidi/models.md - - Tools: api-reference/experimental/bidi/tools.md - - Types: api-reference/experimental/bidi/types.md + - Python API: [] - TypeScript API: api-reference/typescript/index.html exclude_docs: |