smallestai 2.1.0__py3-none-any.whl → 3.0.0__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_campaign200_response.py +93 -0
- smallestai/atoms/models/create_campaign200_response_data.py +106 -0
- smallestai/atoms/models/create_campaign200_response_inner.py +106 -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 +114 -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_conversation200_response.py +93 -0
- smallestai/atoms/models/get_conversation200_response_data.py +125 -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 +60 -47
- smallestai/waves/stream_tts.py +272 -0
- {smallest → smallestai/waves}/utils.py +8 -8
- smallest/tts.py → smallestai/waves/waves_client.py +58 -46
- {smallestai-2.1.0.dist-info → smallestai-3.0.0.dist-info}/METADATA +194 -43
- smallestai-3.0.0.dist-info/RECORD +92 -0
- {smallestai-2.1.0.dist-info → smallestai-3.0.0.dist-info}/WHEEL +1 -1
- smallestai-3.0.0.dist-info/top_level.txt +1 -0
- smallest/__init__.py +0 -5
- smallest/stream_tts.py +0 -161
- smallestai-2.1.0.dist-info/RECORD +0 -12
- smallestai-2.1.0.dist-info/top_level.txt +0 -1
- {smallest → smallestai/waves}/exceptions.py +0 -0
- {smallest → smallestai/waves}/models.py +0 -0
- {smallestai-2.1.0.dist-info → smallestai-3.0.0.dist-info/licenses}/LICENSE +0 -0
|
@@ -0,0 +1,124 @@
|
|
|
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, StrictFloat, StrictInt, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from smallestai.atoms.models.create_agent_request_language_synthesizer import CreateAgentRequestLanguageSynthesizer
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class CreateAgentRequestLanguage(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
Language configuration for the agent. You can enable or disable language switching for the agent. This will be used to determine the language of the agent.
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
enabled: Optional[StrictStr] = Field(default=None, description="The language of the agent. You can choose from the list of supported languages.")
|
|
32
|
+
switching: Optional[StrictBool] = Field(default=False, description="Whether to enable language switching for the agent. If enabled, the agent will be able to switch between languages based on the user's language.")
|
|
33
|
+
synthesizer: Optional[CreateAgentRequestLanguageSynthesizer] = None
|
|
34
|
+
speed: Optional[Union[StrictFloat, StrictInt]] = 1.2
|
|
35
|
+
consistency: Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = 0.5
|
|
36
|
+
similarity: Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = 0
|
|
37
|
+
enhancement: Optional[Union[StrictFloat, StrictInt]] = 1
|
|
38
|
+
__properties: ClassVar[List[str]] = ["enabled", "switching", "synthesizer", "speed", "consistency", "similarity", "enhancement"]
|
|
39
|
+
|
|
40
|
+
@field_validator('enabled')
|
|
41
|
+
def enabled_validate_enum(cls, value):
|
|
42
|
+
"""Validates the enum"""
|
|
43
|
+
if value is None:
|
|
44
|
+
return value
|
|
45
|
+
|
|
46
|
+
if value not in set(['en', 'hi']):
|
|
47
|
+
raise ValueError("must be one of enum values ('en', 'hi')")
|
|
48
|
+
return value
|
|
49
|
+
|
|
50
|
+
@field_validator('enhancement')
|
|
51
|
+
def enhancement_validate_enum(cls, value):
|
|
52
|
+
"""Validates the enum"""
|
|
53
|
+
if value is None:
|
|
54
|
+
return value
|
|
55
|
+
|
|
56
|
+
if value not in set([0, 1, 2]):
|
|
57
|
+
raise ValueError("must be one of enum values (0, 1, 2)")
|
|
58
|
+
return value
|
|
59
|
+
|
|
60
|
+
model_config = ConfigDict(
|
|
61
|
+
populate_by_name=True,
|
|
62
|
+
validate_assignment=True,
|
|
63
|
+
protected_namespaces=(),
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def to_str(self) -> str:
|
|
68
|
+
"""Returns the string representation of the model using alias"""
|
|
69
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
70
|
+
|
|
71
|
+
def to_json(self) -> str:
|
|
72
|
+
"""Returns the JSON representation of the model using alias"""
|
|
73
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
74
|
+
return json.dumps(self.to_dict())
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
78
|
+
"""Create an instance of CreateAgentRequestLanguage from a JSON string"""
|
|
79
|
+
return cls.from_dict(json.loads(json_str))
|
|
80
|
+
|
|
81
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
82
|
+
"""Return the dictionary representation of the model using alias.
|
|
83
|
+
|
|
84
|
+
This has the following differences from calling pydantic's
|
|
85
|
+
`self.model_dump(by_alias=True)`:
|
|
86
|
+
|
|
87
|
+
* `None` is only added to the output dict for nullable fields that
|
|
88
|
+
were set at model initialization. Other fields with value `None`
|
|
89
|
+
are ignored.
|
|
90
|
+
"""
|
|
91
|
+
excluded_fields: Set[str] = set([
|
|
92
|
+
])
|
|
93
|
+
|
|
94
|
+
_dict = self.model_dump(
|
|
95
|
+
by_alias=True,
|
|
96
|
+
exclude=excluded_fields,
|
|
97
|
+
exclude_none=True,
|
|
98
|
+
)
|
|
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 CreateAgentRequestLanguage 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
|
+
"enabled": obj.get("enabled"),
|
|
115
|
+
"switching": obj.get("switching") if obj.get("switching") is not None else False,
|
|
116
|
+
"synthesizer": CreateAgentRequestLanguageSynthesizer.from_dict(obj["synthesizer"]) if obj.get("synthesizer") is not None else None,
|
|
117
|
+
"speed": obj.get("speed") if obj.get("speed") is not None else 1.2,
|
|
118
|
+
"consistency": obj.get("consistency") if obj.get("consistency") is not None else 0.5,
|
|
119
|
+
"similarity": obj.get("similarity") if obj.get("similarity") is not None else 0,
|
|
120
|
+
"enhancement": obj.get("enhancement") if obj.get("enhancement") is not None else 1
|
|
121
|
+
})
|
|
122
|
+
return _obj
|
|
123
|
+
|
|
124
|
+
|
|
@@ -0,0 +1,110 @@
|
|
|
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, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from smallestai.atoms.models.create_agent_request_language_synthesizer_voice_config import CreateAgentRequestLanguageSynthesizerVoiceConfig
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class CreateAgentRequestLanguageSynthesizer(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
Synthesizer configuration for the agent. You can configure the synthesizer to use different voices and models. Currently we support 3 types of models for the synthesizer. Waves, Waves Lightning Large and Waves Lightning Large Voice Clone. You can clone your voice using waves platform https://waves.smallest.ai/voice-clone and use the voiceId for this field and select the model as waves_lightning_large_voice_clone to use your cloned voice. When updating the synthesizer configuration to voice clone model, you have to provide model and voiceId and gender all are required fields but when selecting the model as waves or waves and waves_lightning_large, you have to provide only model field and voiceId.
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
voice_config: Optional[CreateAgentRequestLanguageSynthesizerVoiceConfig] = Field(default=None, alias="voiceConfig")
|
|
32
|
+
speed: Optional[Union[StrictFloat, StrictInt]] = 1.2
|
|
33
|
+
consistency: Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = 0.5
|
|
34
|
+
similarity: Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = 0
|
|
35
|
+
enhancement: Optional[Union[StrictFloat, StrictInt]] = 1
|
|
36
|
+
__properties: ClassVar[List[str]] = ["voiceConfig", "speed", "consistency", "similarity", "enhancement"]
|
|
37
|
+
|
|
38
|
+
@field_validator('enhancement')
|
|
39
|
+
def enhancement_validate_enum(cls, value):
|
|
40
|
+
"""Validates the enum"""
|
|
41
|
+
if value is None:
|
|
42
|
+
return value
|
|
43
|
+
|
|
44
|
+
if value not in set([0, 1, 2]):
|
|
45
|
+
raise ValueError("must be one of enum values (0, 1, 2)")
|
|
46
|
+
return value
|
|
47
|
+
|
|
48
|
+
model_config = ConfigDict(
|
|
49
|
+
populate_by_name=True,
|
|
50
|
+
validate_assignment=True,
|
|
51
|
+
protected_namespaces=(),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def to_str(self) -> str:
|
|
56
|
+
"""Returns the string representation of the model using alias"""
|
|
57
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
58
|
+
|
|
59
|
+
def to_json(self) -> str:
|
|
60
|
+
"""Returns the JSON representation of the model using alias"""
|
|
61
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
62
|
+
return json.dumps(self.to_dict())
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
66
|
+
"""Create an instance of CreateAgentRequestLanguageSynthesizer from a JSON string"""
|
|
67
|
+
return cls.from_dict(json.loads(json_str))
|
|
68
|
+
|
|
69
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
70
|
+
"""Return the dictionary representation of the model using alias.
|
|
71
|
+
|
|
72
|
+
This has the following differences from calling pydantic's
|
|
73
|
+
`self.model_dump(by_alias=True)`:
|
|
74
|
+
|
|
75
|
+
* `None` is only added to the output dict for nullable fields that
|
|
76
|
+
were set at model initialization. Other fields with value `None`
|
|
77
|
+
are ignored.
|
|
78
|
+
"""
|
|
79
|
+
excluded_fields: Set[str] = set([
|
|
80
|
+
])
|
|
81
|
+
|
|
82
|
+
_dict = self.model_dump(
|
|
83
|
+
by_alias=True,
|
|
84
|
+
exclude=excluded_fields,
|
|
85
|
+
exclude_none=True,
|
|
86
|
+
)
|
|
87
|
+
# override the default output from pydantic by calling `to_dict()` of voice_config
|
|
88
|
+
if self.voice_config:
|
|
89
|
+
_dict['voiceConfig'] = self.voice_config.to_dict()
|
|
90
|
+
return _dict
|
|
91
|
+
|
|
92
|
+
@classmethod
|
|
93
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
94
|
+
"""Create an instance of CreateAgentRequestLanguageSynthesizer from a dict"""
|
|
95
|
+
if obj is None:
|
|
96
|
+
return None
|
|
97
|
+
|
|
98
|
+
if not isinstance(obj, dict):
|
|
99
|
+
return cls.model_validate(obj)
|
|
100
|
+
|
|
101
|
+
_obj = cls.model_validate({
|
|
102
|
+
"voiceConfig": CreateAgentRequestLanguageSynthesizerVoiceConfig.from_dict(obj["voiceConfig"]) if obj.get("voiceConfig") is not None else None,
|
|
103
|
+
"speed": obj.get("speed") if obj.get("speed") is not None else 1.2,
|
|
104
|
+
"consistency": obj.get("consistency") if obj.get("consistency") is not None else 0.5,
|
|
105
|
+
"similarity": obj.get("similarity") if obj.get("similarity") is not None else 0,
|
|
106
|
+
"enhancement": obj.get("enhancement") if obj.get("enhancement") is not None else 1
|
|
107
|
+
})
|
|
108
|
+
return _obj
|
|
109
|
+
|
|
110
|
+
|
|
@@ -0,0 +1,137 @@
|
|
|
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 json
|
|
17
|
+
import pprint
|
|
18
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
19
|
+
from typing import Any, List, Optional
|
|
20
|
+
from smallestai.atoms.models.update_agent_request_synthesizer_voice_config_one_of import UpdateAgentRequestSynthesizerVoiceConfigOneOf
|
|
21
|
+
from smallestai.atoms.models.update_agent_request_synthesizer_voice_config_one_of1 import UpdateAgentRequestSynthesizerVoiceConfigOneOf1
|
|
22
|
+
from pydantic import StrictStr, Field
|
|
23
|
+
from typing import Union, List, Set, Optional, Dict
|
|
24
|
+
from typing_extensions import Literal, Self
|
|
25
|
+
|
|
26
|
+
CREATEAGENTREQUESTLANGUAGESYNTHESIZERVOICECONFIG_ONE_OF_SCHEMAS = ["UpdateAgentRequestSynthesizerVoiceConfigOneOf", "UpdateAgentRequestSynthesizerVoiceConfigOneOf1"]
|
|
27
|
+
|
|
28
|
+
class CreateAgentRequestLanguageSynthesizerVoiceConfig(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
CreateAgentRequestLanguageSynthesizerVoiceConfig
|
|
31
|
+
"""
|
|
32
|
+
# data type: UpdateAgentRequestSynthesizerVoiceConfigOneOf
|
|
33
|
+
oneof_schema_1_validator: Optional[UpdateAgentRequestSynthesizerVoiceConfigOneOf] = None
|
|
34
|
+
# data type: UpdateAgentRequestSynthesizerVoiceConfigOneOf1
|
|
35
|
+
oneof_schema_2_validator: Optional[UpdateAgentRequestSynthesizerVoiceConfigOneOf1] = None
|
|
36
|
+
actual_instance: Optional[Union[UpdateAgentRequestSynthesizerVoiceConfigOneOf, UpdateAgentRequestSynthesizerVoiceConfigOneOf1]] = None
|
|
37
|
+
one_of_schemas: Set[str] = { "UpdateAgentRequestSynthesizerVoiceConfigOneOf", "UpdateAgentRequestSynthesizerVoiceConfigOneOf1" }
|
|
38
|
+
|
|
39
|
+
model_config = ConfigDict(
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
46
|
+
if args:
|
|
47
|
+
if len(args) > 1:
|
|
48
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
49
|
+
if kwargs:
|
|
50
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
51
|
+
super().__init__(actual_instance=args[0])
|
|
52
|
+
else:
|
|
53
|
+
super().__init__(**kwargs)
|
|
54
|
+
|
|
55
|
+
@field_validator('actual_instance')
|
|
56
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
57
|
+
instance = CreateAgentRequestLanguageSynthesizerVoiceConfig.model_construct()
|
|
58
|
+
error_messages = []
|
|
59
|
+
match = 0
|
|
60
|
+
# validate data type: UpdateAgentRequestSynthesizerVoiceConfigOneOf
|
|
61
|
+
if not isinstance(v, UpdateAgentRequestSynthesizerVoiceConfigOneOf):
|
|
62
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateAgentRequestSynthesizerVoiceConfigOneOf`")
|
|
63
|
+
else:
|
|
64
|
+
match += 1
|
|
65
|
+
# validate data type: UpdateAgentRequestSynthesizerVoiceConfigOneOf1
|
|
66
|
+
if not isinstance(v, UpdateAgentRequestSynthesizerVoiceConfigOneOf1):
|
|
67
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `UpdateAgentRequestSynthesizerVoiceConfigOneOf1`")
|
|
68
|
+
else:
|
|
69
|
+
match += 1
|
|
70
|
+
if match > 1:
|
|
71
|
+
# more than 1 match
|
|
72
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in CreateAgentRequestLanguageSynthesizerVoiceConfig with oneOf schemas: UpdateAgentRequestSynthesizerVoiceConfigOneOf, UpdateAgentRequestSynthesizerVoiceConfigOneOf1. Details: " + ", ".join(error_messages))
|
|
73
|
+
elif match == 0:
|
|
74
|
+
# no match
|
|
75
|
+
raise ValueError("No match found when setting `actual_instance` in CreateAgentRequestLanguageSynthesizerVoiceConfig with oneOf schemas: UpdateAgentRequestSynthesizerVoiceConfigOneOf, UpdateAgentRequestSynthesizerVoiceConfigOneOf1. Details: " + ", ".join(error_messages))
|
|
76
|
+
else:
|
|
77
|
+
return v
|
|
78
|
+
|
|
79
|
+
@classmethod
|
|
80
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
81
|
+
return cls.from_json(json.dumps(obj))
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def from_json(cls, json_str: str) -> Self:
|
|
85
|
+
"""Returns the object represented by the json string"""
|
|
86
|
+
instance = cls.model_construct()
|
|
87
|
+
error_messages = []
|
|
88
|
+
match = 0
|
|
89
|
+
|
|
90
|
+
# deserialize data into UpdateAgentRequestSynthesizerVoiceConfigOneOf
|
|
91
|
+
try:
|
|
92
|
+
instance.actual_instance = UpdateAgentRequestSynthesizerVoiceConfigOneOf.from_json(json_str)
|
|
93
|
+
match += 1
|
|
94
|
+
except (ValidationError, ValueError) as e:
|
|
95
|
+
error_messages.append(str(e))
|
|
96
|
+
# deserialize data into UpdateAgentRequestSynthesizerVoiceConfigOneOf1
|
|
97
|
+
try:
|
|
98
|
+
instance.actual_instance = UpdateAgentRequestSynthesizerVoiceConfigOneOf1.from_json(json_str)
|
|
99
|
+
match += 1
|
|
100
|
+
except (ValidationError, ValueError) as e:
|
|
101
|
+
error_messages.append(str(e))
|
|
102
|
+
|
|
103
|
+
if match > 1:
|
|
104
|
+
# more than 1 match
|
|
105
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into CreateAgentRequestLanguageSynthesizerVoiceConfig with oneOf schemas: UpdateAgentRequestSynthesizerVoiceConfigOneOf, UpdateAgentRequestSynthesizerVoiceConfigOneOf1. Details: " + ", ".join(error_messages))
|
|
106
|
+
elif match == 0:
|
|
107
|
+
# no match
|
|
108
|
+
raise ValueError("No match found when deserializing the JSON string into CreateAgentRequestLanguageSynthesizerVoiceConfig with oneOf schemas: UpdateAgentRequestSynthesizerVoiceConfigOneOf, UpdateAgentRequestSynthesizerVoiceConfigOneOf1. Details: " + ", ".join(error_messages))
|
|
109
|
+
else:
|
|
110
|
+
return instance
|
|
111
|
+
|
|
112
|
+
def to_json(self) -> str:
|
|
113
|
+
"""Returns the JSON representation of the actual instance"""
|
|
114
|
+
if self.actual_instance is None:
|
|
115
|
+
return "null"
|
|
116
|
+
|
|
117
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
118
|
+
return self.actual_instance.to_json()
|
|
119
|
+
else:
|
|
120
|
+
return json.dumps(self.actual_instance)
|
|
121
|
+
|
|
122
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], UpdateAgentRequestSynthesizerVoiceConfigOneOf, UpdateAgentRequestSynthesizerVoiceConfigOneOf1]]:
|
|
123
|
+
"""Returns the dict representation of the actual instance"""
|
|
124
|
+
if self.actual_instance is None:
|
|
125
|
+
return None
|
|
126
|
+
|
|
127
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
128
|
+
return self.actual_instance.to_dict()
|
|
129
|
+
else:
|
|
130
|
+
# primitive type
|
|
131
|
+
return self.actual_instance
|
|
132
|
+
|
|
133
|
+
def to_str(self) -> str:
|
|
134
|
+
"""Returns the string representation of the actual instance"""
|
|
135
|
+
return pprint.pformat(self.model_dump())
|
|
136
|
+
|
|
137
|
+
|
|
@@ -0,0 +1,93 @@
|
|
|
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, StrictBool
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from smallestai.atoms.models.create_campaign200_response_data import CreateCampaign200ResponseData
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class CreateCampaign200Response(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
CreateCampaign200Response
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
status: Optional[StrictBool] = None
|
|
31
|
+
data: Optional[CreateCampaign200ResponseData] = None
|
|
32
|
+
__properties: ClassVar[List[str]] = ["status", "data"]
|
|
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 CreateCampaign200Response 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
|
+
# override the default output from pydantic by calling `to_dict()` of data
|
|
74
|
+
if self.data:
|
|
75
|
+
_dict['data'] = self.data.to_dict()
|
|
76
|
+
return _dict
|
|
77
|
+
|
|
78
|
+
@classmethod
|
|
79
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
80
|
+
"""Create an instance of CreateCampaign200Response from a dict"""
|
|
81
|
+
if obj is None:
|
|
82
|
+
return None
|
|
83
|
+
|
|
84
|
+
if not isinstance(obj, dict):
|
|
85
|
+
return cls.model_validate(obj)
|
|
86
|
+
|
|
87
|
+
_obj = cls.model_validate({
|
|
88
|
+
"status": obj.get("status"),
|
|
89
|
+
"data": CreateCampaign200ResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
92
|
+
|
|
93
|
+
|
|
@@ -0,0 +1,106 @@
|
|
|
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, StrictInt, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class CreateCampaign200ResponseData(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
CreateCampaign200ResponseData
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
id: Optional[StrictStr] = Field(default=None, description="The unique identifier for the campaign", alias="_id")
|
|
31
|
+
name: Optional[StrictStr] = Field(default=None, description="The name of the campaign")
|
|
32
|
+
description: Optional[StrictStr] = Field(default=None, description="The description of the campaign")
|
|
33
|
+
organization: Optional[StrictStr] = Field(default=None, description="The ID of the organization")
|
|
34
|
+
agent_id: Optional[StrictStr] = Field(default=None, description="The ID of the agent", alias="agentId")
|
|
35
|
+
created_by: Optional[StrictStr] = Field(default=None, description="The ID of the user who created the campaign", alias="createdBy")
|
|
36
|
+
audience_id: Optional[StrictStr] = Field(default=None, description="The ID of the audience", alias="audienceId")
|
|
37
|
+
participants_count: Optional[StrictInt] = Field(default=None, description="The number of participants in the campaign", alias="participantsCount")
|
|
38
|
+
created_at: Optional[datetime] = Field(default=None, description="The date and time when the campaign was created", alias="createdAt")
|
|
39
|
+
updated_at: Optional[datetime] = Field(default=None, description="The date and time when the campaign was last updated", alias="updatedAt")
|
|
40
|
+
__properties: ClassVar[List[str]] = ["_id", "name", "description", "organization", "agentId", "createdBy", "audienceId", "participantsCount", "createdAt", "updatedAt"]
|
|
41
|
+
|
|
42
|
+
model_config = ConfigDict(
|
|
43
|
+
populate_by_name=True,
|
|
44
|
+
validate_assignment=True,
|
|
45
|
+
protected_namespaces=(),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def to_str(self) -> str:
|
|
50
|
+
"""Returns the string representation of the model using alias"""
|
|
51
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
52
|
+
|
|
53
|
+
def to_json(self) -> str:
|
|
54
|
+
"""Returns the JSON representation of the model using alias"""
|
|
55
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
56
|
+
return json.dumps(self.to_dict())
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
60
|
+
"""Create an instance of CreateCampaign200ResponseData from a JSON string"""
|
|
61
|
+
return cls.from_dict(json.loads(json_str))
|
|
62
|
+
|
|
63
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
64
|
+
"""Return the dictionary representation of the model using alias.
|
|
65
|
+
|
|
66
|
+
This has the following differences from calling pydantic's
|
|
67
|
+
`self.model_dump(by_alias=True)`:
|
|
68
|
+
|
|
69
|
+
* `None` is only added to the output dict for nullable fields that
|
|
70
|
+
were set at model initialization. Other fields with value `None`
|
|
71
|
+
are ignored.
|
|
72
|
+
"""
|
|
73
|
+
excluded_fields: Set[str] = set([
|
|
74
|
+
])
|
|
75
|
+
|
|
76
|
+
_dict = self.model_dump(
|
|
77
|
+
by_alias=True,
|
|
78
|
+
exclude=excluded_fields,
|
|
79
|
+
exclude_none=True,
|
|
80
|
+
)
|
|
81
|
+
return _dict
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
85
|
+
"""Create an instance of CreateCampaign200ResponseData from a dict"""
|
|
86
|
+
if obj is None:
|
|
87
|
+
return None
|
|
88
|
+
|
|
89
|
+
if not isinstance(obj, dict):
|
|
90
|
+
return cls.model_validate(obj)
|
|
91
|
+
|
|
92
|
+
_obj = cls.model_validate({
|
|
93
|
+
"_id": obj.get("_id"),
|
|
94
|
+
"name": obj.get("name"),
|
|
95
|
+
"description": obj.get("description"),
|
|
96
|
+
"organization": obj.get("organization"),
|
|
97
|
+
"agentId": obj.get("agentId"),
|
|
98
|
+
"createdBy": obj.get("createdBy"),
|
|
99
|
+
"audienceId": obj.get("audienceId"),
|
|
100
|
+
"participantsCount": obj.get("participantsCount"),
|
|
101
|
+
"createdAt": obj.get("createdAt"),
|
|
102
|
+
"updatedAt": obj.get("updatedAt")
|
|
103
|
+
})
|
|
104
|
+
return _obj
|
|
105
|
+
|
|
106
|
+
|
|
@@ -0,0 +1,106 @@
|
|
|
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, StrictInt, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class CreateCampaign200ResponseInner(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
CreateCampaign200ResponseInner
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
id: Optional[StrictStr] = Field(default=None, description="The unique identifier for the campaign", alias="_id")
|
|
31
|
+
name: Optional[StrictStr] = Field(default=None, description="The name of the campaign")
|
|
32
|
+
description: Optional[StrictStr] = Field(default=None, description="The description of the campaign")
|
|
33
|
+
organization: Optional[StrictStr] = Field(default=None, description="The ID of the organization")
|
|
34
|
+
agent_id: Optional[StrictStr] = Field(default=None, description="The ID of the agent", alias="agentId")
|
|
35
|
+
created_by: Optional[StrictStr] = Field(default=None, description="The ID of the user who created the campaign", alias="createdBy")
|
|
36
|
+
audience_id: Optional[StrictStr] = Field(default=None, description="The ID of the audience", alias="audienceId")
|
|
37
|
+
participants_count: Optional[StrictInt] = Field(default=None, description="The number of participants in the campaign", alias="participantsCount")
|
|
38
|
+
created_at: Optional[datetime] = Field(default=None, description="The date and time when the campaign was created", alias="createdAt")
|
|
39
|
+
updated_at: Optional[datetime] = Field(default=None, description="The date and time when the campaign was last updated", alias="updatedAt")
|
|
40
|
+
__properties: ClassVar[List[str]] = ["_id", "name", "description", "organization", "agentId", "createdBy", "audienceId", "participantsCount", "createdAt", "updatedAt"]
|
|
41
|
+
|
|
42
|
+
model_config = ConfigDict(
|
|
43
|
+
populate_by_name=True,
|
|
44
|
+
validate_assignment=True,
|
|
45
|
+
protected_namespaces=(),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def to_str(self) -> str:
|
|
50
|
+
"""Returns the string representation of the model using alias"""
|
|
51
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
52
|
+
|
|
53
|
+
def to_json(self) -> str:
|
|
54
|
+
"""Returns the JSON representation of the model using alias"""
|
|
55
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
56
|
+
return json.dumps(self.to_dict())
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
60
|
+
"""Create an instance of CreateCampaign200ResponseInner from a JSON string"""
|
|
61
|
+
return cls.from_dict(json.loads(json_str))
|
|
62
|
+
|
|
63
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
64
|
+
"""Return the dictionary representation of the model using alias.
|
|
65
|
+
|
|
66
|
+
This has the following differences from calling pydantic's
|
|
67
|
+
`self.model_dump(by_alias=True)`:
|
|
68
|
+
|
|
69
|
+
* `None` is only added to the output dict for nullable fields that
|
|
70
|
+
were set at model initialization. Other fields with value `None`
|
|
71
|
+
are ignored.
|
|
72
|
+
"""
|
|
73
|
+
excluded_fields: Set[str] = set([
|
|
74
|
+
])
|
|
75
|
+
|
|
76
|
+
_dict = self.model_dump(
|
|
77
|
+
by_alias=True,
|
|
78
|
+
exclude=excluded_fields,
|
|
79
|
+
exclude_none=True,
|
|
80
|
+
)
|
|
81
|
+
return _dict
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
85
|
+
"""Create an instance of CreateCampaign200ResponseInner from a dict"""
|
|
86
|
+
if obj is None:
|
|
87
|
+
return None
|
|
88
|
+
|
|
89
|
+
if not isinstance(obj, dict):
|
|
90
|
+
return cls.model_validate(obj)
|
|
91
|
+
|
|
92
|
+
_obj = cls.model_validate({
|
|
93
|
+
"_id": obj.get("_id"),
|
|
94
|
+
"name": obj.get("name"),
|
|
95
|
+
"description": obj.get("description"),
|
|
96
|
+
"organization": obj.get("organization"),
|
|
97
|
+
"agentId": obj.get("agentId"),
|
|
98
|
+
"createdBy": obj.get("createdBy"),
|
|
99
|
+
"audienceId": obj.get("audienceId"),
|
|
100
|
+
"participantsCount": obj.get("participantsCount"),
|
|
101
|
+
"createdAt": obj.get("createdAt"),
|
|
102
|
+
"updatedAt": obj.get("updatedAt")
|
|
103
|
+
})
|
|
104
|
+
return _obj
|
|
105
|
+
|
|
106
|
+
|