beamlit 0.0.54rc100__py3-none-any.whl → 0.0.55__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.
- beamlit/agents/chain.py +2 -1
- beamlit/agents/chat.py +1 -0
- beamlit/agents/decorator.py +3 -2
- beamlit/api/integrations/get_integration_connection_model.py +2 -2
- beamlit/api/integrations/{list_integration_models.py → get_integration_connection_model_endpoint_configurations.py} +12 -12
- beamlit/api/{default/create_account.py → knowledgebases/create_knowledgebase.py} +30 -30
- beamlit/api/{accounts/delete_account.py → knowledgebases/delete_knowledgebase.py} +57 -43
- beamlit/api/{accounts/get_account.py → knowledgebases/get_knowledgebase.py} +56 -35
- beamlit/api/{accounts/list_accounts.py → knowledgebases/list_knowledgebases.py} +57 -25
- beamlit/api/{accounts/update_account.py → knowledgebases/update_knowledgebase.py} +43 -43
- beamlit/deploy/deploy.py +2 -0
- beamlit/deploy/format.py +1 -68
- beamlit/models/__init__.py +8 -10
- beamlit/models/agent_chain.py +9 -0
- beamlit/models/agent_spec.py +10 -1
- beamlit/models/integration_model.py +27 -9
- beamlit/models/knowledgebase.py +126 -0
- beamlit/models/knowledgebase_release.py +70 -0
- beamlit/models/knowledgebase_spec.py +143 -0
- beamlit/models/{account_spec_address.py → knowledgebase_spec_options.py} +6 -6
- beamlit/models/model_spec.py +9 -0
- beamlit/models/runtime.py +21 -2
- beamlit/models/store_agent.py +9 -0
- {beamlit-0.0.54rc100.dist-info → beamlit-0.0.55.dist-info}/METADATA +1 -1
- {beamlit-0.0.54rc100.dist-info → beamlit-0.0.55.dist-info}/RECORD +29 -31
- beamlit/api/integrations/get_integration_model.py +0 -104
- beamlit/models/account.py +0 -224
- beamlit/models/account_metadata.py +0 -121
- beamlit/models/account_spec.py +0 -123
- beamlit/models/billing_address.py +0 -133
- /beamlit/api/{accounts → knowledgebases}/__init__.py +0 -0
- {beamlit-0.0.54rc100.dist-info → beamlit-0.0.55.dist-info}/WHEEL +0 -0
- {beamlit-0.0.54rc100.dist-info → beamlit-0.0.55.dist-info}/entry_points.txt +0 -0
- {beamlit-0.0.54rc100.dist-info → beamlit-0.0.55.dist-info}/licenses/LICENSE +0 -0
beamlit/models/__init__.py
CHANGED
@@ -1,9 +1,5 @@
|
|
1
1
|
"""Contains all the data models used in inputs/outputs"""
|
2
2
|
|
3
|
-
from .account import Account
|
4
|
-
from .account_metadata import AccountMetadata
|
5
|
-
from .account_spec import AccountSpec
|
6
|
-
from .account_spec_address import AccountSpecAddress
|
7
3
|
from .acl import ACL
|
8
4
|
from .agent import Agent
|
9
5
|
from .agent_chain import AgentChain
|
@@ -12,7 +8,6 @@ from .agent_history_event import AgentHistoryEvent
|
|
12
8
|
from .agent_release import AgentRelease
|
13
9
|
from .agent_spec import AgentSpec
|
14
10
|
from .api_key import ApiKey
|
15
|
-
from .billing_address import BillingAddress
|
16
11
|
from .configuration import Configuration
|
17
12
|
from .continent import Continent
|
18
13
|
from .core_event import CoreEvent
|
@@ -47,6 +42,10 @@ from .integration_connection_spec_secret import IntegrationConnectionSpecSecret
|
|
47
42
|
from .integration_model import IntegrationModel
|
48
43
|
from .integration_repository import IntegrationRepository
|
49
44
|
from .invite_workspace_user_body import InviteWorkspaceUserBody
|
45
|
+
from .knowledgebase import Knowledgebase
|
46
|
+
from .knowledgebase_release import KnowledgebaseRelease
|
47
|
+
from .knowledgebase_spec import KnowledgebaseSpec
|
48
|
+
from .knowledgebase_spec_options import KnowledgebaseSpecOptions
|
50
49
|
from .last_n_requests_metric import LastNRequestsMetric
|
51
50
|
from .latency_metric import LatencyMetric
|
52
51
|
from .location_response import LocationResponse
|
@@ -121,10 +120,6 @@ from .workspace_labels import WorkspaceLabels
|
|
121
120
|
from .workspace_user import WorkspaceUser
|
122
121
|
|
123
122
|
__all__ = (
|
124
|
-
"Account",
|
125
|
-
"AccountMetadata",
|
126
|
-
"AccountSpec",
|
127
|
-
"AccountSpecAddress",
|
128
123
|
"ACL",
|
129
124
|
"Agent",
|
130
125
|
"AgentChain",
|
@@ -133,7 +128,6 @@ __all__ = (
|
|
133
128
|
"AgentRelease",
|
134
129
|
"AgentSpec",
|
135
130
|
"ApiKey",
|
136
|
-
"BillingAddress",
|
137
131
|
"Configuration",
|
138
132
|
"Continent",
|
139
133
|
"CoreEvent",
|
@@ -166,6 +160,10 @@ __all__ = (
|
|
166
160
|
"IntegrationModel",
|
167
161
|
"IntegrationRepository",
|
168
162
|
"InviteWorkspaceUserBody",
|
163
|
+
"Knowledgebase",
|
164
|
+
"KnowledgebaseRelease",
|
165
|
+
"KnowledgebaseSpec",
|
166
|
+
"KnowledgebaseSpecOptions",
|
169
167
|
"LastNRequestsMetric",
|
170
168
|
"LatencyMetric",
|
171
169
|
"LocationResponse",
|
beamlit/models/agent_chain.py
CHANGED
@@ -16,11 +16,13 @@ class AgentChain:
|
|
16
16
|
description (Union[Unset, str]): Description of the agent in case you want to override the default one
|
17
17
|
enabled (Union[Unset, bool]): Whether the agent chain is enabled
|
18
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
|
19
20
|
"""
|
20
21
|
|
21
22
|
description: Union[Unset, str] = UNSET
|
22
23
|
enabled: Union[Unset, bool] = UNSET
|
23
24
|
name: Union[Unset, str] = UNSET
|
25
|
+
prompt: Union[Unset, str] = UNSET
|
24
26
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
25
27
|
|
26
28
|
def to_dict(self) -> dict[str, Any]:
|
@@ -30,6 +32,8 @@ class AgentChain:
|
|
30
32
|
|
31
33
|
name = self.name
|
32
34
|
|
35
|
+
prompt = self.prompt
|
36
|
+
|
33
37
|
field_dict: dict[str, Any] = {}
|
34
38
|
field_dict.update(self.additional_properties)
|
35
39
|
field_dict.update({})
|
@@ -39,6 +43,8 @@ class AgentChain:
|
|
39
43
|
field_dict["enabled"] = enabled
|
40
44
|
if name is not UNSET:
|
41
45
|
field_dict["name"] = name
|
46
|
+
if prompt is not UNSET:
|
47
|
+
field_dict["prompt"] = prompt
|
42
48
|
|
43
49
|
return field_dict
|
44
50
|
|
@@ -53,10 +59,13 @@ class AgentChain:
|
|
53
59
|
|
54
60
|
name = d.pop("name", UNSET)
|
55
61
|
|
62
|
+
prompt = d.pop("prompt", UNSET)
|
63
|
+
|
56
64
|
agent_chain = cls(
|
57
65
|
description=description,
|
58
66
|
enabled=enabled,
|
59
67
|
name=name,
|
68
|
+
prompt=prompt,
|
60
69
|
)
|
61
70
|
|
62
71
|
agent_chain.additional_properties = d
|
beamlit/models/agent_spec.py
CHANGED
@@ -35,9 +35,10 @@ class AgentSpec:
|
|
35
35
|
sandbox (Union[Unset, bool]): Sandbox mode
|
36
36
|
serverless_config (Union[Unset, ServerlessConfig]): Configuration for a serverless deployment
|
37
37
|
agent_chain (Union[Unset, list['AgentChain']]): Agent chain
|
38
|
-
description (Union[Unset, str]):
|
38
|
+
description (Union[Unset, str]): Description, small description computed from the prompt
|
39
39
|
functions (Union[Unset, list[str]]):
|
40
40
|
model (Union[Unset, str]): Model name
|
41
|
+
prompt (Union[Unset, str]): Prompt, describe what your agent does
|
41
42
|
repository (Union[Unset, Repository]): Repository
|
42
43
|
store_id (Union[Unset, str]): Store id
|
43
44
|
"""
|
@@ -56,6 +57,7 @@ class AgentSpec:
|
|
56
57
|
description: Union[Unset, str] = UNSET
|
57
58
|
functions: Union[Unset, list[str]] = UNSET
|
58
59
|
model: Union[Unset, str] = UNSET
|
60
|
+
prompt: Union[Unset, str] = UNSET
|
59
61
|
repository: Union[Unset, "Repository"] = UNSET
|
60
62
|
store_id: Union[Unset, str] = UNSET
|
61
63
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
@@ -137,6 +139,8 @@ class AgentSpec:
|
|
137
139
|
|
138
140
|
model = self.model
|
139
141
|
|
142
|
+
prompt = self.prompt
|
143
|
+
|
140
144
|
repository: Union[Unset, dict[str, Any]] = UNSET
|
141
145
|
if self.repository and not isinstance(self.repository, Unset) and not isinstance(self.repository, dict):
|
142
146
|
repository = self.repository.to_dict()
|
@@ -176,6 +180,8 @@ class AgentSpec:
|
|
176
180
|
field_dict["functions"] = functions
|
177
181
|
if model is not UNSET:
|
178
182
|
field_dict["model"] = model
|
183
|
+
if prompt is not UNSET:
|
184
|
+
field_dict["prompt"] = prompt
|
179
185
|
if repository is not UNSET:
|
180
186
|
field_dict["repository"] = repository
|
181
187
|
if store_id is not UNSET:
|
@@ -260,6 +266,8 @@ class AgentSpec:
|
|
260
266
|
|
261
267
|
model = d.pop("model", UNSET)
|
262
268
|
|
269
|
+
prompt = d.pop("prompt", UNSET)
|
270
|
+
|
263
271
|
_repository = d.pop("repository", UNSET)
|
264
272
|
repository: Union[Unset, Repository]
|
265
273
|
if isinstance(_repository, Unset):
|
@@ -284,6 +292,7 @@ class AgentSpec:
|
|
284
292
|
description=description,
|
285
293
|
functions=functions,
|
286
294
|
model=model,
|
295
|
+
prompt=prompt,
|
287
296
|
repository=repository,
|
288
297
|
store_id=store_id,
|
289
298
|
)
|
@@ -13,47 +13,55 @@ class IntegrationModel:
|
|
13
13
|
"""Model obtained from an external authentication provider, such as HuggingFace, OpenAI, etc...
|
14
14
|
|
15
15
|
Attributes:
|
16
|
+
author (Union[Unset, str]): Provider model author
|
16
17
|
created_at (Union[Unset, str]): Provider model created at
|
17
18
|
downloads (Union[Unset, int]): Provider model downloads
|
19
|
+
endpoint (Union[Unset, str]): Model endpoint URL
|
18
20
|
id (Union[Unset, str]): Provider model ID
|
19
21
|
library_name (Union[Unset, str]): Provider model library name
|
20
22
|
likes (Union[Unset, int]): Provider model likes
|
23
|
+
model_private (Union[Unset, str]): Is the model private
|
21
24
|
name (Union[Unset, str]): Provider model name
|
22
25
|
pipeline_tag (Union[Unset, str]): Provider model pipeline tag
|
23
|
-
private (Union[Unset, bool]): Provider model private
|
24
26
|
tags (Union[Unset, list[str]]): Provider model tags
|
25
27
|
trending_score (Union[Unset, int]): Provider model trending score
|
26
28
|
"""
|
27
29
|
|
30
|
+
author: Union[Unset, str] = UNSET
|
28
31
|
created_at: Union[Unset, str] = UNSET
|
29
32
|
downloads: Union[Unset, int] = UNSET
|
33
|
+
endpoint: Union[Unset, str] = UNSET
|
30
34
|
id: Union[Unset, str] = UNSET
|
31
35
|
library_name: Union[Unset, str] = UNSET
|
32
36
|
likes: Union[Unset, int] = UNSET
|
37
|
+
model_private: Union[Unset, str] = UNSET
|
33
38
|
name: Union[Unset, str] = UNSET
|
34
39
|
pipeline_tag: Union[Unset, str] = UNSET
|
35
|
-
private: Union[Unset, bool] = UNSET
|
36
40
|
tags: Union[Unset, list[str]] = UNSET
|
37
41
|
trending_score: Union[Unset, int] = UNSET
|
38
42
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
39
43
|
|
40
44
|
def to_dict(self) -> dict[str, Any]:
|
45
|
+
author = self.author
|
46
|
+
|
41
47
|
created_at = self.created_at
|
42
48
|
|
43
49
|
downloads = self.downloads
|
44
50
|
|
51
|
+
endpoint = self.endpoint
|
52
|
+
|
45
53
|
id = self.id
|
46
54
|
|
47
55
|
library_name = self.library_name
|
48
56
|
|
49
57
|
likes = self.likes
|
50
58
|
|
59
|
+
model_private = self.model_private
|
60
|
+
|
51
61
|
name = self.name
|
52
62
|
|
53
63
|
pipeline_tag = self.pipeline_tag
|
54
64
|
|
55
|
-
private = self.private
|
56
|
-
|
57
65
|
tags: Union[Unset, list[str]] = UNSET
|
58
66
|
if not isinstance(self.tags, Unset):
|
59
67
|
tags = self.tags
|
@@ -63,22 +71,26 @@ class IntegrationModel:
|
|
63
71
|
field_dict: dict[str, Any] = {}
|
64
72
|
field_dict.update(self.additional_properties)
|
65
73
|
field_dict.update({})
|
74
|
+
if author is not UNSET:
|
75
|
+
field_dict["author"] = author
|
66
76
|
if created_at is not UNSET:
|
67
77
|
field_dict["created_at"] = created_at
|
68
78
|
if downloads is not UNSET:
|
69
79
|
field_dict["downloads"] = downloads
|
80
|
+
if endpoint is not UNSET:
|
81
|
+
field_dict["endpoint"] = endpoint
|
70
82
|
if id is not UNSET:
|
71
83
|
field_dict["id"] = id
|
72
84
|
if library_name is not UNSET:
|
73
85
|
field_dict["library_name"] = library_name
|
74
86
|
if likes is not UNSET:
|
75
87
|
field_dict["likes"] = likes
|
88
|
+
if model_private is not UNSET:
|
89
|
+
field_dict["model_private"] = model_private
|
76
90
|
if name is not UNSET:
|
77
91
|
field_dict["name"] = name
|
78
92
|
if pipeline_tag is not UNSET:
|
79
93
|
field_dict["pipeline_tag"] = pipeline_tag
|
80
|
-
if private is not UNSET:
|
81
|
-
field_dict["private"] = private
|
82
94
|
if tags is not UNSET:
|
83
95
|
field_dict["tags"] = tags
|
84
96
|
if trending_score is not UNSET:
|
@@ -91,35 +103,41 @@ class IntegrationModel:
|
|
91
103
|
if not src_dict:
|
92
104
|
return None
|
93
105
|
d = src_dict.copy()
|
106
|
+
author = d.pop("author", UNSET)
|
107
|
+
|
94
108
|
created_at = d.pop("created_at", UNSET)
|
95
109
|
|
96
110
|
downloads = d.pop("downloads", UNSET)
|
97
111
|
|
112
|
+
endpoint = d.pop("endpoint", UNSET)
|
113
|
+
|
98
114
|
id = d.pop("id", UNSET)
|
99
115
|
|
100
116
|
library_name = d.pop("library_name", UNSET)
|
101
117
|
|
102
118
|
likes = d.pop("likes", UNSET)
|
103
119
|
|
120
|
+
model_private = d.pop("model_private", UNSET)
|
121
|
+
|
104
122
|
name = d.pop("name", UNSET)
|
105
123
|
|
106
124
|
pipeline_tag = d.pop("pipeline_tag", UNSET)
|
107
125
|
|
108
|
-
private = d.pop("private", UNSET)
|
109
|
-
|
110
126
|
tags = cast(list[str], d.pop("tags", UNSET))
|
111
127
|
|
112
128
|
trending_score = d.pop("trending_score", UNSET)
|
113
129
|
|
114
130
|
integration_model = cls(
|
131
|
+
author=author,
|
115
132
|
created_at=created_at,
|
116
133
|
downloads=downloads,
|
134
|
+
endpoint=endpoint,
|
117
135
|
id=id,
|
118
136
|
library_name=library_name,
|
119
137
|
likes=likes,
|
138
|
+
model_private=model_private,
|
120
139
|
name=name,
|
121
140
|
pipeline_tag=pipeline_tag,
|
122
|
-
private=private,
|
123
141
|
tags=tags,
|
124
142
|
trending_score=trending_score,
|
125
143
|
)
|
@@ -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.core_event import CoreEvent
|
10
|
+
from ..models.environment_metadata import EnvironmentMetadata
|
11
|
+
from ..models.knowledgebase_spec import KnowledgebaseSpec
|
12
|
+
|
13
|
+
|
14
|
+
T = TypeVar("T", bound="Knowledgebase")
|
15
|
+
|
16
|
+
|
17
|
+
@_attrs_define
|
18
|
+
class Knowledgebase:
|
19
|
+
"""Knowledgebase
|
20
|
+
|
21
|
+
Attributes:
|
22
|
+
events (Union[Unset, list['CoreEvent']]): Core events
|
23
|
+
metadata (Union[Unset, EnvironmentMetadata]): Environment metadata
|
24
|
+
spec (Union[Unset, KnowledgebaseSpec]): Knowledgebase specification
|
25
|
+
status (Union[Unset, str]): Knowledgebase status
|
26
|
+
"""
|
27
|
+
|
28
|
+
events: Union[Unset, list["CoreEvent"]] = UNSET
|
29
|
+
metadata: Union[Unset, "EnvironmentMetadata"] = UNSET
|
30
|
+
spec: Union[Unset, "KnowledgebaseSpec"] = 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.core_event import CoreEvent
|
73
|
+
from ..models.environment_metadata import EnvironmentMetadata
|
74
|
+
from ..models.knowledgebase_spec import KnowledgebaseSpec
|
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, EnvironmentMetadata]
|
88
|
+
if isinstance(_metadata, Unset):
|
89
|
+
metadata = UNSET
|
90
|
+
else:
|
91
|
+
metadata = EnvironmentMetadata.from_dict(_metadata)
|
92
|
+
|
93
|
+
_spec = d.pop("spec", UNSET)
|
94
|
+
spec: Union[Unset, KnowledgebaseSpec]
|
95
|
+
if isinstance(_spec, Unset):
|
96
|
+
spec = UNSET
|
97
|
+
else:
|
98
|
+
spec = KnowledgebaseSpec.from_dict(_spec)
|
99
|
+
|
100
|
+
status = d.pop("status", UNSET)
|
101
|
+
|
102
|
+
knowledgebase = cls(
|
103
|
+
events=events,
|
104
|
+
metadata=metadata,
|
105
|
+
spec=spec,
|
106
|
+
status=status,
|
107
|
+
)
|
108
|
+
|
109
|
+
knowledgebase.additional_properties = d
|
110
|
+
return knowledgebase
|
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,70 @@
|
|
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="KnowledgebaseRelease")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class KnowledgebaseRelease:
|
13
|
+
"""Knowledgebase release, used to deploy a function from one environment to another
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
from_ (Union[Unset, str]): Origin environment from which the function is released
|
17
|
+
to (Union[Unset, str]): Destination environment to which the function is released
|
18
|
+
"""
|
19
|
+
|
20
|
+
from_: Union[Unset, str] = UNSET
|
21
|
+
to: Union[Unset, str] = UNSET
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
23
|
+
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
25
|
+
from_ = self.from_
|
26
|
+
|
27
|
+
to = self.to
|
28
|
+
|
29
|
+
field_dict: dict[str, Any] = {}
|
30
|
+
field_dict.update(self.additional_properties)
|
31
|
+
field_dict.update({})
|
32
|
+
if from_ is not UNSET:
|
33
|
+
field_dict["from"] = from_
|
34
|
+
if to is not UNSET:
|
35
|
+
field_dict["to"] = to
|
36
|
+
|
37
|
+
return field_dict
|
38
|
+
|
39
|
+
@classmethod
|
40
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
41
|
+
if not src_dict:
|
42
|
+
return None
|
43
|
+
d = src_dict.copy()
|
44
|
+
from_ = d.pop("from", UNSET)
|
45
|
+
|
46
|
+
to = d.pop("to", UNSET)
|
47
|
+
|
48
|
+
knowledgebase_release = cls(
|
49
|
+
from_=from_,
|
50
|
+
to=to,
|
51
|
+
)
|
52
|
+
|
53
|
+
knowledgebase_release.additional_properties = d
|
54
|
+
return knowledgebase_release
|
55
|
+
|
56
|
+
@property
|
57
|
+
def additional_keys(self) -> list[str]:
|
58
|
+
return list(self.additional_properties.keys())
|
59
|
+
|
60
|
+
def __getitem__(self, key: str) -> Any:
|
61
|
+
return self.additional_properties[key]
|
62
|
+
|
63
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
64
|
+
self.additional_properties[key] = value
|
65
|
+
|
66
|
+
def __delitem__(self, key: str) -> None:
|
67
|
+
del self.additional_properties[key]
|
68
|
+
|
69
|
+
def __contains__(self, key: str) -> bool:
|
70
|
+
return key in self.additional_properties
|
@@ -0,0 +1,143 @@
|
|
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.knowledgebase_spec_options import KnowledgebaseSpecOptions
|
10
|
+
|
11
|
+
|
12
|
+
T = TypeVar("T", bound="KnowledgebaseSpec")
|
13
|
+
|
14
|
+
|
15
|
+
@_attrs_define
|
16
|
+
class KnowledgebaseSpec:
|
17
|
+
"""Knowledgebase specification
|
18
|
+
|
19
|
+
Attributes:
|
20
|
+
collection_name (Union[Unset, str]): Collection name
|
21
|
+
embedding_model (Union[Unset, str]): Embedding model
|
22
|
+
embedding_model_type (Union[Unset, str]): Embedding model type
|
23
|
+
enabled (Union[Unset, bool]): Enable or disable the agent
|
24
|
+
integration_connections (Union[Unset, list[str]]):
|
25
|
+
options (Union[Unset, KnowledgebaseSpecOptions]): Options specific to the knowledge base
|
26
|
+
policies (Union[Unset, list[str]]):
|
27
|
+
sandbox (Union[Unset, bool]): Sandbox mode
|
28
|
+
"""
|
29
|
+
|
30
|
+
collection_name: Union[Unset, str] = UNSET
|
31
|
+
embedding_model: Union[Unset, str] = UNSET
|
32
|
+
embedding_model_type: Union[Unset, str] = UNSET
|
33
|
+
enabled: Union[Unset, bool] = UNSET
|
34
|
+
integration_connections: Union[Unset, list[str]] = UNSET
|
35
|
+
options: Union[Unset, "KnowledgebaseSpecOptions"] = UNSET
|
36
|
+
policies: Union[Unset, list[str]] = UNSET
|
37
|
+
sandbox: Union[Unset, bool] = UNSET
|
38
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
39
|
+
|
40
|
+
def to_dict(self) -> dict[str, Any]:
|
41
|
+
collection_name = self.collection_name
|
42
|
+
|
43
|
+
embedding_model = self.embedding_model
|
44
|
+
|
45
|
+
embedding_model_type = self.embedding_model_type
|
46
|
+
|
47
|
+
enabled = self.enabled
|
48
|
+
|
49
|
+
integration_connections: Union[Unset, list[str]] = UNSET
|
50
|
+
if not isinstance(self.integration_connections, Unset):
|
51
|
+
integration_connections = self.integration_connections
|
52
|
+
|
53
|
+
options: Union[Unset, dict[str, Any]] = UNSET
|
54
|
+
if self.options and not isinstance(self.options, Unset) and not isinstance(self.options, dict):
|
55
|
+
options = self.options.to_dict()
|
56
|
+
elif self.options and isinstance(self.options, dict):
|
57
|
+
options = self.options
|
58
|
+
|
59
|
+
policies: Union[Unset, list[str]] = UNSET
|
60
|
+
if not isinstance(self.policies, Unset):
|
61
|
+
policies = self.policies
|
62
|
+
|
63
|
+
sandbox = self.sandbox
|
64
|
+
|
65
|
+
field_dict: dict[str, Any] = {}
|
66
|
+
field_dict.update(self.additional_properties)
|
67
|
+
field_dict.update({})
|
68
|
+
if collection_name is not UNSET:
|
69
|
+
field_dict["collectionName"] = collection_name
|
70
|
+
if embedding_model is not UNSET:
|
71
|
+
field_dict["embeddingModel"] = embedding_model
|
72
|
+
if embedding_model_type is not UNSET:
|
73
|
+
field_dict["embeddingModelType"] = embedding_model_type
|
74
|
+
if enabled is not UNSET:
|
75
|
+
field_dict["enabled"] = enabled
|
76
|
+
if integration_connections is not UNSET:
|
77
|
+
field_dict["integrationConnections"] = integration_connections
|
78
|
+
if options is not UNSET:
|
79
|
+
field_dict["options"] = options
|
80
|
+
if policies is not UNSET:
|
81
|
+
field_dict["policies"] = policies
|
82
|
+
if sandbox is not UNSET:
|
83
|
+
field_dict["sandbox"] = sandbox
|
84
|
+
|
85
|
+
return field_dict
|
86
|
+
|
87
|
+
@classmethod
|
88
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
89
|
+
from ..models.knowledgebase_spec_options import KnowledgebaseSpecOptions
|
90
|
+
|
91
|
+
if not src_dict:
|
92
|
+
return None
|
93
|
+
d = src_dict.copy()
|
94
|
+
collection_name = d.pop("collectionName", UNSET)
|
95
|
+
|
96
|
+
embedding_model = d.pop("embeddingModel", UNSET)
|
97
|
+
|
98
|
+
embedding_model_type = d.pop("embeddingModelType", UNSET)
|
99
|
+
|
100
|
+
enabled = d.pop("enabled", UNSET)
|
101
|
+
|
102
|
+
integration_connections = cast(list[str], d.pop("integrationConnections", UNSET))
|
103
|
+
|
104
|
+
_options = d.pop("options", UNSET)
|
105
|
+
options: Union[Unset, KnowledgebaseSpecOptions]
|
106
|
+
if isinstance(_options, Unset):
|
107
|
+
options = UNSET
|
108
|
+
else:
|
109
|
+
options = KnowledgebaseSpecOptions.from_dict(_options)
|
110
|
+
|
111
|
+
policies = cast(list[str], d.pop("policies", UNSET))
|
112
|
+
|
113
|
+
sandbox = d.pop("sandbox", UNSET)
|
114
|
+
|
115
|
+
knowledgebase_spec = cls(
|
116
|
+
collection_name=collection_name,
|
117
|
+
embedding_model=embedding_model,
|
118
|
+
embedding_model_type=embedding_model_type,
|
119
|
+
enabled=enabled,
|
120
|
+
integration_connections=integration_connections,
|
121
|
+
options=options,
|
122
|
+
policies=policies,
|
123
|
+
sandbox=sandbox,
|
124
|
+
)
|
125
|
+
|
126
|
+
knowledgebase_spec.additional_properties = d
|
127
|
+
return knowledgebase_spec
|
128
|
+
|
129
|
+
@property
|
130
|
+
def additional_keys(self) -> list[str]:
|
131
|
+
return list(self.additional_properties.keys())
|
132
|
+
|
133
|
+
def __getitem__(self, key: str) -> Any:
|
134
|
+
return self.additional_properties[key]
|
135
|
+
|
136
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
137
|
+
self.additional_properties[key] = value
|
138
|
+
|
139
|
+
def __delitem__(self, key: str) -> None:
|
140
|
+
del self.additional_properties[key]
|
141
|
+
|
142
|
+
def __contains__(self, key: str) -> bool:
|
143
|
+
return key in self.additional_properties
|
@@ -3,12 +3,12 @@ from typing import Any, TypeVar
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
5
5
|
|
6
|
-
T = TypeVar("T", bound="
|
6
|
+
T = TypeVar("T", bound="KnowledgebaseSpecOptions")
|
7
7
|
|
8
8
|
|
9
9
|
@_attrs_define
|
10
|
-
class
|
11
|
-
"""
|
10
|
+
class KnowledgebaseSpecOptions:
|
11
|
+
"""Options specific to the knowledge base"""
|
12
12
|
|
13
13
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
14
14
|
|
@@ -23,10 +23,10 @@ class AccountSpecAddress:
|
|
23
23
|
if not src_dict:
|
24
24
|
return None
|
25
25
|
d = src_dict.copy()
|
26
|
-
|
26
|
+
knowledgebase_spec_options = cls()
|
27
27
|
|
28
|
-
|
29
|
-
return
|
28
|
+
knowledgebase_spec_options.additional_properties = d
|
29
|
+
return knowledgebase_spec_options
|
30
30
|
|
31
31
|
@property
|
32
32
|
def additional_keys(self) -> list[str]:
|