lightning-sdk 0.1.34__py3-none-any.whl → 0.1.36__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.
- lightning_sdk/__init__.py +1 -1
- lightning_sdk/ai_hub.py +67 -8
- lightning_sdk/api/ai_hub_api.py +60 -19
- lightning_sdk/api/utils.py +1 -0
- lightning_sdk/cli/ai_hub.py +11 -0
- lightning_sdk/cli/download.py +3 -3
- lightning_sdk/lightning_cloud/cli/__main__.py +15 -13
- lightning_sdk/lightning_cloud/login.py +5 -2
- lightning_sdk/lightning_cloud/openapi/api/cloud_space_service_api.py +10 -2
- lightning_sdk/lightning_cloud/openapi/models/agents_id_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/cloud_space_id_versionpublications_body1.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/create_deployment_request_defines_a_spec_for_the_job_that_allows_for_autoscaling_jobs.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/deployments_id_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/externalv1_cloud_space_instance_status.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/snowflake_export_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_assistant.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_capacity_block_offering.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space_version.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_accelerator.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_release.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_state.py +1 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_deployment_status.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_get_model_files_response.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_get_user_response.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_google_cloud_direct_v1.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_magic_link_login_request.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_metric_value.py +1 -27
- lightning_sdk/lightning_cloud/openapi/models/v1_metrics.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_snowflake_data_connection.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_update_user_request.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +27 -1
- lightning_sdk/lightning_cloud/rest_client.py +1 -4
- lightning_sdk/lightning_cloud/source_code/tar.py +1 -3
- {lightning_sdk-0.1.34.dist-info → lightning_sdk-0.1.36.dist-info}/METADATA +1 -2
- {lightning_sdk-0.1.34.dist-info → lightning_sdk-0.1.36.dist-info}/RECORD +40 -40
- {lightning_sdk-0.1.34.dist-info → lightning_sdk-0.1.36.dist-info}/LICENSE +0 -0
- {lightning_sdk-0.1.34.dist-info → lightning_sdk-0.1.36.dist-info}/WHEEL +0 -0
- {lightning_sdk-0.1.34.dist-info → lightning_sdk-0.1.36.dist-info}/entry_points.txt +0 -0
- {lightning_sdk-0.1.34.dist-info → lightning_sdk-0.1.36.dist-info}/top_level.txt +0 -0
lightning_sdk/__init__.py
CHANGED
lightning_sdk/ai_hub.py
CHANGED
|
@@ -23,12 +23,66 @@ class AIHub:
|
|
|
23
23
|
self._api = AIHubApi()
|
|
24
24
|
self._auth = None
|
|
25
25
|
|
|
26
|
+
def api_info(self, api_id: str) -> dict:
|
|
27
|
+
"""Get full API template info such as input details.
|
|
28
|
+
|
|
29
|
+
Example:
|
|
30
|
+
ai_hub = AIHub()
|
|
31
|
+
api_info = ai_hub.api_info("api_12345")
|
|
32
|
+
|
|
33
|
+
Args:
|
|
34
|
+
api_id: The ID of the API for which information is requested.
|
|
35
|
+
|
|
36
|
+
Returns:
|
|
37
|
+
A dictionary containing detailed information about the API,
|
|
38
|
+
including its name, description, creation and update timestamps,
|
|
39
|
+
parameters, tags, job specifications, and autoscaling settings.
|
|
40
|
+
"""
|
|
41
|
+
template = self._api.api_info(api_id)
|
|
42
|
+
|
|
43
|
+
api_arguments = [
|
|
44
|
+
{
|
|
45
|
+
"name": param.name,
|
|
46
|
+
"short_description": param.short_description,
|
|
47
|
+
"required": param.required,
|
|
48
|
+
"default": param.input.default_value,
|
|
49
|
+
}
|
|
50
|
+
for param in template.parameter_spec.parameters
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
"name": template.name,
|
|
55
|
+
"description": template.description,
|
|
56
|
+
"created_at": template.created_at,
|
|
57
|
+
"updated_at": template.updated_at,
|
|
58
|
+
"api_arguments": api_arguments,
|
|
59
|
+
"tags": [tag.name for tag in template.tags],
|
|
60
|
+
"job": {
|
|
61
|
+
"image": template.spec_v2.job.image,
|
|
62
|
+
"interruptible": template.spec_v2.job.spot,
|
|
63
|
+
"instance_type": template.spec_v2.job.instance_type,
|
|
64
|
+
"resources": template.spec_v2.job.resources,
|
|
65
|
+
},
|
|
66
|
+
"autoscaling": {
|
|
67
|
+
"enabled": template.spec_v2.autoscaling.enabled,
|
|
68
|
+
"min_replicas": template.spec_v2.autoscaling.min_replicas,
|
|
69
|
+
"max_replicas": template.spec_v2.autoscaling.max_replicas,
|
|
70
|
+
},
|
|
71
|
+
}
|
|
72
|
+
|
|
26
73
|
def list_apis(self, search: Optional[str] = None) -> List[Dict[str, str]]:
|
|
27
74
|
"""Get a list of AI Hub API templates.
|
|
28
75
|
|
|
29
76
|
Example:
|
|
30
|
-
|
|
31
|
-
api_list =
|
|
77
|
+
ai_hub = AIHub()
|
|
78
|
+
api_list = ai_hub.list_apis(search="Llama")
|
|
79
|
+
|
|
80
|
+
Args:
|
|
81
|
+
search: A search query to filter the list of APIs. Defaults to None.
|
|
82
|
+
|
|
83
|
+
Returns:
|
|
84
|
+
A list of dictionaries, each containing information about an API,
|
|
85
|
+
such as its ID, name, description, creator's username, and creation timestamp.
|
|
32
86
|
"""
|
|
33
87
|
search_query = search or ""
|
|
34
88
|
api_templates = self._api.list_apis(search_query=search_query)
|
|
@@ -73,22 +127,26 @@ class AIHub:
|
|
|
73
127
|
name: Optional[str] = None,
|
|
74
128
|
teamspace: Optional[Union[str, "Teamspace"]] = None,
|
|
75
129
|
org: Optional[Union[str, "Organization"]] = None,
|
|
76
|
-
|
|
130
|
+
api_arguments: Optional[Dict[str, Any]] = None,
|
|
77
131
|
) -> Dict[str, Union[str, bool]]:
|
|
78
132
|
"""Deploy an API from the AI Hub.
|
|
79
133
|
|
|
80
134
|
Example:
|
|
81
135
|
from lightning_sdk import AIHub
|
|
82
|
-
|
|
83
|
-
deployment =
|
|
136
|
+
hub = AIHub()
|
|
137
|
+
deployment = hub.deploy("temp_01jc37n6qpqkdptjpyep0z06hy")
|
|
138
|
+
|
|
139
|
+
# Using API arguments
|
|
140
|
+
api_arugments = {"batch_size" 10, "batch_timeout": 0.001, "env_token": "lit_xxxx"}
|
|
141
|
+
deployment = hub.deploy("temp_01jc37n6qpqkdptjpyep0z06hy", api_arugments=api_arugments)
|
|
84
142
|
|
|
85
143
|
Args:
|
|
86
144
|
api_id: The ID of the API you want to deploy.
|
|
87
|
-
cluster: The cluster where you want to deploy the API, such as "lightning-public-prod".
|
|
145
|
+
cluster: The cluster where you want to deploy the API, such as "lightning-public-prod". Defaults to None.
|
|
88
146
|
name: Name for the deployed API. Defaults to None.
|
|
89
147
|
teamspace: The team or group for deployment. Defaults to None.
|
|
90
148
|
org: The organization for deployment. Defaults to None.
|
|
91
|
-
|
|
149
|
+
api_arguments: Additional API argument, such as model name, or batch size.
|
|
92
150
|
|
|
93
151
|
Returns:
|
|
94
152
|
A dictionary containing the name of the deployed API,
|
|
@@ -101,8 +159,9 @@ class AIHub:
|
|
|
101
159
|
teamspace = self._authenticate(teamspace, org)
|
|
102
160
|
teamspace_id = teamspace.id
|
|
103
161
|
|
|
162
|
+
api_arguments = api_arguments or {}
|
|
104
163
|
deployment = self._api.deploy_api(
|
|
105
|
-
template_id=api_id, cluster_id=cluster, project_id=teamspace_id, name=name,
|
|
164
|
+
template_id=api_id, cluster_id=cluster, project_id=teamspace_id, name=name, api_arguments=api_arguments
|
|
106
165
|
)
|
|
107
166
|
url = quote(f"{LIGHTNING_CLOUD_URL}/{teamspace._org.name}/{teamspace.name}/jobs/{deployment.name}", safe=":/()")
|
|
108
167
|
print("Deployment available at:", url)
|
lightning_sdk/api/ai_hub_api.py
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
from typing import List, Optional
|
|
1
|
+
import traceback
|
|
2
|
+
from typing import Dict, List, Optional
|
|
3
3
|
|
|
4
4
|
import backoff
|
|
5
5
|
|
|
6
6
|
from lightning_sdk.lightning_cloud.openapi.models import (
|
|
7
7
|
CreateDeploymentRequestDefinesASpecForTheJobThatAllowsForAutoscalingJobs,
|
|
8
8
|
V1Deployment,
|
|
9
|
-
|
|
9
|
+
V1DeploymentTemplate,
|
|
10
|
+
V1DeploymentTemplateParameter,
|
|
11
|
+
V1DeploymentTemplateParameterPlacement,
|
|
12
|
+
V1DeploymentTemplateParameterType,
|
|
13
|
+
V1JobSpec,
|
|
10
14
|
)
|
|
11
15
|
from lightning_sdk.lightning_cloud.openapi.models.v1_deployment_template_gallery_response import (
|
|
12
16
|
V1DeploymentTemplateGalleryResponse,
|
|
@@ -18,6 +22,15 @@ class AIHubApi:
|
|
|
18
22
|
def __init__(self) -> None:
|
|
19
23
|
self._client = LightningClient(max_tries=3)
|
|
20
24
|
|
|
25
|
+
def api_info(self, api_id: str) -> "V1DeploymentTemplate":
|
|
26
|
+
try:
|
|
27
|
+
return self._client.deployment_templates_service_get_deployment_template(api_id)
|
|
28
|
+
except Exception as e:
|
|
29
|
+
stack_trace = traceback.format_exc()
|
|
30
|
+
if "record not found" in stack_trace:
|
|
31
|
+
raise ValueError(f"api_id={api_id} not found.") from None
|
|
32
|
+
raise e
|
|
33
|
+
|
|
21
34
|
@backoff.on_predicate(backoff.expo, lambda x: not x, max_tries=5)
|
|
22
35
|
def list_apis(self, search_query: str) -> List[V1DeploymentTemplateGalleryResponse]:
|
|
23
36
|
kwargs = {"show_globally_visible": True}
|
|
@@ -26,31 +39,59 @@ class AIHubApi:
|
|
|
26
39
|
).templates
|
|
27
40
|
|
|
28
41
|
@staticmethod
|
|
29
|
-
def
|
|
30
|
-
|
|
42
|
+
def _update_parameters(
|
|
43
|
+
job: V1JobSpec, placements: List[V1DeploymentTemplateParameterPlacement], pattern: str, value: str
|
|
44
|
+
) -> None:
|
|
45
|
+
for placement in placements:
|
|
46
|
+
if placement == V1DeploymentTemplateParameterPlacement.COMMAND:
|
|
47
|
+
job.command = job.command.replace(pattern, str(value))
|
|
48
|
+
if placement == V1DeploymentTemplateParameterPlacement.ENTRYPOINT:
|
|
49
|
+
job.entrypoint = job.entrypoint.replace(pattern, str(value))
|
|
31
50
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
arguments = {}
|
|
37
|
-
for key in keys:
|
|
38
|
-
if key in kwargs:
|
|
39
|
-
arguments[key] = kwargs[key]
|
|
40
|
-
return [f"--{k} {v}" for k, v in arguments.items()]
|
|
51
|
+
if placement == V1DeploymentTemplateParameterPlacement.ENV:
|
|
52
|
+
for e in job.env:
|
|
53
|
+
if e.value == pattern:
|
|
54
|
+
e.value = str(value)
|
|
41
55
|
|
|
42
56
|
@staticmethod
|
|
43
|
-
def
|
|
44
|
-
|
|
57
|
+
def _set_parameters(
|
|
58
|
+
job: V1JobSpec, parameters: List[V1DeploymentTemplateParameter], api_arguments: Dict[str, str]
|
|
59
|
+
) -> V1JobSpec:
|
|
60
|
+
for p in parameters:
|
|
61
|
+
if p.name not in api_arguments:
|
|
62
|
+
if p.type == V1DeploymentTemplateParameterType.INPUT and p.input and p.input.default_value:
|
|
63
|
+
api_arguments[p.name] = p.input.default_value
|
|
64
|
+
|
|
65
|
+
if p.type == V1DeploymentTemplateParameterType.SELECT and p.select and len(p.select.options) > 0:
|
|
66
|
+
api_arguments[p.name] = p.select.options[0]
|
|
67
|
+
|
|
68
|
+
if p.type == V1DeploymentTemplateParameterType.CHECKBOX and p.checkbox:
|
|
69
|
+
api_arguments[p.name] = (
|
|
70
|
+
(p.checkbox.true_value or "True")
|
|
71
|
+
if p.checkbox.is_checked
|
|
72
|
+
else (p.checkbox.false_value or "False")
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
for p in parameters:
|
|
76
|
+
name = p.name
|
|
77
|
+
pattern = f"${{{name}}}"
|
|
78
|
+
if name in api_arguments:
|
|
79
|
+
AIHubApi._update_parameters(job, p.placements, pattern, api_arguments[name])
|
|
80
|
+
elif not p.required:
|
|
81
|
+
AIHubApi._update_parameters(job, p.placements, pattern, "")
|
|
82
|
+
else:
|
|
83
|
+
raise ValueError(f"API reqires argument '{p.name}' but is not provided with api_arguments.")
|
|
84
|
+
|
|
85
|
+
return job
|
|
45
86
|
|
|
46
87
|
def deploy_api(
|
|
47
|
-
self, template_id: str, project_id: str, cluster_id: str, name: Optional[str],
|
|
88
|
+
self, template_id: str, project_id: str, cluster_id: str, name: Optional[str], api_arguments: Dict[str, str]
|
|
48
89
|
) -> V1Deployment:
|
|
49
90
|
template = self._client.deployment_templates_service_get_deployment_template(template_id)
|
|
50
91
|
name = name or template.name
|
|
51
92
|
template.spec_v2.endpoint.id = None
|
|
52
|
-
|
|
53
|
-
template.spec_v2.job.
|
|
93
|
+
|
|
94
|
+
AIHubApi._set_parameters(template.spec_v2.job, template.parameter_spec.parameters, api_arguments)
|
|
54
95
|
return self._client.jobs_service_create_deployment(
|
|
55
96
|
project_id=project_id,
|
|
56
97
|
body=CreateDeploymentRequestDefinesASpecForTheJobThatAllowsForAutoscalingJobs(
|
lightning_sdk/api/utils.py
CHANGED
lightning_sdk/cli/ai_hub.py
CHANGED
|
@@ -10,6 +10,17 @@ class _AIHub(_StudiosMenu):
|
|
|
10
10
|
def __init__(self) -> None:
|
|
11
11
|
self._hub = AIHub()
|
|
12
12
|
|
|
13
|
+
def api_info(self, api_id: str) -> dict:
|
|
14
|
+
"""Get full API template info such as input details.
|
|
15
|
+
|
|
16
|
+
Example:
|
|
17
|
+
lightning aihub api_info [API_ID]
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
api_id: The ID of the API for which information is requested.
|
|
21
|
+
"""
|
|
22
|
+
return self._hub.api_info(api_id)
|
|
23
|
+
|
|
13
24
|
def list_apis(self, search: Optional[str] = None) -> List[dict]:
|
|
14
25
|
"""List API templates available in the AI Hub.
|
|
15
26
|
|
lightning_sdk/cli/download.py
CHANGED
|
@@ -13,19 +13,19 @@ from lightning_sdk.utils.resolve import _get_authed_user, skip_studio_init
|
|
|
13
13
|
class _Downloads(_StudiosMenu):
|
|
14
14
|
"""Download files and folders from Lightning AI."""
|
|
15
15
|
|
|
16
|
-
def model(self, name: str,
|
|
16
|
+
def model(self, name: str, download_dir: str = ".") -> None:
|
|
17
17
|
"""Download a Model.
|
|
18
18
|
|
|
19
19
|
Args:
|
|
20
20
|
name: The name of the Model you want to download.
|
|
21
21
|
This should have the format <ORGANIZATION-NAME>/<TEAMSPACE-NAME>/<MODEL-NAME>.
|
|
22
|
-
|
|
22
|
+
download_dir: The directory where the Model should be downloaded.
|
|
23
23
|
"""
|
|
24
24
|
org_name, teamspace_name, model_name = _parse_model_name(name)
|
|
25
25
|
teamspace = _get_teamspace(name=teamspace_name, organization=org_name)
|
|
26
26
|
teamspace.download_model(
|
|
27
27
|
name=model_name,
|
|
28
|
-
download_dir=
|
|
28
|
+
download_dir=download_dir,
|
|
29
29
|
progress_bar=True,
|
|
30
30
|
)
|
|
31
31
|
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import click
|
|
2
1
|
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
def main():
|
|
6
|
-
pass
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
@main.command()
|
|
10
|
-
def login():
|
|
3
|
+
def login() -> None:
|
|
11
4
|
"""Authorize the CLI to access Grid AI resources for a particular user.
|
|
12
|
-
|
|
13
|
-
a web browser will open to complete the authentication.
|
|
5
|
+
|
|
6
|
+
Use login command to force authenticate, a web browser will open to complete the authentication.
|
|
14
7
|
"""
|
|
15
8
|
from lightning_sdk.lightning_cloud.login import Auth # local to avoid circular import
|
|
16
9
|
|
|
@@ -18,10 +11,19 @@ def login():
|
|
|
18
11
|
auth.clear()
|
|
19
12
|
auth._run_server()
|
|
20
13
|
|
|
21
|
-
|
|
22
|
-
@main.command()
|
|
23
|
-
def logout():
|
|
14
|
+
def logout() -> None:
|
|
24
15
|
"""Logout from LightningCloud"""
|
|
25
16
|
from lightning_sdk.lightning_cloud.login import Auth # local to avoid circular import
|
|
26
17
|
|
|
27
18
|
Auth.clear()
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def main() -> None:
|
|
22
|
+
"""CLI entrypoint."""
|
|
23
|
+
from fire import Fire
|
|
24
|
+
|
|
25
|
+
Fire({"login": login, "logout": logout})
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
if __name__ == "__main__":
|
|
29
|
+
main()
|
|
@@ -8,7 +8,7 @@ from dataclasses import dataclass
|
|
|
8
8
|
from typing import Optional
|
|
9
9
|
from urllib.parse import urlencode
|
|
10
10
|
|
|
11
|
-
import
|
|
11
|
+
import webbrowser
|
|
12
12
|
|
|
13
13
|
import requests
|
|
14
14
|
import uvicorn
|
|
@@ -165,7 +165,10 @@ class AuthServer:
|
|
|
165
165
|
)
|
|
166
166
|
|
|
167
167
|
logger.info(f"login started for lightning.ai, opening {url}")
|
|
168
|
-
|
|
168
|
+
ok = webbrowser.open(url)
|
|
169
|
+
if not ok:
|
|
170
|
+
# can't open a browser, authentication failed
|
|
171
|
+
raise RuntimeError("Failed to authenticate to Lightning. When running without access to a browser, `LIGHTNING_USER_ID` and `LIGHTNING_API_KEY` should be exported.")
|
|
169
172
|
|
|
170
173
|
@app.get("/login-complete")
|
|
171
174
|
async def save_token(request: Request,
|
|
@@ -1753,6 +1753,7 @@ class CloudSpaceServiceApi(object):
|
|
|
1753
1753
|
:param str project_id: (required)
|
|
1754
1754
|
:param str cloud_space_id: (required)
|
|
1755
1755
|
:param str org_id:
|
|
1756
|
+
:param str cloud_space_version_id:
|
|
1756
1757
|
:return: V1DeleteCloudSpaceVersionPublicationResponse
|
|
1757
1758
|
If the method is called asynchronously,
|
|
1758
1759
|
returns the request thread.
|
|
@@ -1776,12 +1777,13 @@ class CloudSpaceServiceApi(object):
|
|
|
1776
1777
|
:param str project_id: (required)
|
|
1777
1778
|
:param str cloud_space_id: (required)
|
|
1778
1779
|
:param str org_id:
|
|
1780
|
+
:param str cloud_space_version_id:
|
|
1779
1781
|
:return: V1DeleteCloudSpaceVersionPublicationResponse
|
|
1780
1782
|
If the method is called asynchronously,
|
|
1781
1783
|
returns the request thread.
|
|
1782
1784
|
"""
|
|
1783
1785
|
|
|
1784
|
-
all_params = ['project_id', 'cloud_space_id', 'org_id'] # noqa: E501
|
|
1786
|
+
all_params = ['project_id', 'cloud_space_id', 'org_id', 'cloud_space_version_id'] # noqa: E501
|
|
1785
1787
|
all_params.append('async_req')
|
|
1786
1788
|
all_params.append('_return_http_data_only')
|
|
1787
1789
|
all_params.append('_preload_content')
|
|
@@ -1816,6 +1818,8 @@ class CloudSpaceServiceApi(object):
|
|
|
1816
1818
|
query_params = []
|
|
1817
1819
|
if 'org_id' in params:
|
|
1818
1820
|
query_params.append(('orgId', params['org_id'])) # noqa: E501
|
|
1821
|
+
if 'cloud_space_version_id' in params:
|
|
1822
|
+
query_params.append(('cloudSpaceVersionId', params['cloud_space_version_id'])) # noqa: E501
|
|
1819
1823
|
|
|
1820
1824
|
header_params = {}
|
|
1821
1825
|
|
|
@@ -5610,6 +5614,7 @@ class CloudSpaceServiceApi(object):
|
|
|
5610
5614
|
:param str cloud_space_id: (required)
|
|
5611
5615
|
:param bool draft:
|
|
5612
5616
|
:param str limit:
|
|
5617
|
+
:param bool include_publications:
|
|
5613
5618
|
:return: V1ListCloudSpaceVersionsResponse
|
|
5614
5619
|
If the method is called asynchronously,
|
|
5615
5620
|
returns the request thread.
|
|
@@ -5634,12 +5639,13 @@ class CloudSpaceServiceApi(object):
|
|
|
5634
5639
|
:param str cloud_space_id: (required)
|
|
5635
5640
|
:param bool draft:
|
|
5636
5641
|
:param str limit:
|
|
5642
|
+
:param bool include_publications:
|
|
5637
5643
|
:return: V1ListCloudSpaceVersionsResponse
|
|
5638
5644
|
If the method is called asynchronously,
|
|
5639
5645
|
returns the request thread.
|
|
5640
5646
|
"""
|
|
5641
5647
|
|
|
5642
|
-
all_params = ['project_id', 'cloud_space_id', 'draft', 'limit'] # noqa: E501
|
|
5648
|
+
all_params = ['project_id', 'cloud_space_id', 'draft', 'limit', 'include_publications'] # noqa: E501
|
|
5643
5649
|
all_params.append('async_req')
|
|
5644
5650
|
all_params.append('_return_http_data_only')
|
|
5645
5651
|
all_params.append('_preload_content')
|
|
@@ -5676,6 +5682,8 @@ class CloudSpaceServiceApi(object):
|
|
|
5676
5682
|
query_params.append(('draft', params['draft'])) # noqa: E501
|
|
5677
5683
|
if 'limit' in params:
|
|
5678
5684
|
query_params.append(('limit', params['limit'])) # noqa: E501
|
|
5685
|
+
if 'include_publications' in params:
|
|
5686
|
+
query_params.append(('includePublications', params['include_publications'])) # noqa: E501
|
|
5679
5687
|
|
|
5680
5688
|
header_params = {}
|
|
5681
5689
|
|
|
@@ -52,6 +52,7 @@ class AgentsIdBody(object):
|
|
|
52
52
|
'knowledge': 'str',
|
|
53
53
|
'knowledge_configuration': 'V1KnowledgeConfiguration',
|
|
54
54
|
'model': 'str',
|
|
55
|
+
'model_provider': 'str',
|
|
55
56
|
'name': 'str',
|
|
56
57
|
'org_id': 'str',
|
|
57
58
|
'prompt_suggestions': 'list[V1PromptSuggestion]',
|
|
@@ -75,6 +76,7 @@ class AgentsIdBody(object):
|
|
|
75
76
|
'knowledge': 'knowledge',
|
|
76
77
|
'knowledge_configuration': 'knowledgeConfiguration',
|
|
77
78
|
'model': 'model',
|
|
79
|
+
'model_provider': 'modelProvider',
|
|
78
80
|
'name': 'name',
|
|
79
81
|
'org_id': 'orgId',
|
|
80
82
|
'prompt_suggestions': 'promptSuggestions',
|
|
@@ -86,7 +88,7 @@ class AgentsIdBody(object):
|
|
|
86
88
|
'user_id': 'userId'
|
|
87
89
|
}
|
|
88
90
|
|
|
89
|
-
def __init__(self, cloudspace_id: 'str' =None, cluster_id: 'str' =None, created_at: 'datetime' =None, description: 'str' =None, endpoint_id: 'str' =None, expected_cold_start_time: 'str' =None, file_uploads_enabled: 'bool' =None, internal_assistant_name: 'str' =None, knowledge: 'str' =None, knowledge_configuration: 'V1KnowledgeConfiguration' =None, model: 'str' =None, name: 'str' =None, org_id: 'str' =None, prompt_suggestions: 'list[V1PromptSuggestion]' =None, prompt_template: 'str' =None, publish_status: 'str' =None, status: 'V1AssistantModelStatus' =None, thumbnail_url: 'str' =None, updated_at: 'datetime' =None, user_id: 'str' =None): # noqa: E501
|
|
91
|
+
def __init__(self, cloudspace_id: 'str' =None, cluster_id: 'str' =None, created_at: 'datetime' =None, description: 'str' =None, endpoint_id: 'str' =None, expected_cold_start_time: 'str' =None, file_uploads_enabled: 'bool' =None, internal_assistant_name: 'str' =None, knowledge: 'str' =None, knowledge_configuration: 'V1KnowledgeConfiguration' =None, model: 'str' =None, model_provider: 'str' =None, name: 'str' =None, org_id: 'str' =None, prompt_suggestions: 'list[V1PromptSuggestion]' =None, prompt_template: 'str' =None, publish_status: 'str' =None, status: 'V1AssistantModelStatus' =None, thumbnail_url: 'str' =None, updated_at: 'datetime' =None, user_id: 'str' =None): # noqa: E501
|
|
90
92
|
"""AgentsIdBody - a model defined in Swagger""" # noqa: E501
|
|
91
93
|
self._cloudspace_id = None
|
|
92
94
|
self._cluster_id = None
|
|
@@ -99,6 +101,7 @@ class AgentsIdBody(object):
|
|
|
99
101
|
self._knowledge = None
|
|
100
102
|
self._knowledge_configuration = None
|
|
101
103
|
self._model = None
|
|
104
|
+
self._model_provider = None
|
|
102
105
|
self._name = None
|
|
103
106
|
self._org_id = None
|
|
104
107
|
self._prompt_suggestions = None
|
|
@@ -131,6 +134,8 @@ class AgentsIdBody(object):
|
|
|
131
134
|
self.knowledge_configuration = knowledge_configuration
|
|
132
135
|
if model is not None:
|
|
133
136
|
self.model = model
|
|
137
|
+
if model_provider is not None:
|
|
138
|
+
self.model_provider = model_provider
|
|
134
139
|
if name is not None:
|
|
135
140
|
self.name = name
|
|
136
141
|
if org_id is not None:
|
|
@@ -381,6 +386,27 @@ class AgentsIdBody(object):
|
|
|
381
386
|
|
|
382
387
|
self._model = model
|
|
383
388
|
|
|
389
|
+
@property
|
|
390
|
+
def model_provider(self) -> 'str':
|
|
391
|
+
"""Gets the model_provider of this AgentsIdBody. # noqa: E501
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
:return: The model_provider of this AgentsIdBody. # noqa: E501
|
|
395
|
+
:rtype: str
|
|
396
|
+
"""
|
|
397
|
+
return self._model_provider
|
|
398
|
+
|
|
399
|
+
@model_provider.setter
|
|
400
|
+
def model_provider(self, model_provider: 'str'):
|
|
401
|
+
"""Sets the model_provider of this AgentsIdBody.
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
:param model_provider: The model_provider of this AgentsIdBody. # noqa: E501
|
|
405
|
+
:type: str
|
|
406
|
+
"""
|
|
407
|
+
|
|
408
|
+
self._model_provider = model_provider
|
|
409
|
+
|
|
384
410
|
@property
|
|
385
411
|
def name(self) -> 'str':
|
|
386
412
|
"""Gets the name of this AgentsIdBody. # noqa: E501
|
|
@@ -42,21 +42,26 @@ class CloudSpaceIdVersionpublicationsBody1(object):
|
|
|
42
42
|
"""
|
|
43
43
|
swagger_types = {
|
|
44
44
|
'cloud_space_version_id': 'str',
|
|
45
|
+
'featured': 'bool',
|
|
45
46
|
'org_id': 'str'
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
attribute_map = {
|
|
49
50
|
'cloud_space_version_id': 'cloudSpaceVersionId',
|
|
51
|
+
'featured': 'featured',
|
|
50
52
|
'org_id': 'orgId'
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
def __init__(self, cloud_space_version_id: 'str' =None, org_id: 'str' =None): # noqa: E501
|
|
55
|
+
def __init__(self, cloud_space_version_id: 'str' =None, featured: 'bool' =None, org_id: 'str' =None): # noqa: E501
|
|
54
56
|
"""CloudSpaceIdVersionpublicationsBody1 - a model defined in Swagger""" # noqa: E501
|
|
55
57
|
self._cloud_space_version_id = None
|
|
58
|
+
self._featured = None
|
|
56
59
|
self._org_id = None
|
|
57
60
|
self.discriminator = None
|
|
58
61
|
if cloud_space_version_id is not None:
|
|
59
62
|
self.cloud_space_version_id = cloud_space_version_id
|
|
63
|
+
if featured is not None:
|
|
64
|
+
self.featured = featured
|
|
60
65
|
if org_id is not None:
|
|
61
66
|
self.org_id = org_id
|
|
62
67
|
|
|
@@ -81,6 +86,27 @@ class CloudSpaceIdVersionpublicationsBody1(object):
|
|
|
81
86
|
|
|
82
87
|
self._cloud_space_version_id = cloud_space_version_id
|
|
83
88
|
|
|
89
|
+
@property
|
|
90
|
+
def featured(self) -> 'bool':
|
|
91
|
+
"""Gets the featured of this CloudSpaceIdVersionpublicationsBody1. # noqa: E501
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
:return: The featured of this CloudSpaceIdVersionpublicationsBody1. # noqa: E501
|
|
95
|
+
:rtype: bool
|
|
96
|
+
"""
|
|
97
|
+
return self._featured
|
|
98
|
+
|
|
99
|
+
@featured.setter
|
|
100
|
+
def featured(self, featured: 'bool'):
|
|
101
|
+
"""Sets the featured of this CloudSpaceIdVersionpublicationsBody1.
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
:param featured: The featured of this CloudSpaceIdVersionpublicationsBody1. # noqa: E501
|
|
105
|
+
:type: bool
|
|
106
|
+
"""
|
|
107
|
+
|
|
108
|
+
self._featured = featured
|
|
109
|
+
|
|
84
110
|
@property
|
|
85
111
|
def org_id(self) -> 'str':
|
|
86
112
|
"""Gets the org_id of this CloudSpaceIdVersionpublicationsBody1. # noqa: E501
|
|
@@ -42,6 +42,7 @@ class CreateDeploymentRequestDefinesASpecForTheJobThatAllowsForAutoscalingJobs(o
|
|
|
42
42
|
"""
|
|
43
43
|
swagger_types = {
|
|
44
44
|
'autoscaling': 'V1AutoscalingSpec',
|
|
45
|
+
'cloudspace_id': 'str',
|
|
45
46
|
'cluster_id': 'str',
|
|
46
47
|
'endpoint': 'V1Endpoint',
|
|
47
48
|
'name': 'str',
|
|
@@ -53,6 +54,7 @@ class CreateDeploymentRequestDefinesASpecForTheJobThatAllowsForAutoscalingJobs(o
|
|
|
53
54
|
|
|
54
55
|
attribute_map = {
|
|
55
56
|
'autoscaling': 'autoscaling',
|
|
57
|
+
'cloudspace_id': 'cloudspaceId',
|
|
56
58
|
'cluster_id': 'clusterId',
|
|
57
59
|
'endpoint': 'endpoint',
|
|
58
60
|
'name': 'name',
|
|
@@ -62,9 +64,10 @@ class CreateDeploymentRequestDefinesASpecForTheJobThatAllowsForAutoscalingJobs(o
|
|
|
62
64
|
'strategy': 'strategy'
|
|
63
65
|
}
|
|
64
66
|
|
|
65
|
-
def __init__(self, autoscaling: 'V1AutoscalingSpec' =None, cluster_id: 'str' =None, endpoint: 'V1Endpoint' =None, name: 'str' =None, parameter_spec: 'V1ParameterizationSpec' =None, replicas: 'int' =None, spec: 'V1JobSpec' =None, strategy: 'V1DeploymentStrategy' =None): # noqa: E501
|
|
67
|
+
def __init__(self, autoscaling: 'V1AutoscalingSpec' =None, cloudspace_id: 'str' =None, cluster_id: 'str' =None, endpoint: 'V1Endpoint' =None, name: 'str' =None, parameter_spec: 'V1ParameterizationSpec' =None, replicas: 'int' =None, spec: 'V1JobSpec' =None, strategy: 'V1DeploymentStrategy' =None): # noqa: E501
|
|
66
68
|
"""CreateDeploymentRequestDefinesASpecForTheJobThatAllowsForAutoscalingJobs - a model defined in Swagger""" # noqa: E501
|
|
67
69
|
self._autoscaling = None
|
|
70
|
+
self._cloudspace_id = None
|
|
68
71
|
self._cluster_id = None
|
|
69
72
|
self._endpoint = None
|
|
70
73
|
self._name = None
|
|
@@ -75,6 +78,8 @@ class CreateDeploymentRequestDefinesASpecForTheJobThatAllowsForAutoscalingJobs(o
|
|
|
75
78
|
self.discriminator = None
|
|
76
79
|
if autoscaling is not None:
|
|
77
80
|
self.autoscaling = autoscaling
|
|
81
|
+
if cloudspace_id is not None:
|
|
82
|
+
self.cloudspace_id = cloudspace_id
|
|
78
83
|
if cluster_id is not None:
|
|
79
84
|
self.cluster_id = cluster_id
|
|
80
85
|
if endpoint is not None:
|
|
@@ -111,6 +116,27 @@ class CreateDeploymentRequestDefinesASpecForTheJobThatAllowsForAutoscalingJobs(o
|
|
|
111
116
|
|
|
112
117
|
self._autoscaling = autoscaling
|
|
113
118
|
|
|
119
|
+
@property
|
|
120
|
+
def cloudspace_id(self) -> 'str':
|
|
121
|
+
"""Gets the cloudspace_id of this CreateDeploymentRequestDefinesASpecForTheJobThatAllowsForAutoscalingJobs. # noqa: E501
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
:return: The cloudspace_id of this CreateDeploymentRequestDefinesASpecForTheJobThatAllowsForAutoscalingJobs. # noqa: E501
|
|
125
|
+
:rtype: str
|
|
126
|
+
"""
|
|
127
|
+
return self._cloudspace_id
|
|
128
|
+
|
|
129
|
+
@cloudspace_id.setter
|
|
130
|
+
def cloudspace_id(self, cloudspace_id: 'str'):
|
|
131
|
+
"""Sets the cloudspace_id of this CreateDeploymentRequestDefinesASpecForTheJobThatAllowsForAutoscalingJobs.
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
:param cloudspace_id: The cloudspace_id of this CreateDeploymentRequestDefinesASpecForTheJobThatAllowsForAutoscalingJobs. # noqa: E501
|
|
135
|
+
:type: str
|
|
136
|
+
"""
|
|
137
|
+
|
|
138
|
+
self._cloudspace_id = cloudspace_id
|
|
139
|
+
|
|
114
140
|
@property
|
|
115
141
|
def cluster_id(self) -> 'str':
|
|
116
142
|
"""Gets the cluster_id of this CreateDeploymentRequestDefinesASpecForTheJobThatAllowsForAutoscalingJobs. # noqa: E501
|
|
@@ -42,6 +42,7 @@ class DeploymentsIdBody(object):
|
|
|
42
42
|
"""
|
|
43
43
|
swagger_types = {
|
|
44
44
|
'autoscaling': 'V1AutoscalingSpec',
|
|
45
|
+
'cloudspace_id': 'str',
|
|
45
46
|
'created_at': 'datetime',
|
|
46
47
|
'desired_state': 'V1DeploymentState',
|
|
47
48
|
'endpoint': 'V1Endpoint',
|
|
@@ -59,6 +60,7 @@ class DeploymentsIdBody(object):
|
|
|
59
60
|
|
|
60
61
|
attribute_map = {
|
|
61
62
|
'autoscaling': 'autoscaling',
|
|
63
|
+
'cloudspace_id': 'cloudspaceId',
|
|
62
64
|
'created_at': 'createdAt',
|
|
63
65
|
'desired_state': 'desiredState',
|
|
64
66
|
'endpoint': 'endpoint',
|
|
@@ -74,9 +76,10 @@ class DeploymentsIdBody(object):
|
|
|
74
76
|
'user_id': 'userId'
|
|
75
77
|
}
|
|
76
78
|
|
|
77
|
-
def __init__(self, autoscaling: 'V1AutoscalingSpec' =None, created_at: 'datetime' =None, desired_state: 'V1DeploymentState' =None, endpoint: 'V1Endpoint' =None, is_published: 'bool' =None, name: 'str' =None, parameter_spec: 'V1ParameterizationSpec' =None, release_id: 'str' =None, replicas: 'int' =None, spec: 'V1JobSpec' =None, status: 'V1DeploymentStatus' =None, strategy: 'V1DeploymentStrategy' =None, updated_at: 'datetime' =None, user_id: 'str' =None): # noqa: E501
|
|
79
|
+
def __init__(self, autoscaling: 'V1AutoscalingSpec' =None, cloudspace_id: 'str' =None, created_at: 'datetime' =None, desired_state: 'V1DeploymentState' =None, endpoint: 'V1Endpoint' =None, is_published: 'bool' =None, name: 'str' =None, parameter_spec: 'V1ParameterizationSpec' =None, release_id: 'str' =None, replicas: 'int' =None, spec: 'V1JobSpec' =None, status: 'V1DeploymentStatus' =None, strategy: 'V1DeploymentStrategy' =None, updated_at: 'datetime' =None, user_id: 'str' =None): # noqa: E501
|
|
78
80
|
"""DeploymentsIdBody - a model defined in Swagger""" # noqa: E501
|
|
79
81
|
self._autoscaling = None
|
|
82
|
+
self._cloudspace_id = None
|
|
80
83
|
self._created_at = None
|
|
81
84
|
self._desired_state = None
|
|
82
85
|
self._endpoint = None
|
|
@@ -93,6 +96,8 @@ class DeploymentsIdBody(object):
|
|
|
93
96
|
self.discriminator = None
|
|
94
97
|
if autoscaling is not None:
|
|
95
98
|
self.autoscaling = autoscaling
|
|
99
|
+
if cloudspace_id is not None:
|
|
100
|
+
self.cloudspace_id = cloudspace_id
|
|
96
101
|
if created_at is not None:
|
|
97
102
|
self.created_at = created_at
|
|
98
103
|
if desired_state is not None:
|
|
@@ -141,6 +146,27 @@ class DeploymentsIdBody(object):
|
|
|
141
146
|
|
|
142
147
|
self._autoscaling = autoscaling
|
|
143
148
|
|
|
149
|
+
@property
|
|
150
|
+
def cloudspace_id(self) -> 'str':
|
|
151
|
+
"""Gets the cloudspace_id of this DeploymentsIdBody. # noqa: E501
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
:return: The cloudspace_id of this DeploymentsIdBody. # noqa: E501
|
|
155
|
+
:rtype: str
|
|
156
|
+
"""
|
|
157
|
+
return self._cloudspace_id
|
|
158
|
+
|
|
159
|
+
@cloudspace_id.setter
|
|
160
|
+
def cloudspace_id(self, cloudspace_id: 'str'):
|
|
161
|
+
"""Sets the cloudspace_id of this DeploymentsIdBody.
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
:param cloudspace_id: The cloudspace_id of this DeploymentsIdBody. # noqa: E501
|
|
165
|
+
:type: str
|
|
166
|
+
"""
|
|
167
|
+
|
|
168
|
+
self._cloudspace_id = cloudspace_id
|
|
169
|
+
|
|
144
170
|
@property
|
|
145
171
|
def created_at(self) -> 'datetime':
|
|
146
172
|
"""Gets the created_at of this DeploymentsIdBody. # noqa: E501
|