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,101 @@
|
|
|
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, StrictInt
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from smallestai.atoms.models.agent_dto import AgentDTO
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class GetAgents200ResponseData(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
GetAgents200ResponseData
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
agents: Optional[List[AgentDTO]] = None
|
|
31
|
+
total_count: Optional[StrictInt] = Field(default=None, description="Total number of agents", alias="totalCount")
|
|
32
|
+
has_more: Optional[StrictBool] = Field(default=None, description="Whether there are more agents to fetch", alias="hasMore")
|
|
33
|
+
is_search_results: Optional[StrictBool] = Field(default=None, description="Whether the results are from a search query", alias="isSearchResults")
|
|
34
|
+
__properties: ClassVar[List[str]] = ["agents", "totalCount", "hasMore", "isSearchResults"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
+
return json.dumps(self.to_dict())
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of GetAgents200ResponseData from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
# override the default output from pydantic by calling `to_dict()` of each item in agents (list)
|
|
76
|
+
_items = []
|
|
77
|
+
if self.agents:
|
|
78
|
+
for _item_agents in self.agents:
|
|
79
|
+
if _item_agents:
|
|
80
|
+
_items.append(_item_agents.to_dict())
|
|
81
|
+
_dict['agents'] = _items
|
|
82
|
+
return _dict
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
86
|
+
"""Create an instance of GetAgents200ResponseData from a dict"""
|
|
87
|
+
if obj is None:
|
|
88
|
+
return None
|
|
89
|
+
|
|
90
|
+
if not isinstance(obj, dict):
|
|
91
|
+
return cls.model_validate(obj)
|
|
92
|
+
|
|
93
|
+
_obj = cls.model_validate({
|
|
94
|
+
"agents": [AgentDTO.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None,
|
|
95
|
+
"totalCount": obj.get("totalCount"),
|
|
96
|
+
"hasMore": obj.get("hasMore"),
|
|
97
|
+
"isSearchResults": obj.get("isSearchResults")
|
|
98
|
+
})
|
|
99
|
+
return _obj
|
|
100
|
+
|
|
101
|
+
|
|
@@ -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.get_campaign_by_id200_response_data import GetCampaignById200ResponseData
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class GetCampaignById200Response(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
GetCampaignById200Response
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
status: Optional[StrictBool] = None
|
|
31
|
+
data: Optional[GetCampaignById200ResponseData] = 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 GetCampaignById200Response 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 GetCampaignById200Response 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": GetCampaignById200ResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
92
|
+
|
|
93
|
+
|
|
@@ -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 datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, 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 GetCampaignById200ResponseData(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
GetCampaignById200ResponseData
|
|
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
|
+
is_campaign_in_progress: Optional[StrictBool] = Field(default=None, description="Whether the campaign is in progress", alias="isCampaignInProgress")
|
|
41
|
+
is_campaign_completed: Optional[StrictBool] = Field(default=None, description="Whether the campaign is completed", alias="isCampaignCompleted")
|
|
42
|
+
__properties: ClassVar[List[str]] = ["_id", "name", "description", "organization", "agentId", "createdBy", "audienceId", "participantsCount", "createdAt", "updatedAt", "isCampaignInProgress", "isCampaignCompleted"]
|
|
43
|
+
|
|
44
|
+
model_config = ConfigDict(
|
|
45
|
+
populate_by_name=True,
|
|
46
|
+
validate_assignment=True,
|
|
47
|
+
protected_namespaces=(),
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def to_str(self) -> str:
|
|
52
|
+
"""Returns the string representation of the model using alias"""
|
|
53
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
54
|
+
|
|
55
|
+
def to_json(self) -> str:
|
|
56
|
+
"""Returns the JSON representation of the model using alias"""
|
|
57
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
58
|
+
return json.dumps(self.to_dict())
|
|
59
|
+
|
|
60
|
+
@classmethod
|
|
61
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
62
|
+
"""Create an instance of GetCampaignById200ResponseData from a JSON string"""
|
|
63
|
+
return cls.from_dict(json.loads(json_str))
|
|
64
|
+
|
|
65
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
66
|
+
"""Return the dictionary representation of the model using alias.
|
|
67
|
+
|
|
68
|
+
This has the following differences from calling pydantic's
|
|
69
|
+
`self.model_dump(by_alias=True)`:
|
|
70
|
+
|
|
71
|
+
* `None` is only added to the output dict for nullable fields that
|
|
72
|
+
were set at model initialization. Other fields with value `None`
|
|
73
|
+
are ignored.
|
|
74
|
+
"""
|
|
75
|
+
excluded_fields: Set[str] = set([
|
|
76
|
+
])
|
|
77
|
+
|
|
78
|
+
_dict = self.model_dump(
|
|
79
|
+
by_alias=True,
|
|
80
|
+
exclude=excluded_fields,
|
|
81
|
+
exclude_none=True,
|
|
82
|
+
)
|
|
83
|
+
return _dict
|
|
84
|
+
|
|
85
|
+
@classmethod
|
|
86
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
87
|
+
"""Create an instance of GetCampaignById200ResponseData from a dict"""
|
|
88
|
+
if obj is None:
|
|
89
|
+
return None
|
|
90
|
+
|
|
91
|
+
if not isinstance(obj, dict):
|
|
92
|
+
return cls.model_validate(obj)
|
|
93
|
+
|
|
94
|
+
_obj = cls.model_validate({
|
|
95
|
+
"_id": obj.get("_id"),
|
|
96
|
+
"name": obj.get("name"),
|
|
97
|
+
"description": obj.get("description"),
|
|
98
|
+
"organization": obj.get("organization"),
|
|
99
|
+
"agentId": obj.get("agentId"),
|
|
100
|
+
"createdBy": obj.get("createdBy"),
|
|
101
|
+
"audienceId": obj.get("audienceId"),
|
|
102
|
+
"participantsCount": obj.get("participantsCount"),
|
|
103
|
+
"createdAt": obj.get("createdAt"),
|
|
104
|
+
"updatedAt": obj.get("updatedAt"),
|
|
105
|
+
"isCampaignInProgress": obj.get("isCampaignInProgress"),
|
|
106
|
+
"isCampaignCompleted": obj.get("isCampaignCompleted")
|
|
107
|
+
})
|
|
108
|
+
return _obj
|
|
109
|
+
|
|
110
|
+
|
|
@@ -0,0 +1,97 @@
|
|
|
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.get_campaigns200_response_data_inner import GetCampaigns200ResponseDataInner
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class GetCampaigns200Response(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
GetCampaigns200Response
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
status: Optional[StrictBool] = None
|
|
31
|
+
data: Optional[List[GetCampaigns200ResponseDataInner]] = 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 GetCampaigns200Response 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 each item in data (list)
|
|
74
|
+
_items = []
|
|
75
|
+
if self.data:
|
|
76
|
+
for _item_data in self.data:
|
|
77
|
+
if _item_data:
|
|
78
|
+
_items.append(_item_data.to_dict())
|
|
79
|
+
_dict['data'] = _items
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of GetCampaigns200Response from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate({
|
|
92
|
+
"status": obj.get("status"),
|
|
93
|
+
"data": [GetCampaigns200ResponseDataInner.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None
|
|
94
|
+
})
|
|
95
|
+
return _obj
|
|
96
|
+
|
|
97
|
+
|
|
@@ -0,0 +1,118 @@
|
|
|
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, StrictBool, StrictInt, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from smallestai.atoms.models.get_campaigns200_response_data_inner_agent import GetCampaigns200ResponseDataInnerAgent
|
|
24
|
+
from smallestai.atoms.models.get_campaigns200_response_data_inner_audience import GetCampaigns200ResponseDataInnerAudience
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class GetCampaigns200ResponseDataInner(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
GetCampaigns200ResponseDataInner
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
id: StrictStr = Field(description="The unique identifier for the campaign", alias="_id")
|
|
33
|
+
name: StrictStr = Field(description="The name of the campaign")
|
|
34
|
+
description: Optional[StrictStr] = Field(default=None, description="The description of the campaign")
|
|
35
|
+
organization: Optional[StrictStr] = Field(default=None, description="The ID of the organization")
|
|
36
|
+
agent: Optional[GetCampaigns200ResponseDataInnerAgent] = None
|
|
37
|
+
created_by: Optional[StrictStr] = Field(default=None, description="The ID of the user who created the campaign", alias="createdBy")
|
|
38
|
+
audience: Optional[GetCampaigns200ResponseDataInnerAudience] = None
|
|
39
|
+
participants_count: Optional[StrictInt] = Field(default=None, description="The number of participants in the campaign", alias="participantsCount")
|
|
40
|
+
created_at: Optional[datetime] = Field(default=None, description="The date and time when the campaign was created", alias="createdAt")
|
|
41
|
+
updated_at: Optional[datetime] = Field(default=None, description="The date and time when the campaign was last updated", alias="updatedAt")
|
|
42
|
+
is_campaign_in_progress: Optional[StrictBool] = Field(default=None, description="Whether the campaign is in progress", alias="isCampaignInProgress")
|
|
43
|
+
is_campaign_completed: Optional[StrictBool] = Field(default=None, description="Whether the campaign is completed", alias="isCampaignCompleted")
|
|
44
|
+
__properties: ClassVar[List[str]] = ["_id", "name", "description", "organization", "agent", "createdBy", "audience", "participantsCount", "createdAt", "updatedAt", "isCampaignInProgress", "isCampaignCompleted"]
|
|
45
|
+
|
|
46
|
+
model_config = ConfigDict(
|
|
47
|
+
populate_by_name=True,
|
|
48
|
+
validate_assignment=True,
|
|
49
|
+
protected_namespaces=(),
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def to_str(self) -> str:
|
|
54
|
+
"""Returns the string representation of the model using alias"""
|
|
55
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
56
|
+
|
|
57
|
+
def to_json(self) -> str:
|
|
58
|
+
"""Returns the JSON representation of the model using alias"""
|
|
59
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
60
|
+
return json.dumps(self.to_dict())
|
|
61
|
+
|
|
62
|
+
@classmethod
|
|
63
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
64
|
+
"""Create an instance of GetCampaigns200ResponseDataInner from a JSON string"""
|
|
65
|
+
return cls.from_dict(json.loads(json_str))
|
|
66
|
+
|
|
67
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
68
|
+
"""Return the dictionary representation of the model using alias.
|
|
69
|
+
|
|
70
|
+
This has the following differences from calling pydantic's
|
|
71
|
+
`self.model_dump(by_alias=True)`:
|
|
72
|
+
|
|
73
|
+
* `None` is only added to the output dict for nullable fields that
|
|
74
|
+
were set at model initialization. Other fields with value `None`
|
|
75
|
+
are ignored.
|
|
76
|
+
"""
|
|
77
|
+
excluded_fields: Set[str] = set([
|
|
78
|
+
])
|
|
79
|
+
|
|
80
|
+
_dict = self.model_dump(
|
|
81
|
+
by_alias=True,
|
|
82
|
+
exclude=excluded_fields,
|
|
83
|
+
exclude_none=True,
|
|
84
|
+
)
|
|
85
|
+
# override the default output from pydantic by calling `to_dict()` of agent
|
|
86
|
+
if self.agent:
|
|
87
|
+
_dict['agent'] = self.agent.to_dict()
|
|
88
|
+
# override the default output from pydantic by calling `to_dict()` of audience
|
|
89
|
+
if self.audience:
|
|
90
|
+
_dict['audience'] = self.audience.to_dict()
|
|
91
|
+
return _dict
|
|
92
|
+
|
|
93
|
+
@classmethod
|
|
94
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
95
|
+
"""Create an instance of GetCampaigns200ResponseDataInner from a dict"""
|
|
96
|
+
if obj is None:
|
|
97
|
+
return None
|
|
98
|
+
|
|
99
|
+
if not isinstance(obj, dict):
|
|
100
|
+
return cls.model_validate(obj)
|
|
101
|
+
|
|
102
|
+
_obj = cls.model_validate({
|
|
103
|
+
"_id": obj.get("_id"),
|
|
104
|
+
"name": obj.get("name"),
|
|
105
|
+
"description": obj.get("description"),
|
|
106
|
+
"organization": obj.get("organization"),
|
|
107
|
+
"agent": GetCampaigns200ResponseDataInnerAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None,
|
|
108
|
+
"createdBy": obj.get("createdBy"),
|
|
109
|
+
"audience": GetCampaigns200ResponseDataInnerAudience.from_dict(obj["audience"]) if obj.get("audience") is not None else None,
|
|
110
|
+
"participantsCount": obj.get("participantsCount"),
|
|
111
|
+
"createdAt": obj.get("createdAt"),
|
|
112
|
+
"updatedAt": obj.get("updatedAt"),
|
|
113
|
+
"isCampaignInProgress": obj.get("isCampaignInProgress"),
|
|
114
|
+
"isCampaignCompleted": obj.get("isCampaignCompleted")
|
|
115
|
+
})
|
|
116
|
+
return _obj
|
|
117
|
+
|
|
118
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
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, 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 GetCampaigns200ResponseDataInnerAgent(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
GetCampaigns200ResponseDataInnerAgent
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
id: Optional[StrictStr] = Field(default=None, description="The ID of the agent", alias="_id")
|
|
30
|
+
name: Optional[StrictStr] = Field(default=None, description="The name of the agent")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["_id", "name"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of GetCampaigns200ResponseDataInnerAgent from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
return _dict
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
+
"""Create an instance of GetCampaigns200ResponseDataInnerAgent from a dict"""
|
|
77
|
+
if obj is None:
|
|
78
|
+
return None
|
|
79
|
+
|
|
80
|
+
if not isinstance(obj, dict):
|
|
81
|
+
return cls.model_validate(obj)
|
|
82
|
+
|
|
83
|
+
_obj = cls.model_validate({
|
|
84
|
+
"_id": obj.get("_id"),
|
|
85
|
+
"name": obj.get("name")
|
|
86
|
+
})
|
|
87
|
+
return _obj
|
|
88
|
+
|
|
89
|
+
|