smallestai 2.2.0__py3-none-any.whl → 3.0.1__py3-none-any.whl
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/__init__.py +95 -0
- smallestai/atoms/__init__.py +182 -0
- smallestai/atoms/api/__init__.py +12 -0
- smallestai/atoms/api/agent_templates_api.py +573 -0
- smallestai/atoms/api/agents_api.py +1465 -0
- smallestai/atoms/api/calls_api.py +320 -0
- smallestai/atoms/api/campaigns_api.py +1689 -0
- smallestai/atoms/api/knowledge_base_api.py +2271 -0
- smallestai/atoms/api/logs_api.py +305 -0
- smallestai/atoms/api/organization_api.py +285 -0
- smallestai/atoms/api/user_api.py +285 -0
- smallestai/atoms/api_client.py +797 -0
- smallestai/atoms/api_response.py +21 -0
- smallestai/atoms/atoms_client.py +560 -0
- smallestai/atoms/configuration.py +582 -0
- smallestai/atoms/exceptions.py +216 -0
- smallestai/atoms/models/__init__.py +72 -0
- smallestai/atoms/models/agent_dto.py +130 -0
- smallestai/atoms/models/agent_dto_language.py +91 -0
- smallestai/atoms/models/agent_dto_synthesizer.py +99 -0
- smallestai/atoms/models/agent_dto_synthesizer_voice_config.py +111 -0
- smallestai/atoms/models/api_response.py +89 -0
- smallestai/atoms/models/bad_request_error_response.py +89 -0
- smallestai/atoms/models/create_agent_from_template200_response.py +89 -0
- smallestai/atoms/models/create_agent_from_template_request.py +91 -0
- smallestai/atoms/models/create_agent_request.py +113 -0
- smallestai/atoms/models/create_agent_request_language.py +124 -0
- smallestai/atoms/models/create_agent_request_language_synthesizer.py +110 -0
- smallestai/atoms/models/create_agent_request_language_synthesizer_voice_config.py +137 -0
- smallestai/atoms/models/create_campaign201_response.py +93 -0
- smallestai/atoms/models/create_campaign201_response_data.py +104 -0
- smallestai/atoms/models/create_campaign_request.py +93 -0
- smallestai/atoms/models/create_knowledge_base201_response.py +89 -0
- smallestai/atoms/models/create_knowledge_base_request.py +89 -0
- smallestai/atoms/models/delete_agent200_response.py +87 -0
- smallestai/atoms/models/get_agent_by_id200_response.py +93 -0
- smallestai/atoms/models/get_agent_templates200_response.py +97 -0
- smallestai/atoms/models/get_agent_templates200_response_data_inner.py +97 -0
- smallestai/atoms/models/get_agents200_response.py +93 -0
- smallestai/atoms/models/get_agents200_response_data.py +101 -0
- smallestai/atoms/models/get_campaign_by_id200_response.py +93 -0
- smallestai/atoms/models/get_campaign_by_id200_response_data.py +110 -0
- smallestai/atoms/models/get_campaigns200_response.py +97 -0
- smallestai/atoms/models/get_campaigns200_response_data_inner.py +118 -0
- smallestai/atoms/models/get_campaigns200_response_data_inner_agent.py +89 -0
- smallestai/atoms/models/get_campaigns200_response_data_inner_audience.py +89 -0
- smallestai/atoms/models/get_campaigns_request.py +89 -0
- smallestai/atoms/models/get_conversation_logs200_response.py +93 -0
- smallestai/atoms/models/get_conversation_logs200_response_data.py +125 -0
- smallestai/atoms/models/get_current_user200_response.py +93 -0
- smallestai/atoms/models/get_current_user200_response_data.py +99 -0
- smallestai/atoms/models/get_knowledge_base_by_id200_response.py +93 -0
- smallestai/atoms/models/get_knowledge_base_items200_response.py +97 -0
- smallestai/atoms/models/get_knowledge_bases200_response.py +97 -0
- smallestai/atoms/models/get_organization200_response.py +93 -0
- smallestai/atoms/models/get_organization200_response_data.py +105 -0
- smallestai/atoms/models/get_organization200_response_data_members_inner.py +89 -0
- smallestai/atoms/models/get_organization200_response_data_subscription.py +87 -0
- smallestai/atoms/models/internal_server_error_response.py +89 -0
- smallestai/atoms/models/knowledge_base_dto.py +93 -0
- smallestai/atoms/models/knowledge_base_item_dto.py +124 -0
- smallestai/atoms/models/start_outbound_call200_response.py +93 -0
- smallestai/atoms/models/start_outbound_call200_response_data.py +87 -0
- smallestai/atoms/models/start_outbound_call_request.py +89 -0
- smallestai/atoms/models/unauthorized_error_reponse.py +89 -0
- smallestai/atoms/models/update_agent200_response.py +89 -0
- smallestai/atoms/models/update_agent_request.py +119 -0
- smallestai/atoms/models/update_agent_request_language.py +99 -0
- smallestai/atoms/models/update_agent_request_synthesizer.py +110 -0
- smallestai/atoms/models/update_agent_request_synthesizer_voice_config.py +137 -0
- smallestai/atoms/models/update_agent_request_synthesizer_voice_config_one_of.py +111 -0
- smallestai/atoms/models/update_agent_request_synthesizer_voice_config_one_of1.py +99 -0
- smallestai/atoms/models/upload_text_to_knowledge_base_request.py +89 -0
- smallestai/atoms/py.typed +0 -0
- smallestai/atoms/rest.py +258 -0
- smallestai/waves/__init__.py +5 -0
- smallest/async_tts.py → smallestai/waves/async_waves_client.py +3 -3
- {smallest → smallestai/waves}/stream_tts.py +6 -6
- {smallest → smallestai/waves}/utils.py +2 -2
- smallest/tts.py → smallestai/waves/waves_client.py +3 -3
- {smallestai-2.2.0.dist-info → smallestai-3.0.1.dist-info}/METADATA +182 -43
- smallestai-3.0.1.dist-info/RECORD +87 -0
- {smallestai-2.2.0.dist-info → smallestai-3.0.1.dist-info}/WHEEL +1 -1
- smallestai-3.0.1.dist-info/top_level.txt +1 -0
- smallest/__init__.py +0 -5
- smallestai-2.2.0.dist-info/RECORD +0 -12
- smallestai-2.2.0.dist-info/top_level.txt +0 -1
- {smallest → smallestai/waves}/exceptions.py +0 -0
- {smallest → smallestai/waves}/models.py +0 -0
- {smallestai-2.2.0.dist-info → smallestai-3.0.1.dist-info/licenses}/LICENSE +0 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Agent Management API
|
|
5
|
+
|
|
6
|
+
API for managing agents, their templates, and call logs
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from typing import Any, Optional
|
|
15
|
+
from typing_extensions import Self
|
|
16
|
+
|
|
17
|
+
class OpenApiException(Exception):
|
|
18
|
+
"""The base exception class for all OpenAPIExceptions"""
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class ApiTypeError(OpenApiException, TypeError):
|
|
22
|
+
def __init__(self, msg, path_to_item=None, valid_classes=None,
|
|
23
|
+
key_type=None) -> None:
|
|
24
|
+
""" Raises an exception for TypeErrors
|
|
25
|
+
|
|
26
|
+
Args:
|
|
27
|
+
msg (str): the exception message
|
|
28
|
+
|
|
29
|
+
Keyword Args:
|
|
30
|
+
path_to_item (list): a list of keys an indices to get to the
|
|
31
|
+
current_item
|
|
32
|
+
None if unset
|
|
33
|
+
valid_classes (tuple): the primitive classes that current item
|
|
34
|
+
should be an instance of
|
|
35
|
+
None if unset
|
|
36
|
+
key_type (bool): False if our value is a value in a dict
|
|
37
|
+
True if it is a key in a dict
|
|
38
|
+
False if our item is an item in a list
|
|
39
|
+
None if unset
|
|
40
|
+
"""
|
|
41
|
+
self.path_to_item = path_to_item
|
|
42
|
+
self.valid_classes = valid_classes
|
|
43
|
+
self.key_type = key_type
|
|
44
|
+
full_msg = msg
|
|
45
|
+
if path_to_item:
|
|
46
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
47
|
+
super(ApiTypeError, self).__init__(full_msg)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class ApiValueError(OpenApiException, ValueError):
|
|
51
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
52
|
+
"""
|
|
53
|
+
Args:
|
|
54
|
+
msg (str): the exception message
|
|
55
|
+
|
|
56
|
+
Keyword Args:
|
|
57
|
+
path_to_item (list) the path to the exception in the
|
|
58
|
+
received_data dict. None if unset
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
self.path_to_item = path_to_item
|
|
62
|
+
full_msg = msg
|
|
63
|
+
if path_to_item:
|
|
64
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
65
|
+
super(ApiValueError, self).__init__(full_msg)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class ApiAttributeError(OpenApiException, AttributeError):
|
|
69
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
70
|
+
"""
|
|
71
|
+
Raised when an attribute reference or assignment fails.
|
|
72
|
+
|
|
73
|
+
Args:
|
|
74
|
+
msg (str): the exception message
|
|
75
|
+
|
|
76
|
+
Keyword Args:
|
|
77
|
+
path_to_item (None/list) the path to the exception in the
|
|
78
|
+
received_data dict
|
|
79
|
+
"""
|
|
80
|
+
self.path_to_item = path_to_item
|
|
81
|
+
full_msg = msg
|
|
82
|
+
if path_to_item:
|
|
83
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
84
|
+
super(ApiAttributeError, self).__init__(full_msg)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class ApiKeyError(OpenApiException, KeyError):
|
|
88
|
+
def __init__(self, msg, path_to_item=None) -> None:
|
|
89
|
+
"""
|
|
90
|
+
Args:
|
|
91
|
+
msg (str): the exception message
|
|
92
|
+
|
|
93
|
+
Keyword Args:
|
|
94
|
+
path_to_item (None/list) the path to the exception in the
|
|
95
|
+
received_data dict
|
|
96
|
+
"""
|
|
97
|
+
self.path_to_item = path_to_item
|
|
98
|
+
full_msg = msg
|
|
99
|
+
if path_to_item:
|
|
100
|
+
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
101
|
+
super(ApiKeyError, self).__init__(full_msg)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class ApiException(OpenApiException):
|
|
105
|
+
|
|
106
|
+
def __init__(
|
|
107
|
+
self,
|
|
108
|
+
status=None,
|
|
109
|
+
reason=None,
|
|
110
|
+
http_resp=None,
|
|
111
|
+
*,
|
|
112
|
+
body: Optional[str] = None,
|
|
113
|
+
data: Optional[Any] = None,
|
|
114
|
+
) -> None:
|
|
115
|
+
self.status = status
|
|
116
|
+
self.reason = reason
|
|
117
|
+
self.body = body
|
|
118
|
+
self.data = data
|
|
119
|
+
self.headers = None
|
|
120
|
+
|
|
121
|
+
if http_resp:
|
|
122
|
+
if self.status is None:
|
|
123
|
+
self.status = http_resp.status
|
|
124
|
+
if self.reason is None:
|
|
125
|
+
self.reason = http_resp.reason
|
|
126
|
+
if self.body is None:
|
|
127
|
+
try:
|
|
128
|
+
self.body = http_resp.data.decode('utf-8')
|
|
129
|
+
except Exception:
|
|
130
|
+
pass
|
|
131
|
+
self.headers = http_resp.getheaders()
|
|
132
|
+
|
|
133
|
+
@classmethod
|
|
134
|
+
def from_response(
|
|
135
|
+
cls,
|
|
136
|
+
*,
|
|
137
|
+
http_resp,
|
|
138
|
+
body: Optional[str],
|
|
139
|
+
data: Optional[Any],
|
|
140
|
+
) -> Self:
|
|
141
|
+
if http_resp.status == 400:
|
|
142
|
+
raise BadRequestException(http_resp=http_resp, body=body, data=data)
|
|
143
|
+
|
|
144
|
+
if http_resp.status == 401:
|
|
145
|
+
raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
|
|
146
|
+
|
|
147
|
+
if http_resp.status == 403:
|
|
148
|
+
raise ForbiddenException(http_resp=http_resp, body=body, data=data)
|
|
149
|
+
|
|
150
|
+
if http_resp.status == 404:
|
|
151
|
+
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
|
152
|
+
|
|
153
|
+
# Added new conditions for 409 and 422
|
|
154
|
+
if http_resp.status == 409:
|
|
155
|
+
raise ConflictException(http_resp=http_resp, body=body, data=data)
|
|
156
|
+
|
|
157
|
+
if http_resp.status == 422:
|
|
158
|
+
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
|
|
159
|
+
|
|
160
|
+
if 500 <= http_resp.status <= 599:
|
|
161
|
+
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
|
162
|
+
raise ApiException(http_resp=http_resp, body=body, data=data)
|
|
163
|
+
|
|
164
|
+
def __str__(self):
|
|
165
|
+
"""Custom error messages for exception"""
|
|
166
|
+
error_message = "({0})\n"\
|
|
167
|
+
"Reason: {1}\n".format(self.status, self.reason)
|
|
168
|
+
if self.headers:
|
|
169
|
+
error_message += "HTTP response headers: {0}\n".format(
|
|
170
|
+
self.headers)
|
|
171
|
+
|
|
172
|
+
if self.data or self.body:
|
|
173
|
+
error_message += "HTTP response body: {0}\n".format(self.data or self.body)
|
|
174
|
+
|
|
175
|
+
return error_message
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
class BadRequestException(ApiException):
|
|
179
|
+
pass
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
class NotFoundException(ApiException):
|
|
183
|
+
pass
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
class UnauthorizedException(ApiException):
|
|
187
|
+
pass
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
class ForbiddenException(ApiException):
|
|
191
|
+
pass
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
class ServiceException(ApiException):
|
|
195
|
+
pass
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
class ConflictException(ApiException):
|
|
199
|
+
"""Exception for HTTP 409 Conflict."""
|
|
200
|
+
pass
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
class UnprocessableEntityException(ApiException):
|
|
204
|
+
"""Exception for HTTP 422 Unprocessable Entity."""
|
|
205
|
+
pass
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
def render_path(path_to_item):
|
|
209
|
+
"""Returns a string representation of a path"""
|
|
210
|
+
result = ""
|
|
211
|
+
for pth in path_to_item:
|
|
212
|
+
if isinstance(pth, int):
|
|
213
|
+
result += "[{0}]".format(pth)
|
|
214
|
+
else:
|
|
215
|
+
result += "['{0}']".format(pth)
|
|
216
|
+
return result
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
"""
|
|
5
|
+
Agent Management API
|
|
6
|
+
|
|
7
|
+
API for managing agents, their templates, and call logs
|
|
8
|
+
|
|
9
|
+
The version of the OpenAPI document: 1.0.0
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# import models into model package
|
|
17
|
+
from smallestai.atoms.models.agent_dto import AgentDTO
|
|
18
|
+
from smallestai.atoms.models.agent_dto_language import AgentDTOLanguage
|
|
19
|
+
from smallestai.atoms.models.agent_dto_synthesizer import AgentDTOSynthesizer
|
|
20
|
+
from smallestai.atoms.models.agent_dto_synthesizer_voice_config import AgentDTOSynthesizerVoiceConfig
|
|
21
|
+
from smallestai.atoms.models.api_response import ApiResponse
|
|
22
|
+
from smallestai.atoms.models.bad_request_error_response import BadRequestErrorResponse
|
|
23
|
+
from smallestai.atoms.models.create_agent_from_template200_response import CreateAgentFromTemplate200Response
|
|
24
|
+
from smallestai.atoms.models.create_agent_from_template_request import CreateAgentFromTemplateRequest
|
|
25
|
+
from smallestai.atoms.models.create_agent_request import CreateAgentRequest
|
|
26
|
+
from smallestai.atoms.models.create_agent_request_language import CreateAgentRequestLanguage
|
|
27
|
+
from smallestai.atoms.models.create_agent_request_language_synthesizer import CreateAgentRequestLanguageSynthesizer
|
|
28
|
+
from smallestai.atoms.models.create_agent_request_language_synthesizer_voice_config import CreateAgentRequestLanguageSynthesizerVoiceConfig
|
|
29
|
+
from smallestai.atoms.models.create_campaign201_response import CreateCampaign201Response
|
|
30
|
+
from smallestai.atoms.models.create_campaign201_response_data import CreateCampaign201ResponseData
|
|
31
|
+
from smallestai.atoms.models.create_campaign_request import CreateCampaignRequest
|
|
32
|
+
from smallestai.atoms.models.create_knowledge_base201_response import CreateKnowledgeBase201Response
|
|
33
|
+
from smallestai.atoms.models.create_knowledge_base_request import CreateKnowledgeBaseRequest
|
|
34
|
+
from smallestai.atoms.models.delete_agent200_response import DeleteAgent200Response
|
|
35
|
+
from smallestai.atoms.models.get_agent_by_id200_response import GetAgentById200Response
|
|
36
|
+
from smallestai.atoms.models.get_agent_templates200_response import GetAgentTemplates200Response
|
|
37
|
+
from smallestai.atoms.models.get_agent_templates200_response_data_inner import GetAgentTemplates200ResponseDataInner
|
|
38
|
+
from smallestai.atoms.models.get_agents200_response import GetAgents200Response
|
|
39
|
+
from smallestai.atoms.models.get_agents200_response_data import GetAgents200ResponseData
|
|
40
|
+
from smallestai.atoms.models.get_campaign_by_id200_response import GetCampaignById200Response
|
|
41
|
+
from smallestai.atoms.models.get_campaign_by_id200_response_data import GetCampaignById200ResponseData
|
|
42
|
+
from smallestai.atoms.models.get_campaigns200_response import GetCampaigns200Response
|
|
43
|
+
from smallestai.atoms.models.get_campaigns200_response_data_inner import GetCampaigns200ResponseDataInner
|
|
44
|
+
from smallestai.atoms.models.get_campaigns200_response_data_inner_agent import GetCampaigns200ResponseDataInnerAgent
|
|
45
|
+
from smallestai.atoms.models.get_campaigns200_response_data_inner_audience import GetCampaigns200ResponseDataInnerAudience
|
|
46
|
+
from smallestai.atoms.models.get_campaigns_request import GetCampaignsRequest
|
|
47
|
+
from smallestai.atoms.models.get_conversation_logs200_response import GetConversationLogs200Response
|
|
48
|
+
from smallestai.atoms.models.get_conversation_logs200_response_data import GetConversationLogs200ResponseData
|
|
49
|
+
from smallestai.atoms.models.get_current_user200_response import GetCurrentUser200Response
|
|
50
|
+
from smallestai.atoms.models.get_current_user200_response_data import GetCurrentUser200ResponseData
|
|
51
|
+
from smallestai.atoms.models.get_knowledge_base_by_id200_response import GetKnowledgeBaseById200Response
|
|
52
|
+
from smallestai.atoms.models.get_knowledge_base_items200_response import GetKnowledgeBaseItems200Response
|
|
53
|
+
from smallestai.atoms.models.get_knowledge_bases200_response import GetKnowledgeBases200Response
|
|
54
|
+
from smallestai.atoms.models.get_organization200_response import GetOrganization200Response
|
|
55
|
+
from smallestai.atoms.models.get_organization200_response_data import GetOrganization200ResponseData
|
|
56
|
+
from smallestai.atoms.models.get_organization200_response_data_members_inner import GetOrganization200ResponseDataMembersInner
|
|
57
|
+
from smallestai.atoms.models.get_organization200_response_data_subscription import GetOrganization200ResponseDataSubscription
|
|
58
|
+
from smallestai.atoms.models.internal_server_error_response import InternalServerErrorResponse
|
|
59
|
+
from smallestai.atoms.models.knowledge_base_dto import KnowledgeBaseDTO
|
|
60
|
+
from smallestai.atoms.models.knowledge_base_item_dto import KnowledgeBaseItemDTO
|
|
61
|
+
from smallestai.atoms.models.start_outbound_call200_response import StartOutboundCall200Response
|
|
62
|
+
from smallestai.atoms.models.start_outbound_call200_response_data import StartOutboundCall200ResponseData
|
|
63
|
+
from smallestai.atoms.models.start_outbound_call_request import StartOutboundCallRequest
|
|
64
|
+
from smallestai.atoms.models.unauthorized_error_reponse import UnauthorizedErrorReponse
|
|
65
|
+
from smallestai.atoms.models.update_agent200_response import UpdateAgent200Response
|
|
66
|
+
from smallestai.atoms.models.update_agent_request import UpdateAgentRequest
|
|
67
|
+
from smallestai.atoms.models.update_agent_request_language import UpdateAgentRequestLanguage
|
|
68
|
+
from smallestai.atoms.models.update_agent_request_synthesizer import UpdateAgentRequestSynthesizer
|
|
69
|
+
from smallestai.atoms.models.update_agent_request_synthesizer_voice_config import UpdateAgentRequestSynthesizerVoiceConfig
|
|
70
|
+
from smallestai.atoms.models.update_agent_request_synthesizer_voice_config_one_of import UpdateAgentRequestSynthesizerVoiceConfigOneOf
|
|
71
|
+
from smallestai.atoms.models.update_agent_request_synthesizer_voice_config_one_of1 import UpdateAgentRequestSynthesizerVoiceConfigOneOf1
|
|
72
|
+
from smallestai.atoms.models.upload_text_to_knowledge_base_request import UploadTextToKnowledgeBaseRequest
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Agent Management API
|
|
5
|
+
|
|
6
|
+
API for managing agents, their templates, and call logs
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from smallestai.atoms.models.agent_dto_language import AgentDTOLanguage
|
|
24
|
+
from smallestai.atoms.models.agent_dto_synthesizer import AgentDTOSynthesizer
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class AgentDTO(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
AgentDTO
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
id: StrictStr = Field(description="The ID of the agent", alias="_id")
|
|
33
|
+
name: StrictStr = Field(description="The name of the agent")
|
|
34
|
+
description: Optional[StrictStr] = Field(default=None, description="The description of the agent")
|
|
35
|
+
organization: Optional[StrictStr] = Field(default=None, description="The organization ID of the agent")
|
|
36
|
+
workflow_id: Optional[StrictStr] = Field(default=None, description="The workflow ID of the agent", alias="workflowId")
|
|
37
|
+
created_by: Optional[StrictStr] = Field(default=None, description="The user ID of the user who created the agent", alias="createdBy")
|
|
38
|
+
global_knowledge_base_id: Optional[StrictStr] = Field(default=None, description="The global knowledge base ID of the agent", alias="globalKnowledgeBaseId")
|
|
39
|
+
language: Optional[AgentDTOLanguage] = None
|
|
40
|
+
synthesizer: Optional[AgentDTOSynthesizer] = None
|
|
41
|
+
slm_model: Optional[StrictStr] = Field(default=None, description="The LLM model to use for the agent. LLM model will be used to generate the response and take decisions based on the user's query.", alias="slmModel")
|
|
42
|
+
default_variables: Optional[Dict[str, Any]] = Field(default=None, description="The default variables to use for the agent. These variables will be used if no variables are provided when initiating a conversation with the agent.", alias="defaultVariables")
|
|
43
|
+
created_at: Optional[datetime] = Field(default=None, description="The date and time when the agent was created", alias="createdAt")
|
|
44
|
+
updated_at: Optional[datetime] = Field(default=None, description="The date and time when the agent was last updated", alias="updatedAt")
|
|
45
|
+
__properties: ClassVar[List[str]] = ["_id", "name", "description", "organization", "workflowId", "createdBy", "globalKnowledgeBaseId", "language", "synthesizer", "slmModel", "defaultVariables", "createdAt", "updatedAt"]
|
|
46
|
+
|
|
47
|
+
@field_validator('slm_model')
|
|
48
|
+
def slm_model_validate_enum(cls, value):
|
|
49
|
+
"""Validates the enum"""
|
|
50
|
+
if value is None:
|
|
51
|
+
return value
|
|
52
|
+
|
|
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
|
+
return value
|
|
56
|
+
|
|
57
|
+
model_config = ConfigDict(
|
|
58
|
+
populate_by_name=True,
|
|
59
|
+
validate_assignment=True,
|
|
60
|
+
protected_namespaces=(),
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def to_str(self) -> str:
|
|
65
|
+
"""Returns the string representation of the model using alias"""
|
|
66
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
67
|
+
|
|
68
|
+
def to_json(self) -> str:
|
|
69
|
+
"""Returns the JSON representation of the model using alias"""
|
|
70
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
71
|
+
return json.dumps(self.to_dict())
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of AgentDTO from a JSON string"""
|
|
76
|
+
return cls.from_dict(json.loads(json_str))
|
|
77
|
+
|
|
78
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
79
|
+
"""Return the dictionary representation of the model using alias.
|
|
80
|
+
|
|
81
|
+
This has the following differences from calling pydantic's
|
|
82
|
+
`self.model_dump(by_alias=True)`:
|
|
83
|
+
|
|
84
|
+
* `None` is only added to the output dict for nullable fields that
|
|
85
|
+
were set at model initialization. Other fields with value `None`
|
|
86
|
+
are ignored.
|
|
87
|
+
"""
|
|
88
|
+
excluded_fields: Set[str] = set([
|
|
89
|
+
])
|
|
90
|
+
|
|
91
|
+
_dict = self.model_dump(
|
|
92
|
+
by_alias=True,
|
|
93
|
+
exclude=excluded_fields,
|
|
94
|
+
exclude_none=True,
|
|
95
|
+
)
|
|
96
|
+
# override the default output from pydantic by calling `to_dict()` of language
|
|
97
|
+
if self.language:
|
|
98
|
+
_dict['language'] = self.language.to_dict()
|
|
99
|
+
# override the default output from pydantic by calling `to_dict()` of synthesizer
|
|
100
|
+
if self.synthesizer:
|
|
101
|
+
_dict['synthesizer'] = self.synthesizer.to_dict()
|
|
102
|
+
return _dict
|
|
103
|
+
|
|
104
|
+
@classmethod
|
|
105
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
106
|
+
"""Create an instance of AgentDTO from a dict"""
|
|
107
|
+
if obj is None:
|
|
108
|
+
return None
|
|
109
|
+
|
|
110
|
+
if not isinstance(obj, dict):
|
|
111
|
+
return cls.model_validate(obj)
|
|
112
|
+
|
|
113
|
+
_obj = cls.model_validate({
|
|
114
|
+
"_id": obj.get("_id"),
|
|
115
|
+
"name": obj.get("name"),
|
|
116
|
+
"description": obj.get("description"),
|
|
117
|
+
"organization": obj.get("organization"),
|
|
118
|
+
"workflowId": obj.get("workflowId"),
|
|
119
|
+
"createdBy": obj.get("createdBy"),
|
|
120
|
+
"globalKnowledgeBaseId": obj.get("globalKnowledgeBaseId"),
|
|
121
|
+
"language": AgentDTOLanguage.from_dict(obj["language"]) if obj.get("language") is not None else None,
|
|
122
|
+
"synthesizer": AgentDTOSynthesizer.from_dict(obj["synthesizer"]) if obj.get("synthesizer") is not None else None,
|
|
123
|
+
"slmModel": obj.get("slmModel"),
|
|
124
|
+
"defaultVariables": obj.get("defaultVariables"),
|
|
125
|
+
"createdAt": obj.get("createdAt"),
|
|
126
|
+
"updatedAt": obj.get("updatedAt")
|
|
127
|
+
})
|
|
128
|
+
return _obj
|
|
129
|
+
|
|
130
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Agent Management API
|
|
5
|
+
|
|
6
|
+
API for managing agents, their templates, and call logs
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class AgentDTOLanguage(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
The language configuration of the agent
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
enabled: Optional[StrictStr] = Field(default=None, description="The language of the agent")
|
|
30
|
+
switching: Optional[StrictBool] = Field(default=None, description="Whether the agent can switch between languages")
|
|
31
|
+
supported: Optional[List[StrictStr]] = Field(default=None, description="The supported languages of the agent")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["enabled", "switching", "supported"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of AgentDTOLanguage from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
return _dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
+
"""Create an instance of AgentDTOLanguage from a dict"""
|
|
78
|
+
if obj is None:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
if not isinstance(obj, dict):
|
|
82
|
+
return cls.model_validate(obj)
|
|
83
|
+
|
|
84
|
+
_obj = cls.model_validate({
|
|
85
|
+
"enabled": obj.get("enabled"),
|
|
86
|
+
"switching": obj.get("switching"),
|
|
87
|
+
"supported": obj.get("supported")
|
|
88
|
+
})
|
|
89
|
+
return _obj
|
|
90
|
+
|
|
91
|
+
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Agent Management API
|
|
5
|
+
|
|
6
|
+
API for managing agents, their templates, and call logs
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
|
+
from smallestai.atoms.models.agent_dto_synthesizer_voice_config import AgentDTOSynthesizerVoiceConfig
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class AgentDTOSynthesizer(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
The synthesizer (TTS) configuration of the agent
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
voice_config: Optional[AgentDTOSynthesizerVoiceConfig] = Field(default=None, alias="voiceConfig")
|
|
31
|
+
speed: Optional[Union[StrictFloat, StrictInt]] = 1.2
|
|
32
|
+
consistency: Optional[Union[StrictFloat, StrictInt]] = Field(default=0.5, description="The consistency of the synthesizer")
|
|
33
|
+
similarity: Optional[Union[StrictFloat, StrictInt]] = Field(default=0, description="The similarity of the synthesizer")
|
|
34
|
+
enhancement: Optional[Union[StrictFloat, StrictInt]] = Field(default=1, description="The enhancement of the synthesizer")
|
|
35
|
+
__properties: ClassVar[List[str]] = ["voiceConfig", "speed", "consistency", "similarity", "enhancement"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
populate_by_name=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
+
return json.dumps(self.to_dict())
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of AgentDTOSynthesizer from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
60
|
+
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
63
|
+
|
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
|
65
|
+
were set at model initialization. Other fields with value `None`
|
|
66
|
+
are ignored.
|
|
67
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
])
|
|
70
|
+
|
|
71
|
+
_dict = self.model_dump(
|
|
72
|
+
by_alias=True,
|
|
73
|
+
exclude=excluded_fields,
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
# override the default output from pydantic by calling `to_dict()` of voice_config
|
|
77
|
+
if self.voice_config:
|
|
78
|
+
_dict['voiceConfig'] = self.voice_config.to_dict()
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of AgentDTOSynthesizer from a dict"""
|
|
84
|
+
if obj is None:
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
if not isinstance(obj, dict):
|
|
88
|
+
return cls.model_validate(obj)
|
|
89
|
+
|
|
90
|
+
_obj = cls.model_validate({
|
|
91
|
+
"voiceConfig": AgentDTOSynthesizerVoiceConfig.from_dict(obj["voiceConfig"]) if obj.get("voiceConfig") is not None else None,
|
|
92
|
+
"speed": obj.get("speed") if obj.get("speed") is not None else 1.2,
|
|
93
|
+
"consistency": obj.get("consistency") if obj.get("consistency") is not None else 0.5,
|
|
94
|
+
"similarity": obj.get("similarity") if obj.get("similarity") is not None else 0,
|
|
95
|
+
"enhancement": obj.get("enhancement") if obj.get("enhancement") is not None else 1
|
|
96
|
+
})
|
|
97
|
+
return _obj
|
|
98
|
+
|
|
99
|
+
|