Metadata-Version: 2.4
Name: rboto-bedrock-agent-runtime
Version: 0.1.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Framework :: AsyncIO
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Rust
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Dist: rboto==0.1.0
License-File: LICENSE
Summary: rboto: async-only, typed Python client for Amazon Bedrock Agent Runtime, powered by Rust. Alpha preview.
Keywords: rboto,aws,bedrock-agent-runtime,asyncio,typing,rust
Home-Page: https://github.com/ferrumio/rboto
Author-email: Leandro Cavalcante Damascena <leandro.damascena@gmail.com>
License-Expression: Apache-2.0
Requires-Python: >=3.12
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://github.com/ferrumio/rboto/releases
Project-URL: Documentation, https://ferrumio.github.io/rboto/clients/
Project-URL: Homepage, https://ferrumio.github.io/rboto/
Project-URL: Issues, https://github.com/ferrumio/rboto/issues
Project-URL: Repository, https://github.com/ferrumio/rboto

<!-- Generated by rboto-codegen. Edit the descriptor, template, or example source. -->
# rboto-bedrock-agent-runtime

rboto is an independent project maintained by [Ferrumio](https://github.com/ferrumio).
It is not affiliated with, sponsored by, or endorsed by Amazon Web Services (AWS).

**Preview (Alpha).** rboto is under active development. APIs may change between releases.

rboto provides an **async-only, typed Python client for Amazon Bedrock Agent Runtime**,
powered by Rust. This package contains `BedrockAgentRuntimeClient` and
**35 operations**.

## Installation

Requires Python 3.12 or newer and a native wheel for your Python version and platform.

```bash
python -m pip install "rboto[bedrock-agent-runtime]"
```

You can also install `rboto-bedrock-agent-runtime` directly; it installs the matching
`rboto` package. Only the selected service is installed.

These are the package names to use when a release is available on your package index.
If your index has no release yet, follow the
[source installation instructions](https://ferrumio.github.io/rboto/getting-started/).

## Usage

Configure credentials through your environment, shared profile, or workload role.
The example uses `us-east-1`; select a region where your service and resources are available.
Resource names, identifiers, input files, and model IDs in the example are placeholders
to replace with your own.

```python
import asyncio

from rboto import BedrockAgentRuntimeClient
from rboto_bedrock_agent_runtime.types import KnowledgeBaseQuery


async def main() -> None:
    client = BedrockAgentRuntimeClient(region="us-east-1")
    query: KnowledgeBaseQuery = {"text": "How do I reset my password?"}
    response = await client.retrieve(knowledge_base_id="KB12345678", retrieval_query=query)
    for result in response.retrieval_results:
        print(result.content, result.score)


if __name__ == "__main__":
    asyncio.run(main())
```

In an application with an event loop, call `await main()` instead of `asyncio.run(main())`.
Reuse the client across calls. Constructing a client does not send a request.

## API conventions

- Import the client with `from rboto import BedrockAgentRuntimeClient`.
- Every operation is asynchronous: use `await client.method(...)`.
- Operation arguments are keyword-only and use the Python names listed below.
- Structured inputs use typed dictionaries and tagged unions from `rboto_bedrock_agent_runtime.types`.
- Regular responses expose typed attributes; `response.to_dict()` converts them to a dictionary.
- Event-stream responses may be typed dictionaries containing async iterators. Follow the
  declared return type; consume event streams with `async for`.
- Byte streams are consumed asynchronously. `await stream.read()` buffers the complete body;
  iterate the stream when processing a large response.
- Direct operation calls return one page.
- Use `async for page in client.paginators.method(...)` for supported paginated operations.
  Paginators accept the same typed arguments as the corresponding client method.

- Catch modeled exceptions from `rboto_bedrock_agent_runtime.exceptions`. Their `error_code`,
  `message`, and `operation_name` identify service failures.

Clients also accept `profile`, `endpoint_url`, or shared `Session` settings.
See [configuration](https://ferrumio.github.io/rboto/guides/configuration/),
[errors](https://ferrumio.github.io/rboto/guides/errors/), and
[streaming](https://ferrumio.github.io/rboto/guides/streaming/).

## Operations

This is the complete operation catalog for this generated package. “Required arguments”
lists arguments without defaults in the Python signature. Service-side conditions may
require additional arguments. Each method links to its complete signature, including
optional arguments. Nested input definitions are in `rboto_bedrock_agent_runtime.types`;
native response definitions are in the package's `_native.pyi`.

| Method | Required arguments | Return type |
|---|---|---|
| [`agentic_retrieve_stream`](#agentic_retrieve_stream) | <code>messages: Sequence[AgenticRetrieveMessage]</code>, <code>retrievers: Sequence[AgenticRetriever]</code>, <code>agentic_retrieve_configuration: AgenticRetrieveConfiguration</code> | <code>AgenticRetrieveStreamOutput</code> |
| [`check_ingested_document_acl`](#check_ingested_document_acl) | <code>knowledge_base_id: str</code>, <code>data_source_id: str</code>, <code>document_id: str</code>, <code>user_context: UserContext</code> | <code>CheckIngestedDocumentAclOutput</code> |
| [`create_invocation`](#create_invocation) | <code>session_identifier: str</code> | <code>CreateInvocationOutput</code> |
| [`create_session`](#create_session) | None | <code>CreateSessionOutput</code> |
| [`delete_agent_memory`](#delete_agent_memory) | <code>agent_id: str</code>, <code>agent_alias_id: str</code> | <code>DeleteAgentMemoryOutput</code> |
| [`delete_session`](#delete_session) | <code>session_identifier: str</code> | <code>DeleteSessionOutput</code> |
| [`end_session`](#end_session) | <code>session_identifier: str</code> | <code>EndSessionOutput</code> |
| [`generate_query`](#generate_query) | <code>query_generation_input: QueryGenerationInput</code>, <code>transformation_configuration: TransformationConfiguration</code> | <code>GenerateQueryOutput</code> |
| [`get_agent_memory`](#get_agent_memory) | <code>agent_id: str</code>, <code>agent_alias_id: str</code>, <code>memory_type: MemoryType</code>, <code>memory_id: str</code> | <code>GetAgentMemoryOutput</code> |
| [`get_document_content`](#get_document_content) | <code>knowledge_base_id: str</code>, <code>data_source_id: str</code>, <code>document_id: str</code> | <code>GetDocumentContentOutput</code> |
| [`get_execution_flow_snapshot`](#get_execution_flow_snapshot) | <code>flow_identifier: str</code>, <code>flow_alias_identifier: str</code>, <code>execution_identifier: str</code> | <code>GetExecutionFlowSnapshotOutput</code> |
| [`get_flow_execution`](#get_flow_execution) | <code>flow_identifier: str</code>, <code>flow_alias_identifier: str</code>, <code>execution_identifier: str</code> | <code>GetFlowExecutionOutput</code> |
| [`get_ingested_document_acl`](#get_ingested_document_acl) | <code>knowledge_base_id: str</code>, <code>data_source_id: str</code>, <code>document_id: str</code> | <code>GetIngestedDocumentAclOutput</code> |
| [`get_invocation_step`](#get_invocation_step) | <code>invocation_identifier: str</code>, <code>invocation_step_id: str</code>, <code>session_identifier: str</code> | <code>GetInvocationStepOutput</code> |
| [`get_session`](#get_session) | <code>session_identifier: str</code> | <code>GetSessionOutput</code> |
| [`invoke_agent`](#invoke_agent) | <code>agent_id: str</code>, <code>agent_alias_id: str</code>, <code>session_id: str</code> | <code>InvokeAgentOutput</code> |
| [`invoke_flow`](#invoke_flow) | <code>flow_identifier: str</code>, <code>flow_alias_identifier: str</code>, <code>inputs: Sequence[FlowInput]</code> | <code>InvokeFlowOutput</code> |
| [`invoke_inline_agent`](#invoke_inline_agent) | <code>foundation_model: str</code>, <code>instruction: str</code>, <code>session_id: str</code> | <code>InvokeInlineAgentOutput</code> |
| [`list_flow_execution_events`](#list_flow_execution_events) | <code>flow_identifier: str</code>, <code>flow_alias_identifier: str</code>, <code>execution_identifier: str</code>, <code>event_type: FlowExecutionEventType</code> | <code>ListFlowExecutionEventsOutput</code> |
| [`list_flow_executions`](#list_flow_executions) | <code>flow_identifier: str</code> | <code>ListFlowExecutionsOutput</code> |
| [`list_invocation_steps`](#list_invocation_steps) | <code>session_identifier: str</code> | <code>ListInvocationStepsOutput</code> |
| [`list_invocations`](#list_invocations) | <code>session_identifier: str</code> | <code>ListInvocationsOutput</code> |
| [`list_sessions`](#list_sessions) | None | <code>ListSessionsOutput</code> |
| [`list_tags_for_resource`](#list_tags_for_resource) | <code>resource_arn: str</code> | <code>ListTagsForResourceOutput</code> |
| [`optimize_prompt`](#optimize_prompt) | <code>input: InputPrompt</code>, <code>target_model_id: str</code> | <code>OptimizePromptOutput</code> |
| [`put_invocation_step`](#put_invocation_step) | <code>session_identifier: str</code>, <code>invocation_identifier: str</code>, <code>invocation_step_time: str</code>, <code>payload: InvocationStepPayload</code> | <code>PutInvocationStepOutput</code> |
| [`rerank`](#rerank) | <code>queries: Sequence[RerankQuery]</code>, <code>sources: Sequence[RerankSource]</code>, <code>reranking_configuration: RerankingConfiguration</code> | <code>RerankOutput</code> |
| [`retrieve`](#retrieve) | <code>knowledge_base_id: str</code>, <code>retrieval_query: KnowledgeBaseQuery</code> | <code>RetrieveOutput</code> |
| [`retrieve_and_generate`](#retrieve_and_generate) | <code>input: RetrieveAndGenerateInput</code> | <code>RetrieveAndGenerateOutput</code> |
| [`retrieve_and_generate_stream`](#retrieve_and_generate_stream) | <code>input: RetrieveAndGenerateInput</code> | <code>RetrieveAndGenerateStreamOutput</code> |
| [`start_flow_execution`](#start_flow_execution) | <code>flow_identifier: str</code>, <code>flow_alias_identifier: str</code>, <code>inputs: Sequence[FlowInput]</code> | <code>StartFlowExecutionOutput</code> |
| [`stop_flow_execution`](#stop_flow_execution) | <code>flow_identifier: str</code>, <code>flow_alias_identifier: str</code>, <code>execution_identifier: str</code> | <code>StopFlowExecutionOutput</code> |
| [`tag_resource`](#tag_resource) | <code>resource_arn: str</code>, <code>tags: dict[str, str]</code> | <code>TagResourceOutput</code> |
| [`untag_resource`](#untag_resource) | <code>resource_arn: str</code>, <code>tag_keys: Sequence[str]</code> | <code>UntagResourceOutput</code> |
| [`update_session`](#update_session) | <code>session_identifier: str</code> | <code>UpdateSessionOutput</code> |

## Complete signatures

### agentic_retrieve_stream

```python
async def agentic_retrieve_stream(
    *,
    messages: Sequence[AgenticRetrieveMessage],
    retrievers: Sequence[AgenticRetriever],
    agentic_retrieve_configuration: AgenticRetrieveConfiguration,
    policy_configuration: AgenticRetrievePolicyConfiguration | None = None,
    next_token: str | None = None,
    user_context: UserContext | None = None,
    memory_configuration: AgenticRetrieveMemoryConfiguration | None = None,
    retrieval_instruction_configuration: AgenticRetrieveInstructionConfiguration | None = None,
    generate_response: bool | None = None,
) -> AgenticRetrieveStreamOutput: ...
```


### check_ingested_document_acl

```python
async def check_ingested_document_acl(
    *,
    knowledge_base_id: str,
    data_source_id: str,
    document_id: str,
    user_context: UserContext,
) -> CheckIngestedDocumentAclOutput: ...
```


### create_invocation

```python
async def create_invocation(
    *,
    session_identifier: str,
    invocation_id: str | None = None,
    description: str | None = None,
) -> CreateInvocationOutput: ...
```


### create_session

```python
async def create_session(
    *,
    session_metadata: dict[str, str] | None = None,
    encryption_key_arn: str | None = None,
    tags: dict[str, str] | None = None,
) -> CreateSessionOutput: ...
```


### delete_agent_memory

```python
async def delete_agent_memory(
    *,
    agent_id: str,
    agent_alias_id: str,
    memory_id: str | None = None,
    session_id: str | None = None,
) -> DeleteAgentMemoryOutput: ...
```


### delete_session

```python
async def delete_session(
    *,
    session_identifier: str,
) -> DeleteSessionOutput: ...
```


### end_session

```python
async def end_session(
    *,
    session_identifier: str,
) -> EndSessionOutput: ...
```


### generate_query

```python
async def generate_query(
    *,
    query_generation_input: QueryGenerationInput,
    transformation_configuration: TransformationConfiguration,
) -> GenerateQueryOutput: ...
```


### get_agent_memory

```python
async def get_agent_memory(
    *,
    agent_id: str,
    agent_alias_id: str,
    memory_type: MemoryType,
    memory_id: str,
    next_token: str | None = None,
    max_items: int | None = None,
) -> GetAgentMemoryOutput: ...
```

Also available as `client.paginators.get_agent_memory(...)`, returning an
async iterator of the response type above.


### get_document_content

```python
async def get_document_content(
    *,
    knowledge_base_id: str,
    data_source_id: str,
    document_id: str,
    output_format: DocumentOutputFormat | None = None,
    user_context: UserContext | None = None,
) -> GetDocumentContentOutput: ...
```


### get_execution_flow_snapshot

```python
async def get_execution_flow_snapshot(
    *,
    flow_identifier: str,
    flow_alias_identifier: str,
    execution_identifier: str,
) -> GetExecutionFlowSnapshotOutput: ...
```


### get_flow_execution

```python
async def get_flow_execution(
    *,
    flow_identifier: str,
    flow_alias_identifier: str,
    execution_identifier: str,
) -> GetFlowExecutionOutput: ...
```


### get_ingested_document_acl

```python
async def get_ingested_document_acl(
    *,
    knowledge_base_id: str,
    data_source_id: str,
    document_id: str,
) -> GetIngestedDocumentAclOutput: ...
```


### get_invocation_step

```python
async def get_invocation_step(
    *,
    invocation_identifier: str,
    invocation_step_id: str,
    session_identifier: str,
) -> GetInvocationStepOutput: ...
```


### get_session

```python
async def get_session(
    *,
    session_identifier: str,
) -> GetSessionOutput: ...
```


### invoke_agent

```python
async def invoke_agent(
    *,
    agent_id: str,
    agent_alias_id: str,
    session_id: str,
    session_state: SessionState | None = None,
    end_session: bool | None = None,
    enable_trace: bool | None = None,
    input_text: str | None = None,
    memory_id: str | None = None,
    bedrock_model_configurations: BedrockModelConfigurations | None = None,
    streaming_configurations: StreamingConfigurations | None = None,
    prompt_creation_configurations: PromptCreationConfigurations | None = None,
    source_arn: str | None = None,
) -> InvokeAgentOutput: ...
```


### invoke_flow

```python
async def invoke_flow(
    *,
    flow_identifier: str,
    flow_alias_identifier: str,
    inputs: Sequence[FlowInput],
    enable_trace: bool | None = None,
    model_performance_configuration: ModelPerformanceConfiguration | None = None,
    execution_id: str | None = None,
) -> InvokeFlowOutput: ...
```


### invoke_inline_agent

```python
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: ...
```


### list_flow_execution_events

```python
async def list_flow_execution_events(
    *,
    flow_identifier: str,
    flow_alias_identifier: str,
    execution_identifier: str,
    event_type: FlowExecutionEventType,
    max_results: int | None = None,
    next_token: str | None = None,
) -> ListFlowExecutionEventsOutput: ...
```

Also available as `client.paginators.list_flow_execution_events(...)`, returning an
async iterator of the response type above.


### list_flow_executions

```python
async def list_flow_executions(
    *,
    flow_identifier: str,
    flow_alias_identifier: str | None = None,
    max_results: int | None = None,
    next_token: str | None = None,
) -> ListFlowExecutionsOutput: ...
```

Also available as `client.paginators.list_flow_executions(...)`, returning an
async iterator of the response type above.


### list_invocation_steps

```python
async def list_invocation_steps(
    *,
    session_identifier: str,
    invocation_identifier: str | None = None,
    next_token: str | None = None,
    max_results: int | None = None,
) -> ListInvocationStepsOutput: ...
```

Also available as `client.paginators.list_invocation_steps(...)`, returning an
async iterator of the response type above.


### list_invocations

```python
async def list_invocations(
    *,
    session_identifier: str,
    next_token: str | None = None,
    max_results: int | None = None,
) -> ListInvocationsOutput: ...
```

Also available as `client.paginators.list_invocations(...)`, returning an
async iterator of the response type above.


### list_sessions

```python
async def list_sessions(
    *,
    max_results: int | None = None,
    next_token: str | None = None,
) -> ListSessionsOutput: ...
```

Also available as `client.paginators.list_sessions(...)`, returning an
async iterator of the response type above.


### list_tags_for_resource

```python
async def list_tags_for_resource(
    *,
    resource_arn: str,
) -> ListTagsForResourceOutput: ...
```


### optimize_prompt

```python
async def optimize_prompt(
    *,
    input: InputPrompt,
    target_model_id: str,
) -> OptimizePromptOutput: ...
```


### put_invocation_step

```python
async def put_invocation_step(
    *,
    session_identifier: str,
    invocation_identifier: str,
    invocation_step_time: str,
    payload: InvocationStepPayload,
    invocation_step_id: str | None = None,
) -> PutInvocationStepOutput: ...
```


### rerank

```python
async def rerank(
    *,
    queries: Sequence[RerankQuery],
    sources: Sequence[RerankSource],
    reranking_configuration: RerankingConfiguration,
    next_token: str | None = None,
) -> RerankOutput: ...
```

Also available as `client.paginators.rerank(...)`, returning an
async iterator of the response type above.


### retrieve

```python
async def retrieve(
    *,
    knowledge_base_id: str,
    retrieval_query: KnowledgeBaseQuery,
    retrieval_configuration: KnowledgeBaseRetrievalConfiguration | None = None,
    guardrail_configuration: GuardrailConfiguration | None = None,
    next_token: str | None = None,
    user_context: UserContext | None = None,
) -> RetrieveOutput: ...
```

Also available as `client.paginators.retrieve(...)`, returning an
async iterator of the response type above.


### retrieve_and_generate

```python
async def retrieve_and_generate(
    *,
    input: RetrieveAndGenerateInput,
    session_id: str | None = None,
    retrieve_and_generate_configuration: RetrieveAndGenerateConfiguration | None = None,
    session_configuration: RetrieveAndGenerateSessionConfiguration | None = None,
    user_context: UserContext | None = None,
) -> RetrieveAndGenerateOutput: ...
```


### retrieve_and_generate_stream

```python
async def retrieve_and_generate_stream(
    *,
    input: RetrieveAndGenerateInput,
    session_id: str | None = None,
    retrieve_and_generate_configuration: RetrieveAndGenerateConfiguration | None = None,
    session_configuration: RetrieveAndGenerateSessionConfiguration | None = None,
    user_context: UserContext | None = None,
) -> RetrieveAndGenerateStreamOutput: ...
```


### start_flow_execution

```python
async def start_flow_execution(
    *,
    flow_identifier: str,
    flow_alias_identifier: str,
    inputs: Sequence[FlowInput],
    flow_execution_name: str | None = None,
    model_performance_configuration: ModelPerformanceConfiguration | None = None,
) -> StartFlowExecutionOutput: ...
```


### stop_flow_execution

```python
async def stop_flow_execution(
    *,
    flow_identifier: str,
    flow_alias_identifier: str,
    execution_identifier: str,
) -> StopFlowExecutionOutput: ...
```


### tag_resource

```python
async def tag_resource(
    *,
    resource_arn: str,
    tags: dict[str, str],
) -> TagResourceOutput: ...
```


### untag_resource

```python
async def untag_resource(
    *,
    resource_arn: str,
    tag_keys: Sequence[str],
) -> UntagResourceOutput: ...
```


### update_session

```python
async def update_session(
    *,
    session_identifier: str,
    session_metadata: dict[str, str] | None = None,
) -> UpdateSessionOutput: ...
```


## Links

- [Service guide](https://ferrumio.github.io/rboto/clients/)
- [Repository](https://github.com/ferrumio/rboto)
- [Issues](https://github.com/ferrumio/rboto/issues)
- [Releases](https://github.com/ferrumio/rboto/releases)

Licensed under Apache-2.0.

