superu 2025.11.7.1__tar.gz → 2026.2.5.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.
- superu-2026.2.5.2/PKG-INFO +522 -0
- superu-2026.2.5.2/README.md +490 -0
- {superu-2025.11.7.1 → superu-2026.2.5.2}/pyproject.toml +7 -3
- superu-2026.2.5.2/superu/__init__.py +1 -0
- superu-2026.2.5.2/superu/core.py +1383 -0
- superu-2026.2.5.2/superu/example.py +116 -0
- superu-2026.2.5.2/superu.egg-info/PKG-INFO +522 -0
- superu-2025.11.7.1/PKG-INFO +0 -303
- superu-2025.11.7.1/README.md +0 -271
- superu-2025.11.7.1/superu/__init__.py +0 -1
- superu-2025.11.7.1/superu/core.py +0 -518
- superu-2025.11.7.1/superu/example.py +0 -662
- superu-2025.11.7.1/superu.egg-info/PKG-INFO +0 -303
- {superu-2025.11.7.1 → superu-2026.2.5.2}/setup.cfg +0 -0
- {superu-2025.11.7.1 → superu-2026.2.5.2}/superu.egg-info/SOURCES.txt +0 -0
- {superu-2025.11.7.1 → superu-2026.2.5.2}/superu.egg-info/dependency_links.txt +0 -0
- {superu-2025.11.7.1 → superu-2026.2.5.2}/superu.egg-info/requires.txt +0 -0
- {superu-2025.11.7.1 → superu-2026.2.5.2}/superu.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: superu
|
|
3
|
+
Version: 2026.2.5.2
|
|
4
|
+
Summary: SuperU SDK to make AI calls - Create intelligent voice assistants for automated phone calls
|
|
5
|
+
Author-email: Paras Chhugani <paras@superu.ai>, Sajda Kabir <sajda@superu.ai>, Hritam Shrivastava <hritam@superu.ai>
|
|
6
|
+
Maintainer-email: Paras Chhugani <peoband@gmail.com>, Sajda Kabir <sajda.kbir@gmail.com>, Hritam Shrivastava <hritamstark05@gmail.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://dev.superu.ai
|
|
9
|
+
Project-URL: Documentation, https://dev.superu.ai
|
|
10
|
+
Project-URL: Repository, https://github.com/superu/superu-python
|
|
11
|
+
Project-URL: Issues, https://github.com/superu/superu-python/issues
|
|
12
|
+
Project-URL: Changelog, https://github.com/superu/superu-python/releases
|
|
13
|
+
Keywords: ai,voice,assistant,phone,calls,automation,superu,sdk
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Topic :: Communications :: Telephony
|
|
25
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
26
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
|
27
|
+
Classifier: Operating System :: OS Independent
|
|
28
|
+
Requires-Python: >=3.7
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
Requires-Dist: plivo
|
|
31
|
+
Requires-Dist: requests
|
|
32
|
+
|
|
33
|
+
# SuperU - AI Voice Assistant Platform
|
|
34
|
+
|
|
35
|
+
[](https://pypi.org/project/superu/)
|
|
36
|
+
[](https://www.python.org/downloads/)
|
|
37
|
+
[](LICENSE)
|
|
38
|
+
|
|
39
|
+
SuperU is a Python SDK for creating AI-powered voice assistants, running phone calls, and managing your assistants, tools, audiences, and knowledge bases from your SuperU account.
|
|
40
|
+
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install superu
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Quickstart
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
import superu
|
|
51
|
+
|
|
52
|
+
client = superu.SuperU("your_api_key")
|
|
53
|
+
|
|
54
|
+
# Start an outbound call using an existing assistant ID
|
|
55
|
+
response = client.calls.create(
|
|
56
|
+
from_="+15551234567",
|
|
57
|
+
to_="+15557654321",
|
|
58
|
+
assistant_id="assistant_id_from_dashboard",
|
|
59
|
+
max_duration_seconds=120
|
|
60
|
+
)
|
|
61
|
+
response.raise_for_status()
|
|
62
|
+
call_uuid = response.json()["call_uuid"]
|
|
63
|
+
|
|
64
|
+
# Request call analysis
|
|
65
|
+
analysis_response = client.calls.analysis(call_uuid)
|
|
66
|
+
analysis_response.raise_for_status()
|
|
67
|
+
analysis = analysis_response.json()
|
|
68
|
+
print(analysis)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Client Overview
|
|
72
|
+
|
|
73
|
+
The SDK exposes a single top-level client, `SuperU`, which validates your API key and provides typed wrappers for each API surface.
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
import superu
|
|
77
|
+
|
|
78
|
+
client = superu.SuperU("your_api_key")
|
|
79
|
+
|
|
80
|
+
# Wrappers available on the client
|
|
81
|
+
client.assistants
|
|
82
|
+
client.calls
|
|
83
|
+
client.call_logs
|
|
84
|
+
client.tools
|
|
85
|
+
client.folders
|
|
86
|
+
client.pluto
|
|
87
|
+
client.phone_numbers
|
|
88
|
+
client.contacts
|
|
89
|
+
client.audience
|
|
90
|
+
client.knowledge_base
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## API Reference
|
|
94
|
+
|
|
95
|
+
**SuperU**
|
|
96
|
+
|
|
97
|
+
High-level client that validates your API key and exposes service wrappers.
|
|
98
|
+
|
|
99
|
+
Constructor
|
|
100
|
+
|
|
101
|
+
- `SuperU(api_key: str)`
|
|
102
|
+
|
|
103
|
+
Attributes
|
|
104
|
+
|
|
105
|
+
- `assistants`: `AssistantWrapper`
|
|
106
|
+
- `calls`: `CallWrapper`
|
|
107
|
+
- `call_logs`: `CallLogsWrapper`
|
|
108
|
+
- `tools`: `ToolsWrapper`
|
|
109
|
+
- `folders`: `FolderWrapper`
|
|
110
|
+
- `pluto`: `PlutoWrapper`
|
|
111
|
+
- `phone_numbers`: `PhoneNumberWrapper`
|
|
112
|
+
- `contacts`: `ContactWrapper`
|
|
113
|
+
- `audience`: `AudienceWrapper`
|
|
114
|
+
- `knowledge_base`: `KnowledgeBaseWrapper`
|
|
115
|
+
|
|
116
|
+
Basic example
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
import superu
|
|
120
|
+
|
|
121
|
+
client = superu.SuperU("your_api_key")
|
|
122
|
+
print(client.assistants.list_agents())
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
**AssistantWrapper**
|
|
128
|
+
|
|
129
|
+
Manage assistants and assistant versions.
|
|
130
|
+
|
|
131
|
+
Constructor
|
|
132
|
+
|
|
133
|
+
- `AssistantWrapper(api_key: str)`
|
|
134
|
+
|
|
135
|
+
Methods
|
|
136
|
+
|
|
137
|
+
- `create_version(agent_id, version, assistant_data, knowledge_base=None, tools=None, call_forwarding=None)`
|
|
138
|
+
Creates a new assistant version. Returns a JSON dict.
|
|
139
|
+
- `update_version(agent_id, version_id, version=None, assistant_data=None, composio_app=None)`
|
|
140
|
+
Updates an existing assistant version. Returns a JSON dict.
|
|
141
|
+
- `list_agents(page=1, limit=20, inbound_or_outbound=None, search_query=None)`
|
|
142
|
+
Lists assistants with pagination and optional filtering. Returns a JSON dict.
|
|
143
|
+
- `get_version(agent_id, version)`
|
|
144
|
+
Retrieves a specific assistant version. Returns a JSON dict.
|
|
145
|
+
- `list_versions(agent_id)`
|
|
146
|
+
Lists all versions for an assistant. Returns a JSON dict.
|
|
147
|
+
- `deploy_version(agent_id, version_id)`
|
|
148
|
+
Deploys a version. Returns a JSON dict.
|
|
149
|
+
- `create_agent(type=None, name=None, company_name=None, assistant_name=None, first_message=None, voice_id=None, voice_provider='11labs', speed='1.0', bg_noice=False, script=None, industry=None, useCase=None, form_model=None, assistant_data=None, knowledge_base=None, tools=None, call_forwarding=None)`
|
|
150
|
+
Creates a new assistant. Returns a JSON dict.
|
|
151
|
+
- `update_name(agent_id, name)`
|
|
152
|
+
Updates assistant name. Returns a JSON dict.
|
|
153
|
+
- `import_agents()`
|
|
154
|
+
Imports assistants for the API key. Returns a JSON dict.
|
|
155
|
+
- `delete(agent_id)`
|
|
156
|
+
Deletes an assistant. Returns a JSON dict.
|
|
157
|
+
|
|
158
|
+
Basic example
|
|
159
|
+
|
|
160
|
+
```python
|
|
161
|
+
assistant = client.assistants.create_agent(
|
|
162
|
+
type="outbound",
|
|
163
|
+
name="Demo Assistant",
|
|
164
|
+
assistant_name="Demo Voice",
|
|
165
|
+
first_message="Hello! This is a demo call.",
|
|
166
|
+
script="You are a friendly assistant.",
|
|
167
|
+
voice_id="90ipbRoKi4CpHXvKVtl0"
|
|
168
|
+
)
|
|
169
|
+
print(assistant)
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
**CallWrapper**
|
|
175
|
+
|
|
176
|
+
Create and analyze calls, including Twilio-backed calls.
|
|
177
|
+
|
|
178
|
+
Constructor
|
|
179
|
+
|
|
180
|
+
- `CallWrapper(api_key: str)`
|
|
181
|
+
|
|
182
|
+
Methods
|
|
183
|
+
|
|
184
|
+
- `create(from_, to_, first_message_url=None, assistant_id=None, max_duration_seconds=120, **kwargs)`
|
|
185
|
+
Creates an outbound call using a SuperU number. Returns `requests.Response`.
|
|
186
|
+
- `analysis(call_uuid, custom_fields=None)`
|
|
187
|
+
Requests analysis for a call. Returns `requests.Response`.
|
|
188
|
+
- `create_twilio_call(phoneNumberId, to_, assistant_id, additional_payload=None)`
|
|
189
|
+
Creates a call using your Twilio number. Returns a JSON dict.
|
|
190
|
+
- `analysis_twilio_call(call_uuid, custom_fields=None)`
|
|
191
|
+
Requests analysis for a Twilio call. Returns a JSON dict.
|
|
192
|
+
- `create_outbound_call(assistant_id, campaign_id, to, from_=None, customer_name='Unknown', customer_id='Unknown', variable_values=None)`
|
|
193
|
+
Creates a campaign outbound call. Returns a JSON dict.
|
|
194
|
+
|
|
195
|
+
Custom analysis fields format
|
|
196
|
+
|
|
197
|
+
- Each item must be a dict with keys: `field`, `definition`, `outputs_options`.
|
|
198
|
+
- `field` and `definition` must be strings.
|
|
199
|
+
- `outputs_options` must be a list of strings.
|
|
200
|
+
|
|
201
|
+
Basic example
|
|
202
|
+
|
|
203
|
+
```python
|
|
204
|
+
response = client.calls.create(
|
|
205
|
+
from_="+15551234567",
|
|
206
|
+
to_="+15557654321",
|
|
207
|
+
assistant_id="assistant_id_from_dashboard",
|
|
208
|
+
max_duration_seconds=120
|
|
209
|
+
)
|
|
210
|
+
response.raise_for_status()
|
|
211
|
+
call_uuid = response.json()["call_uuid"]
|
|
212
|
+
|
|
213
|
+
analysis = client.calls.analysis(call_uuid)
|
|
214
|
+
analysis.raise_for_status()
|
|
215
|
+
print(analysis.json())
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Outbound campaign example
|
|
219
|
+
|
|
220
|
+
```python
|
|
221
|
+
outbound = client.calls.create_outbound_call(
|
|
222
|
+
assistant_id="assistant_id_from_dashboard",
|
|
223
|
+
campaign_id="campaign_id_from_dashboard",
|
|
224
|
+
to="+15557654321",
|
|
225
|
+
customer_name="Ava",
|
|
226
|
+
customer_id="cust_123",
|
|
227
|
+
variable_values={"plan": "pro"}
|
|
228
|
+
)
|
|
229
|
+
print(outbound)
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
**PhoneNumberWrapper**
|
|
235
|
+
|
|
236
|
+
Retrieve owned phone numbers.
|
|
237
|
+
|
|
238
|
+
Constructor
|
|
239
|
+
|
|
240
|
+
- `PhoneNumberWrapper(api_key: str)`
|
|
241
|
+
|
|
242
|
+
Methods
|
|
243
|
+
|
|
244
|
+
- `get_owned()`
|
|
245
|
+
Returns owned phone numbers as a JSON dict.
|
|
246
|
+
|
|
247
|
+
Basic example
|
|
248
|
+
|
|
249
|
+
```python
|
|
250
|
+
numbers = client.phone_numbers.get_owned()
|
|
251
|
+
print(numbers)
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
**CallLogsWrapper**
|
|
257
|
+
|
|
258
|
+
Retrieve call logs with filters.
|
|
259
|
+
|
|
260
|
+
Constructor
|
|
261
|
+
|
|
262
|
+
- `CallLogsWrapper(api_key: str)`
|
|
263
|
+
|
|
264
|
+
Methods
|
|
265
|
+
|
|
266
|
+
- `get_logs(assistant_id='all', limit=20, page=1, before=None, after=None, status=None, campaign_id=None, search_query=None)`
|
|
267
|
+
Returns call logs as a JSON dict.
|
|
268
|
+
|
|
269
|
+
Basic example
|
|
270
|
+
|
|
271
|
+
```python
|
|
272
|
+
logs = client.call_logs.get_logs(assistant_id="all", limit=10, page=1)
|
|
273
|
+
print(logs)
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
**ToolsWrapper**
|
|
279
|
+
|
|
280
|
+
Create and manage tools that your assistants can call.
|
|
281
|
+
|
|
282
|
+
Constructor
|
|
283
|
+
|
|
284
|
+
- `ToolsWrapper(api_key: str)`
|
|
285
|
+
|
|
286
|
+
Methods
|
|
287
|
+
|
|
288
|
+
- `create(tool_data)`
|
|
289
|
+
Creates a tool. `tool_data` must be a non-empty dict. Returns a JSON dict.
|
|
290
|
+
- `list(page=1, per_page=20, tool_type=None)`
|
|
291
|
+
Lists tools. Returns a JSON dict.
|
|
292
|
+
- `get(tool_id)`
|
|
293
|
+
Retrieves a tool. Returns a JSON dict.
|
|
294
|
+
- `update(tool_id, update_data)`
|
|
295
|
+
Updates a tool. `update_data` must be a non-empty dict. Returns a JSON dict.
|
|
296
|
+
- `delete(tool_id)`
|
|
297
|
+
Deletes a tool. Returns a JSON dict.
|
|
298
|
+
|
|
299
|
+
Basic example
|
|
300
|
+
|
|
301
|
+
```python
|
|
302
|
+
tool = client.tools.create({
|
|
303
|
+
"name": "check-user-status",
|
|
304
|
+
"description": "Check if a user exists in our database",
|
|
305
|
+
"parameters": {
|
|
306
|
+
"type": "object",
|
|
307
|
+
"properties": {
|
|
308
|
+
"email": {"type": "string", "description": "User email"}
|
|
309
|
+
},
|
|
310
|
+
"required": ["email"]
|
|
311
|
+
},
|
|
312
|
+
"tool_url": "/api/check-user",
|
|
313
|
+
"tool_url_domain": "https://your-api.com",
|
|
314
|
+
"async_": False
|
|
315
|
+
})
|
|
316
|
+
print(tool)
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
**FolderWrapper**
|
|
322
|
+
|
|
323
|
+
Organize assistants into folders.
|
|
324
|
+
|
|
325
|
+
Constructor
|
|
326
|
+
|
|
327
|
+
- `FolderWrapper(api_key: str)`
|
|
328
|
+
|
|
329
|
+
Methods
|
|
330
|
+
|
|
331
|
+
- `create(folder_name, description=None)`
|
|
332
|
+
Creates a folder. Returns a JSON dict.
|
|
333
|
+
- `list(page=1, per_page=20)`
|
|
334
|
+
Lists folders. Returns a JSON dict.
|
|
335
|
+
- `get(folder_id)`
|
|
336
|
+
Retrieves a folder. Returns a JSON dict.
|
|
337
|
+
- `update(folder_id, folder_name=None, description=None)`
|
|
338
|
+
Updates a folder. Returns a JSON dict.
|
|
339
|
+
- `delete(folder_id)`
|
|
340
|
+
Deletes a folder. Returns a JSON dict.
|
|
341
|
+
- `assign_agent(agent_id, folder_id=None)`
|
|
342
|
+
Assigns an assistant to a folder. Returns a JSON dict.
|
|
343
|
+
- `get_agents(folder_id, page=1, per_page=20)`
|
|
344
|
+
Lists assistants in a folder. Returns a JSON dict.
|
|
345
|
+
|
|
346
|
+
Basic example
|
|
347
|
+
|
|
348
|
+
```python
|
|
349
|
+
folder = client.folders.create("Outbound Assistants", description="Sales and support")
|
|
350
|
+
folder_id = folder["folder_id"]
|
|
351
|
+
|
|
352
|
+
client.folders.assign_agent(agent_id="assistant_id_from_dashboard", folder_id=folder_id)
|
|
353
|
+
print(client.folders.get_agents(folder_id))
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
**PlutoWrapper**
|
|
359
|
+
|
|
360
|
+
Low-level call orchestration for Pluto WS calls.
|
|
361
|
+
|
|
362
|
+
Constructor
|
|
363
|
+
|
|
364
|
+
- `PlutoWrapper(api_key: str, user_id: str, assistants)`
|
|
365
|
+
|
|
366
|
+
Methods
|
|
367
|
+
|
|
368
|
+
- `register_call(call_uuid, assistant_id, Telephony)`
|
|
369
|
+
Registers a call with Pluto. Returns `True` on success.
|
|
370
|
+
- `join_agent_advance(pluto_url, call_id, json_for_url)`
|
|
371
|
+
Pre-warms an agent and returns a URL override.
|
|
372
|
+
- `create_call(voice_id, call_uuid=None, model=None, assistant_id=None, system_prompt=None, first_message=None, language_clue='en-US', background_audio=False, prewarm_agent=False, localhost=None, Telephony=False, custom_analysis_prompt=None, custom_summary_prompt=None)`
|
|
373
|
+
Creates a Pluto WS call. Returns a dict with `streamId`, `ws_url`, and `call_id`.
|
|
374
|
+
- `create_call_plivo(voice_id, from_, to_, model=None, assistant_id=None, system_prompt=None, first_message=None, language_clue='en-US', background_audio=False, prewarm_agent=False, localhost=None, max_duration_seconds=120, custom_analysis_prompt=None, custom_summary_prompt=None, **kwargs)`
|
|
375
|
+
Creates a Plivo telephony call plus a Pluto WS call. Returns `(plivo_call, call_create)`.
|
|
376
|
+
- `get_call(call_id, model=None)`
|
|
377
|
+
Retrieves Pluto call logs. Returns a JSON dict.
|
|
378
|
+
|
|
379
|
+
Notes
|
|
380
|
+
|
|
381
|
+
- `assistant_id` usage expects an assistants mapping with `model` and `firstMessage` fields. If you do not have that mapping, pass `system_prompt` and `first_message` instead.
|
|
382
|
+
|
|
383
|
+
Basic example
|
|
384
|
+
|
|
385
|
+
```python
|
|
386
|
+
pluto_call = client.pluto.create_call(
|
|
387
|
+
voice_id="90ipbRoKi4CpHXvKVtl0",
|
|
388
|
+
system_prompt="You are a helpful assistant.",
|
|
389
|
+
first_message="Hello! How can I help you today?"
|
|
390
|
+
)
|
|
391
|
+
print(pluto_call["ws_url"])
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
**ContactWrapper**
|
|
397
|
+
|
|
398
|
+
Create and list contacts with validation.
|
|
399
|
+
|
|
400
|
+
Constructor
|
|
401
|
+
|
|
402
|
+
- `ContactWrapper(api_key: str)`
|
|
403
|
+
|
|
404
|
+
Methods
|
|
405
|
+
|
|
406
|
+
- `create(first_name, last_name, email, country_code, phone_number, audience_id=None)`
|
|
407
|
+
Creates a contact. Returns a JSON dict.
|
|
408
|
+
- `list(page=1, limit=10, search_query=None)`
|
|
409
|
+
Lists contacts with pagination. Returns a JSON dict.
|
|
410
|
+
|
|
411
|
+
Validation
|
|
412
|
+
|
|
413
|
+
- Email, phone, and country code are validated before requests are sent.
|
|
414
|
+
|
|
415
|
+
Basic example
|
|
416
|
+
|
|
417
|
+
```python
|
|
418
|
+
contact = client.contacts.create(
|
|
419
|
+
first_name="Ava",
|
|
420
|
+
last_name="Patel",
|
|
421
|
+
email="ava.patel@example.com",
|
|
422
|
+
country_code="+1",
|
|
423
|
+
phone_number="5551234567"
|
|
424
|
+
)
|
|
425
|
+
print(contact)
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
---
|
|
429
|
+
|
|
430
|
+
**AudienceWrapper**
|
|
431
|
+
|
|
432
|
+
Create, update, and manage audiences and their contacts.
|
|
433
|
+
|
|
434
|
+
Constructor
|
|
435
|
+
|
|
436
|
+
- `AudienceWrapper(api_key: str)`
|
|
437
|
+
|
|
438
|
+
Methods
|
|
439
|
+
|
|
440
|
+
- `create(audience_name, contacts, audience_description='')`
|
|
441
|
+
Creates a new audience and contacts. Returns a JSON dict.
|
|
442
|
+
- `list()`
|
|
443
|
+
Lists audiences. Returns a JSON dict.
|
|
444
|
+
- `get(audience_id)`
|
|
445
|
+
Retrieves audience details and contacts. Returns a JSON dict.
|
|
446
|
+
- `get_contacts(audience_id, page=1, limit=10)`
|
|
447
|
+
Lists contacts for an audience. Returns a JSON dict.
|
|
448
|
+
- `update(audience_id, audience_name=None, audience_description=None)`
|
|
449
|
+
Updates audience metadata. Returns a JSON dict.
|
|
450
|
+
- `add_contacts(audience_id, contacts)`
|
|
451
|
+
Adds contacts to an existing audience. Returns a JSON dict.
|
|
452
|
+
- `delete(audience_id)`
|
|
453
|
+
Deletes an audience and its contacts. Returns a JSON dict.
|
|
454
|
+
|
|
455
|
+
Contact format
|
|
456
|
+
|
|
457
|
+
- Required: `first_name`, `country_code`, `phone_number`
|
|
458
|
+
- Optional: `last_name`, `email`, `variable_values`
|
|
459
|
+
|
|
460
|
+
Basic example
|
|
461
|
+
|
|
462
|
+
```python
|
|
463
|
+
audience = client.audience.create(
|
|
464
|
+
audience_name="Demo Audience",
|
|
465
|
+
contacts=[
|
|
466
|
+
{"first_name": "Ava", "country_code": "+1", "phone_number": "5551234567"}
|
|
467
|
+
]
|
|
468
|
+
)
|
|
469
|
+
print(audience)
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
---
|
|
473
|
+
|
|
474
|
+
**KnowledgeBaseWrapper**
|
|
475
|
+
|
|
476
|
+
Create and manage knowledge bases with file uploads.
|
|
477
|
+
|
|
478
|
+
Constructor
|
|
479
|
+
|
|
480
|
+
- `KnowledgeBaseWrapper(api_key: str)`
|
|
481
|
+
|
|
482
|
+
Methods
|
|
483
|
+
|
|
484
|
+
- `create(name, description, files)`
|
|
485
|
+
Creates a knowledge base with uploaded files. Returns a JSON dict.
|
|
486
|
+
- `list(page=1, limit=10)`
|
|
487
|
+
Lists knowledge bases. Returns a JSON dict.
|
|
488
|
+
- `get(knowledge_base_id)`
|
|
489
|
+
Retrieves a knowledge base. Returns a JSON dict.
|
|
490
|
+
|
|
491
|
+
Files format
|
|
492
|
+
|
|
493
|
+
- File-like objects: `open("file.pdf", "rb")`
|
|
494
|
+
- Tuples: `(filename, content, content_type)`
|
|
495
|
+
|
|
496
|
+
Basic example
|
|
497
|
+
|
|
498
|
+
```python
|
|
499
|
+
with open("faq.pdf", "rb") as f:
|
|
500
|
+
kb = client.knowledge_base.create(
|
|
501
|
+
name="FAQ",
|
|
502
|
+
description="Frequently asked questions",
|
|
503
|
+
files=[f]
|
|
504
|
+
)
|
|
505
|
+
print(kb)
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
---
|
|
509
|
+
|
|
510
|
+
## Error Handling
|
|
511
|
+
|
|
512
|
+
Most methods validate inputs and raise `ValueError` on invalid data. API requests raise `Exception` when the server returns a non-success status. Methods that return `requests.Response` let you call `raise_for_status()` and `json()` directly.
|
|
513
|
+
|
|
514
|
+
## Support
|
|
515
|
+
|
|
516
|
+
- Documentation: [https://dev.superu.ai](https://dev.superu.ai)
|
|
517
|
+
- Issues: [https://github.com/superu/superu-python/issues](https://github.com/superu/superu-python/issues)
|
|
518
|
+
- Email: Contact support via your SuperU dashboard
|
|
519
|
+
|
|
520
|
+
## License
|
|
521
|
+
|
|
522
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|