blaxel 0.64.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.
Files changed (261) hide show
  1. blaxel/__init__.py +8 -0
  2. blaxel/agents/__init__.py +5 -0
  3. blaxel/agents/chain.py +153 -0
  4. blaxel/agents/chat.py +286 -0
  5. blaxel/agents/decorator.py +208 -0
  6. blaxel/agents/thread.py +24 -0
  7. blaxel/agents/voice/openai.py +255 -0
  8. blaxel/agents/voice/utils.py +25 -0
  9. blaxel/api/__init__.py +1 -0
  10. blaxel/api/agents/__init__.py +0 -0
  11. blaxel/api/agents/create_agent.py +155 -0
  12. blaxel/api/agents/delete_agent.py +146 -0
  13. blaxel/api/agents/get_agent.py +146 -0
  14. blaxel/api/agents/get_agent_logs.py +151 -0
  15. blaxel/api/agents/get_agent_metrics.py +150 -0
  16. blaxel/api/agents/get_agent_trace_ids.py +201 -0
  17. blaxel/api/agents/list_agent_revisions.py +155 -0
  18. blaxel/api/agents/list_agents.py +127 -0
  19. blaxel/api/agents/update_agent.py +168 -0
  20. blaxel/api/configurations/__init__.py +0 -0
  21. blaxel/api/configurations/get_configuration.py +122 -0
  22. blaxel/api/default/__init__.py +0 -0
  23. blaxel/api/default/get_trace.py +150 -0
  24. blaxel/api/default/get_trace_ids.py +218 -0
  25. blaxel/api/default/get_trace_logs.py +186 -0
  26. blaxel/api/default/list_mcp_hub_definitions.py +127 -0
  27. blaxel/api/functions/__init__.py +0 -0
  28. blaxel/api/functions/create_function.py +155 -0
  29. blaxel/api/functions/delete_function.py +146 -0
  30. blaxel/api/functions/get_function.py +146 -0
  31. blaxel/api/functions/get_function_logs.py +151 -0
  32. blaxel/api/functions/get_function_metrics.py +150 -0
  33. blaxel/api/functions/get_function_trace_ids.py +201 -0
  34. blaxel/api/functions/list_function_revisions.py +158 -0
  35. blaxel/api/functions/list_functions.py +131 -0
  36. blaxel/api/functions/update_function.py +168 -0
  37. blaxel/api/integrations/__init__.py +0 -0
  38. blaxel/api/integrations/create_integration_connection.py +167 -0
  39. blaxel/api/integrations/delete_integration_connection.py +158 -0
  40. blaxel/api/integrations/get_integration.py +97 -0
  41. blaxel/api/integrations/get_integration_connection.py +158 -0
  42. blaxel/api/integrations/get_integration_connection_model.py +104 -0
  43. blaxel/api/integrations/get_integration_connection_model_endpoint_configurations.py +97 -0
  44. blaxel/api/integrations/list_integration_connection_models.py +97 -0
  45. blaxel/api/integrations/list_integration_connections.py +139 -0
  46. blaxel/api/integrations/update_integration_connection.py +180 -0
  47. blaxel/api/invitations/__init__.py +0 -0
  48. blaxel/api/invitations/list_all_pending_invitations.py +142 -0
  49. blaxel/api/knowledgebases/__init__.py +0 -0
  50. blaxel/api/knowledgebases/create_knowledgebase.py +163 -0
  51. blaxel/api/knowledgebases/delete_knowledgebase.py +154 -0
  52. blaxel/api/knowledgebases/get_knowledgebase.py +154 -0
  53. blaxel/api/knowledgebases/list_knowledgebase_revisions.py +158 -0
  54. blaxel/api/knowledgebases/list_knowledgebases.py +139 -0
  55. blaxel/api/knowledgebases/update_knowledgebase.py +176 -0
  56. blaxel/api/locations/__init__.py +0 -0
  57. blaxel/api/locations/list_locations.py +139 -0
  58. blaxel/api/metrics/__init__.py +0 -0
  59. blaxel/api/metrics/get_metrics.py +130 -0
  60. blaxel/api/models/__init__.py +0 -0
  61. blaxel/api/models/create_model.py +163 -0
  62. blaxel/api/models/delete_model.py +154 -0
  63. blaxel/api/models/get_model.py +154 -0
  64. blaxel/api/models/get_model_logs.py +155 -0
  65. blaxel/api/models/get_model_metrics.py +158 -0
  66. blaxel/api/models/get_model_trace_ids.py +201 -0
  67. blaxel/api/models/list_model_revisions.py +158 -0
  68. blaxel/api/models/list_models.py +135 -0
  69. blaxel/api/models/update_model.py +176 -0
  70. blaxel/api/policies/__init__.py +0 -0
  71. blaxel/api/policies/create_policy.py +167 -0
  72. blaxel/api/policies/delete_policy.py +154 -0
  73. blaxel/api/policies/get_policy.py +154 -0
  74. blaxel/api/policies/list_policies.py +139 -0
  75. blaxel/api/policies/update_policy.py +180 -0
  76. blaxel/api/privateclusters/__init__.py +0 -0
  77. blaxel/api/privateclusters/create_private_cluster.py +132 -0
  78. blaxel/api/privateclusters/delete_private_cluster.py +156 -0
  79. blaxel/api/privateclusters/get_private_cluster.py +159 -0
  80. blaxel/api/privateclusters/get_private_cluster_health.py +97 -0
  81. blaxel/api/privateclusters/list_private_clusters.py +140 -0
  82. blaxel/api/privateclusters/update_private_cluster.py +156 -0
  83. blaxel/api/privateclusters/update_private_cluster_health.py +97 -0
  84. blaxel/api/service_accounts/__init__.py +0 -0
  85. blaxel/api/service_accounts/create_api_key_for_service_account.py +177 -0
  86. blaxel/api/service_accounts/create_workspace_service_account.py +170 -0
  87. blaxel/api/service_accounts/delete_api_key_for_service_account.py +104 -0
  88. blaxel/api/service_accounts/delete_workspace_service_account.py +160 -0
  89. blaxel/api/service_accounts/get_workspace_service_accounts.py +141 -0
  90. blaxel/api/service_accounts/list_api_keys_for_service_account.py +163 -0
  91. blaxel/api/service_accounts/update_workspace_service_account.py +183 -0
  92. blaxel/api/store/__init__.py +0 -0
  93. blaxel/api/store/get_store_agent.py +146 -0
  94. blaxel/api/store/get_store_function.py +146 -0
  95. blaxel/api/store/list_store_agents.py +131 -0
  96. blaxel/api/store/list_store_functions.py +131 -0
  97. blaxel/api/workspaces/__init__.py +0 -0
  98. blaxel/api/workspaces/accept_workspace_invitation.py +161 -0
  99. blaxel/api/workspaces/create_worspace.py +163 -0
  100. blaxel/api/workspaces/decline_workspace_invitation.py +158 -0
  101. blaxel/api/workspaces/delete_workspace.py +154 -0
  102. blaxel/api/workspaces/get_workspace.py +154 -0
  103. blaxel/api/workspaces/invite_workspace_user.py +174 -0
  104. blaxel/api/workspaces/leave_workspace.py +161 -0
  105. blaxel/api/workspaces/list_workspace_users.py +139 -0
  106. blaxel/api/workspaces/list_workspaces.py +139 -0
  107. blaxel/api/workspaces/remove_workspace_user.py +101 -0
  108. blaxel/api/workspaces/update_workspace.py +176 -0
  109. blaxel/api/workspaces/update_workspace_user_role.py +187 -0
  110. blaxel/authentication/__init__.py +45 -0
  111. blaxel/authentication/apikey.py +50 -0
  112. blaxel/authentication/authentication.py +176 -0
  113. blaxel/authentication/clientcredentials.py +103 -0
  114. blaxel/authentication/credentials.py +295 -0
  115. blaxel/authentication/device_mode.py +197 -0
  116. blaxel/client.py +281 -0
  117. blaxel/common/__init__.py +17 -0
  118. blaxel/common/error.py +27 -0
  119. blaxel/common/instrumentation.py +317 -0
  120. blaxel/common/logger.py +60 -0
  121. blaxel/common/secrets.py +39 -0
  122. blaxel/common/settings.py +150 -0
  123. blaxel/common/slugify.py +18 -0
  124. blaxel/common/utils.py +34 -0
  125. blaxel/deploy/__init__.py +8 -0
  126. blaxel/deploy/deploy.py +316 -0
  127. blaxel/deploy/format.py +46 -0
  128. blaxel/deploy/parser.py +192 -0
  129. blaxel/errors.py +16 -0
  130. blaxel/functions/__init__.py +7 -0
  131. blaxel/functions/common.py +228 -0
  132. blaxel/functions/decorator.py +64 -0
  133. blaxel/functions/local/local.py +48 -0
  134. blaxel/functions/mcp/client.py +96 -0
  135. blaxel/functions/mcp/mcp.py +168 -0
  136. blaxel/functions/mcp/utils.py +56 -0
  137. blaxel/functions/remote/remote.py +183 -0
  138. blaxel/models/__init__.py +233 -0
  139. blaxel/models/acl.py +133 -0
  140. blaxel/models/agent.py +126 -0
  141. blaxel/models/agent_chain.py +88 -0
  142. blaxel/models/agent_spec.py +346 -0
  143. blaxel/models/api_key.py +142 -0
  144. blaxel/models/configuration.py +85 -0
  145. blaxel/models/continent.py +70 -0
  146. blaxel/models/core_event.py +97 -0
  147. blaxel/models/core_spec.py +249 -0
  148. blaxel/models/core_spec_configurations.py +77 -0
  149. blaxel/models/country.py +70 -0
  150. blaxel/models/create_api_key_for_service_account_body.py +69 -0
  151. blaxel/models/create_workspace_service_account_body.py +71 -0
  152. blaxel/models/create_workspace_service_account_response_200.py +105 -0
  153. blaxel/models/delete_workspace_service_account_response_200.py +96 -0
  154. blaxel/models/entrypoint.py +96 -0
  155. blaxel/models/entrypoint_env.py +45 -0
  156. blaxel/models/flavor.py +70 -0
  157. blaxel/models/form.py +120 -0
  158. blaxel/models/form_config.py +45 -0
  159. blaxel/models/form_oauthomitempty.py +45 -0
  160. blaxel/models/form_secrets.py +45 -0
  161. blaxel/models/function.py +126 -0
  162. blaxel/models/function_kit.py +97 -0
  163. blaxel/models/function_spec.py +310 -0
  164. blaxel/models/get_trace_ids_response_200.py +45 -0
  165. blaxel/models/get_trace_logs_response_200.py +45 -0
  166. blaxel/models/get_trace_response_200.py +45 -0
  167. blaxel/models/get_workspace_service_accounts_response_200_item.py +96 -0
  168. blaxel/models/histogram_bucket.py +79 -0
  169. blaxel/models/histogram_stats.py +88 -0
  170. blaxel/models/integration_connection.py +96 -0
  171. blaxel/models/integration_connection_spec.py +114 -0
  172. blaxel/models/integration_connection_spec_config.py +45 -0
  173. blaxel/models/integration_connection_spec_secret.py +45 -0
  174. blaxel/models/integration_model.py +162 -0
  175. blaxel/models/integration_repository.py +88 -0
  176. blaxel/models/invite_workspace_user_body.py +60 -0
  177. blaxel/models/knowledgebase.py +126 -0
  178. blaxel/models/knowledgebase_spec.py +163 -0
  179. blaxel/models/knowledgebase_spec_options.py +45 -0
  180. blaxel/models/last_n_requests_metric.py +79 -0
  181. blaxel/models/latency_metric.py +144 -0
  182. blaxel/models/location_response.py +113 -0
  183. blaxel/models/mcp_definition.py +188 -0
  184. blaxel/models/mcp_definition_entrypoint.py +45 -0
  185. blaxel/models/mcp_definition_form.py +45 -0
  186. blaxel/models/metadata.py +139 -0
  187. blaxel/models/metadata_labels.py +45 -0
  188. blaxel/models/metric.py +79 -0
  189. blaxel/models/metrics.py +169 -0
  190. blaxel/models/metrics_models.py +45 -0
  191. blaxel/models/metrics_request_total_per_code.py +45 -0
  192. blaxel/models/metrics_rps_per_code.py +45 -0
  193. blaxel/models/model.py +126 -0
  194. blaxel/models/model_private_cluster.py +79 -0
  195. blaxel/models/model_spec.py +249 -0
  196. blaxel/models/o_auth.py +72 -0
  197. blaxel/models/owner_fields.py +70 -0
  198. blaxel/models/pending_invitation.py +124 -0
  199. blaxel/models/pending_invitation_accept.py +85 -0
  200. blaxel/models/pending_invitation_render.py +147 -0
  201. blaxel/models/pending_invitation_render_invited_by.py +88 -0
  202. blaxel/models/pending_invitation_render_workspace.py +70 -0
  203. blaxel/models/pending_invitation_workspace_details.py +72 -0
  204. blaxel/models/pod_template_spec.py +45 -0
  205. blaxel/models/policy.py +96 -0
  206. blaxel/models/policy_location.py +70 -0
  207. blaxel/models/policy_max_tokens.py +106 -0
  208. blaxel/models/policy_spec.py +151 -0
  209. blaxel/models/private_cluster.py +183 -0
  210. blaxel/models/private_location.py +61 -0
  211. blaxel/models/repository.py +70 -0
  212. blaxel/models/request_duration_over_time_metric.py +97 -0
  213. blaxel/models/request_duration_over_time_metrics.py +80 -0
  214. blaxel/models/request_total_by_origin_metric.py +115 -0
  215. blaxel/models/request_total_by_origin_metric_request_total_by_origin.py +45 -0
  216. blaxel/models/request_total_by_origin_metric_request_total_by_origin_and_code.py +45 -0
  217. blaxel/models/request_total_metric.py +123 -0
  218. blaxel/models/request_total_metric_request_total_per_code.py +45 -0
  219. blaxel/models/request_total_metric_rps_per_code.py +45 -0
  220. blaxel/models/resource_log.py +79 -0
  221. blaxel/models/resource_metrics.py +270 -0
  222. blaxel/models/resource_metrics_request_total_per_code.py +45 -0
  223. blaxel/models/resource_metrics_rps_per_code.py +45 -0
  224. blaxel/models/revision_configuration.py +97 -0
  225. blaxel/models/revision_metadata.py +124 -0
  226. blaxel/models/runtime.py +196 -0
  227. blaxel/models/runtime_startup_probe.py +45 -0
  228. blaxel/models/serverless_config.py +80 -0
  229. blaxel/models/spec_configuration.py +70 -0
  230. blaxel/models/store_agent.py +178 -0
  231. blaxel/models/store_agent_labels.py +45 -0
  232. blaxel/models/store_configuration.py +151 -0
  233. blaxel/models/store_configuration_option.py +79 -0
  234. blaxel/models/store_function.py +211 -0
  235. blaxel/models/store_function_kit.py +97 -0
  236. blaxel/models/store_function_labels.py +45 -0
  237. blaxel/models/store_function_parameter.py +88 -0
  238. blaxel/models/time_fields.py +70 -0
  239. blaxel/models/token_rate_metric.py +88 -0
  240. blaxel/models/token_rate_metrics.py +120 -0
  241. blaxel/models/token_total_metric.py +106 -0
  242. blaxel/models/trace_ids_response.py +45 -0
  243. blaxel/models/update_workspace_service_account_body.py +69 -0
  244. blaxel/models/update_workspace_service_account_response_200.py +96 -0
  245. blaxel/models/update_workspace_user_role_body.py +60 -0
  246. blaxel/models/websocket_channel.py +88 -0
  247. blaxel/models/workspace.py +148 -0
  248. blaxel/models/workspace_labels.py +45 -0
  249. blaxel/models/workspace_user.py +115 -0
  250. blaxel/py.typed +1 -0
  251. blaxel/run.py +108 -0
  252. blaxel/serve/app.py +131 -0
  253. blaxel/serve/middlewares/__init__.py +10 -0
  254. blaxel/serve/middlewares/accesslog.py +32 -0
  255. blaxel/serve/middlewares/processtime.py +28 -0
  256. blaxel/types.py +46 -0
  257. blaxel-0.64.0.dist-info/METADATA +96 -0
  258. blaxel-0.64.0.dist-info/RECORD +261 -0
  259. blaxel-0.64.0.dist-info/WHEEL +4 -0
  260. blaxel-0.64.0.dist-info/entry_points.txt +2 -0
  261. blaxel-0.64.0.dist-info/licenses/LICENSE +21 -0
blaxel/models/acl.py ADDED
@@ -0,0 +1,133 @@
1
+ from typing import Any, TypeVar, Union
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..types import UNSET, Unset
7
+
8
+ T = TypeVar("T", bound="ACL")
9
+
10
+
11
+ @_attrs_define
12
+ class ACL:
13
+ """ACL
14
+
15
+ Attributes:
16
+ created_at (Union[Unset, str]): The date and time when the resource was created
17
+ updated_at (Union[Unset, str]): The date and time when the resource was updated
18
+ id (Union[Unset, str]): ACL id
19
+ resource_id (Union[Unset, str]): Resource ID
20
+ resource_type (Union[Unset, str]): Resource type
21
+ role (Union[Unset, str]): Role
22
+ subject_id (Union[Unset, str]): Subject ID
23
+ subject_type (Union[Unset, str]): Subject type
24
+ workspace (Union[Unset, str]): Workspace name
25
+ """
26
+
27
+ created_at: Union[Unset, str] = UNSET
28
+ updated_at: Union[Unset, str] = UNSET
29
+ id: Union[Unset, str] = UNSET
30
+ resource_id: Union[Unset, str] = UNSET
31
+ resource_type: Union[Unset, str] = UNSET
32
+ role: Union[Unset, str] = UNSET
33
+ subject_id: Union[Unset, str] = UNSET
34
+ subject_type: Union[Unset, str] = UNSET
35
+ workspace: Union[Unset, str] = UNSET
36
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
37
+
38
+ def to_dict(self) -> dict[str, Any]:
39
+ created_at = self.created_at
40
+
41
+ updated_at = self.updated_at
42
+
43
+ id = self.id
44
+
45
+ resource_id = self.resource_id
46
+
47
+ resource_type = self.resource_type
48
+
49
+ role = self.role
50
+
51
+ subject_id = self.subject_id
52
+
53
+ subject_type = self.subject_type
54
+
55
+ workspace = self.workspace
56
+
57
+ field_dict: dict[str, Any] = {}
58
+ field_dict.update(self.additional_properties)
59
+ field_dict.update({})
60
+ if created_at is not UNSET:
61
+ field_dict["createdAt"] = created_at
62
+ if updated_at is not UNSET:
63
+ field_dict["updatedAt"] = updated_at
64
+ if id is not UNSET:
65
+ field_dict["id"] = id
66
+ if resource_id is not UNSET:
67
+ field_dict["resource_id"] = resource_id
68
+ if resource_type is not UNSET:
69
+ field_dict["resource_type"] = resource_type
70
+ if role is not UNSET:
71
+ field_dict["role"] = role
72
+ if subject_id is not UNSET:
73
+ field_dict["subject_id"] = subject_id
74
+ if subject_type is not UNSET:
75
+ field_dict["subject_type"] = subject_type
76
+ if workspace is not UNSET:
77
+ field_dict["workspace"] = workspace
78
+
79
+ return field_dict
80
+
81
+ @classmethod
82
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
83
+ if not src_dict:
84
+ return None
85
+ d = src_dict.copy()
86
+ created_at = d.pop("createdAt", UNSET)
87
+
88
+ updated_at = d.pop("updatedAt", UNSET)
89
+
90
+ id = d.pop("id", UNSET)
91
+
92
+ resource_id = d.pop("resource_id", UNSET)
93
+
94
+ resource_type = d.pop("resource_type", UNSET)
95
+
96
+ role = d.pop("role", UNSET)
97
+
98
+ subject_id = d.pop("subject_id", UNSET)
99
+
100
+ subject_type = d.pop("subject_type", UNSET)
101
+
102
+ workspace = d.pop("workspace", UNSET)
103
+
104
+ acl = cls(
105
+ created_at=created_at,
106
+ updated_at=updated_at,
107
+ id=id,
108
+ resource_id=resource_id,
109
+ resource_type=resource_type,
110
+ role=role,
111
+ subject_id=subject_id,
112
+ subject_type=subject_type,
113
+ workspace=workspace,
114
+ )
115
+
116
+ acl.additional_properties = d
117
+ return acl
118
+
119
+ @property
120
+ def additional_keys(self) -> list[str]:
121
+ return list(self.additional_properties.keys())
122
+
123
+ def __getitem__(self, key: str) -> Any:
124
+ return self.additional_properties[key]
125
+
126
+ def __setitem__(self, key: str, value: Any) -> None:
127
+ self.additional_properties[key] = value
128
+
129
+ def __delitem__(self, key: str) -> None:
130
+ del self.additional_properties[key]
131
+
132
+ def __contains__(self, key: str) -> bool:
133
+ return key in self.additional_properties
blaxel/models/agent.py ADDED
@@ -0,0 +1,126 @@
1
+ from typing import TYPE_CHECKING, Any, TypeVar, Union
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..types import UNSET, Unset
7
+
8
+ if TYPE_CHECKING:
9
+ from ..models.agent_spec import AgentSpec
10
+ from ..models.core_event import CoreEvent
11
+ from ..models.metadata import Metadata
12
+
13
+
14
+ T = TypeVar("T", bound="Agent")
15
+
16
+
17
+ @_attrs_define
18
+ class Agent:
19
+ """Agent
20
+
21
+ Attributes:
22
+ events (Union[Unset, list['CoreEvent']]): Core events
23
+ metadata (Union[Unset, Metadata]): Metadata
24
+ spec (Union[Unset, AgentSpec]): Agent specification
25
+ status (Union[Unset, str]): Agent status
26
+ """
27
+
28
+ events: Union[Unset, list["CoreEvent"]] = UNSET
29
+ metadata: Union[Unset, "Metadata"] = UNSET
30
+ spec: Union[Unset, "AgentSpec"] = UNSET
31
+ status: Union[Unset, str] = UNSET
32
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
33
+
34
+ def to_dict(self) -> dict[str, Any]:
35
+ events: Union[Unset, list[dict[str, Any]]] = UNSET
36
+ if not isinstance(self.events, Unset):
37
+ events = []
38
+ for componentsschemas_core_events_item_data in self.events:
39
+ componentsschemas_core_events_item = componentsschemas_core_events_item_data.to_dict()
40
+ events.append(componentsschemas_core_events_item)
41
+
42
+ metadata: Union[Unset, dict[str, Any]] = UNSET
43
+ if self.metadata and not isinstance(self.metadata, Unset) and not isinstance(self.metadata, dict):
44
+ metadata = self.metadata.to_dict()
45
+ elif self.metadata and isinstance(self.metadata, dict):
46
+ metadata = self.metadata
47
+
48
+ spec: Union[Unset, dict[str, Any]] = UNSET
49
+ if self.spec and not isinstance(self.spec, Unset) and not isinstance(self.spec, dict):
50
+ spec = self.spec.to_dict()
51
+ elif self.spec and isinstance(self.spec, dict):
52
+ spec = self.spec
53
+
54
+ status = self.status
55
+
56
+ field_dict: dict[str, Any] = {}
57
+ field_dict.update(self.additional_properties)
58
+ field_dict.update({})
59
+ if events is not UNSET:
60
+ field_dict["events"] = events
61
+ if metadata is not UNSET:
62
+ field_dict["metadata"] = metadata
63
+ if spec is not UNSET:
64
+ field_dict["spec"] = spec
65
+ if status is not UNSET:
66
+ field_dict["status"] = status
67
+
68
+ return field_dict
69
+
70
+ @classmethod
71
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
72
+ from ..models.agent_spec import AgentSpec
73
+ from ..models.core_event import CoreEvent
74
+ from ..models.metadata import Metadata
75
+
76
+ if not src_dict:
77
+ return None
78
+ d = src_dict.copy()
79
+ events = []
80
+ _events = d.pop("events", UNSET)
81
+ for componentsschemas_core_events_item_data in _events or []:
82
+ componentsschemas_core_events_item = CoreEvent.from_dict(componentsschemas_core_events_item_data)
83
+
84
+ events.append(componentsschemas_core_events_item)
85
+
86
+ _metadata = d.pop("metadata", UNSET)
87
+ metadata: Union[Unset, Metadata]
88
+ if isinstance(_metadata, Unset):
89
+ metadata = UNSET
90
+ else:
91
+ metadata = Metadata.from_dict(_metadata)
92
+
93
+ _spec = d.pop("spec", UNSET)
94
+ spec: Union[Unset, AgentSpec]
95
+ if isinstance(_spec, Unset):
96
+ spec = UNSET
97
+ else:
98
+ spec = AgentSpec.from_dict(_spec)
99
+
100
+ status = d.pop("status", UNSET)
101
+
102
+ agent = cls(
103
+ events=events,
104
+ metadata=metadata,
105
+ spec=spec,
106
+ status=status,
107
+ )
108
+
109
+ agent.additional_properties = d
110
+ return agent
111
+
112
+ @property
113
+ def additional_keys(self) -> list[str]:
114
+ return list(self.additional_properties.keys())
115
+
116
+ def __getitem__(self, key: str) -> Any:
117
+ return self.additional_properties[key]
118
+
119
+ def __setitem__(self, key: str, value: Any) -> None:
120
+ self.additional_properties[key] = value
121
+
122
+ def __delitem__(self, key: str) -> None:
123
+ del self.additional_properties[key]
124
+
125
+ def __contains__(self, key: str) -> bool:
126
+ return key in self.additional_properties
@@ -0,0 +1,88 @@
1
+ from typing import Any, TypeVar, Union
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..types import UNSET, Unset
7
+
8
+ T = TypeVar("T", bound="AgentChain")
9
+
10
+
11
+ @_attrs_define
12
+ class AgentChain:
13
+ """Agent chain configuration
14
+
15
+ Attributes:
16
+ description (Union[Unset, str]): Description of the agent in case you want to override the default one
17
+ enabled (Union[Unset, bool]): Whether the agent chain is enabled
18
+ name (Union[Unset, str]): The name of the agent to chain to
19
+ prompt (Union[Unset, str]): Prompt of the agent in case you want to override the default one
20
+ """
21
+
22
+ description: Union[Unset, str] = UNSET
23
+ enabled: Union[Unset, bool] = UNSET
24
+ name: Union[Unset, str] = UNSET
25
+ prompt: Union[Unset, str] = UNSET
26
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
27
+
28
+ def to_dict(self) -> dict[str, Any]:
29
+ description = self.description
30
+
31
+ enabled = self.enabled
32
+
33
+ name = self.name
34
+
35
+ prompt = self.prompt
36
+
37
+ field_dict: dict[str, Any] = {}
38
+ field_dict.update(self.additional_properties)
39
+ field_dict.update({})
40
+ if description is not UNSET:
41
+ field_dict["description"] = description
42
+ if enabled is not UNSET:
43
+ field_dict["enabled"] = enabled
44
+ if name is not UNSET:
45
+ field_dict["name"] = name
46
+ if prompt is not UNSET:
47
+ field_dict["prompt"] = prompt
48
+
49
+ return field_dict
50
+
51
+ @classmethod
52
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
53
+ if not src_dict:
54
+ return None
55
+ d = src_dict.copy()
56
+ description = d.pop("description", UNSET)
57
+
58
+ enabled = d.pop("enabled", UNSET)
59
+
60
+ name = d.pop("name", UNSET)
61
+
62
+ prompt = d.pop("prompt", UNSET)
63
+
64
+ agent_chain = cls(
65
+ description=description,
66
+ enabled=enabled,
67
+ name=name,
68
+ prompt=prompt,
69
+ )
70
+
71
+ agent_chain.additional_properties = d
72
+ return agent_chain
73
+
74
+ @property
75
+ def additional_keys(self) -> list[str]:
76
+ return list(self.additional_properties.keys())
77
+
78
+ def __getitem__(self, key: str) -> Any:
79
+ return self.additional_properties[key]
80
+
81
+ def __setitem__(self, key: str, value: Any) -> None:
82
+ self.additional_properties[key] = value
83
+
84
+ def __delitem__(self, key: str) -> None:
85
+ del self.additional_properties[key]
86
+
87
+ def __contains__(self, key: str) -> bool:
88
+ return key in self.additional_properties
@@ -0,0 +1,346 @@
1
+ from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
2
+
3
+ from attrs import define as _attrs_define
4
+ from attrs import field as _attrs_field
5
+
6
+ from ..types import UNSET, Unset
7
+
8
+ if TYPE_CHECKING:
9
+ from ..models.agent_chain import AgentChain
10
+ from ..models.core_spec_configurations import CoreSpecConfigurations
11
+ from ..models.flavor import Flavor
12
+ from ..models.model_private_cluster import ModelPrivateCluster
13
+ from ..models.pod_template_spec import PodTemplateSpec
14
+ from ..models.repository import Repository
15
+ from ..models.revision_configuration import RevisionConfiguration
16
+ from ..models.runtime import Runtime
17
+ from ..models.serverless_config import ServerlessConfig
18
+
19
+
20
+ T = TypeVar("T", bound="AgentSpec")
21
+
22
+
23
+ @_attrs_define
24
+ class AgentSpec:
25
+ """Agent specification
26
+
27
+ Attributes:
28
+ configurations (Union[Unset, CoreSpecConfigurations]): Optional configurations for the object
29
+ enabled (Union[Unset, bool]): Enable or disable the agent
30
+ flavors (Union[Unset, list['Flavor']]): Types of hardware available for deployments
31
+ integration_connections (Union[Unset, list[str]]):
32
+ pod_template (Union[Unset, PodTemplateSpec]): Pod template specification
33
+ policies (Union[Unset, list[str]]):
34
+ private_clusters (Union[Unset, ModelPrivateCluster]): Private cluster where the model deployment is deployed
35
+ revision (Union[Unset, RevisionConfiguration]): Revision configuration
36
+ runtime (Union[Unset, Runtime]): Set of configurations for a deployment
37
+ sandbox (Union[Unset, bool]): Sandbox mode
38
+ serverless_config (Union[Unset, ServerlessConfig]): Configuration for a serverless deployment
39
+ agent_chain (Union[Unset, list['AgentChain']]): Agent chain
40
+ description (Union[Unset, str]): Description, small description computed from the prompt
41
+ functions (Union[Unset, list[str]]):
42
+ knowledgebase (Union[Unset, str]): Knowledgebase Name
43
+ model (Union[Unset, str]): Model name
44
+ prompt (Union[Unset, str]): Prompt, describe what your agent does
45
+ repository (Union[Unset, Repository]): Repository
46
+ store_id (Union[Unset, str]): Store id
47
+ """
48
+
49
+ configurations: Union[Unset, "CoreSpecConfigurations"] = UNSET
50
+ enabled: Union[Unset, bool] = UNSET
51
+ flavors: Union[Unset, list["Flavor"]] = UNSET
52
+ integration_connections: Union[Unset, list[str]] = UNSET
53
+ pod_template: Union[Unset, "PodTemplateSpec"] = UNSET
54
+ policies: Union[Unset, list[str]] = UNSET
55
+ private_clusters: Union[Unset, "ModelPrivateCluster"] = UNSET
56
+ revision: Union[Unset, "RevisionConfiguration"] = UNSET
57
+ runtime: Union[Unset, "Runtime"] = UNSET
58
+ sandbox: Union[Unset, bool] = UNSET
59
+ serverless_config: Union[Unset, "ServerlessConfig"] = UNSET
60
+ agent_chain: Union[Unset, list["AgentChain"]] = UNSET
61
+ description: Union[Unset, str] = UNSET
62
+ functions: Union[Unset, list[str]] = UNSET
63
+ knowledgebase: Union[Unset, str] = UNSET
64
+ model: Union[Unset, str] = UNSET
65
+ prompt: Union[Unset, str] = UNSET
66
+ repository: Union[Unset, "Repository"] = UNSET
67
+ store_id: Union[Unset, str] = UNSET
68
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
69
+
70
+ def to_dict(self) -> dict[str, Any]:
71
+ configurations: Union[Unset, dict[str, Any]] = UNSET
72
+ if (
73
+ self.configurations
74
+ and not isinstance(self.configurations, Unset)
75
+ and not isinstance(self.configurations, dict)
76
+ ):
77
+ configurations = self.configurations.to_dict()
78
+ elif self.configurations and isinstance(self.configurations, dict):
79
+ configurations = self.configurations
80
+
81
+ enabled = self.enabled
82
+
83
+ flavors: Union[Unset, list[dict[str, Any]]] = UNSET
84
+ if not isinstance(self.flavors, Unset):
85
+ flavors = []
86
+ for componentsschemas_flavors_item_data in self.flavors:
87
+ componentsschemas_flavors_item = componentsschemas_flavors_item_data.to_dict()
88
+ flavors.append(componentsschemas_flavors_item)
89
+
90
+ integration_connections: Union[Unset, list[str]] = UNSET
91
+ if not isinstance(self.integration_connections, Unset):
92
+ integration_connections = self.integration_connections
93
+
94
+ pod_template: Union[Unset, dict[str, Any]] = UNSET
95
+ if self.pod_template and not isinstance(self.pod_template, Unset) and not isinstance(self.pod_template, dict):
96
+ pod_template = self.pod_template.to_dict()
97
+ elif self.pod_template and isinstance(self.pod_template, dict):
98
+ pod_template = self.pod_template
99
+
100
+ policies: Union[Unset, list[str]] = UNSET
101
+ if not isinstance(self.policies, Unset):
102
+ policies = self.policies
103
+
104
+ private_clusters: Union[Unset, dict[str, Any]] = UNSET
105
+ if (
106
+ self.private_clusters
107
+ and not isinstance(self.private_clusters, Unset)
108
+ and not isinstance(self.private_clusters, dict)
109
+ ):
110
+ private_clusters = self.private_clusters.to_dict()
111
+ elif self.private_clusters and isinstance(self.private_clusters, dict):
112
+ private_clusters = self.private_clusters
113
+
114
+ revision: Union[Unset, dict[str, Any]] = UNSET
115
+ if self.revision and not isinstance(self.revision, Unset) and not isinstance(self.revision, dict):
116
+ revision = self.revision.to_dict()
117
+ elif self.revision and isinstance(self.revision, dict):
118
+ revision = self.revision
119
+
120
+ runtime: Union[Unset, dict[str, Any]] = UNSET
121
+ if self.runtime and not isinstance(self.runtime, Unset) and not isinstance(self.runtime, dict):
122
+ runtime = self.runtime.to_dict()
123
+ elif self.runtime and isinstance(self.runtime, dict):
124
+ runtime = self.runtime
125
+
126
+ sandbox = self.sandbox
127
+
128
+ serverless_config: Union[Unset, dict[str, Any]] = UNSET
129
+ if (
130
+ self.serverless_config
131
+ and not isinstance(self.serverless_config, Unset)
132
+ and not isinstance(self.serverless_config, dict)
133
+ ):
134
+ serverless_config = self.serverless_config.to_dict()
135
+ elif self.serverless_config and isinstance(self.serverless_config, dict):
136
+ serverless_config = self.serverless_config
137
+
138
+ agent_chain: Union[Unset, list[dict[str, Any]]] = UNSET
139
+ if not isinstance(self.agent_chain, Unset):
140
+ agent_chain = []
141
+ for componentsschemas_agent_chains_item_data in self.agent_chain:
142
+ componentsschemas_agent_chains_item = componentsschemas_agent_chains_item_data.to_dict()
143
+ agent_chain.append(componentsschemas_agent_chains_item)
144
+
145
+ description = self.description
146
+
147
+ functions: Union[Unset, list[str]] = UNSET
148
+ if not isinstance(self.functions, Unset):
149
+ functions = self.functions
150
+
151
+ knowledgebase = self.knowledgebase
152
+
153
+ model = self.model
154
+
155
+ prompt = self.prompt
156
+
157
+ repository: Union[Unset, dict[str, Any]] = UNSET
158
+ if self.repository and not isinstance(self.repository, Unset) and not isinstance(self.repository, dict):
159
+ repository = self.repository.to_dict()
160
+ elif self.repository and isinstance(self.repository, dict):
161
+ repository = self.repository
162
+
163
+ store_id = self.store_id
164
+
165
+ field_dict: dict[str, Any] = {}
166
+ field_dict.update(self.additional_properties)
167
+ field_dict.update({})
168
+ if configurations is not UNSET:
169
+ field_dict["configurations"] = configurations
170
+ if enabled is not UNSET:
171
+ field_dict["enabled"] = enabled
172
+ if flavors is not UNSET:
173
+ field_dict["flavors"] = flavors
174
+ if integration_connections is not UNSET:
175
+ field_dict["integrationConnections"] = integration_connections
176
+ if pod_template is not UNSET:
177
+ field_dict["podTemplate"] = pod_template
178
+ if policies is not UNSET:
179
+ field_dict["policies"] = policies
180
+ if private_clusters is not UNSET:
181
+ field_dict["privateClusters"] = private_clusters
182
+ if revision is not UNSET:
183
+ field_dict["revision"] = revision
184
+ if runtime is not UNSET:
185
+ field_dict["runtime"] = runtime
186
+ if sandbox is not UNSET:
187
+ field_dict["sandbox"] = sandbox
188
+ if serverless_config is not UNSET:
189
+ field_dict["serverlessConfig"] = serverless_config
190
+ if agent_chain is not UNSET:
191
+ field_dict["agentChain"] = agent_chain
192
+ if description is not UNSET:
193
+ field_dict["description"] = description
194
+ if functions is not UNSET:
195
+ field_dict["functions"] = functions
196
+ if knowledgebase is not UNSET:
197
+ field_dict["knowledgebase"] = knowledgebase
198
+ if model is not UNSET:
199
+ field_dict["model"] = model
200
+ if prompt is not UNSET:
201
+ field_dict["prompt"] = prompt
202
+ if repository is not UNSET:
203
+ field_dict["repository"] = repository
204
+ if store_id is not UNSET:
205
+ field_dict["storeId"] = store_id
206
+
207
+ return field_dict
208
+
209
+ @classmethod
210
+ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
211
+ from ..models.agent_chain import AgentChain
212
+ from ..models.core_spec_configurations import CoreSpecConfigurations
213
+ from ..models.flavor import Flavor
214
+ from ..models.model_private_cluster import ModelPrivateCluster
215
+ from ..models.pod_template_spec import PodTemplateSpec
216
+ from ..models.repository import Repository
217
+ from ..models.revision_configuration import RevisionConfiguration
218
+ from ..models.runtime import Runtime
219
+ from ..models.serverless_config import ServerlessConfig
220
+
221
+ if not src_dict:
222
+ return None
223
+ d = src_dict.copy()
224
+ _configurations = d.pop("configurations", UNSET)
225
+ configurations: Union[Unset, CoreSpecConfigurations]
226
+ if isinstance(_configurations, Unset):
227
+ configurations = UNSET
228
+ else:
229
+ configurations = CoreSpecConfigurations.from_dict(_configurations)
230
+
231
+ enabled = d.pop("enabled", UNSET)
232
+
233
+ flavors = []
234
+ _flavors = d.pop("flavors", UNSET)
235
+ for componentsschemas_flavors_item_data in _flavors or []:
236
+ componentsschemas_flavors_item = Flavor.from_dict(componentsschemas_flavors_item_data)
237
+
238
+ flavors.append(componentsschemas_flavors_item)
239
+
240
+ integration_connections = cast(list[str], d.pop("integrationConnections", UNSET))
241
+
242
+ _pod_template = d.pop("podTemplate", UNSET)
243
+ pod_template: Union[Unset, PodTemplateSpec]
244
+ if isinstance(_pod_template, Unset):
245
+ pod_template = UNSET
246
+ else:
247
+ pod_template = PodTemplateSpec.from_dict(_pod_template)
248
+
249
+ policies = cast(list[str], d.pop("policies", UNSET))
250
+
251
+ _private_clusters = d.pop("privateClusters", UNSET)
252
+ private_clusters: Union[Unset, ModelPrivateCluster]
253
+ if isinstance(_private_clusters, Unset):
254
+ private_clusters = UNSET
255
+ else:
256
+ private_clusters = ModelPrivateCluster.from_dict(_private_clusters)
257
+
258
+ _revision = d.pop("revision", UNSET)
259
+ revision: Union[Unset, RevisionConfiguration]
260
+ if isinstance(_revision, Unset):
261
+ revision = UNSET
262
+ else:
263
+ revision = RevisionConfiguration.from_dict(_revision)
264
+
265
+ _runtime = d.pop("runtime", UNSET)
266
+ runtime: Union[Unset, Runtime]
267
+ if isinstance(_runtime, Unset):
268
+ runtime = UNSET
269
+ else:
270
+ runtime = Runtime.from_dict(_runtime)
271
+
272
+ sandbox = d.pop("sandbox", UNSET)
273
+
274
+ _serverless_config = d.pop("serverlessConfig", UNSET)
275
+ serverless_config: Union[Unset, ServerlessConfig]
276
+ if isinstance(_serverless_config, Unset):
277
+ serverless_config = UNSET
278
+ else:
279
+ serverless_config = ServerlessConfig.from_dict(_serverless_config)
280
+
281
+ agent_chain = []
282
+ _agent_chain = d.pop("agentChain", UNSET)
283
+ for componentsschemas_agent_chains_item_data in _agent_chain or []:
284
+ componentsschemas_agent_chains_item = AgentChain.from_dict(componentsschemas_agent_chains_item_data)
285
+
286
+ agent_chain.append(componentsschemas_agent_chains_item)
287
+
288
+ description = d.pop("description", UNSET)
289
+
290
+ functions = cast(list[str], d.pop("functions", UNSET))
291
+
292
+ knowledgebase = d.pop("knowledgebase", UNSET)
293
+
294
+ model = d.pop("model", UNSET)
295
+
296
+ prompt = d.pop("prompt", UNSET)
297
+
298
+ _repository = d.pop("repository", UNSET)
299
+ repository: Union[Unset, Repository]
300
+ if isinstance(_repository, Unset):
301
+ repository = UNSET
302
+ else:
303
+ repository = Repository.from_dict(_repository)
304
+
305
+ store_id = d.pop("storeId", UNSET)
306
+
307
+ agent_spec = cls(
308
+ configurations=configurations,
309
+ enabled=enabled,
310
+ flavors=flavors,
311
+ integration_connections=integration_connections,
312
+ pod_template=pod_template,
313
+ policies=policies,
314
+ private_clusters=private_clusters,
315
+ revision=revision,
316
+ runtime=runtime,
317
+ sandbox=sandbox,
318
+ serverless_config=serverless_config,
319
+ agent_chain=agent_chain,
320
+ description=description,
321
+ functions=functions,
322
+ knowledgebase=knowledgebase,
323
+ model=model,
324
+ prompt=prompt,
325
+ repository=repository,
326
+ store_id=store_id,
327
+ )
328
+
329
+ agent_spec.additional_properties = d
330
+ return agent_spec
331
+
332
+ @property
333
+ def additional_keys(self) -> list[str]:
334
+ return list(self.additional_properties.keys())
335
+
336
+ def __getitem__(self, key: str) -> Any:
337
+ return self.additional_properties[key]
338
+
339
+ def __setitem__(self, key: str, value: Any) -> None:
340
+ self.additional_properties[key] = value
341
+
342
+ def __delitem__(self, key: str) -> None:
343
+ del self.additional_properties[key]
344
+
345
+ def __contains__(self, key: str) -> bool:
346
+ return key in self.additional_properties