harness-sdk API reference
369 public APIs from harness-sdk (strands-agents/harness-sdk) — 176 classes, 48 functions, 145 methods. Signatures extracted by static analysis of the actual source.
Repository: strands-agents/harness-sdk
| Kind | Count |
|---|---|
| Classes | 176 |
| Functions | 48 |
| Methods | 145 |
API list
class
strands-mcp.src.strands_mcp_server.config.ConfigConfiguration settings for the MCP server.
func
strands-mcp.src.strands_mcp_server.server.main() -> NoneMain entry point for the MCP server.
func
strands-mcp.src.strands_mcp_server.server.search_docs(query:str, k:int=5) -> List[Dict[str, Any]]Search the curated documentation catalog.
func
strands-mcp.src.strands_mcp_server.utils.cache.ensure_page(url:str) -> doc_fetcher.Page | NoneEnsure a page is cached, fetching it if necessary.
func
strands-mcp.src.strands_mcp_server.utils.cache.get_index() -> indexer.IndexSearch | NoneGet the current search index instance.
func
strands-mcp.src.strands_mcp_server.utils.cache.get_url_cache() -> Dict[str, doc_fetcher.Page | None]Get the URL cache dictionary.
func
strands-mcp.src.strands_mcp_server.utils.cache.get_url_titles() -> Dict[str, str]Get the curated URL titles mapping.
class
strands-mcp.src.strands_mcp_server.utils.doc_fetcher.PageRepresents a fetched and cleaned documentation page.
func
strands-mcp.src.strands_mcp_server.utils.doc_fetcher.fetch_and_clean(page_url:str) -> PageFetch a web page and return cleaned content.
func
strands-mcp.src.strands_mcp_server.utils.doc_fetcher.parse_llms_txt(url:str) -> list[tuple[str, str]]Parse an llms.txt file and extract document links.
func
strands-mcp.src.strands_mcp_server.utils.text_processor.extract_preamble(content:str) -> strExtract the preamble text before the first H2 section.
func
strands-mcp.src.strands_mcp_server.utils.text_processor.index_title_variants(display_title:str, url:str) -> strGenerate searchable title variants for indexing.
func
strands-mcp.src.strands_mcp_server.utils.text_processor.make_snippet(page:Page | None, display_title:str, max_chars:int=300) -> strCreate a contextual snippet from page content.
func
strands-mcp.src.strands_mcp_server.utils.text_processor.normalize(s:str) -> strNormalize whitespace in a string.
func
strands-mcp.src.strands_mcp_server.utils.text_processor.normalize_for_comparison(string:str) -> strNormalize string for case-insensitive comparison.
func
strands-mcp.src.strands_mcp_server.utils.text_processor.title_from_url(url:str) -> strGenerate a human-readable title from a URL path.
class
strands-py.src.strands._identifier.IdentifierStrands identifier types.
func
strands-py.src.strands._identifier.new_uuid7() -> strReturn a fresh, monotonic UUID version 7 (RFC 9562).
func
strands-py.src.strands._identifier.validate(id_:str, type_:Identifier) -> strValidate strands id.
class
strands-py.src.strands._middleware.stages.AgentStreamContextContext passed to AgentStreamStage middleware.
method
strands-py.src.strands._middleware.stages.AgentStreamContext.interrupt(name:str, *reason:Any=None, *response:Any=None) -> MiddlewareInterruptResultRequest a human-in-the-loop interrupt.
class
strands-py.src.strands._middleware.stages.ExecuteToolContextContext passed to ExecuteToolStage middleware.
method
strands-py.src.strands._middleware.stages.ExecuteToolContext.interrupt(name:str, *reason:Any=None, *response:Any=None) -> MiddlewareInterruptResultRequest a human-in-the-loop interrupt.
class
strands-py.src.strands._middleware.stages.InvokeModelContextContext passed to InvokeModelStage middleware.
class
strands-py.src.strands.agent.a2a_agent.A2AAgentClient wrapper for remote A2A agents.
method
strands-py.src.strands.agent.a2a_agent.A2AAgent.get_agent_card() -> AgentCardFetch and return the remote agent's card.
method
strands-py.src.strands.agent.a2a_agent.A2AAgent.invoke_async(prompt:AgentInput=None, **kwargs:Any) -> AgentResultAsynchronously invoke the remote A2A agent.
method
strands-py.src.strands.agent.a2a_agent.A2AAgent.stream_async(prompt:AgentInput=None, **kwargs:Any) -> AsyncIterator[Any]Stream remote agent execution asynchronously.
class
strands-py.src.strands.agent.agent.AgentCore Agent implementation.
method
strands-py.src.strands.agent.agent.Agent.cancel() -> NoneCancel the currently running agent invocation.
method
strands-py.src.strands.agent.agent.Agent.cleanup() -> NoneClean up resources used by the agent.
method
strands-py.src.strands.agent.agent.Agent.load_snapshot(snapshot:Snapshot) -> NoneRestore agent state from a previously captured snapshot.
method
strands-py.src.strands.agent.agent.Agent.tool() -> _ToolCallerCall tool as a function.
method
strands-py.src.strands.agent.agent.Agent.tool_names() -> list[str]Get a list of all registered tool names.
method
strands-py.src.strands.agent.base.AgentBase.stream_async(prompt:AgentInput=None, **kwargs:Any) -> AsyncIterator[Any]Stream agent execution asynchronously.
func
strands-py.src.strands.event_loop.streaming.remove_blank_messages_content_text(messages:Messages) -> MessagesRemove or replace blank text in message content.
func
strands-py.src.strands.experimental.bidi._async.stop_all(*funcs:Callable[..., Awaitable[None]]) -> NoneCall all stops in sequence and aggregate errors.
func
strands-py.src.strands.experimental.bidi._telemetry.end_connection_span(tracer:Tracer, span:Span, error:Exception | None=None) -> NoneEnd the model connection span.
func
strands-py.src.strands.experimental.bidi._telemetry.end_response_span(tracer:Tracer, span:Span, stop_reason:str | None=None, time_to_first_audio_ms:int | None=None, error:Exception | None=None) -> NoneEnd a model response span.
func
strands-py.src.strands.experimental.bidi._telemetry.end_restart_span(tracer:Tracer, span:Span, error:Exception | None=None) -> NoneEnd a connection restart span.
func
strands-py.src.strands.experimental.bidi._telemetry.start_response_span(tracer:Tracer, response_id:str, parent_span:Span | None=None) -> SpanStart a span for a model response.
func
strands-py.src.strands.experimental.bidi._telemetry.start_restart_span(tracer:Tracer, parent_span:Span | None=None, error_message:str | None=None) -> SpanStart a span for a connection restart.
method
strands-py.src.strands.experimental.bidi.agent.agent.BidiAgent.tool() -> _ToolCallerCall tool as a function.
method
strands-py.src.strands.experimental.bidi.agent.agent.BidiAgent.tool_names() -> list[str]Get a list of all registered tool names.
class
strands-py.src.strands.experimental.bidi.io.audio.BidiAudioIOSend and receive audio data from devices.
method
strands-py.src.strands.experimental.bidi.io.audio.BidiAudioIO.input() -> _BidiAudioInputReturn audio processing BidiInput.
method
strands-py.src.strands.experimental.bidi.io.audio.BidiAudioIO.output() -> _BidiAudioOutputReturn audio processing BidiOutput.
class
strands-py.src.strands.experimental.bidi.models.model.BidiModelProtocol for bidirectional streaming models.
class
strands-py.src.strands.experimental.bidi.models.model.BidiModelTimeoutErrorModel timeout error.
class
strands-py.src.strands.experimental.bidi.types.events.BidiAudioStreamEventStreaming audio output from the model.
method
strands-py.src.strands.experimental.bidi.types.events.BidiAudioStreamEvent.audio() -> strBase64-encoded audio string.
method
strands-py.src.strands.experimental.bidi.types.events.BidiAudioStreamEvent.format() -> AudioFormatAudio encoding format.
class
strands-py.src.strands.experimental.bidi.types.events.BidiConnectionCloseEventStreaming connection closed.
method
strands-py.src.strands.experimental.bidi.types.events.BidiConnectionCloseEvent.reason() -> strWhy the interruption occurred.
class
strands-py.src.strands.experimental.bidi.types.events.BidiErrorEventError occurred during the session.
method
strands-py.src.strands.experimental.bidi.types.events.BidiErrorEvent.error() -> ExceptionThe original exception that occurred.
class
strands-py.src.strands.experimental.bidi.types.events.BidiInterruptionEventModel generation was interrupted.
method
strands-py.src.strands.experimental.bidi.types.events.BidiInterruptionEvent.reason() -> strWhy the interruption occurred.
class
strands-py.src.strands.experimental.bidi.types.events.BidiResponseCompleteEventModel finished generating response.
method
strands-py.src.strands.experimental.bidi.types.events.BidiResponseCompleteEvent.response_id() -> strUnique identifier for this response.
method
strands-py.src.strands.experimental.bidi.types.events.BidiResponseCompleteEvent.stop_reason() -> StopReasonWhy the response ended.
class
strands-py.src.strands.experimental.bidi.types.events.BidiResponseStartEventModel starts generating a response.
method
strands-py.src.strands.experimental.bidi.types.events.BidiResponseStartEvent.response_id() -> strUnique identifier for this response.
method
strands-py.src.strands.experimental.bidi.types.events.BidiTextInputEvent.role() -> RoleThe role of the message sender.
method
strands-py.src.strands.experimental.bidi.types.events.BidiTextInputEvent.text() -> strThe text content to send to the model.
class
strands-py.src.strands.experimental.bidi.types.events.ModalityUsageToken usage for a specific modality.
class
strands-py.src.strands.experimental.bidi.types.io.BidiInputProtocol for bidirectional input callables.
method
strands-py.src.strands.experimental.bidi.types.io.BidiInput.start(agent:'BidiAgent') -> NoneStart input.
method
strands-py.src.strands.experimental.bidi.types.io.BidiInput.stop() -> NoneStop input.
class
strands-py.src.strands.experimental.bidi.types.io.BidiOutputProtocol for bidirectional output callables.
method
strands-py.src.strands.experimental.bidi.types.io.BidiOutput.start(agent:'BidiAgent') -> NoneStart output.
method
strands-py.src.strands.experimental.bidi.types.io.BidiOutput.stop() -> NoneStop output.
class
strands-py.src.strands.experimental.checkpoint.checkpoint.CheckpointPause-point marker.
method
strands-py.src.strands.experimental.checkpoint.checkpoint.Checkpoint.from_dict(data:dict[str, Any]) -> 'Checkpoint'Reconstruct from a dict produced by to_dict().
method
strands-py.src.strands.experimental.checkpoint.checkpoint.Checkpoint.to_dict() -> dict[str, Any]Serialize for persistence.
class
strands-py.src.strands.experimental.hooks.events.BidiHookEventBase class for BidiAgent hook events.
func
strands-py.src.strands.handlers.callback_handler.null_callback_handler(**_kwargs:Any) -> NoneCallback handler that discards all output.
class
strands-py.src.strands.hooks.events.AfterInvocationEventEvent triggered at the end of an agent request.
class
strands-py.src.strands.hooks.events.AfterToolCallEventEvent triggered after a tool invocation completes.
class
strands-py.src.strands.hooks.events.AfterToolsEventEvent triggered after all tools complete execution.
class
strands-py.src.strands.hooks.events.BeforeModelCallEventEvent triggered before the model is invoked.
class
strands-py.src.strands.hooks.events.BeforeToolCallEventEvent triggered before a tool is invoked.
class
strands-py.src.strands.hooks.events.BeforeToolsEventEvent triggered before executing tools.
class
strands-py.src.strands.hooks.registry.BaseHookEventBase class for all hook events.
class
strands-py.src.strands.hooks.registry.HookEventBase class for single agent hook events.
class
strands-py.src.strands.hooks.registry.HookOrderNamed constants for hook execution priority.
method
strands-py.src.strands.hooks.registry.HookRegistry.add_hook(hook:HookProvider) -> NoneRegister all callbacks from a hook provider.
method
strands-py.src.strands.interrupt.Interrupt.to_dict() -> dict[str, Any]Serialize to dict for session management.
class
strands-py.src.strands.interrupt.InterruptExceptionException raised when human input is required.
class
strands-py.src.strands.interventions.actions.ConfirmRequest human approval before proceeding.
class
strands-py.src.strands.interventions.actions.DenyBlock the operation.
class
strands-py.src.strands.interventions.actions.GuideProvide feedback to steer behavior.
class
strands-py.src.strands.interventions.actions.ProceedAllow the operation to continue unchanged.
class
strands-py.src.strands.interventions.actions.TransformModify event content in-place.
func
strands-py.src.strands.interventions.actions.default_evaluate(response:Any) -> boolDefault evaluate function for the confirm action.
class
strands-py.src.strands.interventions.handler.InterventionHandlerBase class for intervention handlers.
method
strands-py.src.strands.interventions.handler.InterventionHandler.name() -> strUnique name identifying this handler.
method
strands-py.src.strands.interventions.handler.InterventionHandler.on_error() -> OnErrorWhat to do when this handler throws.
class
strands-py.src.strands.memory.extraction.triggers.InvocationTriggerRuns extraction after every agent invocation.
class
strands-py.src.strands.memory.extraction.types.ExtractionConfigPer-store automatic-extraction configuration.
class
strands-py.src.strands.memory.extraction.types.ExtractorContextContext passed to :meth:`Extractor.extract`.
func
strands-py.src.strands.memory.memory_manager.MemoryManager.add_memory(entries:list[str], stores:list[str] | None=None) -> dict[str, int]Add data to long-term memory.
func
strands-py.src.strands.memory.memory_manager.MemoryManager.search_memory(query:str, max_search_results:int | None=None, stores:list[str] | None=None) -> list[dict[str, Any]]Search long-term memory.
class
strands-py.src.strands.memory.types.MemoryAddOptionsOptions for ``MemoryManager.add``.
class
strands-py.src.strands.memory.types.MemoryAddToolConfigConfiguration for the ``add_memory`` tool.
class
strands-py.src.strands.memory.types.MemoryInjectionConfigConfiguration for memory context injection.
class
strands-py.src.strands.memory.types.MemorySearchOptionsOptions for ``MemoryManager.search``.
class
strands-py.src.strands.memory.types.MemoryStoreRuntime contract for a memory store backend.
method
strands-py.src.strands.memory.types.MemoryStore.add(content:str, metadata:Metadata | None=None) -> AnyAdd a single piece of content to the store.
class
strands-py.src.strands.memory.types.SearchOptionsOptions passed to :meth:`MemoryStore.search`.
func
strands-py.src.strands.models._defaults.get_context_window_limit(model_id:str) -> int | NoneLook up the context window limit for a model ID.
func
strands-py.src.strands.models._validation.validate_config_keys(config_dict:Mapping[str, Any], config_class:type) -> NoneValidate that config keys match the TypedDict fields.
class
strands-py.src.strands.models.anthropic.AnthropicModelAnthropic model provider implementation.
class
strands-py.src.strands.models.anthropic.AnthropicModel.AnthropicConfigConfiguration options for Anthropic models.
method
strands-py.src.strands.models.anthropic.AnthropicModel.get_config() -> AnthropicConfigGet the Anthropic model configuration.
class
strands-py.src.strands.models.bedrock.BedrockModelAWS Bedrock model provider implementation.
class
strands-py.src.strands.models.bedrock.BedrockModel.BedrockConfigConfiguration options for Bedrock models.
method
strands-py.src.strands.models.bedrock.BedrockModel.get_config() -> BedrockConfigGet the current Bedrock Model configuration.
class
strands-py.src.strands.models.gemini.GeminiModelGoogle Gemini model provider implementation.
class
strands-py.src.strands.models.gemini.GeminiModel.GeminiConfigConfiguration options for Gemini models.
method
strands-py.src.strands.models.gemini.GeminiModel.get_config() -> GeminiConfigGet the Gemini model configuration.
class
strands-py.src.strands.models.litellm.LiteLLMModelLiteLLM model provider implementation.
class
strands-py.src.strands.models.litellm.LiteLLMModel.LiteLLMConfigConfiguration options for LiteLLM models.
method
strands-py.src.strands.models.litellm.LiteLLMModel.format_request_message_content(content:ContentBlock, **kwargs:Any) -> dict[str, Any]Format a LiteLLM content block.
method
strands-py.src.strands.models.litellm.LiteLLMModel.get_config() -> LiteLLMConfigGet the LiteLLM model configuration.
class
strands-py.src.strands.models.llamaapi.LlamaAPIModelLlama API model provider implementation.
class
strands-py.src.strands.models.llamaapi.LlamaAPIModel.LlamaConfigConfiguration options for Llama API models.
method
strands-py.src.strands.models.llamaapi.LlamaAPIModel.get_config() -> LlamaConfigGet the Llama API model configuration.
class
strands-py.src.strands.models.llamacpp.LlamaCppModelllama.cpp model provider implementation.
class
strands-py.src.strands.models.llamacpp.LlamaCppModel.LlamaCppConfigConfiguration options for llama.cpp models.
method
strands-py.src.strands.models.llamacpp.LlamaCppModel.get_config() -> LlamaCppConfigGet the llama.cpp model configuration.
class
strands-py.src.strands.models.mistral.MistralModelMistral API model provider implementation.
class
strands-py.src.strands.models.mistral.MistralModel.MistralConfigConfiguration parameters for Mistral models.
method
strands-py.src.strands.models.mistral.MistralModel.get_config() -> MistralConfigGet the Mistral model configuration.
class
strands-py.src.strands.models.model.BaseModelConfigBase configuration shared by all model providers.
class
strands-py.src.strands.models.model.CacheConfigConfiguration for prompt caching.
class
strands-py.src.strands.models.model.CacheToolsConfigConfiguration for the toolConfig cache point.
class
strands-py.src.strands.models.model.ModelAbstract base class for Agent model providers.
method
strands-py.src.strands.models.model.Model.get_config() -> AnyReturn the model configuration.
class
strands-py.src.strands.models.ollama.OllamaModelOllama model provider implementation.
class
strands-py.src.strands.models.ollama.OllamaModel.OllamaConfigConfiguration parameters for Ollama models.
method
strands-py.src.strands.models.ollama.OllamaModel.get_config() -> OllamaConfigGet the Ollama model configuration.
method
strands-py.src.strands.models.openai.Client.chat() -> AnyChat completions interface.
class
strands-py.src.strands.models.openai.OpenAIModelOpenAI model provider implementation.
class
strands-py.src.strands.models.openai.OpenAIModel.OpenAIConfigConfiguration options for OpenAI models.
method
strands-py.src.strands.models.openai.OpenAIModel.format_request_message_content(content:ContentBlock, **kwargs:Any) -> dict[str, Any]Format an OpenAI compatible content block.
method
strands-py.src.strands.models.openai.OpenAIModel.format_request_message_tool_call(tool_use:ToolUse, **kwargs:Any) -> dict[str, Any]Format an OpenAI compatible tool call.
method
strands-py.src.strands.models.openai.OpenAIModel.format_request_tool_message(tool_result:ToolResult, **kwargs:Any) -> dict[str, Any]Format an OpenAI compatible tool message.
method
strands-py.src.strands.models.openai.OpenAIModel.get_config() -> OpenAIConfigGet the OpenAI model configuration.
method
strands-py.src.strands.models.openai_responses.Client.responses() -> AnyResponses interface.
class
strands-py.src.strands.models.sagemaker.FunctionCallFunction call for the model.
class
strands-py.src.strands.models.sagemaker.SageMakerAIModelAmazon SageMaker model provider implementation.
method
strands-py.src.strands.models.sagemaker.SageMakerAIModel.format_request_message_content(content:ContentBlock, **kwargs:Any) -> dict[str, Any]Format a content block.
class
strands-py.src.strands.models.sagemaker.ToolCallTool call for the model object.
class
strands-py.src.strands.models.sagemaker.UsageMetadataUsage metadata for the model.
class
strands-py.src.strands.models.writer.WriterModelWriter API model provider implementation.
class
strands-py.src.strands.models.writer.WriterModel.WriterConfigConfiguration options for Writer API.
method
strands-py.src.strands.models.writer.WriterModel.get_config() -> WriterConfigGet the Writer model configuration.
func
strands-py.src.strands.multiagent.a2a._converters.convert_content_blocks_to_parts(content_blocks:list[ContentBlock]) -> list[Part]Convert Strands ContentBlocks to A2A Parts.
func
strands-py.src.strands.multiagent.a2a._converters.convert_input_to_message(prompt:AgentInput) -> A2AMessageConvert AgentInput to A2A Message.
func
strands-py.src.strands.multiagent.a2a._converters.convert_response_to_agent_result(response:A2AResponse) -> AgentResultConvert A2A response to AgentResult.
class
strands-py.src.strands.multiagent.a2a.server.A2AServerA2A-compatible wrapper for Strands Agent.
method
strands-py.src.strands.multiagent.a2a.server.A2AServer.agent_card_url() -> strGet the URL advertised in the AgentCard.
method
strands-py.src.strands.multiagent.a2a.server.A2AServer.public_agent_card() -> AgentCardGet the public AgentCard for this agent.
class
strands-py.src.strands.multiagent.base.MultiAgentBaseBase class for multi-agent helpers.
method
strands-py.src.strands.multiagent.base.MultiAgentBase.deserialize_state(payload:dict[str, Any]) -> NoneRestore orchestrator state from a session dict.
method
strands-py.src.strands.multiagent.base.MultiAgentBase.invoke_async(task:MultiAgentInput, invocation_state:dict[str, Any] | None=None, **kwargs:Any) -> MultiAgentResultInvoke asynchronously.
class
strands-py.src.strands.multiagent.base.StatusExecution status for both graphs and nodes.
method
strands-py.src.strands.multiagent.graph.Graph.add_hook(callback:HookCallback, event_type:type | list[type] | None=None, *order:float=HookOrder.DEFAULT) -> NoneRegister a hook callback with the graph.
method
strands-py.src.strands.multiagent.graph.Graph.invoke_async(task:MultiAgentInput, invocation_state:dict[str, Any] | None=None, **kwargs:Any) -> GraphResultInvoke the graph asynchronously.
method
strands-py.src.strands.multiagent.graph.Graph.stream_async(task:MultiAgentInput, invocation_state:dict[str, Any] | None=None, **kwargs:Any) -> AsyncIterator[dict[str, Any]]Stream events during graph execution.
class
strands-py.src.strands.multiagent.graph.GraphBuilderBuilder pattern for constructing graphs.
method
strands-py.src.strands.multiagent.graph.GraphBuilder.set_entry_point(node_id:str) -> 'GraphBuilder'Set a node as an entry point for graph execution.
method
strands-py.src.strands.multiagent.graph.GraphBuilder.set_execution_timeout(timeout:float) -> 'GraphBuilder'Set total execution timeout.
method
strands-py.src.strands.multiagent.graph.GraphBuilder.set_graph_id(graph_id:str) -> 'GraphBuilder'Set graph id.
method
strands-py.src.strands.multiagent.graph.GraphBuilder.set_hook_providers(hooks:list[HookProvider]) -> 'GraphBuilder'Set hook providers for the graph.
method
strands-py.src.strands.multiagent.graph.GraphBuilder.set_max_node_executions(max_executions:int) -> 'GraphBuilder'Set maximum number of node executions allowed.
method
strands-py.src.strands.multiagent.graph.GraphBuilder.set_node_timeout(timeout:float) -> 'GraphBuilder'Set individual node execution timeout.
method
strands-py.src.strands.multiagent.graph.GraphBuilder.set_plugins(plugins:list[MultiAgentPlugin]) -> 'GraphBuilder'Set plugins for the graph.
method
strands-py.src.strands.multiagent.graph.GraphBuilder.set_session_manager(session_manager:SessionManager) -> 'GraphBuilder'Set session manager for the graph.
class
strands-py.src.strands.multiagent.graph.GraphNodeRepresents a node in the graph.
class
strands-py.src.strands.multiagent.graph.GraphStateGraph execution state.
class
strands-py.src.strands.multiagent.swarm.SharedContextShared context between swarm nodes.
method
strands-py.src.strands.multiagent.swarm.SharedContext.add_context(node:SwarmNode, key:str, value:Any) -> NoneAdd context.
method
strands-py.src.strands.multiagent.swarm.Swarm.add_hook(callback:HookCallback, event_type:type | list[type] | None=None, *order:float=HookOrder.DEFAULT) -> NoneRegister a hook callback with the swarm.
method
strands-py.src.strands.multiagent.swarm.Swarm.invoke_async(task:MultiAgentInput, invocation_state:dict[str, Any] | None=None, **kwargs:Any) -> SwarmResultInvoke the swarm asynchronously.
method
strands-py.src.strands.multiagent.swarm.Swarm.stream_async(task:MultiAgentInput, invocation_state:dict[str, Any] | None=None, **kwargs:Any) -> AsyncIterator[dict[str, Any]]Stream events during swarm execution.
class
strands-py.src.strands.multiagent.swarm.SwarmNodeRepresents a node (e.g.
class
strands-py.src.strands.multiagent.swarm.SwarmStateCurrent state of swarm execution.
method
strands-py.src.strands.plugins.plugin.Plugin.init_agent(agent:'Agent') -> None | Awaitable[None]Initialize the agent instance.
method
strands-py.src.strands.plugins.plugin.Plugin.name() -> strA stable string identifier for the plugin.
class
strands-py.src.strands.sandbox.base.SandboxAbstract execution environment.
method
strands-py.src.strands.sandbox.base.Sandbox.get_tools() -> list[AgentTool]Tools this sandbox vends to an agent.
method
strands-py.src.strands.sandbox.base.Sandbox.list_files(path:str, **kwargs:Any) -> list[FileInfo]List files in a sandbox directory.
method
strands-py.src.strands.sandbox.base.Sandbox.read_file(path:str, **kwargs:Any) -> bytesRead a file from the sandbox filesystem as raw bytes.
method
strands-py.src.strands.sandbox.base.Sandbox.read_text(path:str, encoding:str='utf-8', **kwargs:Any) -> strRead a text file from the sandbox filesystem.
method
strands-py.src.strands.sandbox.base.Sandbox.remove_file(path:str, **kwargs:Any) -> NoneRemove a file from the sandbox filesystem.
method
strands-py.src.strands.sandbox.base.Sandbox.write_file(path:str, content:bytes, **kwargs:Any) -> NoneWrite raw bytes to a file in the sandbox filesystem.
method
strands-py.src.strands.sandbox.base.Sandbox.write_text(path:str, content:str, encoding:str='utf-8', **kwargs:Any) -> NoneWrite a text file to the sandbox filesystem.
class
strands-py.src.strands.sandbox.ssh.SshSandboxExecute commands on a remote host via SSH.
class
strands-py.src.strands.sandbox.types.ExecutionResultResult of command or code execution in a sandbox.
class
strands-py.src.strands.sandbox.types.FileInfoMetadata about a file or directory in a sandbox.
class
strands-py.src.strands.sandbox.types.OutputFileA file produced as output by code execution.
class
strands-py.src.strands.session.s3_session_manager.S3SessionManagerS3-based session manager for cloud storage.
method
strands-py.src.strands.session.s3_session_manager.S3SessionManager.create_agent(session_id:str, session_agent:SessionAgent, **kwargs:Any) -> NoneCreate a new agent in S3.
method
strands-py.src.strands.session.s3_session_manager.S3SessionManager.create_message(session_id:str, agent_id:str, session_message:SessionMessage, **kwargs:Any) -> NoneCreate a new message in S3.
method
strands-py.src.strands.session.s3_session_manager.S3SessionManager.create_multi_agent(session_id:str, multi_agent:'MultiAgentBase', **kwargs:Any) -> NoneCreate a new multiagent state in S3.
method
strands-py.src.strands.session.s3_session_manager.S3SessionManager.create_session(session:Session, **kwargs:Any) -> SessionCreate a new session in S3.
method
strands-py.src.strands.session.s3_session_manager.S3SessionManager.delete_session(session_id:str, **kwargs:Any) -> NoneDelete session and all associated data from S3.
method
strands-py.src.strands.session.s3_session_manager.S3SessionManager.read_agent(session_id:str, agent_id:str, **kwargs:Any) -> SessionAgent | NoneRead agent data from S3.
method
strands-py.src.strands.session.s3_session_manager.S3SessionManager.read_message(session_id:str, agent_id:str, message_id:int, **kwargs:Any) -> SessionMessage | NoneRead message data from S3.
method
strands-py.src.strands.session.s3_session_manager.S3SessionManager.read_multi_agent(session_id:str, multi_agent_id:str, **kwargs:Any) -> dict[str, Any] | NoneRead multi-agent state from S3.
method
strands-py.src.strands.session.s3_session_manager.S3SessionManager.read_session(session_id:str, **kwargs:Any) -> Session | NoneRead session data from S3.
method
strands-py.src.strands.session.s3_session_manager.S3SessionManager.update_agent(session_id:str, session_agent:SessionAgent, **kwargs:Any) -> NoneUpdate agent data in S3.
method
strands-py.src.strands.session.s3_session_manager.S3SessionManager.update_message(session_id:str, agent_id:str, session_message:SessionMessage, **kwargs:Any) -> NoneUpdate message data in S3.
method
strands-py.src.strands.session.s3_session_manager.S3SessionManager.update_multi_agent(session_id:str, multi_agent:'MultiAgentBase', **kwargs:Any) -> NoneUpdate multi-agent state in S3.
class
strands-py.src.strands.session.session_manager.SessionManagerAbstract interface for managing sessions.
method
strands-py.src.strands.session.session_manager.SessionManager.append_message(message:Message, agent:'Agent', **kwargs:Any) -> NoneAppend a message to the agent's session.
method
strands-py.src.strands.session.session_manager.SessionManager.initialize(agent:'Agent', **kwargs:Any) -> NoneInitialize an agent with a session.
method
strands-py.src.strands.storage.in_memory_storage.InMemoryStorage.clear() -> NoneRemove all stored entries.
method
strands-py.src.strands.storage.in_memory_storage.InMemoryStorage.delete(key:str) -> NoneDelete the value stored under key.
method
strands-py.src.strands.storage.in_memory_storage.InMemoryStorage.list(query:str='') -> builtins.list[str]List keys matching the given prefix.
method
strands-py.src.strands.storage.in_memory_storage.InMemoryStorage.read(key:str) -> bytes | NoneRetrieve the bytes previously stored under key.
method
strands-py.src.strands.storage.in_memory_storage.InMemoryStorage.write(key:str, data:bytes) -> NoneStore data under key, overwriting any existing value.
method
strands-py.src.strands.storage.local_file_storage.LocalFileStorage.delete(key:str) -> NoneDelete the file corresponding to key.
method
strands-py.src.strands.storage.local_file_storage.LocalFileStorage.for_sandbox(sandbox:Sandbox) -> LocalFileStorageReturn a copy bound to the given sandbox.
method
strands-py.src.strands.storage.local_file_storage.LocalFileStorage.read(key:str) -> bytes | NoneRead the file corresponding to key.
class
strands-py.src.strands.storage.s3_storage.S3StoragePersists bytes as objects in an Amazon S3 bucket.
method
strands-py.src.strands.storage.s3_storage.S3Storage.delete(key:str) -> NoneDelete an S3 object.
method
strands-py.src.strands.storage.s3_storage.S3Storage.list(query:str='') -> builtins.list[str]List S3 objects matching the given prefix.
method
strands-py.src.strands.storage.s3_storage.S3Storage.namespace(prefix:str) -> _NamespacedStorageReturn a view of this storage with all keys prefixed.
method
strands-py.src.strands.storage.s3_storage.S3Storage.read(key:str) -> bytes | NoneRead an S3 object.
method
strands-py.src.strands.storage.s3_storage.S3Storage.write(key:str, data:bytes) -> NoneStore data as an S3 object.
method
strands-py.src.strands.storage.storage.Storage.delete(key:str) -> NoneDelete the value stored under key.
method
strands-py.src.strands.storage.storage.Storage.list(query:ListQuery) -> builtins.list[str]List keys matching the given prefix query.
method
strands-py.src.strands.storage.storage.Storage.read(key:str) -> bytes | NoneRetrieve the bytes previously stored under key.
method
strands-py.src.strands.storage.storage.Storage.write(key:str, data:bytes) -> NoneStore data under key, overwriting any existing value.
class
strands-py.src.strands.telemetry.metrics.AgentInvocationMetrics for a single agent invocation.
class
strands-py.src.strands.telemetry.metrics.EventLoopCycleMetricAggregated metrics for a single event loop cycle.
class
strands-py.src.strands.telemetry.metrics.EventLoopMetricsAggregated metrics for an event loop's execution.
class
strands-py.src.strands.telemetry.metrics.ToolMetricsMetrics for a specific tool's usage.
method
strands-py.src.strands.telemetry.metrics.Trace.add_child(child:'Trace') -> NoneAdd a child trace to this trace.
method
strands-py.src.strands.telemetry.metrics.Trace.add_message(message:Message) -> NoneAdd a message to the trace.
method
strands-py.src.strands.telemetry.metrics.Trace.duration() -> float | NoneCalculate the duration of this trace.
class
strands-py.src.strands.telemetry.tracer.TracerHandles OpenTelemetry tracing.
method
strands-py.src.strands.telemetry.tracer.Tracer.end_agent_span(span:Span, response:AgentResult | None=None, error:Exception | None=None) -> NoneEnd an agent span with results and metrics.
method
strands-py.src.strands.telemetry.tracer.Tracer.end_memory_add_span(span:Span, store_failure_count:int=0, error:Exception | None=None) -> NoneEnd a memory add span.
method
strands-py.src.strands.telemetry.tracer.Tracer.end_memory_extract_span(span:Span, entry_count:int | None=None, error:Exception | None=None) -> NoneEnd a memory extraction span.
method
strands-py.src.strands.telemetry.tracer.Tracer.end_memory_inject_span(span:Span, injected:bool, entry_count:int=0, format_error:bool=False) -> NoneEnd a memory injection span.
method
strands-py.src.strands.telemetry.tracer.Tracer.end_span_with_error(span:Span, error_message:str, exception:Exception | None=None) -> NoneEnd a span with error status.
method
strands-py.src.strands.telemetry.tracer.Tracer.end_swarm_span(span:Span, result:str | None=None) -> NoneEnd a swarm span with results.
method
strands-py.src.strands.telemetry.tracer.Tracer.end_tool_call_span(span:Span, tool_result:ToolResult | None, error:Exception | None=None) -> NoneEnd a tool call span with results.
func
strands-py.src.strands.telemetry.tracer.get_tracer() -> TracerGet or create the global tracer.
func
strands-py.src.strands.telemetry.tracer.serialize(obj:Any) -> strSerialize an object to JSON with consistent settings.
class
strands-py.src.strands.types._events.CitationStreamEventEvent emitted during citation streaming.
class
strands-py.src.strands.types._events.ModelStopReasonEvent emitted during reasoning signature streaming.
class
strands-py.src.strands.types._events.ModelStreamEventEvent emitted during model response streaming.
class
strands-py.src.strands.types._events.MultiAgentNodeInterruptEventEvent emitted when a node is interrupted.
method
strands-py.src.strands.types._events.MultiAgentNodeInterruptEvent.interrupts() -> list[Interrupt]The interrupt instances.
class
strands-py.src.strands.types._events.MultiAgentNodeStopEventEvent emitted when a node stops execution.
class
strands-py.src.strands.types._events.ReasoningTextStreamEventEvent emitted during reasoning text streaming.
class
strands-py.src.strands.types._events.StartEventEvent emitted at the start of each event loop cycle.
class
strands-py.src.strands.types._events.TextStreamEventEvent emitted during text content streaming.
class
strands-py.src.strands.types._events.ToolInterruptEventEvent emitted when a tool is interrupted.
method
strands-py.src.strands.types._events.ToolInterruptEvent.interrupts() -> list[Interrupt]The interrupt instances.
method
strands-py.src.strands.types._events.ToolInterruptEvent.tool_use_id() -> strThe id of the tool interrupted.
class
strands-py.src.strands.types._events.ToolResultEventEvent emitted when a tool execution completes.
method
strands-py.src.strands.types._events.ToolResultEvent.exception() -> Exception | NoneThe original exception that occurred, if any.
method
strands-py.src.strands.types._events.ToolResultEvent.tool_use_id() -> strThe toolUseId associated with this result.
class
strands-py.src.strands.types._events.ToolUseStreamEventEvent emitted during tool use input streaming.
class
strands-py.src.strands.types._events.TypedEventBase class for all typed events in the agent system.
method
strands-py.src.strands.types._snapshot.Snapshot.from_dict(d:dict[str, Any]) -> SnapshotReconstruct a Snapshot from a dict produced by to_dict().
method
strands-py.src.strands.types._snapshot.Snapshot.to_dict() -> dict[str, Any]Serialize to a plain JSON-compatible dict.
class
strands-py.src.strands.types.agent.ConcurrentInvocationModeMode controlling concurrent invocation behavior.
class
strands-py.src.strands.types.agent.LimitsPer-invocation budget caps for the agent loop.
class
strands-py.src.strands.types.citations.CitationsConfigConfiguration for enabling citations on documents.
class
strands-py.src.strands.types.content.ContentBlockDeltaThe content block delta event.
class
strands-py.src.strands.types.content.ContentBlockStartContent block start information.
class
strands-py.src.strands.types.content.ContentBlockStartToolUseThe start of a tool use block.
class
strands-py.src.strands.types.content.ContentBlockStopA content block stop event.
class
strands-py.src.strands.types.content.DeltaContentA block of content in a streaming response.
class
strands-py.src.strands.types.content.GuardContentContent block to be evaluated by guardrails.
class
strands-py.src.strands.types.content.GuardContentTextText content to be evaluated by guardrails.
class
strands-py.src.strands.types.content.MessageA message in a conversation with the agent.
class
strands-py.src.strands.types.content.MessageMetadataOptional metadata attached to a message.
class
strands-py.src.strands.types.event_loop.MetricsPerformance metrics for model interactions.
class
strands-py.src.strands.types.event_loop.UsageToken usage information for model interactions.
class
strands-py.src.strands.types.exceptions.EventLoopExceptionException raised by the event loop.
class
strands-py.src.strands.types.exceptions.ModelThrottledExceptionException raised when the model is throttled.
class
strands-py.src.strands.types.exceptions.SessionExceptionException raised when session operations fail.
class
strands-py.src.strands.types.exceptions.StorageErrorRaised when a storage operation fails.
class
strands-py.src.strands.types.guardrails.ContentFilterThe content filter for a guardrail.
class
strands-py.src.strands.types.guardrails.ContentPolicyAn assessment of a content policy for a guardrail.
class
strands-py.src.strands.types.guardrails.CustomWordDefinition of a custom word to be filtered.
class
strands-py.src.strands.types.guardrails.GuardrailConfigConfiguration for content filtering guardrails.
class
strands-py.src.strands.types.guardrails.GuardrailTraceTrace information from guardrail processing.
class
strands-py.src.strands.types.guardrails.ManagedWordDefinition of a managed word to be filtered.
class
strands-py.src.strands.types.guardrails.TopicInformation about a topic guardrail.
class
strands-py.src.strands.types.guardrails.TopicPolicyA behavior assessment of a topic policy.
class
strands-py.src.strands.types.guardrails.TraceA Top level guardrail trace object.
class
strands-py.src.strands.types.guardrails.WordPolicyThe word policy assessment.
class
strands-py.src.strands.types.interrupt.InterruptResponseUser response to an interrupt.
class
strands-py.src.strands.types.media.DocumentContentA document to include in a message.
class
strands-py.src.strands.types.media.DocumentSourceContains the content of a document.
class
strands-py.src.strands.types.media.ImageContentAn image to include in a message.
class
strands-py.src.strands.types.media.ImageSourceContains the content of an image.
class
strands-py.src.strands.types.media.LocationA location for a document.
class
strands-py.src.strands.types.media.S3LocationA storage location in an Amazon S3 bucket.
class
strands-py.src.strands.types.media.VideoContentA video to include in a message.
class
strands-py.src.strands.types.media.VideoSourceContains the content of a video.
class
strands-py.src.strands.types.session.SessionSession data model.
class
strands-py.src.strands.types.session.SessionAgentAgent that belongs to a Session.
method
strands-py.src.strands.types.session.SessionAgent.from_agent(agent:'Agent') -> 'SessionAgent'Convert an Agent to a SessionAgent.
method
strands-py.src.strands.types.session.SessionAgent.from_bidi_agent(agent:'BidiAgent') -> 'SessionAgent'Convert a BidiAgent to a SessionAgent.
method
strands-py.src.strands.types.session.SessionAgent.initialize_bidi_internal_state(agent:'BidiAgent') -> NoneInitialize internal state of BidiAgent.
method
strands-py.src.strands.types.session.SessionAgent.initialize_internal_state(agent:'Agent') -> NoneInitialize internal state of agent.
class
strands-py.src.strands.types.session.SessionMessageMessage within a SessionAgent.
class
strands-py.src.strands.types.session.SessionTypeEnumeration of session types.
func
strands-py.src.strands.types.session.encode_bytes_values(obj:Any) -> AnyRecursively encode any bytes values in an object to base64.
class
strands-py.src.strands.types.streaming.ContentBlockDeltaA block of content in a streaming response.
class
strands-py.src.strands.types.streaming.ContentBlockDeltaTextText content delta in a streaming response.
class
strands-py.src.strands.types.streaming.ContentBlockDeltaToolUseTool use input delta in a streaming response.
class
strands-py.src.strands.types.streaming.ExceptionEventBase event for exceptions in a streaming response.
class
strands-py.src.strands.types.streaming.ModelStreamErrorEventEvent for model streaming errors.
class
strands-py.src.strands.types.streaming.RedactContentEventEvent for redacting content.
class
strands-py.src.strands.types.streaming.StreamEventThe messages output stream.
class
strands-py.src.strands.types.tools.AgentToolAbstract base class for all SDK tools.
method
strands-py.src.strands.types.tools.AgentTool.mark_dynamic() -> NoneMark this tool as dynamically loaded.
class
strands-py.src.strands.types.tools.ToolA tool that can be provided to a model.
class
strands-py.src.strands.types.tools.ToolChoiceAutoConfiguration for automatic tool selection.
class
strands-py.src.strands.types.tools.ToolConfigConfiguration for tools in a model request.
class
strands-py.src.strands.types.tools.ToolResultResult of a tool execution.
class
strands-py.src.strands.types.tools.ToolResultContentContent returned by a tool execution.
class
strands-py.src.strands.types.tools.ToolSpecSpecification for a tool that can be used by an agent.
method
strands-py.src.strands.vended_interventions.cedar.cedar_authorization.CedarAuthorization.reset_call_counts(agent:Agent | None=None) -> NoneClear all rate-limit call counters.
class
strands-py.src.strands.vended_interventions.hitl.classifier.ClassifierResultResult from a classifier evaluation.
method
strands-py.src.strands.vended_plugins.context_offloader.storage.FileStorage.retrieve(reference:str) -> tuple[bytes, str]Retrieve content from a stored file.
class
strands-py.src.strands.vended_plugins.context_offloader.storage.InMemoryStorageStore offloaded content in memory.
method
strands-py.src.strands.vended_plugins.context_offloader.storage.InMemoryStorage.clear() -> NoneRemove all stored content.
method
strands-py.src.strands.vended_plugins.context_offloader.storage.InMemoryStorage.retrieve(reference:str) -> tuple[bytes, str]Retrieve content from memory.
class
strands-py.src.strands.vended_plugins.context_offloader.storage.S3StorageStore offloaded content in Amazon S3.
method
strands-py.src.strands.vended_plugins.context_offloader.storage.S3Storage.retrieve(reference:str) -> tuple[bytes, str]Retrieve content from an S3 object.
method
strands-py.src.strands.vended_plugins.context_offloader.storage.Storage.retrieve(reference:str) -> tuple[bytes, str]Retrieve stored content by reference.
func
strands-py.src.strands.vended_plugins.goal.judge.build_judge_prompt(description:str, transcript:Messages) -> strBuild the judge's input prompt.
class
strands-py.src.strands.vended_plugins.goal.plugin.GoalAttemptSingle attempt summary preserved on GoalResult.
class
strands-py.src.strands.vended_plugins.goal.plugin.GoalLoopIterative-refinement plugin.
method
strands-py.src.strands.vended_plugins.goal.plugin.GoalLoop.init_agent(agent:Agent) -> NoneRegister hooks on the agent.
method
strands-py.src.strands.vended_plugins.goal.plugin.GoalLoop.name() -> strPlugin name.
class
strands-py.src.strands.vended_plugins.goal.plugin.ValidationOutcomeOutcome a validator returns.
class
strands-py.src.strands.vended_plugins.goal.plugin.ValidatorProgrammatic validator callable.
method
strands-py.src.strands.vended_plugins.skills.skill.Skill.from_content(content:str, *strict:bool=False) -> SkillParse SKILL.md content into a Skill instance.
class
strands-py.src.strands.vended_plugins.steering.core.context.SteeringContextContainer for steering context data.
class
strands-py.src.strands.vended_tools.http_request.http_request.HttpRequestErrorRaised when a request fails.
class
strands-py.src.strands.vended_tools.http_request.types.HttpRequestOutputOutput of an HTTP request.
func
strands-py.src.strands.vended_tools.make_bash(**kwargs:Any) -> 'DecoratedFunctionTool'Deprecated alias for :func:`make_shell`.
class
strands-py.src.strands.vended_tools.shell.types.ShellOutputOutput of a shell command execution.
func
strands-py.src.strands.vended_tools.sleep.sleep.sleep_tool(duration:float) -> strPauses execution for the given number of seconds.
func
strands-py.tests_integ._aws.resolve_region(region:str | None=None) -> strResolve the AWS region to use for test infrastructure.
func
strands-py.tests_integ._ssm.read_ssm_parameter(name:str, *with_decryption:bool=False, *region:str | None=None) -> str | NoneRead a single SSM parameter by name.
method
strands-py.tests_integ.bidi.generators.audio.AudioGenerator.clear_cache() -> NoneClear all cached audio files.
func
strands-py.tests_integ.bidi.generators.audio.generate_test_audio(text:str, use_cache:bool=True) -> dictGenerate test audio input event from text.
class
strands-py.tests_integ.mcp.echo_server.EchoResponseResponse model for echo with structured content.
func
strands-py.tests_integ.mcp.echo_server.static_binary_resource() -> bytesA static binary resource (image) for testing
func
strands-py.tests_integ.mcp.echo_server.static_text_resource() -> strA static text resource for testing
func
strands-py.tests_integ.mcp.echo_server.template_resource(id:str) -> strA resource template with parameter substitution
func
strands-py.tests_integ.mcp.elicitation_server.approval_tool() -> strSimulated approval tool.
func
strands-py.tests_integ.mcp.elicitation_server.server() -> NoneSimulate approval through MCP elicitation.
func
strands-py.tests_integ.mcp.task_echo_server.main(port:int) -> intStart the task echo server.
func
strands-py.tests_integ.memory._bedrock_kb_test_helpers.key_from_uri(uri:str) -> strExtract the S3 object key from an ``s3://`` URI.
About this data
These signatures were extracted from the public source of strands-agents/harness-sdk
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.