smallestai 2.2.0__tar.gz → 3.0.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.
Potentially problematic release.
This version of smallestai might be problematic. Click here for more details.
- {smallestai-2.2.0/smallestai.egg-info → smallestai-3.0.0}/PKG-INFO +194 -42
- {smallestai-2.2.0 → smallestai-3.0.0}/README.md +180 -38
- {smallestai-2.2.0 → smallestai-3.0.0}/pyproject.toml +14 -5
- smallestai-3.0.0/smallestai/__init__.py +95 -0
- smallestai-3.0.0/smallestai/atoms/__init__.py +182 -0
- smallestai-3.0.0/smallestai/atoms/api/__init__.py +12 -0
- smallestai-3.0.0/smallestai/atoms/api/agent_templates_api.py +573 -0
- smallestai-3.0.0/smallestai/atoms/api/agents_api.py +1465 -0
- smallestai-3.0.0/smallestai/atoms/api/calls_api.py +320 -0
- smallestai-3.0.0/smallestai/atoms/api/campaigns_api.py +1689 -0
- smallestai-3.0.0/smallestai/atoms/api/knowledge_base_api.py +2271 -0
- smallestai-3.0.0/smallestai/atoms/api/logs_api.py +305 -0
- smallestai-3.0.0/smallestai/atoms/api/organization_api.py +285 -0
- smallestai-3.0.0/smallestai/atoms/api/user_api.py +285 -0
- smallestai-3.0.0/smallestai/atoms/api_client.py +797 -0
- smallestai-3.0.0/smallestai/atoms/api_response.py +21 -0
- smallestai-3.0.0/smallestai/atoms/atoms_client.py +560 -0
- smallestai-3.0.0/smallestai/atoms/configuration.py +582 -0
- smallestai-3.0.0/smallestai/atoms/exceptions.py +216 -0
- smallestai-3.0.0/smallestai/atoms/models/__init__.py +72 -0
- smallestai-3.0.0/smallestai/atoms/models/agent_dto.py +130 -0
- smallestai-3.0.0/smallestai/atoms/models/agent_dto_language.py +91 -0
- smallestai-3.0.0/smallestai/atoms/models/agent_dto_synthesizer.py +99 -0
- smallestai-3.0.0/smallestai/atoms/models/agent_dto_synthesizer_voice_config.py +111 -0
- smallestai-3.0.0/smallestai/atoms/models/api_response.py +89 -0
- smallestai-3.0.0/smallestai/atoms/models/bad_request_error_response.py +89 -0
- smallestai-3.0.0/smallestai/atoms/models/create_agent_from_template200_response.py +89 -0
- smallestai-3.0.0/smallestai/atoms/models/create_agent_from_template_request.py +91 -0
- smallestai-3.0.0/smallestai/atoms/models/create_agent_request.py +113 -0
- smallestai-3.0.0/smallestai/atoms/models/create_agent_request_language.py +124 -0
- smallestai-3.0.0/smallestai/atoms/models/create_agent_request_language_synthesizer.py +110 -0
- smallestai-3.0.0/smallestai/atoms/models/create_agent_request_language_synthesizer_voice_config.py +137 -0
- smallestai-3.0.0/smallestai/atoms/models/create_campaign200_response.py +93 -0
- smallestai-3.0.0/smallestai/atoms/models/create_campaign200_response_data.py +106 -0
- smallestai-3.0.0/smallestai/atoms/models/create_campaign200_response_inner.py +106 -0
- smallestai-3.0.0/smallestai/atoms/models/create_campaign201_response.py +93 -0
- smallestai-3.0.0/smallestai/atoms/models/create_campaign201_response_data.py +104 -0
- smallestai-3.0.0/smallestai/atoms/models/create_campaign_request.py +93 -0
- smallestai-3.0.0/smallestai/atoms/models/create_knowledge_base201_response.py +89 -0
- smallestai-3.0.0/smallestai/atoms/models/create_knowledge_base_request.py +89 -0
- smallestai-3.0.0/smallestai/atoms/models/delete_agent200_response.py +87 -0
- smallestai-3.0.0/smallestai/atoms/models/get_agent_by_id200_response.py +93 -0
- smallestai-3.0.0/smallestai/atoms/models/get_agent_templates200_response.py +97 -0
- smallestai-3.0.0/smallestai/atoms/models/get_agent_templates200_response_data_inner.py +97 -0
- smallestai-3.0.0/smallestai/atoms/models/get_agents200_response.py +93 -0
- smallestai-3.0.0/smallestai/atoms/models/get_agents200_response_data.py +101 -0
- smallestai-3.0.0/smallestai/atoms/models/get_campaign_by_id200_response.py +93 -0
- smallestai-3.0.0/smallestai/atoms/models/get_campaign_by_id200_response_data.py +114 -0
- smallestai-3.0.0/smallestai/atoms/models/get_campaigns200_response.py +97 -0
- smallestai-3.0.0/smallestai/atoms/models/get_campaigns200_response_data_inner.py +118 -0
- smallestai-3.0.0/smallestai/atoms/models/get_campaigns200_response_data_inner_agent.py +89 -0
- smallestai-3.0.0/smallestai/atoms/models/get_campaigns200_response_data_inner_audience.py +89 -0
- smallestai-3.0.0/smallestai/atoms/models/get_campaigns_request.py +89 -0
- smallestai-3.0.0/smallestai/atoms/models/get_conversation200_response.py +93 -0
- smallestai-3.0.0/smallestai/atoms/models/get_conversation200_response_data.py +125 -0
- smallestai-3.0.0/smallestai/atoms/models/get_conversation_logs200_response.py +93 -0
- smallestai-3.0.0/smallestai/atoms/models/get_conversation_logs200_response_data.py +125 -0
- smallestai-3.0.0/smallestai/atoms/models/get_current_user200_response.py +93 -0
- smallestai-3.0.0/smallestai/atoms/models/get_current_user200_response_data.py +99 -0
- smallestai-3.0.0/smallestai/atoms/models/get_knowledge_base_by_id200_response.py +93 -0
- smallestai-3.0.0/smallestai/atoms/models/get_knowledge_base_items200_response.py +97 -0
- smallestai-3.0.0/smallestai/atoms/models/get_knowledge_bases200_response.py +97 -0
- smallestai-3.0.0/smallestai/atoms/models/get_organization200_response.py +93 -0
- smallestai-3.0.0/smallestai/atoms/models/get_organization200_response_data.py +105 -0
- smallestai-3.0.0/smallestai/atoms/models/get_organization200_response_data_members_inner.py +89 -0
- smallestai-3.0.0/smallestai/atoms/models/get_organization200_response_data_subscription.py +87 -0
- smallestai-3.0.0/smallestai/atoms/models/internal_server_error_response.py +89 -0
- smallestai-3.0.0/smallestai/atoms/models/knowledge_base_dto.py +93 -0
- smallestai-3.0.0/smallestai/atoms/models/knowledge_base_item_dto.py +124 -0
- smallestai-3.0.0/smallestai/atoms/models/start_outbound_call200_response.py +93 -0
- smallestai-3.0.0/smallestai/atoms/models/start_outbound_call200_response_data.py +87 -0
- smallestai-3.0.0/smallestai/atoms/models/start_outbound_call_request.py +89 -0
- smallestai-3.0.0/smallestai/atoms/models/unauthorized_error_reponse.py +89 -0
- smallestai-3.0.0/smallestai/atoms/models/update_agent200_response.py +89 -0
- smallestai-3.0.0/smallestai/atoms/models/update_agent_request.py +119 -0
- smallestai-3.0.0/smallestai/atoms/models/update_agent_request_language.py +99 -0
- smallestai-3.0.0/smallestai/atoms/models/update_agent_request_synthesizer.py +110 -0
- smallestai-3.0.0/smallestai/atoms/models/update_agent_request_synthesizer_voice_config.py +137 -0
- smallestai-3.0.0/smallestai/atoms/models/update_agent_request_synthesizer_voice_config_one_of.py +111 -0
- smallestai-3.0.0/smallestai/atoms/models/update_agent_request_synthesizer_voice_config_one_of1.py +99 -0
- smallestai-3.0.0/smallestai/atoms/models/upload_text_to_knowledge_base_request.py +89 -0
- smallestai-3.0.0/smallestai/atoms/py.typed +0 -0
- smallestai-3.0.0/smallestai/atoms/rest.py +258 -0
- smallestai-3.0.0/smallestai/waves/__init__.py +5 -0
- smallestai-2.2.0/smallest/async_tts.py → smallestai-3.0.0/smallestai/waves/async_waves_client.py +3 -3
- {smallestai-2.2.0/smallest → smallestai-3.0.0/smallestai/waves}/stream_tts.py +6 -6
- {smallestai-2.2.0/smallest → smallestai-3.0.0/smallestai/waves}/utils.py +2 -2
- smallestai-2.2.0/smallest/tts.py → smallestai-3.0.0/smallestai/waves/waves_client.py +3 -3
- {smallestai-2.2.0 → smallestai-3.0.0/smallestai.egg-info}/PKG-INFO +194 -42
- smallestai-3.0.0/smallestai.egg-info/SOURCES.txt +95 -0
- smallestai-3.0.0/smallestai.egg-info/requires.txt +21 -0
- smallestai-3.0.0/smallestai.egg-info/top_level.txt +1 -0
- smallestai-2.2.0/smallest/__init__.py +0 -5
- smallestai-2.2.0/smallestai.egg-info/SOURCES.txt +0 -18
- smallestai-2.2.0/smallestai.egg-info/requires.txt +0 -12
- smallestai-2.2.0/smallestai.egg-info/top_level.txt +0 -1
- smallestai-2.2.0/tests/test_async.py +0 -105
- smallestai-2.2.0/tests/test_sync.py +0 -98
- smallestai-2.2.0/tests/test_utils.py +0 -47
- {smallestai-2.2.0 → smallestai-3.0.0}/LICENSE +0 -0
- {smallestai-2.2.0 → smallestai-3.0.0}/setup.cfg +0 -0
- {smallestai-2.2.0/smallest → smallestai-3.0.0/smallestai/waves}/exceptions.py +0 -0
- {smallestai-2.2.0/smallest → smallestai-3.0.0/smallestai/waves}/models.py +0 -0
- {smallestai-2.2.0 → smallestai-3.0.0}/smallestai.egg-info/dependency_links.txt +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: smallestai
|
|
3
|
-
Version:
|
|
3
|
+
Version: 3.0.0
|
|
4
4
|
Summary: Official Python client for the Smallest AI API
|
|
5
5
|
Author-email: Smallest <support@smallest.ai>
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/smallest-inc/smallest-python-sdk
|
|
8
|
-
Keywords: smallest,smallest.ai,tts,text-to-speech
|
|
8
|
+
Keywords: smallest,smallest.ai,tts,text-to-speech,waves,atoms
|
|
9
9
|
Classifier: Intended Audience :: Developers
|
|
10
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -16,13 +16,23 @@ Requires-Dist: aiohttp
|
|
|
16
16
|
Requires-Dist: aiofiles
|
|
17
17
|
Requires-Dist: requests
|
|
18
18
|
Requires-Dist: pydub
|
|
19
|
+
Requires-Dist: urllib3<3.0.0,>=1.25.3
|
|
20
|
+
Requires-Dist: python-dateutil>=2.8.2
|
|
21
|
+
Requires-Dist: pydantic>=2
|
|
22
|
+
Requires-Dist: typing-extensions>=4.7.1
|
|
19
23
|
Provides-Extra: test
|
|
20
24
|
Requires-Dist: jiwer; extra == "test"
|
|
21
25
|
Requires-Dist: httpx; extra == "test"
|
|
22
|
-
Requires-Dist: pytest; extra == "test"
|
|
26
|
+
Requires-Dist: pytest>=7.2.1; extra == "test"
|
|
23
27
|
Requires-Dist: pytest-asyncio; extra == "test"
|
|
24
28
|
Requires-Dist: deepgram-sdk; extra == "test"
|
|
25
29
|
Requires-Dist: python-dotenv; extra == "test"
|
|
30
|
+
Requires-Dist: pytest-cov>=2.8.1; extra == "test"
|
|
31
|
+
Requires-Dist: tox>=3.9.0; extra == "test"
|
|
32
|
+
Requires-Dist: flake8>=4.0.0; extra == "test"
|
|
33
|
+
Requires-Dist: types-python-dateutil>=2.8.19.14; extra == "test"
|
|
34
|
+
Requires-Dist: mypy>=1.5; extra == "test"
|
|
35
|
+
Dynamic: license-file
|
|
26
36
|
|
|
27
37
|

|
|
28
38
|
|
|
@@ -30,7 +40,6 @@ Requires-Dist: python-dotenv; extra == "test"
|
|
|
30
40
|
<div align="center">
|
|
31
41
|
<a href="https://twitter.com/smallest_AI">
|
|
32
42
|
<img src="https://img.shields.io/twitter/url/https/twitter.com/smallest_AI.svg?style=social&label=Follow%20smallest_AI" alt="Twitter">
|
|
33
|
-
</a>
|
|
34
43
|
<a href="https://discord.gg/ywShEyXHBW">
|
|
35
44
|
<img src="https://dcbadge.vercel.app/api/server/ywShEyXHBW?style=flat" alt="Discord">
|
|
36
45
|
</a>
|
|
@@ -46,25 +55,30 @@ Requires-Dist: python-dotenv; extra == "test"
|
|
|
46
55
|
|
|
47
56
|
Smallest AI builds high-speed multi-lingual voice models tailored for real-time applications, achieving ultra-realistic audio generation in as fast as ~100 milliseconds for 10 seconds of audio. With this sdk, you can easily convert text into high-quality audio with humanlike expressiveness.
|
|
48
57
|
|
|
49
|
-
Currently, the
|
|
58
|
+
Currently, the WavesClient supports direct synthesis and the ability to synthesize streamed LLM output, both synchronously and asynchronously.
|
|
50
59
|
|
|
51
60
|
## Table of Contents
|
|
52
61
|
|
|
53
62
|
- [Installation](#installation)
|
|
54
63
|
- [Get the API Key](#get-the-api-key)
|
|
55
|
-
- [
|
|
56
|
-
- [
|
|
57
|
-
- [
|
|
58
|
-
- [
|
|
59
|
-
|
|
60
|
-
- [
|
|
61
|
-
|
|
62
|
-
- [
|
|
63
|
-
|
|
64
|
-
- [
|
|
65
|
-
- [
|
|
66
|
-
- [
|
|
67
|
-
- [
|
|
64
|
+
- [Atoms Documentation](#atoms-documentation)
|
|
65
|
+
- [Getting Started](#getting-started)
|
|
66
|
+
- [Documentation for API Endpoints](#documentation-for-api-endpoints)
|
|
67
|
+
- [Documentation For Models](#documentation-for-models)
|
|
68
|
+
- [Waves Documentation](#waves-documentation)
|
|
69
|
+
- [Best Practices for Input Text](#best-practices-for-input-text)
|
|
70
|
+
- [Examples](#examples)
|
|
71
|
+
- [Synchronous](#synchronous)
|
|
72
|
+
- [Asynchronous](#asynchronous)
|
|
73
|
+
- [LLM to Speech](#llm-to-speech)
|
|
74
|
+
- [Add your Voice](#add-your-voice)
|
|
75
|
+
- [Synchronously](#add-synchronously)
|
|
76
|
+
- [Asynchronously](#add-asynchronously)
|
|
77
|
+
- [Delete your Voice](#delete-your-voice)
|
|
78
|
+
- [Synchronously](#delete-synchronously)
|
|
79
|
+
- [Asynchronously](#delete-asynchronously)
|
|
80
|
+
- [Available Methods](#available-methods)
|
|
81
|
+
- [Technical Note: WAV Headers in Streaming Audio](#technical-note-wav-headers-in-streaming-audio)
|
|
68
82
|
|
|
69
83
|
## Installation
|
|
70
84
|
|
|
@@ -77,24 +91,162 @@ When using an SDK in your application, make sure to pin to at least the major ve
|
|
|
77
91
|
|
|
78
92
|
## Get the API Key
|
|
79
93
|
|
|
80
|
-
1. Visit [
|
|
81
|
-
2. Navigate to `API
|
|
94
|
+
1. Visit [console.smallest.ai](https://console.smallest.ai//) and sign up for an account or log in if you already have an account.
|
|
95
|
+
2. Navigate to `API Keys` tab in your account dashboard.
|
|
82
96
|
3. Create a new API Key and copy it.
|
|
83
97
|
4. Export the API Key in your environment with the name `SMALLEST_API_KEY`, ensuring that your application can access it securely for authentication.
|
|
84
98
|
|
|
85
99
|
|
|
86
|
-
##
|
|
100
|
+
## Atoms Documentation
|
|
101
|
+
|
|
102
|
+
### Getting Started
|
|
103
|
+
|
|
104
|
+
Please follow the [installation procedure](#installation--usage) and then run the following:
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
import smallestai.atoms
|
|
108
|
+
from smallestai.atoms.rest import ApiException
|
|
109
|
+
from pprint import pprint
|
|
110
|
+
|
|
111
|
+
# Defining the host is optional and defaults to https://atoms-api.smallest.ai/api/v1
|
|
112
|
+
# See configuration.py for a list of all supported configuration parameters.
|
|
113
|
+
configuration = atoms.Configuration(
|
|
114
|
+
host = "https://atoms-api.smallest.ai/api/v1"
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
# The client must configure the authentication and authorization parameters
|
|
118
|
+
# in accordance with the API server security policy.
|
|
119
|
+
# Examples for each auth method are provided below, use the example that
|
|
120
|
+
# satisfies your auth use case.
|
|
121
|
+
|
|
122
|
+
# Configure Bearer authorization (JWT): BearerAuth
|
|
123
|
+
configuration = atoms.Configuration(
|
|
124
|
+
access_token = os.environ["BEARER_TOKEN"]
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
# Enter a context with an instance of the API client
|
|
128
|
+
with atoms.ApiClient(configuration) as api_client:
|
|
129
|
+
# Create an instance of the API class
|
|
130
|
+
api_instance = atoms.AgentTemplatesApi(api_client)
|
|
131
|
+
create_agent_from_template_request = atoms.CreateAgentFromTemplateRequest()
|
|
132
|
+
|
|
133
|
+
try:
|
|
134
|
+
# Create agent from template
|
|
135
|
+
api_response = api_instance.create_agent_from_template(create_agent_from_template_request)
|
|
136
|
+
print("The response of AgentTemplatesApi->create_agent_from_template:\n")
|
|
137
|
+
pprint(api_response)
|
|
138
|
+
except ApiException as e:
|
|
139
|
+
print("Exception when calling AgentTemplatesApi->create_agent_from_template: %s\n" % e)
|
|
140
|
+
```
|
|
87
141
|
|
|
88
|
-
###
|
|
142
|
+
### Documentation for API Endpoints
|
|
143
|
+
|
|
144
|
+
All URIs are relative to *https://atoms-api.smallest.ai/api/v1*
|
|
145
|
+
|
|
146
|
+
Class | Method | HTTP request | Description
|
|
147
|
+
------------ | ------------- | ------------- | -------------
|
|
148
|
+
*AgentTemplatesApi* | [**create_agent_from_template**](docs/atoms/AgentTemplatesApi.md#create_agent_from_template) | **POST** /agent/from-template | Create agent from template
|
|
149
|
+
*AgentTemplatesApi* | [**get_agent_templates**](docs/atoms/AgentTemplatesApi.md#get_agent_templates) | **GET** /agent/template | Get agent templates
|
|
150
|
+
*AgentsApi* | [**create_agent**](docs/atoms/AgentsApi.md#create_agent) | **POST** /agent | Create a new agent
|
|
151
|
+
*AgentsApi* | [**delete_agent**](docs/atoms/AgentsApi.md#delete_agent) | **DELETE** /agent/{id} | Delete an agent
|
|
152
|
+
*AgentsApi* | [**get_agent_by_id**](docs/atoms/AgentsApi.md#get_agent_by_id) | **GET** /agent/{id} | Get agent by ID
|
|
153
|
+
*AgentsApi* | [**get_agents**](docs/atoms/AgentsApi.md#get_agents) | **GET** /agent | Get all agents
|
|
154
|
+
*AgentsApi* | [**update_agent**](docs/atoms/AgentsApi.md#update_agent) | **PATCH** /agent/{id} | Update an agent
|
|
155
|
+
*CallsApi* | [**start_outbound_call**](docs/atoms/CallsApi.md#start_outbound_call) | **POST** /conversation/outbound | Start an outbound call
|
|
156
|
+
*CampaignsApi* | [**create_campaign**](docs/atoms/CampaignsApi.md#create_campaign) | **POST** /campaign | Create a campaign
|
|
157
|
+
*CampaignsApi* | [**delete_campaign**](docs/atoms/CampaignsApi.md#delete_campaign) | **DELETE** /campaign/{id} | Delete a campaign
|
|
158
|
+
*CampaignsApi* | [**get_campaign_by_id**](docs/atoms/CampaignsApi.md#get_campaign_by_id) | **GET** /campaign/{id} | Get a campaign
|
|
159
|
+
*CampaignsApi* | [**get_campaigns**](docs/atoms/CampaignsApi.md#get_campaigns) | **GET** /campaign | Retrieve all campaigns
|
|
160
|
+
*CampaignsApi* | [**pause_campaign**](docs/atoms/CampaignsApi.md#pause_campaign) | **POST** /campaign/{id}/pause | Pause a campaign
|
|
161
|
+
*CampaignsApi* | [**start_campaign**](docs/atoms/CampaignsApi.md#start_campaign) | **POST** /campaign/{id}/start | Start a campaign
|
|
162
|
+
*KnowledgeBaseApi* | [**create_knowledge_base**](docs/atoms/KnowledgeBaseApi.md#create_knowledge_base) | **POST** /knowledgebase | Create a knowledge base
|
|
163
|
+
*KnowledgeBaseApi* | [**delete_knowledge_base**](docs/atoms/KnowledgeBaseApi.md#delete_knowledge_base) | **DELETE** /knowledgebase/{id} | Delete a knowledge base
|
|
164
|
+
*KnowledgeBaseApi* | [**delete_knowledge_base_item**](docs/atoms/KnowledgeBaseApi.md#delete_knowledge_base_item) | **DELETE** /knowledgebase/{knowledgeBaseId}/items/{knowledgeBaseItemId} | Delete a knowledge base item
|
|
165
|
+
*KnowledgeBaseApi* | [**get_knowledge_base_by_id**](docs/atoms/KnowledgeBaseApi.md#get_knowledge_base_by_id) | **GET** /knowledgebase/{id} | Get a knowledge base
|
|
166
|
+
*KnowledgeBaseApi* | [**get_knowledge_base_items**](docs/atoms/KnowledgeBaseApi.md#get_knowledge_base_items) | **GET** /knowledgebase/{id}/items | Get all knowledge base items
|
|
167
|
+
*KnowledgeBaseApi* | [**get_knowledge_bases**](docs/atoms/KnowledgeBaseApi.md#get_knowledge_bases) | **GET** /knowledgebase | Get all knowledge bases
|
|
168
|
+
*KnowledgeBaseApi* | [**upload_media_to_knowledge_base**](docs/atoms/KnowledgeBaseApi.md#upload_media_to_knowledge_base) | **POST** /knowledgebase/{id}/items/upload-media | Upload a media to a knowledge base
|
|
169
|
+
*KnowledgeBaseApi* | [**upload_text_to_knowledge_base**](docs/atoms/KnowledgeBaseApi.md#upload_text_to_knowledge_base) | **POST** /knowledgebase/{id}/items/upload-text | Upload a text to a knowledge base
|
|
170
|
+
*LogsApi* | [**get_conversation_logs**](docs/atoms/LogsApi.md#get_conversation_logs) | **GET** /conversation/{id} | Get conversation logs
|
|
171
|
+
*OrganizationApi* | [**get_organization**](docs/atoms/OrganizationApi.md#get_organization) | **GET** /organization | Get organization details
|
|
172
|
+
*UserApi* | [**get_current_user**](docs/atoms/UserApi.md#get_current_user) | **GET** /user | Get user details
|
|
173
|
+
|
|
174
|
+
### Documentation For Models
|
|
175
|
+
|
|
176
|
+
- [AgentDTO](docs/atoms/AgentDTO.md)
|
|
177
|
+
- [AgentDTOLanguage](docs/atoms/AgentDTOLanguage.md)
|
|
178
|
+
- [AgentDTOSynthesizer](docs/atoms/AgentDTOSynthesizer.md)
|
|
179
|
+
- [AgentDTOSynthesizerVoiceConfig](docs/atoms/AgentDTOSynthesizerVoiceConfig.md)
|
|
180
|
+
- [ApiResponse](docs/atoms/ApiResponse.md)
|
|
181
|
+
- [BadRequestErrorResponse](docs/atoms/BadRequestErrorResponse.md)
|
|
182
|
+
- [CreateAgentFromTemplate200Response](docs/atoms/CreateAgentFromTemplate200Response.md)
|
|
183
|
+
- [CreateAgentFromTemplateRequest](docs/atoms/CreateAgentFromTemplateRequest.md)
|
|
184
|
+
- [CreateAgentRequest](docs/atoms/CreateAgentRequest.md)
|
|
185
|
+
- [CreateAgentRequestLanguage](docs/atoms/CreateAgentRequestLanguage.md)
|
|
186
|
+
- [CreateAgentRequestLanguageSynthesizer](docs/atoms/CreateAgentRequestLanguageSynthesizer.md)
|
|
187
|
+
- [CreateAgentRequestLanguageSynthesizerVoiceConfig](docs/atoms/CreateAgentRequestLanguageSynthesizerVoiceConfig.md)
|
|
188
|
+
- [CreateCampaign201Response](docs/atoms/CreateCampaign201Response.md)
|
|
189
|
+
- [CreateCampaign201ResponseData](docs/atoms/CreateCampaign201ResponseData.md)
|
|
190
|
+
- [CreateCampaignRequest](docs/atoms/CreateCampaignRequest.md)
|
|
191
|
+
- [CreateKnowledgeBase201Response](docs/atoms/CreateKnowledgeBase201Response.md)
|
|
192
|
+
- [CreateKnowledgeBaseRequest](docs/atoms/CreateKnowledgeBaseRequest.md)
|
|
193
|
+
- [DeleteAgent200Response](docs/atoms/DeleteAgent200Response.md)
|
|
194
|
+
- [GetAgentById200Response](docs/atoms/GetAgentById200Response.md)
|
|
195
|
+
- [GetAgentTemplates200Response](docs/atoms/GetAgentTemplates200Response.md)
|
|
196
|
+
- [GetAgentTemplates200ResponseDataInner](docs/atoms/GetAgentTemplates200ResponseDataInner.md)
|
|
197
|
+
- [GetAgents200Response](docs/atoms/GetAgents200Response.md)
|
|
198
|
+
- [GetAgents200ResponseData](docs/atoms/GetAgents200ResponseData.md)
|
|
199
|
+
- [GetCampaignById200Response](docs/atoms/GetCampaignById200Response.md)
|
|
200
|
+
- [GetCampaignById200ResponseData](docs/atoms/GetCampaignById200ResponseData.md)
|
|
201
|
+
- [GetCampaigns200Response](docs/atoms/GetCampaigns200Response.md)
|
|
202
|
+
- [GetCampaigns200ResponseDataInner](docs/atoms/GetCampaigns200ResponseDataInner.md)
|
|
203
|
+
- [GetCampaigns200ResponseDataInnerAgent](docs/atoms/GetCampaigns200ResponseDataInnerAgent.md)
|
|
204
|
+
- [GetCampaigns200ResponseDataInnerAudience](docs/atoms/GetCampaigns200ResponseDataInnerAudience.md)
|
|
205
|
+
- [GetCampaignsRequest](docs/atoms/GetCampaignsRequest.md)
|
|
206
|
+
- [GetConversationLogs200Response](docs/atoms/GetConversationLogs200Response.md)
|
|
207
|
+
- [GetConversationLogs200ResponseData](docs/atoms/GetConversationLogs200ResponseData.md)
|
|
208
|
+
- [GetCurrentUser200Response](docs/atoms/GetCurrentUser200Response.md)
|
|
209
|
+
- [GetCurrentUser200ResponseData](docs/atoms/GetCurrentUser200ResponseData.md)
|
|
210
|
+
- [GetKnowledgeBaseById200Response](docs/atoms/GetKnowledgeBaseById200Response.md)
|
|
211
|
+
- [GetKnowledgeBaseItems200Response](docs/atoms/GetKnowledgeBaseItems200Response.md)
|
|
212
|
+
- [GetKnowledgeBases200Response](docs/atoms/GetKnowledgeBases200Response.md)
|
|
213
|
+
- [GetOrganization200Response](docs/atoms/GetOrganization200Response.md)
|
|
214
|
+
- [GetOrganization200ResponseData](docs/atoms/GetOrganization200ResponseData.md)
|
|
215
|
+
- [GetOrganization200ResponseDataMembersInner](docs/atoms/GetOrganization200ResponseDataMembersInner.md)
|
|
216
|
+
- [GetOrganization200ResponseDataSubscription](docs/atoms/GetOrganization200ResponseDataSubscription.md)
|
|
217
|
+
- [InternalServerErrorResponse](docs/atoms/InternalServerErrorResponse.md)
|
|
218
|
+
- [KnowledgeBaseDTO](docs/atoms/KnowledgeBaseDTO.md)
|
|
219
|
+
- [KnowledgeBaseItemDTO](docs/atoms/KnowledgeBaseItemDTO.md)
|
|
220
|
+
- [StartOutboundCall200Response](docs/atoms/StartOutboundCall200Response.md)
|
|
221
|
+
- [StartOutboundCall200ResponseData](docs/atoms/StartOutboundCall200ResponseData.md)
|
|
222
|
+
- [StartOutboundCallRequest](docs/atoms/StartOutboundCallRequest.md)
|
|
223
|
+
- [UnauthorizedErrorReponse](docs/atoms/UnauthorizedErrorReponse.md)
|
|
224
|
+
- [UpdateAgent200Response](docs/atoms/UpdateAgent200Response.md)
|
|
225
|
+
- [UpdateAgentRequest](docs/atoms/UpdateAgentRequest.md)
|
|
226
|
+
- [UpdateAgentRequestLanguage](docs/atoms/UpdateAgentRequestLanguage.md)
|
|
227
|
+
- [UpdateAgentRequestSynthesizer](docs/atoms/UpdateAgentRequestSynthesizer.md)
|
|
228
|
+
- [UpdateAgentRequestSynthesizerVoiceConfig](docs/atoms/UpdateAgentRequestSynthesizerVoiceConfig.md)
|
|
229
|
+
- [UpdateAgentRequestSynthesizerVoiceConfigOneOf](docs/atoms/UpdateAgentRequestSynthesizerVoiceConfigOneOf.md)
|
|
230
|
+
- [UpdateAgentRequestSynthesizerVoiceConfigOneOf1](docs/atoms/UpdateAgentRequestSynthesizerVoiceConfigOneOf1.md)
|
|
231
|
+
- [UploadTextToKnowledgeBaseRequest](docs/atoms/UploadTextToKnowledgeBaseRequest.md)
|
|
232
|
+
|
|
233
|
+
## Waves Documentation
|
|
234
|
+
|
|
235
|
+
### Best Practices for Input Text
|
|
236
|
+
|
|
237
|
+
### Examples
|
|
238
|
+
|
|
239
|
+
#### Synchronous
|
|
89
240
|
A synchronous text-to-speech synthesis client.
|
|
90
241
|
|
|
91
242
|
**Basic Usage:**
|
|
92
243
|
```python
|
|
93
|
-
|
|
244
|
+
|
|
245
|
+
from smallestai.waves import WavesClient
|
|
94
246
|
|
|
95
247
|
def main():
|
|
96
|
-
|
|
97
|
-
|
|
248
|
+
waves_client = WavesClient(api_key="SMALLEST_API_KEY")
|
|
249
|
+
waves_client.synthesize(
|
|
98
250
|
text="Hello, this is a test for sync synthesis function.",
|
|
99
251
|
save_as="sync_synthesize.wav"
|
|
100
252
|
)
|
|
@@ -127,17 +279,17 @@ client.synthesize(
|
|
|
127
279
|
```
|
|
128
280
|
|
|
129
281
|
|
|
130
|
-
|
|
282
|
+
#### Asynchronous
|
|
131
283
|
Asynchronous text-to-speech synthesis client.
|
|
132
284
|
|
|
133
285
|
**Basic Usage:**
|
|
134
286
|
```python
|
|
135
287
|
import asyncio
|
|
136
288
|
import aiofiles
|
|
137
|
-
|
|
289
|
+
import smallestai
|
|
138
290
|
|
|
139
291
|
async def main():
|
|
140
|
-
client =
|
|
292
|
+
client = smallestai.waves.AsyncWavesClient(api_key="SMALLEST_API_KEY")
|
|
141
293
|
async with client as tts:
|
|
142
294
|
audio_bytes = await tts.synthesize("Hello, this is a test of the async synthesis function.")
|
|
143
295
|
async with aiofiles.open("async_synthesize.wav", "wb") as f:
|
|
@@ -186,11 +338,11 @@ audio_bytes = await tts.synthesize(
|
|
|
186
338
|
)
|
|
187
339
|
```
|
|
188
340
|
|
|
189
|
-
|
|
341
|
+
#### LLM to Speech
|
|
190
342
|
|
|
191
343
|
The `TextToAudioStream` class provides real-time text-to-speech processing, converting streaming text into audio output. It's particularly useful for applications like voice assistants, live captioning, or interactive chatbots that require immediate audio feedback from text generation. Supports both synchronous and asynchronous TTS instance.
|
|
192
344
|
|
|
193
|
-
|
|
345
|
+
##### Stream through a WebSocket
|
|
194
346
|
|
|
195
347
|
```python
|
|
196
348
|
import asyncio
|
|
@@ -241,7 +393,7 @@ if __name__ == "__main__":
|
|
|
241
393
|
asyncio.run(main())
|
|
242
394
|
```
|
|
243
395
|
|
|
244
|
-
|
|
396
|
+
##### Save to a File
|
|
245
397
|
```python
|
|
246
398
|
import wave
|
|
247
399
|
import asyncio
|
|
@@ -306,10 +458,10 @@ The processor yields raw audio data chunks without WAV headers for streaming eff
|
|
|
306
458
|
- Streamed over a network
|
|
307
459
|
- Further processed as needed
|
|
308
460
|
|
|
309
|
-
|
|
461
|
+
#### Add your Voice
|
|
310
462
|
The Smallest AI SDK allows you to clone your voice by uploading an audio file. This feature is available both synchronously and asynchronously, making it flexible for different use cases. Below are examples of how to use this functionality.
|
|
311
463
|
|
|
312
|
-
|
|
464
|
+
##### Add Synchronously
|
|
313
465
|
```python
|
|
314
466
|
from smallest import Smallest
|
|
315
467
|
|
|
@@ -322,7 +474,7 @@ if __name__ == "__main__":
|
|
|
322
474
|
main()
|
|
323
475
|
```
|
|
324
476
|
|
|
325
|
-
|
|
477
|
+
##### Add Asynchronously
|
|
326
478
|
```python
|
|
327
479
|
import asyncio
|
|
328
480
|
from smallest import AsyncSmallest
|
|
@@ -336,10 +488,10 @@ if __name__ == "__main__":
|
|
|
336
488
|
asyncio.run(main())
|
|
337
489
|
```
|
|
338
490
|
|
|
339
|
-
|
|
491
|
+
#### Delete your Voice
|
|
340
492
|
The Smallest AI SDK allows you to delete your cloned voice. This feature is available both synchronously and asynchronously, making it flexible for different use cases. Below are examples of how to use this functionality.
|
|
341
493
|
|
|
342
|
-
|
|
494
|
+
##### Delete Synchronously
|
|
343
495
|
```python
|
|
344
496
|
from smallest import Smallest
|
|
345
497
|
|
|
@@ -352,7 +504,7 @@ if __name__ == "__main__":
|
|
|
352
504
|
main()
|
|
353
505
|
```
|
|
354
506
|
|
|
355
|
-
|
|
507
|
+
##### Delete Asynchronously
|
|
356
508
|
```python
|
|
357
509
|
import asyncio
|
|
358
510
|
from smallest import AsyncSmallest
|
|
@@ -366,7 +518,7 @@ if __name__ == "__main__":
|
|
|
366
518
|
asyncio.run(main())
|
|
367
519
|
```
|
|
368
520
|
|
|
369
|
-
|
|
521
|
+
#### Available Methods
|
|
370
522
|
|
|
371
523
|
```python
|
|
372
524
|
from smallest import Smallest
|
|
@@ -379,18 +531,18 @@ print(f"Available Voices: {client.get_cloned_voices()}")
|
|
|
379
531
|
print(f"Available Models: {client.get_models()}")
|
|
380
532
|
```
|
|
381
533
|
|
|
382
|
-
|
|
534
|
+
#### Technical Note: WAV Headers in Streaming Audio
|
|
383
535
|
|
|
384
536
|
When implementing audio streaming with chunks of synthesized speech, WAV headers are omitted from individual chunks because:
|
|
385
537
|
|
|
386
|
-
|
|
538
|
+
##### Technical Issues
|
|
387
539
|
- Each WAV header contains metadata about the entire audio file.
|
|
388
540
|
- Multiple headers would make chunks appear as separate audio files and add redundancy.
|
|
389
541
|
- Headers contain file-specific data (like total size) that's invalid for chunks.
|
|
390
542
|
- Sequential playback of chunks with headers causes audio artifacts (pop sounds) when concatenating or playing audio sequentially.
|
|
391
543
|
- Audio players would try to reinitialize audio settings for each chunk.
|
|
392
544
|
|
|
393
|
-
|
|
545
|
+
##### Best Practices for Audio Streaming
|
|
394
546
|
1. Stream raw PCM audio data without headers
|
|
395
547
|
2. Add a single WAV header only when:
|
|
396
548
|
- Saving the complete stream to a file
|