smallestai 3.0.0__tar.gz → 3.0.2__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-3.0.0/smallestai.egg-info → smallestai-3.0.2}/PKG-INFO +120 -133
- {smallestai-3.0.0 → smallestai-3.0.2}/README.md +119 -133
- {smallestai-3.0.0 → smallestai-3.0.2}/pyproject.toml +3 -2
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/agent_dto.py +2 -2
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/create_agent_request.py +4 -4
- smallestai-3.0.0/smallestai/atoms/models/create_campaign200_response_inner.py → smallestai-3.0.2/smallestai/atoms/models/get_campaign_by_id200_response_data.py +11 -7
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/update_agent_request.py +4 -4
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/waves/utils.py +1 -1
- {smallestai-3.0.0 → smallestai-3.0.2/smallestai.egg-info}/PKG-INFO +120 -133
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai.egg-info/SOURCES.txt +0 -5
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai.egg-info/requires.txt +3 -0
- smallestai-3.0.0/smallestai/atoms/models/create_campaign200_response.py +0 -93
- smallestai-3.0.0/smallestai/atoms/models/create_campaign200_response_data.py +0 -106
- smallestai-3.0.0/smallestai/atoms/models/get_campaign_by_id200_response_data.py +0 -114
- smallestai-3.0.0/smallestai/atoms/models/get_conversation200_response.py +0 -93
- smallestai-3.0.0/smallestai/atoms/models/get_conversation200_response_data.py +0 -125
- {smallestai-3.0.0 → smallestai-3.0.2}/LICENSE +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/setup.cfg +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/__init__.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/__init__.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/api/__init__.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/api/agent_templates_api.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/api/agents_api.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/api/calls_api.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/api/campaigns_api.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/api/knowledge_base_api.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/api/logs_api.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/api/organization_api.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/api/user_api.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/api_client.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/api_response.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/atoms_client.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/configuration.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/exceptions.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/__init__.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/agent_dto_language.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/agent_dto_synthesizer.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/agent_dto_synthesizer_voice_config.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/api_response.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/bad_request_error_response.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/create_agent_from_template200_response.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/create_agent_from_template_request.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/create_agent_request_language.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/create_agent_request_language_synthesizer.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/create_agent_request_language_synthesizer_voice_config.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/create_campaign201_response.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/create_campaign201_response_data.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/create_campaign_request.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/create_knowledge_base201_response.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/create_knowledge_base_request.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/delete_agent200_response.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_agent_by_id200_response.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_agent_templates200_response.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_agent_templates200_response_data_inner.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_agents200_response.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_agents200_response_data.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_campaign_by_id200_response.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_campaigns200_response.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_campaigns200_response_data_inner.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_campaigns200_response_data_inner_agent.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_campaigns200_response_data_inner_audience.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_campaigns_request.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_conversation_logs200_response.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_conversation_logs200_response_data.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_current_user200_response.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_current_user200_response_data.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_knowledge_base_by_id200_response.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_knowledge_base_items200_response.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_knowledge_bases200_response.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_organization200_response.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_organization200_response_data.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_organization200_response_data_members_inner.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/get_organization200_response_data_subscription.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/internal_server_error_response.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/knowledge_base_dto.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/knowledge_base_item_dto.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/start_outbound_call200_response.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/start_outbound_call200_response_data.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/start_outbound_call_request.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/unauthorized_error_reponse.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/update_agent200_response.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/update_agent_request_language.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/update_agent_request_synthesizer.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/update_agent_request_synthesizer_voice_config.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/update_agent_request_synthesizer_voice_config_one_of.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/update_agent_request_synthesizer_voice_config_one_of1.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/models/upload_text_to_knowledge_base_request.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/py.typed +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/atoms/rest.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/waves/__init__.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/waves/async_waves_client.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/waves/exceptions.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/waves/models.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/waves/stream_tts.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai/waves/waves_client.py +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai.egg-info/dependency_links.txt +0 -0
- {smallestai-3.0.0 → smallestai-3.0.2}/smallestai.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: smallestai
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.2
|
|
4
4
|
Summary: Official Python client for the Smallest AI API
|
|
5
5
|
Author-email: Smallest <support@smallest.ai>
|
|
6
6
|
License: MIT
|
|
@@ -20,6 +20,7 @@ Requires-Dist: urllib3<3.0.0,>=1.25.3
|
|
|
20
20
|
Requires-Dist: python-dateutil>=2.8.2
|
|
21
21
|
Requires-Dist: pydantic>=2
|
|
22
22
|
Requires-Dist: typing-extensions>=4.7.1
|
|
23
|
+
Requires-Dist: audioop-lts; python_version >= "3.13"
|
|
23
24
|
Provides-Extra: test
|
|
24
25
|
Requires-Dist: jiwer; extra == "test"
|
|
25
26
|
Requires-Dist: httpx; extra == "test"
|
|
@@ -53,19 +54,23 @@ Dynamic: license-file
|
|
|
53
54
|
|
|
54
55
|
## Official Python Client for Smallest AI API
|
|
55
56
|
|
|
56
|
-
Smallest AI
|
|
57
|
+
Smallest AI offers an end to end Voice AI suite for developers trying to build real-time voice agents. You can either directly use our Text to Speech APIs through the Waves Client or use the Atoms Client to build and operate end to end enterprise ready Voice Agents.
|
|
57
58
|
|
|
58
|
-
Currently, the WavesClient supports direct synthesis and the ability to synthesize streamed LLM output, both synchronously and asynchronously.
|
|
59
|
+
With this sdk, you can easily interact with both Waves and Atoms from any Python 3.9+ application, by utilising WavesClient and AtomsClient classes respectively. Currently, the WavesClient supports direct synthesis and the ability to synthesize streamed LLM output, both synchronously and asynchronously. AtomsClient provides a simpler way of interacting with all our API's to develop and run agentic workflows.
|
|
60
|
+
|
|
61
|
+
To learn how to use our API's, check out our documentation for [Atoms](https://atoms-docs.smallest.ai/introduction) and [Waves](https://waves-docs.smallest.ai/content/introduction/)
|
|
59
62
|
|
|
60
63
|
## Table of Contents
|
|
61
64
|
|
|
62
65
|
- [Installation](#installation)
|
|
63
66
|
- [Get the API Key](#get-the-api-key)
|
|
64
|
-
- [Atoms
|
|
65
|
-
- [
|
|
66
|
-
- [
|
|
67
|
-
- [
|
|
68
|
-
- [
|
|
67
|
+
- [What are Atoms?](#what-are-atoms)
|
|
68
|
+
- [Creating your first Agent](#creating-your-first-agent)
|
|
69
|
+
- [Placing an outbound call](#placing-an-outbound-call)
|
|
70
|
+
- [Providing context to the agent](#providing-context-to-the-agent)
|
|
71
|
+
- [Configuring workflows to drive conversations](#configuring-workflows-to-drive-conversations)
|
|
72
|
+
- [Provisioning bulk calling using campaigns](#provisioning-bulk-calling-using-campaigns)
|
|
73
|
+
- [Getting started with Waves](#getting-started-with-waves)
|
|
69
74
|
- [Best Practices for Input Text](#best-practices-for-input-text)
|
|
70
75
|
- [Examples](#examples)
|
|
71
76
|
- [Synchronous](#synchronous)
|
|
@@ -97,140 +102,122 @@ When using an SDK in your application, make sure to pin to at least the major ve
|
|
|
97
102
|
4. Export the API Key in your environment with the name `SMALLEST_API_KEY`, ensuring that your application can access it securely for authentication.
|
|
98
103
|
|
|
99
104
|
|
|
100
|
-
## Atoms
|
|
105
|
+
## What are Atoms
|
|
106
|
+
|
|
107
|
+
Atoms are agents that can talk to anyone on voice or text in any language, in any voice. Imagine an AI that you can hire to perform end-to-end tasks for your business. The following examples give an overview of how AtomsClient leverages abstractions such as KnowledgeBase, Campaigns and graph-based Workflows to let you build the smartest voice agent for your usecase.
|
|
101
108
|
|
|
102
|
-
|
|
109
|
+
You can find the full reference for Atoms [here](./docs/atoms/Api.md).
|
|
103
110
|
|
|
104
|
-
|
|
111
|
+
### Creating your first Agent
|
|
105
112
|
|
|
106
113
|
```python
|
|
107
|
-
|
|
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
|
-
)
|
|
114
|
+
from smallestai.atoms import AtomsClient
|
|
116
115
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
#
|
|
116
|
+
TARGET_PHONE_NUMBER = "+919666666666"
|
|
117
|
+
|
|
118
|
+
def main():
|
|
119
|
+
# alternatively, you can export API Key as environment variable SMALLEST_API_KEY.
|
|
120
|
+
config = Configuration(
|
|
121
|
+
access_token = 'SMALLEST_API_KEY'
|
|
122
|
+
)
|
|
121
123
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
atoms_client = AtomsClient(config)
|
|
125
|
+
|
|
126
|
+
agent_id = atoms_client.create_agent(
|
|
127
|
+
create_agent_request={
|
|
128
|
+
"name": "Atoms Multi-Modal Agent",
|
|
129
|
+
"description": "My first atoms agent",
|
|
130
|
+
"language": {
|
|
131
|
+
"enabled": "en",
|
|
132
|
+
"switching": False
|
|
133
|
+
},
|
|
134
|
+
"synthesizer": {
|
|
135
|
+
"voiceConfig": {
|
|
136
|
+
"model": "waves_lightning_large",
|
|
137
|
+
"voiceId": "nyah"
|
|
138
|
+
},
|
|
139
|
+
"speed": 1.2,
|
|
140
|
+
"consistency": 0.5,
|
|
141
|
+
"similarity": 0,
|
|
142
|
+
"enhancement": 1
|
|
143
|
+
},
|
|
144
|
+
"slmModel": "electron-v1",
|
|
145
|
+
}
|
|
146
|
+
).data
|
|
147
|
+
|
|
148
|
+
print(f"Successfully created agent with id: {agent_id}")
|
|
126
149
|
|
|
127
|
-
|
|
128
|
-
|
|
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)
|
|
150
|
+
if __name__ == "__main__":
|
|
151
|
+
main()
|
|
140
152
|
```
|
|
141
153
|
|
|
142
|
-
###
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
*
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
- [
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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
|
|
154
|
+
### Placing an outbound call
|
|
155
|
+
|
|
156
|
+
```python
|
|
157
|
+
from smallestai.atoms import AtomsClient
|
|
158
|
+
from smallestai.atoms import Configuration
|
|
159
|
+
|
|
160
|
+
TARGET_PHONE_NUMBER = "+919666666666"
|
|
161
|
+
MY_AGENT_ID = "67e****ff*ec***82*3c9e**"
|
|
162
|
+
|
|
163
|
+
def main():
|
|
164
|
+
# assumes you have exported API_KEY in SMALLEST_API_KEY environment variable
|
|
165
|
+
atoms_client = AtomsClient()
|
|
166
|
+
|
|
167
|
+
call_response = atoms_client.start_outbound_call(
|
|
168
|
+
start_outbound_call_request={
|
|
169
|
+
"agent_id": MY_AGENT_ID,
|
|
170
|
+
"phone_number": TARGET_PHONE_NUMBER,
|
|
171
|
+
}
|
|
172
|
+
)
|
|
173
|
+
print(f"Successfully placed call with id: {call_response.conversation_id}")
|
|
174
|
+
|
|
175
|
+
if __name__ == "__main__":
|
|
176
|
+
main()
|
|
177
|
+
```
|
|
178
|
+
### Providing context to the agent
|
|
179
|
+
|
|
180
|
+
An agent can be attached to a knowledge base, which it can look up during conversations. Here is how you can do it:
|
|
181
|
+
|
|
182
|
+
```python
|
|
183
|
+
from smallestai.atoms import AtomsClient
|
|
184
|
+
|
|
185
|
+
def main():
|
|
186
|
+
# assumes you have exported API_KEY in SMALLEST_API_KEY environment variable
|
|
187
|
+
atoms_client = AtomsClient()
|
|
188
|
+
|
|
189
|
+
# Create a new knowledge base
|
|
190
|
+
knowledge_base = atoms_client.create_knowledge_base(
|
|
191
|
+
create_knowledge_base_request={
|
|
192
|
+
"name": "Customer Support Knowledge Base",
|
|
193
|
+
"description": "Contains FAQs and product information"
|
|
194
|
+
}
|
|
195
|
+
)
|
|
196
|
+
knowledge_base_id = knowledge_base.data
|
|
197
|
+
|
|
198
|
+
with open("product_manual.pdf", "rb") as f:
|
|
199
|
+
media_content = f.read()
|
|
200
|
+
media_response = atoms_client.upload_media_to_knowledge_base(
|
|
201
|
+
id=knowledge_base_id,
|
|
202
|
+
media=media_content
|
|
203
|
+
)
|
|
204
|
+
print("Added product_manual.pdf to knowledge base")
|
|
205
|
+
|
|
206
|
+
if __name__ == "__main__":
|
|
207
|
+
main()
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Configuring workflows to drive conversations
|
|
211
|
+
|
|
212
|
+
An agent can be configured with a graph-based workflow to help it drive meaningful conversations. You can explore making one on our [platform](https://atoms.smallest.ai/dashboard/agents). Refer to our [documentation](https://atoms-docs.smallest.ai/deep-dive/workflow/what-is-a-workflow) for learning more extensively.
|
|
213
|
+
|
|
214
|
+

|
|
215
|
+
|
|
216
|
+
### Provisioning bulk calling using campaigns
|
|
217
|
+
|
|
218
|
+
To manage bulk calls, you can use [Atoms platform](https://atoms.smallest.ai/dashboard/audience) to create [audience](https://atoms-docs.smallest.ai/deep-dive/audience/audience) (collection of contacts) and then configure [campaigns](https://atoms-docs.smallest.ai/deep-dive/campaign/campaign) to run.
|
|
219
|
+
|
|
220
|
+
## Getting started with Waves
|
|
234
221
|
|
|
235
222
|
### Best Practices for Input Text
|
|
236
223
|
|
|
@@ -17,19 +17,23 @@
|
|
|
17
17
|
|
|
18
18
|
## Official Python Client for Smallest AI API
|
|
19
19
|
|
|
20
|
-
Smallest AI
|
|
20
|
+
Smallest AI offers an end to end Voice AI suite for developers trying to build real-time voice agents. You can either directly use our Text to Speech APIs through the Waves Client or use the Atoms Client to build and operate end to end enterprise ready Voice Agents.
|
|
21
21
|
|
|
22
|
-
Currently, the WavesClient supports direct synthesis and the ability to synthesize streamed LLM output, both synchronously and asynchronously.
|
|
22
|
+
With this sdk, you can easily interact with both Waves and Atoms from any Python 3.9+ application, by utilising WavesClient and AtomsClient classes respectively. Currently, the WavesClient supports direct synthesis and the ability to synthesize streamed LLM output, both synchronously and asynchronously. AtomsClient provides a simpler way of interacting with all our API's to develop and run agentic workflows.
|
|
23
|
+
|
|
24
|
+
To learn how to use our API's, check out our documentation for [Atoms](https://atoms-docs.smallest.ai/introduction) and [Waves](https://waves-docs.smallest.ai/content/introduction/)
|
|
23
25
|
|
|
24
26
|
## Table of Contents
|
|
25
27
|
|
|
26
28
|
- [Installation](#installation)
|
|
27
29
|
- [Get the API Key](#get-the-api-key)
|
|
28
|
-
- [Atoms
|
|
29
|
-
- [
|
|
30
|
-
- [
|
|
31
|
-
- [
|
|
32
|
-
- [
|
|
30
|
+
- [What are Atoms?](#what-are-atoms)
|
|
31
|
+
- [Creating your first Agent](#creating-your-first-agent)
|
|
32
|
+
- [Placing an outbound call](#placing-an-outbound-call)
|
|
33
|
+
- [Providing context to the agent](#providing-context-to-the-agent)
|
|
34
|
+
- [Configuring workflows to drive conversations](#configuring-workflows-to-drive-conversations)
|
|
35
|
+
- [Provisioning bulk calling using campaigns](#provisioning-bulk-calling-using-campaigns)
|
|
36
|
+
- [Getting started with Waves](#getting-started-with-waves)
|
|
33
37
|
- [Best Practices for Input Text](#best-practices-for-input-text)
|
|
34
38
|
- [Examples](#examples)
|
|
35
39
|
- [Synchronous](#synchronous)
|
|
@@ -61,140 +65,122 @@ When using an SDK in your application, make sure to pin to at least the major ve
|
|
|
61
65
|
4. Export the API Key in your environment with the name `SMALLEST_API_KEY`, ensuring that your application can access it securely for authentication.
|
|
62
66
|
|
|
63
67
|
|
|
64
|
-
## Atoms
|
|
68
|
+
## What are Atoms
|
|
69
|
+
|
|
70
|
+
Atoms are agents that can talk to anyone on voice or text in any language, in any voice. Imagine an AI that you can hire to perform end-to-end tasks for your business. The following examples give an overview of how AtomsClient leverages abstractions such as KnowledgeBase, Campaigns and graph-based Workflows to let you build the smartest voice agent for your usecase.
|
|
65
71
|
|
|
66
|
-
|
|
72
|
+
You can find the full reference for Atoms [here](./docs/atoms/Api.md).
|
|
67
73
|
|
|
68
|
-
|
|
74
|
+
### Creating your first Agent
|
|
69
75
|
|
|
70
76
|
```python
|
|
71
|
-
|
|
72
|
-
from smallestai.atoms.rest import ApiException
|
|
73
|
-
from pprint import pprint
|
|
74
|
-
|
|
75
|
-
# Defining the host is optional and defaults to https://atoms-api.smallest.ai/api/v1
|
|
76
|
-
# See configuration.py for a list of all supported configuration parameters.
|
|
77
|
-
configuration = atoms.Configuration(
|
|
78
|
-
host = "https://atoms-api.smallest.ai/api/v1"
|
|
79
|
-
)
|
|
77
|
+
from smallestai.atoms import AtomsClient
|
|
80
78
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
#
|
|
79
|
+
TARGET_PHONE_NUMBER = "+919666666666"
|
|
80
|
+
|
|
81
|
+
def main():
|
|
82
|
+
# alternatively, you can export API Key as environment variable SMALLEST_API_KEY.
|
|
83
|
+
config = Configuration(
|
|
84
|
+
access_token = 'SMALLEST_API_KEY'
|
|
85
|
+
)
|
|
85
86
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
atoms_client = AtomsClient(config)
|
|
88
|
+
|
|
89
|
+
agent_id = atoms_client.create_agent(
|
|
90
|
+
create_agent_request={
|
|
91
|
+
"name": "Atoms Multi-Modal Agent",
|
|
92
|
+
"description": "My first atoms agent",
|
|
93
|
+
"language": {
|
|
94
|
+
"enabled": "en",
|
|
95
|
+
"switching": False
|
|
96
|
+
},
|
|
97
|
+
"synthesizer": {
|
|
98
|
+
"voiceConfig": {
|
|
99
|
+
"model": "waves_lightning_large",
|
|
100
|
+
"voiceId": "nyah"
|
|
101
|
+
},
|
|
102
|
+
"speed": 1.2,
|
|
103
|
+
"consistency": 0.5,
|
|
104
|
+
"similarity": 0,
|
|
105
|
+
"enhancement": 1
|
|
106
|
+
},
|
|
107
|
+
"slmModel": "electron-v1",
|
|
108
|
+
}
|
|
109
|
+
).data
|
|
110
|
+
|
|
111
|
+
print(f"Successfully created agent with id: {agent_id}")
|
|
90
112
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
# Create an instance of the API class
|
|
94
|
-
api_instance = atoms.AgentTemplatesApi(api_client)
|
|
95
|
-
create_agent_from_template_request = atoms.CreateAgentFromTemplateRequest()
|
|
96
|
-
|
|
97
|
-
try:
|
|
98
|
-
# Create agent from template
|
|
99
|
-
api_response = api_instance.create_agent_from_template(create_agent_from_template_request)
|
|
100
|
-
print("The response of AgentTemplatesApi->create_agent_from_template:\n")
|
|
101
|
-
pprint(api_response)
|
|
102
|
-
except ApiException as e:
|
|
103
|
-
print("Exception when calling AgentTemplatesApi->create_agent_from_template: %s\n" % e)
|
|
113
|
+
if __name__ == "__main__":
|
|
114
|
+
main()
|
|
104
115
|
```
|
|
105
116
|
|
|
106
|
-
###
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
*
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
- [
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
- [GetCurrentUser200ResponseData](docs/atoms/GetCurrentUser200ResponseData.md)
|
|
174
|
-
- [GetKnowledgeBaseById200Response](docs/atoms/GetKnowledgeBaseById200Response.md)
|
|
175
|
-
- [GetKnowledgeBaseItems200Response](docs/atoms/GetKnowledgeBaseItems200Response.md)
|
|
176
|
-
- [GetKnowledgeBases200Response](docs/atoms/GetKnowledgeBases200Response.md)
|
|
177
|
-
- [GetOrganization200Response](docs/atoms/GetOrganization200Response.md)
|
|
178
|
-
- [GetOrganization200ResponseData](docs/atoms/GetOrganization200ResponseData.md)
|
|
179
|
-
- [GetOrganization200ResponseDataMembersInner](docs/atoms/GetOrganization200ResponseDataMembersInner.md)
|
|
180
|
-
- [GetOrganization200ResponseDataSubscription](docs/atoms/GetOrganization200ResponseDataSubscription.md)
|
|
181
|
-
- [InternalServerErrorResponse](docs/atoms/InternalServerErrorResponse.md)
|
|
182
|
-
- [KnowledgeBaseDTO](docs/atoms/KnowledgeBaseDTO.md)
|
|
183
|
-
- [KnowledgeBaseItemDTO](docs/atoms/KnowledgeBaseItemDTO.md)
|
|
184
|
-
- [StartOutboundCall200Response](docs/atoms/StartOutboundCall200Response.md)
|
|
185
|
-
- [StartOutboundCall200ResponseData](docs/atoms/StartOutboundCall200ResponseData.md)
|
|
186
|
-
- [StartOutboundCallRequest](docs/atoms/StartOutboundCallRequest.md)
|
|
187
|
-
- [UnauthorizedErrorReponse](docs/atoms/UnauthorizedErrorReponse.md)
|
|
188
|
-
- [UpdateAgent200Response](docs/atoms/UpdateAgent200Response.md)
|
|
189
|
-
- [UpdateAgentRequest](docs/atoms/UpdateAgentRequest.md)
|
|
190
|
-
- [UpdateAgentRequestLanguage](docs/atoms/UpdateAgentRequestLanguage.md)
|
|
191
|
-
- [UpdateAgentRequestSynthesizer](docs/atoms/UpdateAgentRequestSynthesizer.md)
|
|
192
|
-
- [UpdateAgentRequestSynthesizerVoiceConfig](docs/atoms/UpdateAgentRequestSynthesizerVoiceConfig.md)
|
|
193
|
-
- [UpdateAgentRequestSynthesizerVoiceConfigOneOf](docs/atoms/UpdateAgentRequestSynthesizerVoiceConfigOneOf.md)
|
|
194
|
-
- [UpdateAgentRequestSynthesizerVoiceConfigOneOf1](docs/atoms/UpdateAgentRequestSynthesizerVoiceConfigOneOf1.md)
|
|
195
|
-
- [UploadTextToKnowledgeBaseRequest](docs/atoms/UploadTextToKnowledgeBaseRequest.md)
|
|
196
|
-
|
|
197
|
-
## Waves Documentation
|
|
117
|
+
### Placing an outbound call
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
from smallestai.atoms import AtomsClient
|
|
121
|
+
from smallestai.atoms import Configuration
|
|
122
|
+
|
|
123
|
+
TARGET_PHONE_NUMBER = "+919666666666"
|
|
124
|
+
MY_AGENT_ID = "67e****ff*ec***82*3c9e**"
|
|
125
|
+
|
|
126
|
+
def main():
|
|
127
|
+
# assumes you have exported API_KEY in SMALLEST_API_KEY environment variable
|
|
128
|
+
atoms_client = AtomsClient()
|
|
129
|
+
|
|
130
|
+
call_response = atoms_client.start_outbound_call(
|
|
131
|
+
start_outbound_call_request={
|
|
132
|
+
"agent_id": MY_AGENT_ID,
|
|
133
|
+
"phone_number": TARGET_PHONE_NUMBER,
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
print(f"Successfully placed call with id: {call_response.conversation_id}")
|
|
137
|
+
|
|
138
|
+
if __name__ == "__main__":
|
|
139
|
+
main()
|
|
140
|
+
```
|
|
141
|
+
### Providing context to the agent
|
|
142
|
+
|
|
143
|
+
An agent can be attached to a knowledge base, which it can look up during conversations. Here is how you can do it:
|
|
144
|
+
|
|
145
|
+
```python
|
|
146
|
+
from smallestai.atoms import AtomsClient
|
|
147
|
+
|
|
148
|
+
def main():
|
|
149
|
+
# assumes you have exported API_KEY in SMALLEST_API_KEY environment variable
|
|
150
|
+
atoms_client = AtomsClient()
|
|
151
|
+
|
|
152
|
+
# Create a new knowledge base
|
|
153
|
+
knowledge_base = atoms_client.create_knowledge_base(
|
|
154
|
+
create_knowledge_base_request={
|
|
155
|
+
"name": "Customer Support Knowledge Base",
|
|
156
|
+
"description": "Contains FAQs and product information"
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
knowledge_base_id = knowledge_base.data
|
|
160
|
+
|
|
161
|
+
with open("product_manual.pdf", "rb") as f:
|
|
162
|
+
media_content = f.read()
|
|
163
|
+
media_response = atoms_client.upload_media_to_knowledge_base(
|
|
164
|
+
id=knowledge_base_id,
|
|
165
|
+
media=media_content
|
|
166
|
+
)
|
|
167
|
+
print("Added product_manual.pdf to knowledge base")
|
|
168
|
+
|
|
169
|
+
if __name__ == "__main__":
|
|
170
|
+
main()
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Configuring workflows to drive conversations
|
|
174
|
+
|
|
175
|
+
An agent can be configured with a graph-based workflow to help it drive meaningful conversations. You can explore making one on our [platform](https://atoms.smallest.ai/dashboard/agents). Refer to our [documentation](https://atoms-docs.smallest.ai/deep-dive/workflow/what-is-a-workflow) for learning more extensively.
|
|
176
|
+
|
|
177
|
+

|
|
178
|
+
|
|
179
|
+
### Provisioning bulk calling using campaigns
|
|
180
|
+
|
|
181
|
+
To manage bulk calls, you can use [Atoms platform](https://atoms.smallest.ai/dashboard/audience) to create [audience](https://atoms-docs.smallest.ai/deep-dive/audience/audience) (collection of contacts) and then configure [campaigns](https://atoms-docs.smallest.ai/deep-dive/campaign/campaign) to run.
|
|
182
|
+
|
|
183
|
+
## Getting started with Waves
|
|
198
184
|
|
|
199
185
|
### Best Practices for Input Text
|
|
200
186
|
|
|
@@ -511,4 +497,4 @@ When implementing audio streaming with chunks of synthesized speech, WAV headers
|
|
|
511
497
|
2. Add a single WAV header only when:
|
|
512
498
|
- Saving the complete stream to a file
|
|
513
499
|
- Initializing the audio playback system
|
|
514
|
-
- Converting the stream to a standard audio format
|
|
500
|
+
- Converting the stream to a standard audio format
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "smallestai"
|
|
3
|
-
version = "3.0.
|
|
3
|
+
version = "3.0.2"
|
|
4
4
|
description = "Official Python client for the Smallest AI API"
|
|
5
5
|
authors = [
|
|
6
6
|
{name = "Smallest", email = "support@smallest.ai"},
|
|
@@ -22,7 +22,8 @@ dependencies = [
|
|
|
22
22
|
"urllib3 >= 1.25.3, < 3.0.0",
|
|
23
23
|
"python-dateutil >= 2.8.2",
|
|
24
24
|
"pydantic >= 2",
|
|
25
|
-
"typing-extensions >= 4.7.1"
|
|
25
|
+
"typing-extensions >= 4.7.1",
|
|
26
|
+
"audioop-lts; python_version >= '3.13'"
|
|
26
27
|
]
|
|
27
28
|
|
|
28
29
|
[project.optional-dependencies]
|
|
@@ -50,8 +50,8 @@ class AgentDTO(BaseModel):
|
|
|
50
50
|
if value is None:
|
|
51
51
|
return value
|
|
52
52
|
|
|
53
|
-
if value not in set(['
|
|
54
|
-
raise ValueError("must be one of enum values ('
|
|
53
|
+
if value not in set(['electron-v1', 'electron-v2', 'gpt-4o-mini']):
|
|
54
|
+
raise ValueError("must be one of enum values ('electron-v1', 'electron-v2', 'gpt-4o-mini')")
|
|
55
55
|
return value
|
|
56
56
|
|
|
57
57
|
model_config = ConfigDict(
|