Metadata-Version: 2.4
Name: rboto-lex-runtime-v2
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 Lex Runtime V2, powered by Rust. Alpha preview.
Keywords: rboto,aws,lex-runtime-v2,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-lex-runtime-v2

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 Lex Runtime V2**,
powered by Rust. This package contains `LexRuntimeV2Client` and
**6 operations**.

## Installation

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

```bash
python -m pip install "rboto[lex-runtime-v2]"
```

You can also install `rboto-lex-runtime-v2` 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 LexRuntimeV2Client


async def main() -> None:
    client = LexRuntimeV2Client(region="us-east-1")
    response = await client.recognize_text(
        bot_id="YOUR_BOT_ID",
        bot_alias_id="YOUR_ALIAS_ID",
        locale_id="en_US",
        session_id="example-session",
        text="I need help with my order",
    )
    print(response.messages)


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 LexRuntimeV2Client`.
- 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_lex_runtime_v2.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.

- Catch modeled exceptions from `rboto_lex_runtime_v2.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_lex_runtime_v2.types`;
native response definitions are in the package's `_native.pyi`.

| Method | Required arguments | Return type |
|---|---|---|
| [`delete_session`](#delete_session) | <code>bot_id: str</code>, <code>bot_alias_id: str</code>, <code>locale_id: str</code>, <code>session_id: str</code> | <code>DeleteSessionOutput</code> |
| [`get_session`](#get_session) | <code>bot_id: str</code>, <code>bot_alias_id: str</code>, <code>locale_id: str</code>, <code>session_id: str</code> | <code>GetSessionOutput</code> |
| [`put_session`](#put_session) | <code>bot_id: str</code>, <code>bot_alias_id: str</code>, <code>locale_id: str</code>, <code>session_id: str</code>, <code>session_state: SessionState</code> | <code>PutSessionOutput</code> |
| [`recognize_text`](#recognize_text) | <code>bot_id: str</code>, <code>bot_alias_id: str</code>, <code>locale_id: str</code>, <code>session_id: str</code>, <code>text: str</code> | <code>RecognizeTextOutput</code> |
| [`recognize_utterance`](#recognize_utterance) | <code>bot_id: str</code>, <code>bot_alias_id: str</code>, <code>locale_id: str</code>, <code>session_id: str</code>, <code>request_content_type: str</code> | <code>RecognizeUtteranceOutput</code> |
| [`start_conversation`](#start_conversation) | <code>bot_id: str</code>, <code>bot_alias_id: str</code>, <code>locale_id: str</code>, <code>session_id: str</code>, <code>request_event_stream: AsyncIterator[StartConversationRequestEventStream]</code> | <code>StartConversationOutput</code> |

## Complete signatures

### delete_session

```python
async def delete_session(
    *,
    bot_id: str,
    bot_alias_id: str,
    locale_id: str,
    session_id: str,
) -> DeleteSessionOutput: ...
```


### get_session

```python
async def get_session(
    *,
    bot_id: str,
    bot_alias_id: str,
    locale_id: str,
    session_id: str,
) -> GetSessionOutput: ...
```


### put_session

```python
async def put_session(
    *,
    bot_id: str,
    bot_alias_id: str,
    locale_id: str,
    session_id: str,
    session_state: SessionState,
    messages: Sequence[Message] | None = None,
    request_attributes: dict[str, str] | None = None,
    response_content_type: str | None = None,
) -> PutSessionOutput: ...
```


### recognize_text

```python
async def recognize_text(
    *,
    bot_id: str,
    bot_alias_id: str,
    locale_id: str,
    session_id: str,
    text: str,
    session_state: SessionState | None = None,
    request_attributes: dict[str, str] | None = None,
) -> RecognizeTextOutput: ...
```


### recognize_utterance

```python
async def recognize_utterance(
    *,
    bot_id: str,
    bot_alias_id: str,
    locale_id: str,
    session_id: str,
    request_content_type: str,
    session_state: str | None = None,
    request_attributes: str | None = None,
    response_content_type: str | None = None,
    input_stream: bytes | None = None,
) -> RecognizeUtteranceOutput: ...
```


### start_conversation

```python
async def start_conversation(
    *,
    bot_id: str,
    bot_alias_id: str,
    locale_id: str,
    session_id: str,
    request_event_stream: AsyncIterator[StartConversationRequestEventStream],
    conversation_mode: ConversationMode | None = None,
) -> StartConversationOutput: ...
```


## 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.

