BedrockAgentCoreClient.invoke_agent_runtime_command
rboto-bedrock-agentcore==0.4.0 · Service index · Types
Model summary (excerpt): Executes a command in a runtime session container and streams the output back to the caller. This operation allows you to run shell commands within the agent runtime environment and receive real-time streaming responses including standard output and standard error. To invoke a command, you must specify the agent runtime ARN and a runtime session ID. The command execution supports streaming...
Install and imports
from rboto import BedrockAgentCoreClient
from rboto_bedrock_agentcore.types import (
InvokeAgentRuntimeCommandOutput,
InvokeAgentRuntimeCommandRequestBody,
)
Signature
async def invoke_agent_runtime_command(
*,
agent_runtime_arn: str,
body: InvokeAgentRuntimeCommandRequestBody,
content_type: str | None = None,
accept: str | None = None,
runtime_session_id: str | None = None,
trace_id: str | None = None,
trace_parent: str | None = None,
trace_state: str | None = None,
baggage: str | None = None,
qualifier: str | None = None,
account_id: str | None = None,
) -> InvokeAgentRuntimeCommandOutput: ...
Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.
Arguments
| Argument | Required | Model notes (excerpt) |
|---|---|---|
agent_runtime_arn |
Yes | The Amazon Resource Name (ARN) of the agent runtime on which to execute the command. This identifies the specific agent runtime environment where the command will run. |
body |
Yes | The request body containing the command to execute and optional configuration parameters such as timeout settings. |
content_type |
No | The MIME type of the input data in the request payload. This tells the agent runtime how to interpret the payload data. Common values include application/json for JSON data. |
accept |
No | The desired MIME type for the response from the agent runtime command. This tells the agent runtime what format to use for the response data. Common values include application/json for JSON data. |
runtime_session_id |
No | The unique identifier of the runtime session in which to execute the command. This session ID is used to maintain state and context across multiple command invocations. |
trace_id |
No | The trace identifier for request tracking. |
trace_parent |
No | The parent trace information for distributed tracing. |
trace_state |
No | The trace state information for distributed tracing. |
baggage |
No | Additional context information for distributed tracing. |
qualifier |
No | The qualifier to use for the agent runtime. This is an endpoint name that points to a specific version. If not specified, Amazon Bedrock AgentCore uses the default endpoint of the agent runtime. |
account_id |
No | The identifier of the Amazon Web Services account for the agent runtime resource. This parameter is required when you specify an agent ID instead of the full ARN for agentRuntimeArn . |
Output
InvokeAgentRuntimeCommandOutput.
Typed response mapping, accessed as response["field"].
| Field | Type | Presence | References |
|---|---|---|---|
runtime_session_id |
str | None |
Always present | — |
trace_id |
str | None |
Always present | — |
trace_parent |
str | None |
Always present | — |
trace_state |
str | None |
Always present | — |
baggage |
str | None |
Always present | — |
content_type |
str |
Always present | — |
status_code |
int | None |
Always present | — |
stream |
AsyncIterator[InvokeAgentRuntimeCommandStreamOutput] |
Always present | InvokeAgentRuntimeCommandStreamOutput |
| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.
Related types
InvokeAgentRuntimeCommandOutput, InvokeAgentRuntimeCommandRequestBody
Follow these links for nested inputs and outputs; recursive types link back to the same type page.
Pagination and streaming
No generated paginator for this operation.
Output streams: InvokeAgentRuntimeCommandOutput.
Consume with async for. Do not reuse a consumed stream.
Errors
Import from rboto_bedrock_agentcore.exceptions:
AccessDeniedError, InternalServerError, ResourceNotFoundError, RetryableConflictError, RuntimeClientError, ServiceQuotaExceededError, ThrottlingError, ValidationError.
Stream decoding may also raise the linked modeled event errors.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.