superu 2025.10.6.2__tar.gz → 2025.11.7.1__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-2025.10.6.2 → superu-2025.11.7.1}/PKG-INFO +1 -1
- {superu-2025.10.6.2 → superu-2025.11.7.1}/pyproject.toml +1 -1
- {superu-2025.10.6.2 → superu-2025.11.7.1}/superu/core.py +69 -1
- {superu-2025.10.6.2 → superu-2025.11.7.1}/superu.egg-info/PKG-INFO +1 -1
- {superu-2025.10.6.2 → superu-2025.11.7.1}/README.md +0 -0
- {superu-2025.10.6.2 → superu-2025.11.7.1}/setup.cfg +0 -0
- {superu-2025.10.6.2 → superu-2025.11.7.1}/superu/__init__.py +0 -0
- {superu-2025.10.6.2 → superu-2025.11.7.1}/superu/example.py +0 -0
- {superu-2025.10.6.2 → superu-2025.11.7.1}/superu.egg-info/SOURCES.txt +0 -0
- {superu-2025.10.6.2 → superu-2025.11.7.1}/superu.egg-info/dependency_links.txt +0 -0
- {superu-2025.10.6.2 → superu-2025.11.7.1}/superu.egg-info/requires.txt +0 -0
- {superu-2025.10.6.2 → superu-2025.11.7.1}/superu.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: superu
|
|
3
|
-
Version: 2025.
|
|
3
|
+
Version: 2025.11.7.1
|
|
4
4
|
Summary: SuperU SDK to make AI calls - Create intelligent voice assistants for automated phone calls
|
|
5
5
|
Author-email: Paras Chhugani <paras@superu.ai>
|
|
6
6
|
Maintainer-email: Paras Chhugani <peoband@gmail.com>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "superu"
|
|
3
|
-
version = "2025.
|
|
3
|
+
version = "2025.11.07.01"
|
|
4
4
|
description = "SuperU SDK to make AI calls - Create intelligent voice assistants for automated phone calls"
|
|
5
5
|
readme = {file = "README.md", content-type = "text/markdown"}
|
|
6
6
|
requires-python = ">=3.7"
|
|
@@ -281,7 +281,74 @@ class ToolWrapper:
|
|
|
281
281
|
if response.status_code != 200:
|
|
282
282
|
raise Exception(f"Failed to get tool: {response.status_code}, {response.text}")
|
|
283
283
|
return response.json()
|
|
284
|
-
|
|
284
|
+
|
|
285
|
+
class ContactWrapper:
|
|
286
|
+
def __init__(self, api_key):
|
|
287
|
+
self.api_key = api_key
|
|
288
|
+
|
|
289
|
+
def create_audience(self , audience_name: str , audience_description: str , contacts: list[dict]):
|
|
290
|
+
payload = {
|
|
291
|
+
"audience_name": audience_name,
|
|
292
|
+
"audience_description": audience_description,
|
|
293
|
+
"contacts": contacts
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
compulsory_fields = ['first_name', 'country_code', 'phone_number']
|
|
297
|
+
|
|
298
|
+
for contact in contacts:
|
|
299
|
+
for field in compulsory_fields:
|
|
300
|
+
if field not in contact:
|
|
301
|
+
raise ValueError(f"Missing compulsory field '{field}' in contact: {contact}")
|
|
302
|
+
|
|
303
|
+
if not isinstance(contact.get('phone_number'), str):
|
|
304
|
+
raise ValueError(f"'phone_number' must be a string in contact: {contact}")
|
|
305
|
+
phone_pattern = re.compile(r'^\d{10,15}$')
|
|
306
|
+
if not phone_pattern.match(contact['phone_number']):
|
|
307
|
+
raise ValueError(f"Invalid 'phone_number' format in contact: {contact}. It should contain only digits and be 10 to 15 digits long.")
|
|
308
|
+
country_code_pattern = re.compile(r'^\+\d{1,4}$')
|
|
309
|
+
if not country_code_pattern.match(contact['country_code']):
|
|
310
|
+
raise ValueError(f"Invalid 'country_code' format in contact: {contact}. It should start with '+' followed by 1 to 4 digits.")
|
|
311
|
+
|
|
312
|
+
response = requests.post(f'{server_url}/pypi_support/audience/create', json={**payload , 'api_key': self.api_key})
|
|
313
|
+
if response.status_code != 200:
|
|
314
|
+
raise Exception(f"Failed to create contact: {response.status_code}, {response.text}")
|
|
315
|
+
return response.json()
|
|
316
|
+
|
|
317
|
+
def create(self , contact: dict):
|
|
318
|
+
payload = {
|
|
319
|
+
**contact
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
compulsory_fields = ['first_name', 'last_name', 'email', 'country_code', 'phone_number']
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
for field in compulsory_fields:
|
|
326
|
+
if field not in contact:
|
|
327
|
+
raise ValueError(f"Missing compulsory field '{field}' in contact: {contact}")
|
|
328
|
+
|
|
329
|
+
if not isinstance(contact.get('phone_number'), str):
|
|
330
|
+
raise ValueError(f"'phone_number' must be a string in contact: {contact}")
|
|
331
|
+
phone_pattern = re.compile(r'^\d{10,15}$')
|
|
332
|
+
if not phone_pattern.match(contact['phone_number']):
|
|
333
|
+
raise ValueError(f"Invalid 'phone_number' format in contact: {contact}. It should contain only digits and be 10 to 15 digits long.")
|
|
334
|
+
country_code_pattern = re.compile(r'^\+\d{1,4}$')
|
|
335
|
+
if not country_code_pattern.match(contact['country_code']):
|
|
336
|
+
raise ValueError(f"Invalid 'country_code' format in contact: {contact}. It should start with '+' followed by 1 to 4 digits.")
|
|
337
|
+
email_pattern = re.compile(r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$')
|
|
338
|
+
if not email_pattern.match(contact['email']):
|
|
339
|
+
raise ValueError(f"Invalid 'email' format in contact: {contact}. It should be a valid email address.")
|
|
340
|
+
|
|
341
|
+
response = requests.post(f'{server_url}/pypi_support/contact/create', json={**payload , 'api_key': self.api_key})
|
|
342
|
+
if response.status_code != 200 and response.status_code != 201:
|
|
343
|
+
raise Exception(f"Failed to create contact: {response.status_code}, {response.text}")
|
|
344
|
+
return response.json()
|
|
345
|
+
|
|
346
|
+
def list(self , page : int = 1 , page_size : int = 10):
|
|
347
|
+
response = requests.post(f'{server_url}/pypi_support/contact/list', json={'api_key': self.api_key, 'page': page, 'page_size': page_size})
|
|
348
|
+
if response.status_code != 200:
|
|
349
|
+
raise Exception(f"Failed to list contacts: {response.status_code}, {response.text}")
|
|
350
|
+
return response.json()
|
|
351
|
+
|
|
285
352
|
class PlutoWrapper:
|
|
286
353
|
def __init__(self, api_key , user_id , assistants):
|
|
287
354
|
self.api_key = api_key
|
|
@@ -434,6 +501,7 @@ class SuperU:
|
|
|
434
501
|
self.assistants = AssistantWrapper(self.api_key)
|
|
435
502
|
self.tools = ToolWrapper(self.api_key)
|
|
436
503
|
self.pluto = PlutoWrapper(self.api_key , self.user_id , assistants=self.assistants)
|
|
504
|
+
self.contacts = ContactWrapper(self.api_key)
|
|
437
505
|
|
|
438
506
|
def validate_api_key(self, api_key):
|
|
439
507
|
response = requests.post(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: superu
|
|
3
|
-
Version: 2025.
|
|
3
|
+
Version: 2025.11.7.1
|
|
4
4
|
Summary: SuperU SDK to make AI calls - Create intelligent voice assistants for automated phone calls
|
|
5
5
|
Author-email: Paras Chhugani <paras@superu.ai>
|
|
6
6
|
Maintainer-email: Paras Chhugani <peoband@gmail.com>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|