BedrockAgentRuntimeClient.invoke_inline_agent
rboto-bedrock-agent-runtime==0.4.0 · Service index · Types
Model summary (excerpt): Invokes an inline Amazon Bedrock agent using the configurations you provide with the request. Specify the following fields for security purposes. (Optional) customerEncryptionKeyArn – The Amazon Resource Name (ARN) of a KMS key to encrypt the creation of the agent. (Optional) idleSessionTTLinSeconds – Specify the number of seconds for which the agent should maintain session information. After...
Install and imports
from rboto import BedrockAgentRuntimeClient
from collections.abc import Sequence
from rboto_bedrock_agent_runtime.types import (
AgentActionGroup,
AgentCollaboration,
Collaborator,
CollaboratorConfiguration,
CustomOrchestration,
GuardrailConfigurationWithArn,
InlineBedrockModelConfigurations,
InlineSessionState,
InvokeInlineAgentOutput,
KnowledgeBase,
OrchestrationType,
PromptCreationConfigurations,
PromptOverrideConfiguration,
StreamingConfigurations,
)
Signature
async def invoke_inline_agent(
*,
foundation_model: str,
instruction: str,
session_id: str,
customer_encryption_key_arn: str | None = None,
idle_session_ttl_in_seconds: int | None = None,
action_groups: Sequence[AgentActionGroup] | None = None,
knowledge_bases: Sequence[KnowledgeBase] | None = None,
guardrail_configuration: GuardrailConfigurationWithArn | None = None,
prompt_override_configuration: PromptOverrideConfiguration | None = None,
agent_collaboration: AgentCollaboration | None = None,
collaborator_configurations: Sequence[CollaboratorConfiguration] | None = None,
agent_name: str | None = None,
end_session: bool | None = None,
enable_trace: bool | None = None,
input_text: str | None = None,
streaming_configurations: StreamingConfigurations | None = None,
prompt_creation_configurations: PromptCreationConfigurations | None = None,
inline_session_state: InlineSessionState | None = None,
collaborators: Sequence[Collaborator] | None = None,
bedrock_model_configurations: InlineBedrockModelConfigurations | None = None,
orchestration_type: OrchestrationType | None = None,
custom_orchestration: CustomOrchestration | None = None,
) -> InvokeInlineAgentOutput: ...
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) |
|---|---|---|
foundation_model |
Yes | The model identifier (ID) of the model to use for orchestration by the inline agent. For example, meta.llama3-1-70b-instruct-v1:0 . |
instruction |
Yes | The instructions that tell the inline agent what it should do and how it should interact with users. |
session_id |
Yes | The unique identifier of the session. Use the same value across requests to continue the same conversation. |
customer_encryption_key_arn |
No | The Amazon Resource Name (ARN) of the Amazon Web Services KMS key to use to encrypt your inline agent. |
idle_session_ttl_in_seconds |
No | The number of seconds for which the inline agent should maintain session information. After this time expires, the subsequent InvokeInlineAgent request begins a new session. A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and the data provided before the timeout is deleted. |
action_groups |
No | A list of action groups with each action group defining the action the inline agent needs to carry out. |
knowledge_bases |
No | Contains information of the knowledge bases to associate with. |
guardrail_configuration |
No | The guardrails to assign to the inline agent. |
prompt_override_configuration |
No | Configurations for advanced prompts used to override the default prompts to enhance the accuracy of the inline agent. |
agent_collaboration |
No | Defines how the inline collaborator agent handles information across multiple collaborator agents to coordinate a final response. The inline collaborator agent can also be the supervisor. |
collaborator_configurations |
No | Settings for an inline agent collaborator called with InvokeInlineAgent . |
agent_name |
No | The name for the agent. |
end_session |
No | Specifies whether to end the session with the inline agent or not. |
enable_trace |
No | Specifies whether to turn on the trace or not to track the agent's reasoning process. For more information, see Using trace . |
input_text |
No | The prompt text to send to the agent. If you include returnControlInvocationResults in the sessionState field, the inputText field will be ignored. |
streaming_configurations |
No | Specifies the configurations for streaming. To use agent streaming, you need permissions to perform the bedrock:InvokeModelWithResponseStream action. |
prompt_creation_configurations |
No | Specifies parameters that control how the service populates the agent prompt for an InvokeInlineAgent request. You can control which aspects of previous invocations in the same agent session the service uses to populate the agent prompt. This gives you more granular control over the contextual history that is used to process the current request. |
inline_session_state |
No | Parameters that specify the various attributes of a sessions. You can include attributes for the session or prompt or, if you configured an action group to return control, results from invocation of the action group. For more information, see Control session context . If you include returnControlInvocationResults in the sessionState field, the inputText field will be ignored. |
collaborators |
No | List of collaborator inline agents. |
bedrock_model_configurations |
No | Model settings for the request. |
orchestration_type |
No | Specifies the type of orchestration strategy for the agent. This is set to DEFAULT orchestration type, by default. |
custom_orchestration |
No | Contains details of the custom orchestration configured for the agent. |
Output
InvokeInlineAgentOutput.
Typed response mapping, accessed as response["field"].
| Field | Type | Presence | References |
|---|---|---|---|
completion |
AsyncIterator[InlineAgentResponseStream] |
Always present | InlineAgentResponseStream |
content_type |
str |
Always present | — |
session_id |
str |
Always present | — |
| 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
AgentActionGroup, AgentCollaboration, Collaborator, CollaboratorConfiguration, CustomOrchestration, GuardrailConfigurationWithArn, InlineBedrockModelConfigurations, InlineSessionState, InvokeInlineAgentOutput, KnowledgeBase, OrchestrationType, PromptCreationConfigurations, PromptOverrideConfiguration, StreamingConfigurations
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: InvokeInlineAgentOutput.
Consume with async for. Do not reuse a consumed stream.
Errors
Import from rboto_bedrock_agent_runtime.exceptions:
AccessDeniedError, BadGatewayError, ConflictError, DependencyFailedError, InternalServerError, ResourceNotFoundError, 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.