strands.event_loop.streaming
¶
Utilities for handling streaming responses from language models.
Messages = List[Message]
module-attribute
¶
A list of messages representing a conversation.
StopReason = Literal['content_filtered', 'end_turn', 'guardrail_intervened', 'interrupt', 'max_tokens', 'stop_sequence', 'tool_use']
module-attribute
¶
Reason for the model ending its response generation.
- "content_filtered": Content was filtered due to policy violation
- "end_turn": Normal completion of the response
- "guardrail_intervened": Guardrail system intervened
- "interrupt": Agent was interrupted for human input
- "max_tokens": Maximum token limit reached
- "stop_sequence": Stop sequence encountered
- "tool_use": Model requested to use a tool
logger = logging.getLogger(__name__)
module-attribute
¶
CitationStreamEvent
¶
Bases: ModelStreamEvent
Event emitted during citation streaming.
Source code in strands/types/_events.py
159 160 161 162 163 164 | |
__init__(delta, citation)
¶
Initialize with delta and citation content.
Source code in strands/types/_events.py
162 163 164 | |
CitationsContentBlock
¶
Bases: TypedDict
A content block containing generated text and associated citations.
This block type is returned when document citations are enabled, providing traceability between the generated content and the source documents that informed the response.
Attributes:
| Name | Type | Description |
|---|---|---|
citations |
List[Citation]
|
An array of citations that reference the source documents used to generate the associated content. |
content |
List[CitationGeneratedContent]
|
The generated content that is supported by the associated citations. |
Source code in strands/types/citations.py
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | |
ContentBlock
¶
Bases: TypedDict
A block of content for a message that you pass to, or receive from, a model.
Attributes:
| Name | Type | Description |
|---|---|---|
cachePoint |
CachePoint
|
A cache point configuration to optimize conversation history. |
document |
DocumentContent
|
A document to include in the message. |
guardContent |
GuardContent
|
Contains the content to assess with the guardrail. |
image |
ImageContent
|
Image to include in the message. |
reasoningContent |
ReasoningContentBlock
|
Contains content regarding the reasoning that is carried out by the model. |
text |
str
|
Text to include in the message. |
toolResult |
ToolResult
|
The result for a tool request that a model makes. |
toolUse |
ToolUse
|
Information about a tool use request from a model. |
video |
VideoContent
|
Video to include in the message. |
citationsContent |
CitationsContentBlock
|
Contains the citations for a document. |
Source code in strands/types/content.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
ContentBlockDeltaEvent
¶
Bases: TypedDict
Event containing a delta update for a content block in a streaming response.
Attributes:
| Name | Type | Description |
|---|---|---|
contentBlockIndex |
Optional[int]
|
Index of the content block within the message. This is optional to accommodate different model providers. |
delta |
ContentBlockDelta
|
The incremental content update for the content block. |
Source code in strands/types/streaming.py
125 126 127 128 129 130 131 132 133 134 135 | |
ContentBlockStart
¶
Bases: TypedDict
Content block start information.
Attributes:
| Name | Type | Description |
|---|---|---|
toolUse |
Optional[ContentBlockStartToolUse]
|
Information about a tool that the model is requesting to use. |
Source code in strands/types/content.py
138 139 140 141 142 143 144 145 | |
ContentBlockStartEvent
¶
Bases: TypedDict
Event signaling the start of a content block in a streaming response.
Attributes:
| Name | Type | Description |
|---|---|---|
contentBlockIndex |
Optional[int]
|
Index of the content block within the message. This is optional to accommodate different model providers. |
start |
ContentBlockStart
|
Information about the content block being started. |
Source code in strands/types/streaming.py
28 29 30 31 32 33 34 35 36 37 38 | |
InvalidToolUseNameException
¶
Bases: Exception
Exception raised when a tool use has an invalid name.
Source code in strands/tools/tools.py
27 28 29 30 | |
Message
¶
Bases: TypedDict
A message in a conversation with the agent.
Attributes:
| Name | Type | Description |
|---|---|---|
content |
List[ContentBlock]
|
The message content. |
role |
Role
|
The role of the message sender. |
Source code in strands/types/content.py
178 179 180 181 182 183 184 185 186 187 | |
MessageStartEvent
¶
Bases: TypedDict
Event signaling the start of a message in a streaming response.
Attributes:
| Name | Type | Description |
|---|---|---|
role |
Role
|
The role of the message sender (e.g., "assistant", "user"). |
Source code in strands/types/streaming.py
18 19 20 21 22 23 24 25 | |
MessageStopEvent
¶
Bases: TypedDict
Event signaling the end of a message in a streaming response.
Attributes:
| Name | Type | Description |
|---|---|---|
additionalModelResponseFields |
Optional[Union[dict, list, int, float, str, bool, None]]
|
Additional fields to include in model response. |
stopReason |
StopReason
|
The reason why the model stopped generating content. |
Source code in strands/types/streaming.py
149 150 151 152 153 154 155 156 157 158 | |
MetadataEvent
¶
Bases: TypedDict
Event containing metadata about the streaming response.
Attributes:
| Name | Type | Description |
|---|---|---|
metrics |
Metrics
|
Performance metrics related to the model invocation. |
trace |
Optional[Trace]
|
Trace information for debugging and monitoring. |
usage |
Usage
|
Resource usage information for the model invocation. |
Source code in strands/types/streaming.py
161 162 163 164 165 166 167 168 169 170 171 172 | |
Metrics
¶
Bases: TypedDict
Performance metrics for model interactions.
Attributes:
| Name | Type | Description |
|---|---|---|
latencyMs |
int
|
Latency of the model request in milliseconds. |
timeToFirstByteMs |
int
|
Latency from sending model request to first content chunk (contentBlockDelta or contentBlockStart) from the model in milliseconds. |
Source code in strands/types/event_loop.py
26 27 28 29 30 31 32 33 34 35 36 | |
Model
¶
Bases: ABC
Abstract base class for Agent model providers.
This class defines the interface for all model implementations in the Strands Agents SDK. It provides a standardized way to configure and process requests for different AI model providers.
Source code in strands/models/model.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |
get_config()
abstractmethod
¶
Return the model configuration.
Returns:
| Type | Description |
|---|---|
Any
|
The model's configuration. |
Source code in strands/models/model.py
35 36 37 38 39 40 41 42 43 | |
stream(messages, tool_specs=None, system_prompt=None, *, tool_choice=None, system_prompt_content=None, **kwargs)
abstractmethod
¶
Stream conversation with the model.
This method handles the full lifecycle of conversing with the model:
- Format the messages, tool specs, and configuration into a streaming request
- Send the request to the model
- Yield the formatted message chunks
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
messages
|
Messages
|
List of message objects to be processed by the model. |
required |
tool_specs
|
Optional[list[ToolSpec]]
|
List of tool specifications to make available to the model. |
None
|
system_prompt
|
Optional[str]
|
System prompt to provide context to the model. |
None
|
tool_choice
|
ToolChoice | None
|
Selection strategy for tool invocation. |
None
|
system_prompt_content
|
list[SystemContentBlock] | None
|
System prompt content blocks for advanced features like caching. |
None
|
**kwargs
|
Any
|
Additional keyword arguments for future extensibility. |
{}
|
Yields:
| Type | Description |
|---|---|
AsyncIterable[StreamEvent]
|
Formatted message chunks from the model. |
Raises:
| Type | Description |
|---|---|
ModelThrottledException
|
When the model service is throttling requests from the client. |
Source code in strands/models/model.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |
structured_output(output_model, prompt, system_prompt=None, **kwargs)
abstractmethod
¶
Get structured output from the model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_model
|
Type[T]
|
The output model to use for the agent. |
required |
prompt
|
Messages
|
The prompt messages to use for the agent. |
required |
system_prompt
|
Optional[str]
|
System prompt to provide context to the model. |
None
|
**kwargs
|
Any
|
Additional keyword arguments for future extensibility. |
{}
|
Yields:
| Type | Description |
|---|---|
AsyncGenerator[dict[str, Union[T, Any]], None]
|
Model events with the last being the structured output. |
Raises:
| Type | Description |
|---|---|
ValidationException
|
The response format from the model does not match the output_model |
Source code in strands/models/model.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
update_config(**model_config)
abstractmethod
¶
Update the model configuration with the provided arguments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**model_config
|
Any
|
Configuration overrides. |
{}
|
Source code in strands/models/model.py
25 26 27 28 29 30 31 32 33 | |
ModelStopReason
¶
Bases: TypedEvent
Event emitted during reasoning signature streaming.
Source code in strands/types/_events.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | |
__init__(stop_reason, message, usage, metrics)
¶
Initialize with the final execution results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stop_reason
|
StopReason
|
Why the agent execution stopped |
required |
message
|
Message
|
Final message from the model |
required |
usage
|
Usage
|
Usage information from the model |
required |
metrics
|
Metrics
|
Execution metrics and performance data |
required |
Source code in strands/types/_events.py
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | |
ModelStreamChunkEvent
¶
Bases: TypedEvent
Event emitted during model response streaming for each raw chunk.
Source code in strands/types/_events.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
__init__(chunk)
¶
Initialize with streaming delta data from the model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chunk
|
StreamEvent
|
Incremental streaming data from the model response |
required |
Source code in strands/types/_events.py
104 105 106 107 108 109 110 | |
ModelStreamEvent
¶
Bases: TypedEvent
Event emitted during model response streaming.
This event is fired when the model produces streaming output during response generation.
Source code in strands/types/_events.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
__init__(delta_data)
¶
Initialize with streaming delta data from the model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
delta_data
|
dict[str, Any]
|
Incremental streaming data from the model response |
required |
Source code in strands/types/_events.py
124 125 126 127 128 129 130 | |
ReasoningRedactedContentStreamEvent
¶
Bases: ModelStreamEvent
Event emitted during redacted content streaming.
Source code in strands/types/_events.py
175 176 177 178 179 180 | |
__init__(delta, redacted_content)
¶
Initialize with delta and redacted content.
Source code in strands/types/_events.py
178 179 180 | |
ReasoningSignatureStreamEvent
¶
Bases: ModelStreamEvent
Event emitted during reasoning signature streaming.
Source code in strands/types/_events.py
183 184 185 186 187 188 | |
__init__(delta, reasoning_signature)
¶
Initialize with delta and reasoning signature.
Source code in strands/types/_events.py
186 187 188 | |
ReasoningTextStreamEvent
¶
Bases: ModelStreamEvent
Event emitted during reasoning text streaming.
Source code in strands/types/_events.py
167 168 169 170 171 172 | |
__init__(delta, reasoning_text)
¶
Initialize with delta and reasoning text.
Source code in strands/types/_events.py
170 171 172 | |
RedactContentEvent
¶
Bases: TypedDict
Event for redacting content.
Attributes:
| Name | Type | Description |
|---|---|---|
redactUserContentMessage |
Optional[str]
|
The string to overwrite the users input with. |
redactAssistantContentMessage |
Optional[str]
|
The string to overwrite the assistants output with. |
Source code in strands/types/streaming.py
197 198 199 200 201 202 203 204 205 206 207 | |
StreamEvent
¶
Bases: TypedDict
The messages output stream.
Attributes:
| Name | Type | Description |
|---|---|---|
contentBlockDelta |
ContentBlockDeltaEvent
|
Delta content for a content block. |
contentBlockStart |
ContentBlockStartEvent
|
Start of a content block. |
contentBlockStop |
ContentBlockStopEvent
|
End of a content block. |
internalServerException |
ExceptionEvent
|
Internal server error information. |
messageStart |
MessageStartEvent
|
Start of a message. |
messageStop |
MessageStopEvent
|
End of a message. |
metadata |
MetadataEvent
|
Metadata about the streaming response. |
modelStreamErrorException |
ModelStreamErrorEvent
|
Model streaming error information. |
serviceUnavailableException |
ExceptionEvent
|
Service unavailable error information. |
throttlingException |
ExceptionEvent
|
Throttling error information. |
validationException |
ExceptionEvent
|
Validation error information. |
Source code in strands/types/streaming.py
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | |
SystemContentBlock
¶
Bases: TypedDict
Contains configurations for instructions to provide the model for how to handle input.
Attributes:
| Name | Type | Description |
|---|---|---|
cachePoint |
CachePoint
|
A cache point configuration to optimize conversation history. |
text |
str
|
A system prompt for the model. |
Source code in strands/types/content.py
102 103 104 105 106 107 108 109 110 111 | |
TextStreamEvent
¶
Bases: ModelStreamEvent
Event emitted during text content streaming.
Source code in strands/types/_events.py
151 152 153 154 155 156 | |
__init__(delta, text)
¶
Initialize with delta and text content.
Source code in strands/types/_events.py
154 155 156 | |
ToolSpec
¶
Bases: TypedDict
Specification for a tool that can be used by an agent.
Attributes:
| Name | Type | Description |
|---|---|---|
description |
str
|
A human-readable description of what the tool does. |
inputSchema |
JSONSchema
|
JSON Schema defining the expected input parameters. |
name |
str
|
The unique name of the tool. |
outputSchema |
NotRequired[JSONSchema]
|
Optional JSON Schema defining the expected output format. Note: Not all model providers support this field. Providers that don't support it should filter it out before sending to their API. |
Source code in strands/types/tools.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | |
ToolUse
¶
Bases: TypedDict
A request from the model to use a specific tool with the provided input.
Attributes:
| Name | Type | Description |
|---|---|---|
input |
Any
|
The input parameters for the tool. Can be any JSON-serializable type. |
name |
str
|
The name of the tool to invoke. |
toolUseId |
str
|
A unique identifier for this specific tool use request. |
Source code in strands/types/tools.py
52 53 54 55 56 57 58 59 60 61 62 63 64 | |
ToolUseStreamEvent
¶
Bases: ModelStreamEvent
Event emitted during tool use input streaming.
Source code in strands/types/_events.py
143 144 145 146 147 148 | |
__init__(delta, current_tool_use)
¶
Initialize with delta and current tool use state.
Source code in strands/types/_events.py
146 147 148 | |
TypedEvent
¶
Bases: dict
Base class for all typed events in the agent system.
Source code in strands/types/_events.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
is_callback_event
property
¶
True if this event should trigger the callback_handler to fire.
__init__(data=None)
¶
Initialize the typed event with optional data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict[str, Any] | None
|
Optional dictionary of event data to initialize with |
None
|
Source code in strands/types/_events.py
29 30 31 32 33 34 35 | |
as_dict()
¶
Convert this event to a raw dictionary for emitting purposes.
Source code in strands/types/_events.py
42 43 44 | |
prepare(invocation_state)
¶
Prepare the event for emission by adding invocation state.
This allows a subset of events to merge with the invocation_state without needing to pass around the invocation_state throughout the system.
Source code in strands/types/_events.py
46 47 48 49 50 51 52 | |
Usage
¶
Bases: TypedDict
Token usage information for model interactions.
Attributes:
| Name | Type | Description |
|---|---|---|
inputTokens |
Required[int]
|
Number of tokens sent in the request to the model. |
outputTokens |
Required[int]
|
Number of tokens that the model generated for the request. |
totalTokens |
Required[int]
|
Total number of tokens (input + output). |
cacheReadInputTokens |
int
|
Number of tokens read from cache (optional). |
cacheWriteInputTokens |
int
|
Number of tokens written to cache (optional). |
Source code in strands/types/event_loop.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | |
_normalize_messages(messages)
¶
Remove or replace blank text in message content.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
messages
|
Messages
|
Conversation messages to update. |
required |
Returns:
| Type | Description |
|---|---|
Messages
|
Updated messages. |
Source code in strands/event_loop/streaming.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | |
extract_usage_metrics(event, time_to_first_byte_ms=None)
¶
Extracts usage metrics from the metadata chunk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
MetadataEvent
|
metadata. |
required |
time_to_first_byte_ms
|
int | None
|
time to get the first byte from the model in milliseconds |
None
|
Returns:
| Type | Description |
|---|---|
tuple[Usage, Metrics]
|
The extracted usage metrics and latency. |
Source code in strands/event_loop/streaming.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | |
handle_content_block_delta(event, state)
¶
Handles content block delta updates by appending text, tool input, or reasoning content to the state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
ContentBlockDeltaEvent
|
Delta event. |
required |
state
|
dict[str, Any]
|
The current state of message processing. |
required |
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], ModelStreamEvent]
|
Updated state with appended text or tool input. |
Source code in strands/event_loop/streaming.py
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | |
handle_content_block_start(event)
¶
Handles the start of a content block by extracting tool usage information if any.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
ContentBlockStartEvent
|
Start event. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary with tool use id and name if tool use request, empty dictionary otherwise. |
Source code in strands/event_loop/streaming.py
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | |
handle_content_block_stop(state)
¶
Handles the end of a content block by finalizing tool usage, text content, or reasoning content.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
dict[str, Any]
|
The current state of message processing. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Updated state with finalized content block. |
Source code in strands/event_loop/streaming.py
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 | |
handle_message_start(event, message)
¶
Handles the start of a message by setting the role in the message dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
MessageStartEvent
|
A message start event. |
required |
message
|
Message
|
The message dictionary being constructed. |
required |
Returns:
| Type | Description |
|---|---|
Message
|
Updated message dictionary with the role set. |
Source code in strands/event_loop/streaming.py
157 158 159 160 161 162 163 164 165 166 167 168 | |
handle_message_stop(event)
¶
Handles the end of a message by returning the stop reason.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
MessageStopEvent
|
Stop event. |
required |
Returns:
| Type | Description |
|---|---|
StopReason
|
The reason for stopping the stream. |
Source code in strands/event_loop/streaming.py
321 322 323 324 325 326 327 328 329 330 | |
handle_redact_content(event, state)
¶
Handles redacting content from the input or output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
RedactContentEvent
|
Redact Content Event. |
required |
state
|
dict[str, Any]
|
The current state of message processing. |
required |
Source code in strands/event_loop/streaming.py
333 334 335 336 337 338 339 340 341 | |
process_stream(chunks, start_time=None)
async
¶
Processes the response stream from the API, constructing the final message and extracting usage metrics.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chunks
|
AsyncIterable[StreamEvent]
|
The chunks of the response stream from the model. |
required |
start_time
|
float | None
|
Time when the model request is initiated |
None
|
Yields:
| Type | Description |
|---|---|
AsyncGenerator[TypedEvent, None]
|
The reason for stopping, the constructed message, and the usage metrics. |
Source code in strands/event_loop/streaming.py
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 | |
remove_blank_messages_content_text(messages)
¶
Remove or replace blank text in message content.
!!deprecated!! This function is deprecated and will be removed in a future version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
messages
|
Messages
|
Conversation messages to update. |
required |
Returns:
| Type | Description |
|---|---|
Messages
|
Updated messages. |
Source code in strands/event_loop/streaming.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | |
stream_messages(model, system_prompt, messages, tool_specs, *, tool_choice=None, system_prompt_content=None, **kwargs)
async
¶
Streams messages to the model and processes the response.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
Model
|
Model provider. |
required |
system_prompt
|
Optional[str]
|
The system prompt string, used for backwards compatibility with models that expect it. |
required |
messages
|
Messages
|
List of messages to send. |
required |
tool_specs
|
list[ToolSpec]
|
The list of tool specs. |
required |
tool_choice
|
Optional[Any]
|
Optional tool choice constraint for forcing specific tool usage. |
None
|
system_prompt_content
|
Optional[list[SystemContentBlock]]
|
The authoritative system prompt content blocks that always contains the system prompt data. |
None
|
**kwargs
|
Any
|
Additional keyword arguments for future extensibility. |
{}
|
Yields:
| Type | Description |
|---|---|
AsyncGenerator[TypedEvent, None]
|
The reason for stopping, the final message, and the usage metrics |
Source code in strands/event_loop/streaming.py
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 | |
validate_tool_use_name(tool)
¶
Validate the name of a tool use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tool
|
ToolUse
|
The tool use to validate. |
required |
Raises:
| Type | Description |
|---|---|
InvalidToolUseNameException
|
If the tool name is invalid. |
Source code in strands/tools/tools.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |