swarmauri_live_model_amazon_nova 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- swarmauri_live_model_amazon_nova-0.1.0/LICENSE +13 -0
- swarmauri_live_model_amazon_nova-0.1.0/NOTICE +7 -0
- swarmauri_live_model_amazon_nova-0.1.0/PKG-INFO +325 -0
- swarmauri_live_model_amazon_nova-0.1.0/README.md +301 -0
- swarmauri_live_model_amazon_nova-0.1.0/pyproject.toml +86 -0
- swarmauri_live_model_amazon_nova-0.1.0/swarmauri_live_model_amazon_nova/NovaSonicCodec.py +84 -0
- swarmauri_live_model_amazon_nova-0.1.0/swarmauri_live_model_amazon_nova/NovaSonicConfigMapper.py +38 -0
- swarmauri_live_model_amazon_nova-0.1.0/swarmauri_live_model_amazon_nova/NovaSonicLiveModel.py +49 -0
- swarmauri_live_model_amazon_nova-0.1.0/swarmauri_live_model_amazon_nova/NovaSonicLiveSession.py +53 -0
- swarmauri_live_model_amazon_nova-0.1.0/swarmauri_live_model_amazon_nova/NovaSonicToolAdapter.py +8 -0
- swarmauri_live_model_amazon_nova-0.1.0/swarmauri_live_model_amazon_nova/__init__.py +13 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright 2024 Jacob Stewart
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: swarmauri_live_model_amazon_nova
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Amazon Nova Sonic bidirectional HTTP/2 model adapter for Swarmauri.
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
License-File: NOTICE
|
|
8
|
+
Keywords: swarmauri,amazon nova,nova sonic,audio,http2
|
|
9
|
+
Author: Jacob Stewart
|
|
10
|
+
Author-email: jacob@swarmauri.com
|
|
11
|
+
Requires-Python: >=3.10,<3.15
|
|
12
|
+
Classifier: Development Status :: 1 - Planning
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Requires-Dist: swarmauri_base (>=0.11.0,<0.12)
|
|
19
|
+
Requires-Dist: swarmauri_core (>=0.11.0,<0.12)
|
|
20
|
+
Requires-Dist: swarmauri_provider_amazon_nova (>=0.1.0)
|
|
21
|
+
Requires-Dist: swarmauri_transport_aws_eventstream (>=0.1.0)
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# swarmauri_live_model_amazon_nova
|
|
25
|
+
|
|
26
|
+
<!-- readme-standards:begin branding -->
|
|
27
|
+
<p align="center"><a href="https://github.com/swarmauri/swarmauri-sdk"><img src="https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/swarmauri.brand.theme.svg" alt="Swarmauri SDK" width="300"></a></p>
|
|
28
|
+
<p align="center"><strong>swarmauri_live_model_amazon_nova</strong></p>
|
|
29
|
+
<p align="center">Amazon Nova Sonic bidirectional HTTP/2 model adapter for Swarmauri.</p>
|
|
30
|
+
<p align="center">
|
|
31
|
+
<a href="https://pypi.org/project/swarmauri_live_model_amazon_nova/"><img alt="pypi: swarmauri_live_model_amazon_nova" src="https://img.shields.io/pypi/v/swarmauri_live_model_amazon_nova?labelColor=1E293B&color=1D4ED8"></a>
|
|
32
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/pyproject.toml"><img alt="Source version: 0.1.0" src="https://img.shields.io/static/v1?label=Source%20version&message=0.1.0&labelColor=1E293B&color=4338CA"></a>
|
|
33
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/pyproject.toml"><img alt="Python: >=3.10,<3.15" src="https://img.shields.io/static/v1?label=Python&message=%3E%3D3.10%2C%3C3.15&labelColor=1E293B&color=0F766E"></a>
|
|
34
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/pyproject.toml"><img alt="Layer: community" src="https://img.shields.io/static/v1?label=Layer&message=community&labelColor=1E293B&color=6D28D9"></a>
|
|
35
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/README.md#lifecycle-and-migration"><img alt="Lifecycle: active" src="https://img.shields.io/static/v1?label=Lifecycle&message=active&labelColor=1E293B&color=166534"></a>
|
|
36
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/LICENSE"><img alt="License: Apache-2.0" src="https://img.shields.io/static/v1?label=License&message=Apache-2.0&labelColor=1E293B&color=86198F"></a>
|
|
37
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/NOTICE"><img alt="Notice: attribution" src="https://img.shields.io/static/v1?label=Notice&message=attribution&labelColor=1E293B&color=86198F"></a>
|
|
38
|
+
</p>
|
|
39
|
+
<p align="center">
|
|
40
|
+
<a href="https://pypi.org/project/swarmauri_live_model_amazon_nova/"><img alt="Monthly PyPI downloads: swarmauri_live_model_amazon_nova" src="https://img.shields.io/pypi/dm/swarmauri_live_model_amazon_nova?labelColor=1E293B&color=0E7490"></a>
|
|
41
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/README.md"><img alt="README hits: swarmauri_live_model_amazon_nova" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/pkgs/50-community/swarmauri_live_model_amazon_nova/README.md.svg?label=README%20hits&labelColor=1E293B&color=0E7490"></a>
|
|
42
|
+
</p>
|
|
43
|
+
<p align="center">
|
|
44
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/actions/workflows/readme-standards.yml"><img alt="README standards: CI gate" src="https://img.shields.io/static/v1?label=README%20standards&message=CI%20gate&labelColor=1E293B&color=1D4ED8"></a>
|
|
45
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/tests/unit/test_readme_sources.py"><img alt="Tests: example source" src="https://img.shields.io/static/v1?label=Tests&message=example%20source&labelColor=1E293B&color=0F766E"></a>
|
|
46
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/README.md#certification-status"><img alt="Certification: not certified" src="https://img.shields.io/static/v1?label=Certification&message=not%20certified&labelColor=1E293B&color=92400E"></a>
|
|
47
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/tools/readme/POLICY.md"><img alt="Governance: repository policy" src="https://img.shields.io/static/v1?label=Governance&message=repository%20policy&labelColor=1E293B&color=4338CA"></a>
|
|
48
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/actions/workflows/readme-standards.yml"><img alt="Evidence: source and CI" src="https://img.shields.io/static/v1?label=Evidence&message=source%20and%20CI&labelColor=1E293B&color=6D28D9"></a>
|
|
49
|
+
</p>
|
|
50
|
+
<p align="center"><a href="#overview">Overview</a> · <a href="#installation">Installation</a> · <a href="#quick-start">Quick Start</a> · <a href="#usage">Usage</a> · <a href="#public-api-and-import-surfaces">API</a> · <a href="#contributing">Contributing</a> · <a href="#governance">Governance</a> · <a href="#license">License</a></p>
|
|
51
|
+
<!-- readme-standards:end branding -->
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Overview
|
|
56
|
+
|
|
57
|
+
### Summary
|
|
58
|
+
|
|
59
|
+
[](https://pypi.org/project/swarmauri_live_model_amazon_nova/) [](https://pypi.org/project/swarmauri_live_model_amazon_nova/) [](LICENSE) [](https://pepy.tech/project/swarmauri_live_model_amazon_nova) [](https://hits.sh/github.com/swarmauri/swarmauri-sdk/)
|
|
60
|
+
|
|
61
|
+
### Why This Package
|
|
62
|
+
|
|
63
|
+
`swarmauri_live_model_amazon_nova` isolates this responsibility: Amazon Nova Sonic bidirectional HTTP/2 model adapter for Swarmauri. Its [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/swarmauri_live_model_amazon_nova/__init__.py) exposes `NovaSonicCodec`, `NovaSonicConfigMapper`, `NovaSonicLiveModel`, `NovaSonicLiveSession`, `NovaSonicToolAdapter`, allowing consumers to select this package without treating adjacent packages as part of its public contract.
|
|
64
|
+
|
|
65
|
+
### When to Use
|
|
66
|
+
|
|
67
|
+
Choose `swarmauri_live_model_amazon_nova` when your integration needs amazon Nova Sonic bidirectional HTTP/2 model adapter for Swarmauri. Match the imports below to your application boundary and install its declared dependencies before using the example.
|
|
68
|
+
|
|
69
|
+
### Features
|
|
70
|
+
|
|
71
|
+
- Nova Sonic text/audio sessions over an injected bidirectional HTTP/2 transport.
|
|
72
|
+
- Typed audio, text, tool, usage, completion, and error events.
|
|
73
|
+
|
|
74
|
+
### Non-Goals
|
|
75
|
+
|
|
76
|
+
`swarmauri_live_model_amazon_nova` owns amazon Nova Sonic bidirectional HTTP/2 model adapter for Swarmauri. Its imports do not by themselves configure credentials, deploy a service, or certify the behavior of its consumers. Dependencies and neighboring packages retain their own documented responsibilities.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Getting Started
|
|
81
|
+
|
|
82
|
+
### Prerequisites
|
|
83
|
+
|
|
84
|
+
Python `>=3.10,<3.15` is required. The [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/pyproject.toml) declares runtime dependencies including `swarmauri-core`, `swarmauri-base`, `swarmauri-provider-amazon-nova`, `swarmauri-transport-aws-eventstream`. Read the example’s inputs and service requirements before execution.
|
|
85
|
+
|
|
86
|
+
### Installation
|
|
87
|
+
|
|
88
|
+
`uv add swarmauri_live_model_amazon_nova` or `pip install swarmauri_live_model_amazon_nova`.
|
|
89
|
+
|
|
90
|
+
#### uv
|
|
91
|
+
|
|
92
|
+
<!-- readme-standards:begin installation.uv -->
|
|
93
|
+
```bash
|
|
94
|
+
uv add swarmauri_live_model_amazon_nova
|
|
95
|
+
```
|
|
96
|
+
<!-- readme-standards:end installation.uv -->
|
|
97
|
+
|
|
98
|
+
#### pip
|
|
99
|
+
|
|
100
|
+
<!-- readme-standards:begin installation.pip -->
|
|
101
|
+
```bash
|
|
102
|
+
python -m pip install swarmauri_live_model_amazon_nova
|
|
103
|
+
```
|
|
104
|
+
<!-- readme-standards:end installation.pip -->
|
|
105
|
+
|
|
106
|
+
#### Poetry
|
|
107
|
+
|
|
108
|
+
<!-- readme-standards:begin installation.poetry -->
|
|
109
|
+
```bash
|
|
110
|
+
poetry add swarmauri_live_model_amazon_nova
|
|
111
|
+
```
|
|
112
|
+
<!-- readme-standards:end installation.poetry -->
|
|
113
|
+
|
|
114
|
+
### Quick Start
|
|
115
|
+
|
|
116
|
+
#### Example
|
|
117
|
+
|
|
118
|
+
<!-- readme-standards:begin example.quick-start -->
|
|
119
|
+
Source: [docs/readme/quick_start.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/docs/readme/quick_start.py).
|
|
120
|
+
|
|
121
|
+
```python
|
|
122
|
+
import importlib
|
|
123
|
+
|
|
124
|
+
package = importlib.import_module("swarmauri_live_model_amazon_nova")
|
|
125
|
+
assert package.__name__ == "swarmauri_live_model_amazon_nova"
|
|
126
|
+
```
|
|
127
|
+
<!-- readme-standards:end example.quick-start -->
|
|
128
|
+
|
|
129
|
+
#### Expected Result
|
|
130
|
+
|
|
131
|
+
This quick start is explicitly an import smoke check for `swarmauri_live_model_amazon_nova`. It confirms that the documented namespace loads; it does not demonstrate or certify a complete application workflow. The detailed source and retained usage guidance below describe the integration boundary.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Usage
|
|
136
|
+
|
|
137
|
+
### Common Workflows
|
|
138
|
+
|
|
139
|
+
<!-- readme-standards:begin example.usage -->
|
|
140
|
+
Source: [docs/readme/usage.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/docs/readme/usage.py).
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
import importlib
|
|
144
|
+
|
|
145
|
+
package = importlib.import_module("swarmauri_live_model_amazon_nova")
|
|
146
|
+
assert package.__name__ == "swarmauri_live_model_amazon_nova"
|
|
147
|
+
```
|
|
148
|
+
<!-- readme-standards:end example.usage -->
|
|
149
|
+
|
|
150
|
+
Inject `AmazonNovaProvider` and an `IBidirectionalStreamClient` into `NovaSonicLiveModel`.
|
|
151
|
+
|
|
152
|
+
### Configuration
|
|
153
|
+
|
|
154
|
+
Configure `swarmauri_live_model_amazon_nova` through the APIs in [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/swarmauri_live_model_amazon_nova/__init__.py); its [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/pyproject.toml) describes installation requirements, not an implicit service configuration. No additional package-global configuration contract is inferred from dependencies.
|
|
155
|
+
|
|
156
|
+
### Error Handling
|
|
157
|
+
|
|
158
|
+
The inspected `swarmauri_live_model_amazon_nova` source raises `ValueError`. Handle these at the calling boundary and consult the implementation for the triggering conditions.
|
|
159
|
+
|
|
160
|
+
### Best Practices
|
|
161
|
+
|
|
162
|
+
Use the explicit `swarmauri_live_model_amazon_nova` imports documented below and keep collaborator configuration with the caller. Run the package’s relevant tests after changing `NovaSonicCodec`, `NovaSonicConfigMapper`, `NovaSonicLiveModel`, `NovaSonicLiveSession`, `NovaSonicToolAdapter`; an import or successful installation alone does not establish its runtime guarantees.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Package Boundary
|
|
167
|
+
|
|
168
|
+
### What It Owns
|
|
169
|
+
|
|
170
|
+
`swarmauri_live_model_amazon_nova` is located in `community` and owns amazon Nova Sonic bidirectional HTTP/2 model adapter for Swarmauri. Source-declared APIs include `NovaSonicCodec`, `NovaSonicConfigMapper`, `NovaSonicLiveModel`, `NovaSonicLiveSession`, `NovaSonicToolAdapter`. The [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/pyproject.toml) records its direct dependency boundary.
|
|
171
|
+
|
|
172
|
+
### Public API and Import Surfaces
|
|
173
|
+
|
|
174
|
+
Import namespace: `swarmauri_live_model_amazon_nova`.
|
|
175
|
+
|
|
176
|
+
Source-declared exports or types: `NovaSonicCodec`, `NovaSonicConfigMapper`, `NovaSonicLiveModel`, `NovaSonicLiveSession`, `NovaSonicToolAdapter`.
|
|
177
|
+
|
|
178
|
+
Inspect [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/swarmauri_live_model_amazon_nova/__init__.py) for exact signatures; this inventory does not designate every internal module as stable.
|
|
179
|
+
|
|
180
|
+
### Entry Points
|
|
181
|
+
|
|
182
|
+
<!-- readme-standards:begin entry-points -->
|
|
183
|
+
- `swarmauri.live_models` → `NovaSonicLiveModel` → `swarmauri_live_model_amazon_nova:NovaSonicLiveModel`
|
|
184
|
+
<!-- readme-standards:end entry-points -->
|
|
185
|
+
|
|
186
|
+
### Injected Dependencies
|
|
187
|
+
|
|
188
|
+
The direct installation dependencies of `swarmauri_live_model_amazon_nova` are `swarmauri-core`, `swarmauri-base`, `swarmauri-provider-amazon-nova`, `swarmauri-transport-aws-eventstream`. These declarations do not imply automatic provider selection. Pass collaborators through the explicit constructors or call signatures in [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/swarmauri_live_model_amazon_nova/__init__.py).
|
|
189
|
+
|
|
190
|
+
### Protocol Consumers
|
|
191
|
+
|
|
192
|
+
No direct package-manifest dependency on `swarmauri_live_model_amazon_nova` was found in the audited three-repository inventory. External consumers may still use its documented imports or commands.
|
|
193
|
+
|
|
194
|
+
### Extensions
|
|
195
|
+
|
|
196
|
+
For `swarmauri_live_model_amazon_nova`, use the source-declared public interfaces (`NovaSonicCodec`, `NovaSonicConfigMapper`, `NovaSonicLiveModel`, `NovaSonicLiveSession`, `NovaSonicToolAdapter`) when composing or extending behavior. Its entry-point section below is authoritative for registered plugins; no additional extension loader is inferred from the package name.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Operations and Readiness
|
|
201
|
+
|
|
202
|
+
### Operational Requirements
|
|
203
|
+
|
|
204
|
+
Operate `swarmauri_live_model_amazon_nova` according to its actual entry points and collaborators. The dependency and Python requirements in the [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/pyproject.toml) are prerequisites; deployment topology, credentials, and readiness remain the responsibility of the consuming application unless explicitly documented above.
|
|
205
|
+
|
|
206
|
+
### Health and Observability
|
|
207
|
+
|
|
208
|
+
This README does not establish a standalone health endpoint for `swarmauri_live_model_amazon_nova`. Observe the concrete caller’s results, exceptions, and existing test reports. An application that embeds this package must define its own health and telemetry contract.
|
|
209
|
+
|
|
210
|
+
### Security and Resource Limits
|
|
211
|
+
|
|
212
|
+
Apply the input, credential, and resource constraints implemented in [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/swarmauri_live_model_amazon_nova/__init__.py). The `swarmauri_live_model_amazon_nova` README gate is a documentation check, not a security review or a substitute for the implementation’s limits and caller authorization.
|
|
213
|
+
|
|
214
|
+
### Compatibility
|
|
215
|
+
|
|
216
|
+
This source version of `swarmauri_live_model_amazon_nova` declares Python `>=3.10,<3.15`. Consult its dependency constraints before upgrading. Source-version and registry-version badges have separate meanings; this migration makes no additional platform or interoperability certification claim.
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## Verification
|
|
221
|
+
|
|
222
|
+
### Tests
|
|
223
|
+
|
|
224
|
+
Run `python -m pytest tests/unit/test_readme_sources.py` from the `swarmauri_live_model_amazon_nova` package directory for the maintained example source checks (Python compilation and non-Python file presence). Existing package tests include:
|
|
225
|
+
|
|
226
|
+
- [tests/unit/test_helper_methods.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/tests/unit/test_helper_methods.py)
|
|
227
|
+
- [tests/unit/test_nova_sonic_codec.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/tests/unit/test_nova_sonic_codec.py)
|
|
228
|
+
- [tests/unit/test_nova_sonic_live_model.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/tests/unit/test_nova_sonic_live_model.py)
|
|
229
|
+
- [tests/unit/test_package_contract.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/tests/unit/test_package_contract.py)
|
|
230
|
+
|
|
231
|
+
The repository README gate also checks the required heading tree, metadata, managed fragments, and referenced files.
|
|
232
|
+
|
|
233
|
+
### Certification Status
|
|
234
|
+
|
|
235
|
+
No external certification is asserted for `swarmauri_live_model_amazon_nova` by this documentation migration. README conformance, example syntax, runtime tests, and protocol or security certification are distinct evidence scopes.
|
|
236
|
+
|
|
237
|
+
### Evidence
|
|
238
|
+
|
|
239
|
+
The [README standards CI](https://github.com/swarmauri/swarmauri-sdk/actions/workflows/readme-standards.yml) records mechanical documentation results for its tested commit. The [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/swarmauri_live_model_amazon_nova/__init__.py) and example sources support the package-boundary description; external runtime behavior requires its own test evidence.
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## FAQ
|
|
244
|
+
|
|
245
|
+
### Why
|
|
246
|
+
|
|
247
|
+
**Why select this package?** `swarmauri_live_model_amazon_nova` provides amazon Nova Sonic bidirectional HTTP/2 model adapter for Swarmauri; use its own API boundary rather than assuming neighboring packages are bundled or configured automatically.
|
|
248
|
+
|
|
249
|
+
### How
|
|
250
|
+
|
|
251
|
+
**How do I start?** Install or synchronize the environment under Getting Started, follow the maintained example for `swarmauri_live_model_amazon_nova`, and consult [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/swarmauri_live_model_amazon_nova/__init__.py) for the exact types and signatures involved.
|
|
252
|
+
|
|
253
|
+
### When
|
|
254
|
+
|
|
255
|
+
**When should I validate an upgrade?** Recheck `swarmauri_live_model_amazon_nova` whenever its source version, declared collaborators, configuration, or caller changes. Run relevant behavioral tests in addition to the README gate before promotion.
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Documentation and Related Packages
|
|
260
|
+
|
|
261
|
+
### More Documentation
|
|
262
|
+
|
|
263
|
+
The [repository contribution guide](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md), [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/swarmauri_live_model_amazon_nova/__init__.py), and [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/pyproject.toml) provide the supporting context for `swarmauri_live_model_amazon_nova`. The [README policy](https://github.com/groupsum/readme-standards/blob/master/docs/outline.md) defines the common document structure.
|
|
264
|
+
|
|
265
|
+
### Related Packages
|
|
266
|
+
|
|
267
|
+
- [swarmauri_base](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/20-bases/swarmauri_base/README.md): Reusable Swarmauri base classes, mixins, and dynamic Pydantic component models for composable intelligence infrastructure.
|
|
268
|
+
- [swarmauri_provider_amazon_nova](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_provider_amazon_nova/README.md): Aggregated Amazon Nova provider resources for Swarmauri models.
|
|
269
|
+
- [swarmauri_core](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/10-interfaces/swarmauri_core/README.md): Core interface contracts and shared types for Swarmauri composable intelligence infrastructure components.
|
|
270
|
+
- [swarmauri_transport_aws_eventstream](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_transport_aws_eventstream/README.md): Amazon Bedrock bidirectional EventStream transport for Swarmauri live models.
|
|
271
|
+
|
|
272
|
+
### Project Links
|
|
273
|
+
|
|
274
|
+
<!-- readme-standards:begin project-links -->
|
|
275
|
+
- [pypi: swarmauri_live_model_amazon_nova](https://pypi.org/project/swarmauri_live_model_amazon_nova/)
|
|
276
|
+
<!-- readme-standards:end project-links -->
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## Contributing
|
|
281
|
+
|
|
282
|
+
### How to Contribute
|
|
283
|
+
|
|
284
|
+
Follow the [contribution guide](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md) and include a focused example or regression for changes to `swarmauri_live_model_amazon_nova`. Keep package behavior, its documented boundary, and its tests aligned.
|
|
285
|
+
|
|
286
|
+
### Development Setup
|
|
287
|
+
|
|
288
|
+
Work from the `pkgs/50-community/swarmauri_live_model_amazon_nova` checkout. Synchronize its declared development environment with uv, then run the relevant package tests and `python -m pytest tests/unit/test_readme_sources.py`. The repository’s dedicated README job installs `readme-standards==0.1.3` without resolving unrelated runtime packages.
|
|
289
|
+
|
|
290
|
+
### Notes for Maintainers
|
|
291
|
+
|
|
292
|
+
Edit authored prose directly in this `swarmauri_live_model_amazon_nova` README. Update source examples in `docs/readme/`, then run `readme-standards render --root . --write` from the package directory and review the diff. Required headings and generated blocks come from package-guide-v1.
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## Governance
|
|
297
|
+
|
|
298
|
+
### Ownership and Decision Making
|
|
299
|
+
|
|
300
|
+
Changes to `swarmauri_live_model_amazon_nova` follow the maintainer review process of [swarmauri/swarmauri-sdk](https://github.com/swarmauri/swarmauri-sdk) and its contribution guide. Author attribution remains in the [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/pyproject.toml); this README does not assign new publishing or administrative authority.
|
|
301
|
+
|
|
302
|
+
### Standards and Policies
|
|
303
|
+
|
|
304
|
+
`swarmauri_live_model_amazon_nova` follows the versioned [package-guide-v1 outline](https://github.com/groupsum/readme-standards/blob/master/docs/outline.md). All fixed headings, hierarchy, order, separators, and package-specific branding are checked by CI; reviewers assess the accuracy and usefulness of authored claims.
|
|
305
|
+
|
|
306
|
+
### Lifecycle and Migration
|
|
307
|
+
|
|
308
|
+
The `swarmauri_live_model_amazon_nova` source version is `0.1.0`.
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## License and Attribution
|
|
313
|
+
|
|
314
|
+
### License
|
|
315
|
+
|
|
316
|
+
<!-- readme-standards:begin license -->
|
|
317
|
+
Licensed under `Apache-2.0`. See [LICENSE](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/LICENSE).
|
|
318
|
+
<!-- readme-standards:end license -->
|
|
319
|
+
|
|
320
|
+
### Notices
|
|
321
|
+
|
|
322
|
+
<!-- readme-standards:begin notices -->
|
|
323
|
+
See [NOTICE](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/NOTICE) for attribution.
|
|
324
|
+
<!-- readme-standards:end notices -->
|
|
325
|
+
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
# swarmauri_live_model_amazon_nova
|
|
2
|
+
|
|
3
|
+
<!-- readme-standards:begin branding -->
|
|
4
|
+
<p align="center"><a href="https://github.com/swarmauri/swarmauri-sdk"><img src="https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/swarmauri.brand.theme.svg" alt="Swarmauri SDK" width="300"></a></p>
|
|
5
|
+
<p align="center"><strong>swarmauri_live_model_amazon_nova</strong></p>
|
|
6
|
+
<p align="center">Amazon Nova Sonic bidirectional HTTP/2 model adapter for Swarmauri.</p>
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://pypi.org/project/swarmauri_live_model_amazon_nova/"><img alt="pypi: swarmauri_live_model_amazon_nova" src="https://img.shields.io/pypi/v/swarmauri_live_model_amazon_nova?labelColor=1E293B&color=1D4ED8"></a>
|
|
9
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/pyproject.toml"><img alt="Source version: 0.1.0" src="https://img.shields.io/static/v1?label=Source%20version&message=0.1.0&labelColor=1E293B&color=4338CA"></a>
|
|
10
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/pyproject.toml"><img alt="Python: >=3.10,<3.15" src="https://img.shields.io/static/v1?label=Python&message=%3E%3D3.10%2C%3C3.15&labelColor=1E293B&color=0F766E"></a>
|
|
11
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/pyproject.toml"><img alt="Layer: community" src="https://img.shields.io/static/v1?label=Layer&message=community&labelColor=1E293B&color=6D28D9"></a>
|
|
12
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/README.md#lifecycle-and-migration"><img alt="Lifecycle: active" src="https://img.shields.io/static/v1?label=Lifecycle&message=active&labelColor=1E293B&color=166534"></a>
|
|
13
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/LICENSE"><img alt="License: Apache-2.0" src="https://img.shields.io/static/v1?label=License&message=Apache-2.0&labelColor=1E293B&color=86198F"></a>
|
|
14
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/NOTICE"><img alt="Notice: attribution" src="https://img.shields.io/static/v1?label=Notice&message=attribution&labelColor=1E293B&color=86198F"></a>
|
|
15
|
+
</p>
|
|
16
|
+
<p align="center">
|
|
17
|
+
<a href="https://pypi.org/project/swarmauri_live_model_amazon_nova/"><img alt="Monthly PyPI downloads: swarmauri_live_model_amazon_nova" src="https://img.shields.io/pypi/dm/swarmauri_live_model_amazon_nova?labelColor=1E293B&color=0E7490"></a>
|
|
18
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/README.md"><img alt="README hits: swarmauri_live_model_amazon_nova" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/pkgs/50-community/swarmauri_live_model_amazon_nova/README.md.svg?label=README%20hits&labelColor=1E293B&color=0E7490"></a>
|
|
19
|
+
</p>
|
|
20
|
+
<p align="center">
|
|
21
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/actions/workflows/readme-standards.yml"><img alt="README standards: CI gate" src="https://img.shields.io/static/v1?label=README%20standards&message=CI%20gate&labelColor=1E293B&color=1D4ED8"></a>
|
|
22
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/tests/unit/test_readme_sources.py"><img alt="Tests: example source" src="https://img.shields.io/static/v1?label=Tests&message=example%20source&labelColor=1E293B&color=0F766E"></a>
|
|
23
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/README.md#certification-status"><img alt="Certification: not certified" src="https://img.shields.io/static/v1?label=Certification&message=not%20certified&labelColor=1E293B&color=92400E"></a>
|
|
24
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/tools/readme/POLICY.md"><img alt="Governance: repository policy" src="https://img.shields.io/static/v1?label=Governance&message=repository%20policy&labelColor=1E293B&color=4338CA"></a>
|
|
25
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/actions/workflows/readme-standards.yml"><img alt="Evidence: source and CI" src="https://img.shields.io/static/v1?label=Evidence&message=source%20and%20CI&labelColor=1E293B&color=6D28D9"></a>
|
|
26
|
+
</p>
|
|
27
|
+
<p align="center"><a href="#overview">Overview</a> · <a href="#installation">Installation</a> · <a href="#quick-start">Quick Start</a> · <a href="#usage">Usage</a> · <a href="#public-api-and-import-surfaces">API</a> · <a href="#contributing">Contributing</a> · <a href="#governance">Governance</a> · <a href="#license">License</a></p>
|
|
28
|
+
<!-- readme-standards:end branding -->
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Overview
|
|
33
|
+
|
|
34
|
+
### Summary
|
|
35
|
+
|
|
36
|
+
[](https://pypi.org/project/swarmauri_live_model_amazon_nova/) [](https://pypi.org/project/swarmauri_live_model_amazon_nova/) [](LICENSE) [](https://pepy.tech/project/swarmauri_live_model_amazon_nova) [](https://hits.sh/github.com/swarmauri/swarmauri-sdk/)
|
|
37
|
+
|
|
38
|
+
### Why This Package
|
|
39
|
+
|
|
40
|
+
`swarmauri_live_model_amazon_nova` isolates this responsibility: Amazon Nova Sonic bidirectional HTTP/2 model adapter for Swarmauri. Its [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/swarmauri_live_model_amazon_nova/__init__.py) exposes `NovaSonicCodec`, `NovaSonicConfigMapper`, `NovaSonicLiveModel`, `NovaSonicLiveSession`, `NovaSonicToolAdapter`, allowing consumers to select this package without treating adjacent packages as part of its public contract.
|
|
41
|
+
|
|
42
|
+
### When to Use
|
|
43
|
+
|
|
44
|
+
Choose `swarmauri_live_model_amazon_nova` when your integration needs amazon Nova Sonic bidirectional HTTP/2 model adapter for Swarmauri. Match the imports below to your application boundary and install its declared dependencies before using the example.
|
|
45
|
+
|
|
46
|
+
### Features
|
|
47
|
+
|
|
48
|
+
- Nova Sonic text/audio sessions over an injected bidirectional HTTP/2 transport.
|
|
49
|
+
- Typed audio, text, tool, usage, completion, and error events.
|
|
50
|
+
|
|
51
|
+
### Non-Goals
|
|
52
|
+
|
|
53
|
+
`swarmauri_live_model_amazon_nova` owns amazon Nova Sonic bidirectional HTTP/2 model adapter for Swarmauri. Its imports do not by themselves configure credentials, deploy a service, or certify the behavior of its consumers. Dependencies and neighboring packages retain their own documented responsibilities.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Getting Started
|
|
58
|
+
|
|
59
|
+
### Prerequisites
|
|
60
|
+
|
|
61
|
+
Python `>=3.10,<3.15` is required. The [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/pyproject.toml) declares runtime dependencies including `swarmauri-core`, `swarmauri-base`, `swarmauri-provider-amazon-nova`, `swarmauri-transport-aws-eventstream`. Read the example’s inputs and service requirements before execution.
|
|
62
|
+
|
|
63
|
+
### Installation
|
|
64
|
+
|
|
65
|
+
`uv add swarmauri_live_model_amazon_nova` or `pip install swarmauri_live_model_amazon_nova`.
|
|
66
|
+
|
|
67
|
+
#### uv
|
|
68
|
+
|
|
69
|
+
<!-- readme-standards:begin installation.uv -->
|
|
70
|
+
```bash
|
|
71
|
+
uv add swarmauri_live_model_amazon_nova
|
|
72
|
+
```
|
|
73
|
+
<!-- readme-standards:end installation.uv -->
|
|
74
|
+
|
|
75
|
+
#### pip
|
|
76
|
+
|
|
77
|
+
<!-- readme-standards:begin installation.pip -->
|
|
78
|
+
```bash
|
|
79
|
+
python -m pip install swarmauri_live_model_amazon_nova
|
|
80
|
+
```
|
|
81
|
+
<!-- readme-standards:end installation.pip -->
|
|
82
|
+
|
|
83
|
+
#### Poetry
|
|
84
|
+
|
|
85
|
+
<!-- readme-standards:begin installation.poetry -->
|
|
86
|
+
```bash
|
|
87
|
+
poetry add swarmauri_live_model_amazon_nova
|
|
88
|
+
```
|
|
89
|
+
<!-- readme-standards:end installation.poetry -->
|
|
90
|
+
|
|
91
|
+
### Quick Start
|
|
92
|
+
|
|
93
|
+
#### Example
|
|
94
|
+
|
|
95
|
+
<!-- readme-standards:begin example.quick-start -->
|
|
96
|
+
Source: [docs/readme/quick_start.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/docs/readme/quick_start.py).
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
import importlib
|
|
100
|
+
|
|
101
|
+
package = importlib.import_module("swarmauri_live_model_amazon_nova")
|
|
102
|
+
assert package.__name__ == "swarmauri_live_model_amazon_nova"
|
|
103
|
+
```
|
|
104
|
+
<!-- readme-standards:end example.quick-start -->
|
|
105
|
+
|
|
106
|
+
#### Expected Result
|
|
107
|
+
|
|
108
|
+
This quick start is explicitly an import smoke check for `swarmauri_live_model_amazon_nova`. It confirms that the documented namespace loads; it does not demonstrate or certify a complete application workflow. The detailed source and retained usage guidance below describe the integration boundary.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Usage
|
|
113
|
+
|
|
114
|
+
### Common Workflows
|
|
115
|
+
|
|
116
|
+
<!-- readme-standards:begin example.usage -->
|
|
117
|
+
Source: [docs/readme/usage.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/docs/readme/usage.py).
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
import importlib
|
|
121
|
+
|
|
122
|
+
package = importlib.import_module("swarmauri_live_model_amazon_nova")
|
|
123
|
+
assert package.__name__ == "swarmauri_live_model_amazon_nova"
|
|
124
|
+
```
|
|
125
|
+
<!-- readme-standards:end example.usage -->
|
|
126
|
+
|
|
127
|
+
Inject `AmazonNovaProvider` and an `IBidirectionalStreamClient` into `NovaSonicLiveModel`.
|
|
128
|
+
|
|
129
|
+
### Configuration
|
|
130
|
+
|
|
131
|
+
Configure `swarmauri_live_model_amazon_nova` through the APIs in [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/swarmauri_live_model_amazon_nova/__init__.py); its [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/pyproject.toml) describes installation requirements, not an implicit service configuration. No additional package-global configuration contract is inferred from dependencies.
|
|
132
|
+
|
|
133
|
+
### Error Handling
|
|
134
|
+
|
|
135
|
+
The inspected `swarmauri_live_model_amazon_nova` source raises `ValueError`. Handle these at the calling boundary and consult the implementation for the triggering conditions.
|
|
136
|
+
|
|
137
|
+
### Best Practices
|
|
138
|
+
|
|
139
|
+
Use the explicit `swarmauri_live_model_amazon_nova` imports documented below and keep collaborator configuration with the caller. Run the package’s relevant tests after changing `NovaSonicCodec`, `NovaSonicConfigMapper`, `NovaSonicLiveModel`, `NovaSonicLiveSession`, `NovaSonicToolAdapter`; an import or successful installation alone does not establish its runtime guarantees.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Package Boundary
|
|
144
|
+
|
|
145
|
+
### What It Owns
|
|
146
|
+
|
|
147
|
+
`swarmauri_live_model_amazon_nova` is located in `community` and owns amazon Nova Sonic bidirectional HTTP/2 model adapter for Swarmauri. Source-declared APIs include `NovaSonicCodec`, `NovaSonicConfigMapper`, `NovaSonicLiveModel`, `NovaSonicLiveSession`, `NovaSonicToolAdapter`. The [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/pyproject.toml) records its direct dependency boundary.
|
|
148
|
+
|
|
149
|
+
### Public API and Import Surfaces
|
|
150
|
+
|
|
151
|
+
Import namespace: `swarmauri_live_model_amazon_nova`.
|
|
152
|
+
|
|
153
|
+
Source-declared exports or types: `NovaSonicCodec`, `NovaSonicConfigMapper`, `NovaSonicLiveModel`, `NovaSonicLiveSession`, `NovaSonicToolAdapter`.
|
|
154
|
+
|
|
155
|
+
Inspect [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/swarmauri_live_model_amazon_nova/__init__.py) for exact signatures; this inventory does not designate every internal module as stable.
|
|
156
|
+
|
|
157
|
+
### Entry Points
|
|
158
|
+
|
|
159
|
+
<!-- readme-standards:begin entry-points -->
|
|
160
|
+
- `swarmauri.live_models` → `NovaSonicLiveModel` → `swarmauri_live_model_amazon_nova:NovaSonicLiveModel`
|
|
161
|
+
<!-- readme-standards:end entry-points -->
|
|
162
|
+
|
|
163
|
+
### Injected Dependencies
|
|
164
|
+
|
|
165
|
+
The direct installation dependencies of `swarmauri_live_model_amazon_nova` are `swarmauri-core`, `swarmauri-base`, `swarmauri-provider-amazon-nova`, `swarmauri-transport-aws-eventstream`. These declarations do not imply automatic provider selection. Pass collaborators through the explicit constructors or call signatures in [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/swarmauri_live_model_amazon_nova/__init__.py).
|
|
166
|
+
|
|
167
|
+
### Protocol Consumers
|
|
168
|
+
|
|
169
|
+
No direct package-manifest dependency on `swarmauri_live_model_amazon_nova` was found in the audited three-repository inventory. External consumers may still use its documented imports or commands.
|
|
170
|
+
|
|
171
|
+
### Extensions
|
|
172
|
+
|
|
173
|
+
For `swarmauri_live_model_amazon_nova`, use the source-declared public interfaces (`NovaSonicCodec`, `NovaSonicConfigMapper`, `NovaSonicLiveModel`, `NovaSonicLiveSession`, `NovaSonicToolAdapter`) when composing or extending behavior. Its entry-point section below is authoritative for registered plugins; no additional extension loader is inferred from the package name.
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Operations and Readiness
|
|
178
|
+
|
|
179
|
+
### Operational Requirements
|
|
180
|
+
|
|
181
|
+
Operate `swarmauri_live_model_amazon_nova` according to its actual entry points and collaborators. The dependency and Python requirements in the [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/pyproject.toml) are prerequisites; deployment topology, credentials, and readiness remain the responsibility of the consuming application unless explicitly documented above.
|
|
182
|
+
|
|
183
|
+
### Health and Observability
|
|
184
|
+
|
|
185
|
+
This README does not establish a standalone health endpoint for `swarmauri_live_model_amazon_nova`. Observe the concrete caller’s results, exceptions, and existing test reports. An application that embeds this package must define its own health and telemetry contract.
|
|
186
|
+
|
|
187
|
+
### Security and Resource Limits
|
|
188
|
+
|
|
189
|
+
Apply the input, credential, and resource constraints implemented in [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/swarmauri_live_model_amazon_nova/__init__.py). The `swarmauri_live_model_amazon_nova` README gate is a documentation check, not a security review or a substitute for the implementation’s limits and caller authorization.
|
|
190
|
+
|
|
191
|
+
### Compatibility
|
|
192
|
+
|
|
193
|
+
This source version of `swarmauri_live_model_amazon_nova` declares Python `>=3.10,<3.15`. Consult its dependency constraints before upgrading. Source-version and registry-version badges have separate meanings; this migration makes no additional platform or interoperability certification claim.
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Verification
|
|
198
|
+
|
|
199
|
+
### Tests
|
|
200
|
+
|
|
201
|
+
Run `python -m pytest tests/unit/test_readme_sources.py` from the `swarmauri_live_model_amazon_nova` package directory for the maintained example source checks (Python compilation and non-Python file presence). Existing package tests include:
|
|
202
|
+
|
|
203
|
+
- [tests/unit/test_helper_methods.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/tests/unit/test_helper_methods.py)
|
|
204
|
+
- [tests/unit/test_nova_sonic_codec.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/tests/unit/test_nova_sonic_codec.py)
|
|
205
|
+
- [tests/unit/test_nova_sonic_live_model.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/tests/unit/test_nova_sonic_live_model.py)
|
|
206
|
+
- [tests/unit/test_package_contract.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/tests/unit/test_package_contract.py)
|
|
207
|
+
|
|
208
|
+
The repository README gate also checks the required heading tree, metadata, managed fragments, and referenced files.
|
|
209
|
+
|
|
210
|
+
### Certification Status
|
|
211
|
+
|
|
212
|
+
No external certification is asserted for `swarmauri_live_model_amazon_nova` by this documentation migration. README conformance, example syntax, runtime tests, and protocol or security certification are distinct evidence scopes.
|
|
213
|
+
|
|
214
|
+
### Evidence
|
|
215
|
+
|
|
216
|
+
The [README standards CI](https://github.com/swarmauri/swarmauri-sdk/actions/workflows/readme-standards.yml) records mechanical documentation results for its tested commit. The [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/swarmauri_live_model_amazon_nova/__init__.py) and example sources support the package-boundary description; external runtime behavior requires its own test evidence.
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## FAQ
|
|
221
|
+
|
|
222
|
+
### Why
|
|
223
|
+
|
|
224
|
+
**Why select this package?** `swarmauri_live_model_amazon_nova` provides amazon Nova Sonic bidirectional HTTP/2 model adapter for Swarmauri; use its own API boundary rather than assuming neighboring packages are bundled or configured automatically.
|
|
225
|
+
|
|
226
|
+
### How
|
|
227
|
+
|
|
228
|
+
**How do I start?** Install or synchronize the environment under Getting Started, follow the maintained example for `swarmauri_live_model_amazon_nova`, and consult [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/swarmauri_live_model_amazon_nova/__init__.py) for the exact types and signatures involved.
|
|
229
|
+
|
|
230
|
+
### When
|
|
231
|
+
|
|
232
|
+
**When should I validate an upgrade?** Recheck `swarmauri_live_model_amazon_nova` whenever its source version, declared collaborators, configuration, or caller changes. Run relevant behavioral tests in addition to the README gate before promotion.
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## Documentation and Related Packages
|
|
237
|
+
|
|
238
|
+
### More Documentation
|
|
239
|
+
|
|
240
|
+
The [repository contribution guide](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md), [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/swarmauri_live_model_amazon_nova/__init__.py), and [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/pyproject.toml) provide the supporting context for `swarmauri_live_model_amazon_nova`. The [README policy](https://github.com/groupsum/readme-standards/blob/master/docs/outline.md) defines the common document structure.
|
|
241
|
+
|
|
242
|
+
### Related Packages
|
|
243
|
+
|
|
244
|
+
- [swarmauri_base](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/20-bases/swarmauri_base/README.md): Reusable Swarmauri base classes, mixins, and dynamic Pydantic component models for composable intelligence infrastructure.
|
|
245
|
+
- [swarmauri_provider_amazon_nova](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_provider_amazon_nova/README.md): Aggregated Amazon Nova provider resources for Swarmauri models.
|
|
246
|
+
- [swarmauri_core](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/10-interfaces/swarmauri_core/README.md): Core interface contracts and shared types for Swarmauri composable intelligence infrastructure components.
|
|
247
|
+
- [swarmauri_transport_aws_eventstream](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/40-standards/swarmauri_transport_aws_eventstream/README.md): Amazon Bedrock bidirectional EventStream transport for Swarmauri live models.
|
|
248
|
+
|
|
249
|
+
### Project Links
|
|
250
|
+
|
|
251
|
+
<!-- readme-standards:begin project-links -->
|
|
252
|
+
- [pypi: swarmauri_live_model_amazon_nova](https://pypi.org/project/swarmauri_live_model_amazon_nova/)
|
|
253
|
+
<!-- readme-standards:end project-links -->
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## Contributing
|
|
258
|
+
|
|
259
|
+
### How to Contribute
|
|
260
|
+
|
|
261
|
+
Follow the [contribution guide](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md) and include a focused example or regression for changes to `swarmauri_live_model_amazon_nova`. Keep package behavior, its documented boundary, and its tests aligned.
|
|
262
|
+
|
|
263
|
+
### Development Setup
|
|
264
|
+
|
|
265
|
+
Work from the `pkgs/50-community/swarmauri_live_model_amazon_nova` checkout. Synchronize its declared development environment with uv, then run the relevant package tests and `python -m pytest tests/unit/test_readme_sources.py`. The repository’s dedicated README job installs `readme-standards==0.1.3` without resolving unrelated runtime packages.
|
|
266
|
+
|
|
267
|
+
### Notes for Maintainers
|
|
268
|
+
|
|
269
|
+
Edit authored prose directly in this `swarmauri_live_model_amazon_nova` README. Update source examples in `docs/readme/`, then run `readme-standards render --root . --write` from the package directory and review the diff. Required headings and generated blocks come from package-guide-v1.
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Governance
|
|
274
|
+
|
|
275
|
+
### Ownership and Decision Making
|
|
276
|
+
|
|
277
|
+
Changes to `swarmauri_live_model_amazon_nova` follow the maintainer review process of [swarmauri/swarmauri-sdk](https://github.com/swarmauri/swarmauri-sdk) and its contribution guide. Author attribution remains in the [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/pyproject.toml); this README does not assign new publishing or administrative authority.
|
|
278
|
+
|
|
279
|
+
### Standards and Policies
|
|
280
|
+
|
|
281
|
+
`swarmauri_live_model_amazon_nova` follows the versioned [package-guide-v1 outline](https://github.com/groupsum/readme-standards/blob/master/docs/outline.md). All fixed headings, hierarchy, order, separators, and package-specific branding are checked by CI; reviewers assess the accuracy and usefulness of authored claims.
|
|
282
|
+
|
|
283
|
+
### Lifecycle and Migration
|
|
284
|
+
|
|
285
|
+
The `swarmauri_live_model_amazon_nova` source version is `0.1.0`.
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## License and Attribution
|
|
290
|
+
|
|
291
|
+
### License
|
|
292
|
+
|
|
293
|
+
<!-- readme-standards:begin license -->
|
|
294
|
+
Licensed under `Apache-2.0`. See [LICENSE](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/LICENSE).
|
|
295
|
+
<!-- readme-standards:end license -->
|
|
296
|
+
|
|
297
|
+
### Notices
|
|
298
|
+
|
|
299
|
+
<!-- readme-standards:begin notices -->
|
|
300
|
+
See [NOTICE](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/NOTICE) for attribution.
|
|
301
|
+
<!-- readme-standards:end notices -->
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "swarmauri_live_model_amazon_nova"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Amazon Nova Sonic bidirectional HTTP/2 model adapter for Swarmauri."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.10,<3.15"
|
|
7
|
+
authors = [{ name = "Jacob Stewart", email = "jacob@swarmauri.com" }]
|
|
8
|
+
license = "Apache-2.0"
|
|
9
|
+
dependencies = ["swarmauri_core<0.12,>=0.11.0", "swarmauri_base<0.12,>=0.11.0", "swarmauri_provider_amazon_nova>=0.1.0", "swarmauri_transport_aws_eventstream>=0.1.0"]
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Development Status :: 1 - Planning",
|
|
12
|
+
"Programming Language :: Python :: 3.10",
|
|
13
|
+
"Programming Language :: Python :: 3.11",
|
|
14
|
+
"Programming Language :: Python :: 3.12",
|
|
15
|
+
"Programming Language :: Python :: 3.13",
|
|
16
|
+
"Programming Language :: Python :: 3.14",
|
|
17
|
+
]
|
|
18
|
+
keywords = ["swarmauri", "amazon nova", "nova sonic", "audio", "http2"]
|
|
19
|
+
license-files = ["LICENSE", "NOTICE"]
|
|
20
|
+
[tool.uv.sources]
|
|
21
|
+
swarmauri_core = { workspace = true }
|
|
22
|
+
swarmauri_base = { workspace = true }
|
|
23
|
+
swarmauri_provider_amazon_nova = { workspace = true }
|
|
24
|
+
swarmauri_transport_aws_eventstream = { workspace = true }
|
|
25
|
+
|
|
26
|
+
[tool.readme_standards]
|
|
27
|
+
policy = "package-guide-v1"
|
|
28
|
+
readme = "README.md"
|
|
29
|
+
brand = "swarmauri"
|
|
30
|
+
brand_catalog = "../../../tools/readme/brands.toml"
|
|
31
|
+
repository = "https://github.com/swarmauri/swarmauri-sdk"
|
|
32
|
+
ref = "master"
|
|
33
|
+
package_path = "pkgs/50-community/swarmauri_live_model_amazon_nova"
|
|
34
|
+
layer = "community"
|
|
35
|
+
lifecycle = "active"
|
|
36
|
+
license_file = "LICENSE"
|
|
37
|
+
notice_file = "NOTICE"
|
|
38
|
+
|
|
39
|
+
[tool.readme_standards.distributions.pypi]
|
|
40
|
+
name = "swarmauri_live_model_amazon_nova"
|
|
41
|
+
published = true
|
|
42
|
+
|
|
43
|
+
[tool.readme_standards.examples.quick_start]
|
|
44
|
+
source = "docs/readme/quick_start.py"
|
|
45
|
+
test = "tests/unit/test_readme_sources.py"
|
|
46
|
+
language = "python"
|
|
47
|
+
expected_exit_code = 0
|
|
48
|
+
|
|
49
|
+
[tool.readme_standards.examples.usage]
|
|
50
|
+
source = "docs/readme/usage.py"
|
|
51
|
+
test = "tests/unit/test_readme_sources.py"
|
|
52
|
+
language = "python"
|
|
53
|
+
expected_exit_code = 0
|
|
54
|
+
|
|
55
|
+
[tool.readme_standards.statuses.readme]
|
|
56
|
+
label = "CI gate"
|
|
57
|
+
url = "https://github.com/swarmauri/swarmauri-sdk/actions/workflows/readme-standards.yml"
|
|
58
|
+
|
|
59
|
+
[tool.readme_standards.statuses.tests]
|
|
60
|
+
label = "example source"
|
|
61
|
+
url = "https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/tests/unit/test_readme_sources.py"
|
|
62
|
+
|
|
63
|
+
[tool.readme_standards.statuses.certification]
|
|
64
|
+
label = "not certified"
|
|
65
|
+
url = "https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_live_model_amazon_nova/README.md#certification-status"
|
|
66
|
+
|
|
67
|
+
[tool.readme_standards.statuses.governance]
|
|
68
|
+
label = "repository policy"
|
|
69
|
+
url = "https://github.com/swarmauri/swarmauri-sdk/blob/master/tools/readme/POLICY.md"
|
|
70
|
+
|
|
71
|
+
[tool.readme_standards.statuses.evidence]
|
|
72
|
+
label = "source and CI"
|
|
73
|
+
url = "https://github.com/swarmauri/swarmauri-sdk/actions/workflows/readme-standards.yml"
|
|
74
|
+
[project.entry-points."swarmauri.live_models"]
|
|
75
|
+
NovaSonicLiveModel = "swarmauri_live_model_amazon_nova:NovaSonicLiveModel"
|
|
76
|
+
[build-system]
|
|
77
|
+
requires = ["poetry-core>=1.8.0"]
|
|
78
|
+
build-backend = "poetry.core.masonry.api"
|
|
79
|
+
[dependency-groups]
|
|
80
|
+
dev = ["pytest>=8.0", "pytest-asyncio>=0.24", "ruff>=0.9.9", "swarmauri_tests_component", "readme-standards==0.1.3; python_version >= \"3.11\""]
|
|
81
|
+
|
|
82
|
+
[tool.ruff]
|
|
83
|
+
extend = "../../pyproject.toml"
|
|
84
|
+
|
|
85
|
+
[tool.ruff.lint]
|
|
86
|
+
ignore = ["BLE001", "N999"]
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import base64
|
|
2
|
+
|
|
3
|
+
from swarmauri_base.live_models.events.AudioDeltaEvent import AudioDeltaEvent
|
|
4
|
+
from swarmauri_base.live_models.events.SessionErrorEvent import (
|
|
5
|
+
SessionErrorEvent,
|
|
6
|
+
)
|
|
7
|
+
from swarmauri_base.live_models.events.TextDeltaEvent import TextDeltaEvent
|
|
8
|
+
from swarmauri_base.live_models.events.ToolCallEvent import ToolCallEvent
|
|
9
|
+
from swarmauri_base.live_models.events.TurnCompleteEvent import (
|
|
10
|
+
TurnCompleteEvent,
|
|
11
|
+
)
|
|
12
|
+
from swarmauri_base.live_models.events.UsageEvent import UsageEvent
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class NovaSonicCodec:
|
|
16
|
+
def encode(self, input_data):
|
|
17
|
+
if input_data.kind == "audio":
|
|
18
|
+
return {
|
|
19
|
+
"event": {
|
|
20
|
+
"audioInput": {
|
|
21
|
+
"content": base64.b64encode(
|
|
22
|
+
input_data.payload
|
|
23
|
+
).decode()
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if input_data.kind == "text":
|
|
28
|
+
return {"event": {"textInput": {"content": input_data.payload}}}
|
|
29
|
+
if input_data.kind == "tool_result":
|
|
30
|
+
return {
|
|
31
|
+
"event": {
|
|
32
|
+
"toolResult": {
|
|
33
|
+
"toolUseId": input_data.call_id,
|
|
34
|
+
"content": [{"json": input_data.payload}],
|
|
35
|
+
"status": "error"
|
|
36
|
+
if input_data.is_error
|
|
37
|
+
else "success",
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if input_data.kind == "commit_turn":
|
|
42
|
+
return {"event": {"contentEnd": {}}}
|
|
43
|
+
if input_data.kind == "interrupt":
|
|
44
|
+
return {"event": {"playbackCompletion": {}}}
|
|
45
|
+
raise ValueError(f"Unsupported Nova Sonic input: {input_data.kind}")
|
|
46
|
+
|
|
47
|
+
def decode(self, data):
|
|
48
|
+
event = data.get("event", data)
|
|
49
|
+
if "audioOutput" in event:
|
|
50
|
+
return [
|
|
51
|
+
AudioDeltaEvent(
|
|
52
|
+
payload=base64.b64decode(
|
|
53
|
+
event["audioOutput"].get("content", "")
|
|
54
|
+
)
|
|
55
|
+
)
|
|
56
|
+
]
|
|
57
|
+
if "textOutput" in event:
|
|
58
|
+
return [
|
|
59
|
+
TextDeltaEvent(payload=event["textOutput"].get("content", ""))
|
|
60
|
+
]
|
|
61
|
+
if "toolUse" in event:
|
|
62
|
+
use = event["toolUse"]
|
|
63
|
+
return [
|
|
64
|
+
ToolCallEvent(
|
|
65
|
+
call_id=use.get("toolUseId", ""),
|
|
66
|
+
tool_name=use.get("toolName", ""),
|
|
67
|
+
arguments=use.get("content", {}),
|
|
68
|
+
)
|
|
69
|
+
]
|
|
70
|
+
if "completionEnd" in event or "contentEnd" in event:
|
|
71
|
+
return [TurnCompleteEvent()]
|
|
72
|
+
if "usageEvent" in event:
|
|
73
|
+
return [
|
|
74
|
+
UsageEvent(
|
|
75
|
+
payload={
|
|
76
|
+
key: int(value)
|
|
77
|
+
for key, value in event["usageEvent"].items()
|
|
78
|
+
if isinstance(value, int)
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
]
|
|
82
|
+
if "error" in event:
|
|
83
|
+
return [SessionErrorEvent(message=str(event["error"]))]
|
|
84
|
+
return []
|
swarmauri_live_model_amazon_nova-0.1.0/swarmauri_live_model_amazon_nova/NovaSonicConfigMapper.py
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from swarmauri_base.live_models.LiveConfigBase import LiveConfigBase
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class NovaSonicConfigMapper:
|
|
5
|
+
def map(self, model: str, config: LiveConfigBase) -> list[dict]:
|
|
6
|
+
return [
|
|
7
|
+
{
|
|
8
|
+
"event": {
|
|
9
|
+
"sessionStart": {
|
|
10
|
+
"inferenceConfiguration": config.provider_options.get(
|
|
11
|
+
"inference", {}
|
|
12
|
+
)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"event": {
|
|
18
|
+
"promptStart": {
|
|
19
|
+
"promptName": config.provider_options.get(
|
|
20
|
+
"prompt_name", "swarmauri"
|
|
21
|
+
),
|
|
22
|
+
"textOutputConfiguration": {"mediaType": "text/plain"},
|
|
23
|
+
"audioOutputConfiguration": config.provider_options.get( # noqa: E501
|
|
24
|
+
"audio_output",
|
|
25
|
+
{
|
|
26
|
+
"mediaType": "audio/lpcm",
|
|
27
|
+
"sampleRateHertz": 24000,
|
|
28
|
+
"sampleSizeBits": 16,
|
|
29
|
+
"channelCount": 1,
|
|
30
|
+
"voiceId": "matthew",
|
|
31
|
+
"encoding": "base64",
|
|
32
|
+
"audioType": "SPEECH",
|
|
33
|
+
},
|
|
34
|
+
),
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
]
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
from pydantic import ConfigDict, Field
|
|
4
|
+
from swarmauri_base.ComponentBase import ComponentBase
|
|
5
|
+
from swarmauri_base.live_models.LiveCapabilitiesBase import (
|
|
6
|
+
LiveCapabilitiesBase,
|
|
7
|
+
)
|
|
8
|
+
from swarmauri_base.live_models.LiveConfigBase import LiveConfigBase
|
|
9
|
+
from swarmauri_base.live_models.LiveModelBase import LiveModelBase
|
|
10
|
+
from swarmauri_core.transports.i_bidirectional_stream import (
|
|
11
|
+
IBidirectionalStreamClient,
|
|
12
|
+
)
|
|
13
|
+
from swarmauri_provider_amazon_nova import AmazonNovaProvider
|
|
14
|
+
from swarmauri_transport_aws_eventstream import AwsEventStreamClient
|
|
15
|
+
|
|
16
|
+
from .NovaSonicConfigMapper import NovaSonicConfigMapper
|
|
17
|
+
from .NovaSonicLiveSession import NovaSonicLiveSession
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@ComponentBase.register_type(LiveModelBase, "NovaSonicLiveModel")
|
|
21
|
+
class NovaSonicLiveModel(LiveModelBase):
|
|
22
|
+
name: str = "amazon.nova-sonic-v1:0"
|
|
23
|
+
provider: AmazonNovaProvider = Field(default_factory=AmazonNovaProvider)
|
|
24
|
+
transport: IBidirectionalStreamClient = Field(
|
|
25
|
+
default_factory=AwsEventStreamClient, exclude=True
|
|
26
|
+
)
|
|
27
|
+
capabilities: LiveCapabilitiesBase = Field(
|
|
28
|
+
default_factory=lambda: LiveCapabilitiesBase(
|
|
29
|
+
input_modalities=frozenset({"text", "audio"}),
|
|
30
|
+
output_modalities=frozenset({"text", "audio"}),
|
|
31
|
+
features=frozenset({"tools"}),
|
|
32
|
+
session_features=frozenset({"realtime", "bidirectional_http2"}),
|
|
33
|
+
)
|
|
34
|
+
)
|
|
35
|
+
type: Literal["NovaSonicLiveModel"] = "NovaSonicLiveModel"
|
|
36
|
+
model_config = ConfigDict(arbitrary_types_allowed=True, extra="allow")
|
|
37
|
+
|
|
38
|
+
async def aconnect(self, config: LiveConfigBase):
|
|
39
|
+
connection_config = self.provider.prepare_connection(
|
|
40
|
+
"live.connect", model=self.name
|
|
41
|
+
)
|
|
42
|
+
connection = await self.transport.aconnect(
|
|
43
|
+
connection_config.resolved_url(),
|
|
44
|
+
headers=connection_config.headers,
|
|
45
|
+
**connection_config.transport_options,
|
|
46
|
+
)
|
|
47
|
+
return await NovaSonicLiveSession.create(
|
|
48
|
+
connection, NovaSonicConfigMapper().map(self.name, config)
|
|
49
|
+
)
|
swarmauri_live_model_amazon_nova-0.1.0/swarmauri_live_model_amazon_nova/NovaSonicLiveSession.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
from contextlib import suppress
|
|
3
|
+
from typing import Literal
|
|
4
|
+
|
|
5
|
+
from pydantic import PrivateAttr
|
|
6
|
+
from swarmauri_base.live_models.events.SessionErrorEvent import (
|
|
7
|
+
SessionErrorEvent,
|
|
8
|
+
)
|
|
9
|
+
from swarmauri_base.live_models.LiveSessionBase import LiveSessionBase
|
|
10
|
+
from swarmauri_base.ComponentBase import ComponentBase
|
|
11
|
+
|
|
12
|
+
from .NovaSonicCodec import NovaSonicCodec
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@ComponentBase.register_type(LiveSessionBase, "NovaSonicLiveSession")
|
|
16
|
+
class NovaSonicLiveSession(LiveSessionBase):
|
|
17
|
+
type: Literal["NovaSonicLiveSession"] = "NovaSonicLiveSession"
|
|
18
|
+
_connection = PrivateAttr()
|
|
19
|
+
_codec = PrivateAttr(default_factory=NovaSonicCodec)
|
|
20
|
+
_receiver = PrivateAttr(default=None)
|
|
21
|
+
|
|
22
|
+
@classmethod
|
|
23
|
+
async def create(cls, connection, setup_events):
|
|
24
|
+
session = cls()
|
|
25
|
+
session._connection = connection
|
|
26
|
+
for event in setup_events:
|
|
27
|
+
await connection.asend(event)
|
|
28
|
+
session.mark_open()
|
|
29
|
+
session._receiver = asyncio.create_task(session._receive_loop())
|
|
30
|
+
return session
|
|
31
|
+
|
|
32
|
+
async def _receive_loop(self) -> None:
|
|
33
|
+
try:
|
|
34
|
+
async for data in self._connection.aiter_events():
|
|
35
|
+
for event in self._codec.decode(data):
|
|
36
|
+
await self.emit(event)
|
|
37
|
+
except asyncio.CancelledError:
|
|
38
|
+
raise
|
|
39
|
+
except Exception as exc:
|
|
40
|
+
await self.emit(SessionErrorEvent(message=str(exc)))
|
|
41
|
+
await self.fail(exc)
|
|
42
|
+
else:
|
|
43
|
+
await self.finish()
|
|
44
|
+
|
|
45
|
+
async def _asend_impl(self, input_data):
|
|
46
|
+
await self._connection.asend(self._codec.encode(input_data))
|
|
47
|
+
|
|
48
|
+
async def _aclose_impl(self):
|
|
49
|
+
if self._receiver and self._receiver is not asyncio.current_task():
|
|
50
|
+
self._receiver.cancel()
|
|
51
|
+
with suppress(asyncio.CancelledError):
|
|
52
|
+
await self._receiver
|
|
53
|
+
await self._connection.aclose()
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from .NovaSonicCodec import NovaSonicCodec
|
|
2
|
+
from .NovaSonicConfigMapper import NovaSonicConfigMapper
|
|
3
|
+
from .NovaSonicLiveModel import NovaSonicLiveModel
|
|
4
|
+
from .NovaSonicLiveSession import NovaSonicLiveSession
|
|
5
|
+
from .NovaSonicToolAdapter import NovaSonicToolAdapter
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
"NovaSonicCodec",
|
|
9
|
+
"NovaSonicConfigMapper",
|
|
10
|
+
"NovaSonicLiveModel",
|
|
11
|
+
"NovaSonicLiveSession",
|
|
12
|
+
"NovaSonicToolAdapter",
|
|
13
|
+
]
|