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.

Files changed (96) hide show
  1. smallestai/__init__.py +95 -0
  2. smallestai/atoms/__init__.py +182 -0
  3. smallestai/atoms/api/__init__.py +12 -0
  4. smallestai/atoms/api/agent_templates_api.py +573 -0
  5. smallestai/atoms/api/agents_api.py +1465 -0
  6. smallestai/atoms/api/calls_api.py +320 -0
  7. smallestai/atoms/api/campaigns_api.py +1689 -0
  8. smallestai/atoms/api/knowledge_base_api.py +2271 -0
  9. smallestai/atoms/api/logs_api.py +305 -0
  10. smallestai/atoms/api/organization_api.py +285 -0
  11. smallestai/atoms/api/user_api.py +285 -0
  12. smallestai/atoms/api_client.py +797 -0
  13. smallestai/atoms/api_response.py +21 -0
  14. smallestai/atoms/atoms_client.py +560 -0
  15. smallestai/atoms/configuration.py +582 -0
  16. smallestai/atoms/exceptions.py +216 -0
  17. smallestai/atoms/models/__init__.py +72 -0
  18. smallestai/atoms/models/agent_dto.py +130 -0
  19. smallestai/atoms/models/agent_dto_language.py +91 -0
  20. smallestai/atoms/models/agent_dto_synthesizer.py +99 -0
  21. smallestai/atoms/models/agent_dto_synthesizer_voice_config.py +111 -0
  22. smallestai/atoms/models/api_response.py +89 -0
  23. smallestai/atoms/models/bad_request_error_response.py +89 -0
  24. smallestai/atoms/models/create_agent_from_template200_response.py +89 -0
  25. smallestai/atoms/models/create_agent_from_template_request.py +91 -0
  26. smallestai/atoms/models/create_agent_request.py +113 -0
  27. smallestai/atoms/models/create_agent_request_language.py +124 -0
  28. smallestai/atoms/models/create_agent_request_language_synthesizer.py +110 -0
  29. smallestai/atoms/models/create_agent_request_language_synthesizer_voice_config.py +137 -0
  30. smallestai/atoms/models/create_campaign200_response.py +93 -0
  31. smallestai/atoms/models/create_campaign200_response_data.py +106 -0
  32. smallestai/atoms/models/create_campaign200_response_inner.py +106 -0
  33. smallestai/atoms/models/create_campaign201_response.py +93 -0
  34. smallestai/atoms/models/create_campaign201_response_data.py +104 -0
  35. smallestai/atoms/models/create_campaign_request.py +93 -0
  36. smallestai/atoms/models/create_knowledge_base201_response.py +89 -0
  37. smallestai/atoms/models/create_knowledge_base_request.py +89 -0
  38. smallestai/atoms/models/delete_agent200_response.py +87 -0
  39. smallestai/atoms/models/get_agent_by_id200_response.py +93 -0
  40. smallestai/atoms/models/get_agent_templates200_response.py +97 -0
  41. smallestai/atoms/models/get_agent_templates200_response_data_inner.py +97 -0
  42. smallestai/atoms/models/get_agents200_response.py +93 -0
  43. smallestai/atoms/models/get_agents200_response_data.py +101 -0
  44. smallestai/atoms/models/get_campaign_by_id200_response.py +93 -0
  45. smallestai/atoms/models/get_campaign_by_id200_response_data.py +114 -0
  46. smallestai/atoms/models/get_campaigns200_response.py +97 -0
  47. smallestai/atoms/models/get_campaigns200_response_data_inner.py +118 -0
  48. smallestai/atoms/models/get_campaigns200_response_data_inner_agent.py +89 -0
  49. smallestai/atoms/models/get_campaigns200_response_data_inner_audience.py +89 -0
  50. smallestai/atoms/models/get_campaigns_request.py +89 -0
  51. smallestai/atoms/models/get_conversation200_response.py +93 -0
  52. smallestai/atoms/models/get_conversation200_response_data.py +125 -0
  53. smallestai/atoms/models/get_conversation_logs200_response.py +93 -0
  54. smallestai/atoms/models/get_conversation_logs200_response_data.py +125 -0
  55. smallestai/atoms/models/get_current_user200_response.py +93 -0
  56. smallestai/atoms/models/get_current_user200_response_data.py +99 -0
  57. smallestai/atoms/models/get_knowledge_base_by_id200_response.py +93 -0
  58. smallestai/atoms/models/get_knowledge_base_items200_response.py +97 -0
  59. smallestai/atoms/models/get_knowledge_bases200_response.py +97 -0
  60. smallestai/atoms/models/get_organization200_response.py +93 -0
  61. smallestai/atoms/models/get_organization200_response_data.py +105 -0
  62. smallestai/atoms/models/get_organization200_response_data_members_inner.py +89 -0
  63. smallestai/atoms/models/get_organization200_response_data_subscription.py +87 -0
  64. smallestai/atoms/models/internal_server_error_response.py +89 -0
  65. smallestai/atoms/models/knowledge_base_dto.py +93 -0
  66. smallestai/atoms/models/knowledge_base_item_dto.py +124 -0
  67. smallestai/atoms/models/start_outbound_call200_response.py +93 -0
  68. smallestai/atoms/models/start_outbound_call200_response_data.py +87 -0
  69. smallestai/atoms/models/start_outbound_call_request.py +89 -0
  70. smallestai/atoms/models/unauthorized_error_reponse.py +89 -0
  71. smallestai/atoms/models/update_agent200_response.py +89 -0
  72. smallestai/atoms/models/update_agent_request.py +119 -0
  73. smallestai/atoms/models/update_agent_request_language.py +99 -0
  74. smallestai/atoms/models/update_agent_request_synthesizer.py +110 -0
  75. smallestai/atoms/models/update_agent_request_synthesizer_voice_config.py +137 -0
  76. smallestai/atoms/models/update_agent_request_synthesizer_voice_config_one_of.py +111 -0
  77. smallestai/atoms/models/update_agent_request_synthesizer_voice_config_one_of1.py +99 -0
  78. smallestai/atoms/models/upload_text_to_knowledge_base_request.py +89 -0
  79. smallestai/atoms/py.typed +0 -0
  80. smallestai/atoms/rest.py +258 -0
  81. smallestai/waves/__init__.py +5 -0
  82. smallest/async_tts.py → smallestai/waves/async_waves_client.py +60 -47
  83. smallestai/waves/stream_tts.py +272 -0
  84. {smallest → smallestai/waves}/utils.py +8 -8
  85. smallest/tts.py → smallestai/waves/waves_client.py +58 -46
  86. {smallestai-2.1.0.dist-info → smallestai-3.0.0.dist-info}/METADATA +194 -43
  87. smallestai-3.0.0.dist-info/RECORD +92 -0
  88. {smallestai-2.1.0.dist-info → smallestai-3.0.0.dist-info}/WHEEL +1 -1
  89. smallestai-3.0.0.dist-info/top_level.txt +1 -0
  90. smallest/__init__.py +0 -5
  91. smallest/stream_tts.py +0 -161
  92. smallestai-2.1.0.dist-info/RECORD +0 -12
  93. smallestai-2.1.0.dist-info/top_level.txt +0 -1
  94. {smallest → smallestai/waves}/exceptions.py +0 -0
  95. {smallest → smallestai/waves}/models.py +0 -0
  96. {smallestai-2.1.0.dist-info → smallestai-3.0.0.dist-info/licenses}/LICENSE +0 -0
@@ -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_agent_templates200_response_data_inner import GetAgentTemplates200ResponseDataInner
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class GetAgentTemplates200Response(BaseModel):
27
+ """
28
+ GetAgentTemplates200Response
29
+ """ # noqa: E501
30
+ status: Optional[StrictBool] = None
31
+ data: Optional[List[GetAgentTemplates200ResponseDataInner]] = 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 GetAgentTemplates200Response 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 GetAgentTemplates200Response 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": [GetAgentTemplates200ResponseDataInner.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,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, 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 GetAgentTemplates200ResponseDataInner(BaseModel):
26
+ """
27
+ GetAgentTemplates200ResponseDataInner
28
+ """ # noqa: E501
29
+ id: StrictStr = Field(description="The ID of the agent template")
30
+ name: StrictStr = Field(description="The name of the agent template")
31
+ description: Optional[StrictStr] = Field(default=None, description="The description of the agent template")
32
+ avatar_url: Optional[StrictStr] = Field(default=None, description="The avatar URL of the agent template", alias="avatarUrl")
33
+ reference_url: Optional[StrictStr] = Field(default=None, description="The docs url of the agent template", alias="referenceUrl")
34
+ category: Optional[StrictStr] = Field(default=None, description="The category of the agent template")
35
+ __properties: ClassVar[List[str]] = ["id", "name", "description", "avatarUrl", "referenceUrl", "category"]
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 GetAgentTemplates200ResponseDataInner 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
+ return _dict
77
+
78
+ @classmethod
79
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80
+ """Create an instance of GetAgentTemplates200ResponseDataInner 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
+ "id": obj.get("id"),
89
+ "name": obj.get("name"),
90
+ "description": obj.get("description"),
91
+ "avatarUrl": obj.get("avatarUrl"),
92
+ "referenceUrl": obj.get("referenceUrl"),
93
+ "category": obj.get("category")
94
+ })
95
+ return _obj
96
+
97
+
@@ -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_agents200_response_data import GetAgents200ResponseData
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class GetAgents200Response(BaseModel):
27
+ """
28
+ GetAgents200Response
29
+ """ # noqa: E501
30
+ status: Optional[StrictBool] = None
31
+ data: Optional[GetAgents200ResponseData] = 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 GetAgents200Response 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 GetAgents200Response 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": GetAgents200ResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None
90
+ })
91
+ return _obj
92
+
93
+
@@ -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,114 @@
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 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 GetCampaignById200ResponseData(BaseModel):
29
+ """
30
+ GetCampaignById200ResponseData
31
+ """ # noqa: E501
32
+ id: Optional[StrictStr] = Field(default=None, description="The unique identifier for the campaign", alias="_id")
33
+ name: Optional[StrictStr] = Field(default=None, 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
+ __properties: ClassVar[List[str]] = ["_id", "name", "description", "organization", "agent", "createdBy", "audience", "participantsCount", "createdAt", "updatedAt"]
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
+ # override the default output from pydantic by calling `to_dict()` of agent
84
+ if self.agent:
85
+ _dict['agent'] = self.agent.to_dict()
86
+ # override the default output from pydantic by calling `to_dict()` of audience
87
+ if self.audience:
88
+ _dict['audience'] = self.audience.to_dict()
89
+ return _dict
90
+
91
+ @classmethod
92
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93
+ """Create an instance of GetCampaignById200ResponseData from a dict"""
94
+ if obj is None:
95
+ return None
96
+
97
+ if not isinstance(obj, dict):
98
+ return cls.model_validate(obj)
99
+
100
+ _obj = cls.model_validate({
101
+ "_id": obj.get("_id"),
102
+ "name": obj.get("name"),
103
+ "description": obj.get("description"),
104
+ "organization": obj.get("organization"),
105
+ "agent": GetCampaigns200ResponseDataInnerAgent.from_dict(obj["agent"]) if obj.get("agent") is not None else None,
106
+ "createdBy": obj.get("createdBy"),
107
+ "audience": GetCampaigns200ResponseDataInnerAudience.from_dict(obj["audience"]) if obj.get("audience") is not None else None,
108
+ "participantsCount": obj.get("participantsCount"),
109
+ "createdAt": obj.get("createdAt"),
110
+ "updatedAt": obj.get("updatedAt")
111
+ })
112
+ return _obj
113
+
114
+
@@ -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
+