lightning-sdk 2025.10.23__py3-none-any.whl → 2025.10.31__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/api/deployment_api.py +16 -0
- lightning_sdk/api/mmt_api.py +4 -1
- lightning_sdk/api/teamspace_api.py +1 -1
- lightning_sdk/cli/legacy/deploy/_auth.py +1 -2
- lightning_sdk/cli/utils/teamspace_selection.py +4 -5
- lightning_sdk/deployment/deployment.py +2 -1
- lightning_sdk/lightning_cloud/openapi/__init__.py +8 -0
- lightning_sdk/lightning_cloud/openapi/api/__init__.py +1 -0
- lightning_sdk/lightning_cloud/openapi/api/assistants_service_api.py +234 -0
- lightning_sdk/lightning_cloud/openapi/api/markets_service_api.py +145 -0
- lightning_sdk/lightning_cloud/openapi/models/__init__.py +7 -0
- lightning_sdk/lightning_cloud/openapi/models/message_id_actions_body.py +201 -0
- lightning_sdk/lightning_cloud/openapi/models/project_id_storagetransfers_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/projects_id_body.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space_environment_template_config.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_cloud_space_specialized_view.py +1 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_accelerator.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_cluster_capacity_reservation.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_create_project_request.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_get_market_pricing_response.py +201 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_incident_type.py +1 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_kubernetes_aws_config.py +279 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_kubernetes_direct_settings_v1.py +253 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_kubernetes_direct_v1.py +53 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_list_conversation_message_actions_response.py +123 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_market_price.py +149 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_membership.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_message_action.py +279 -0
- lightning_sdk/lightning_cloud/openapi/models/v1_project_membership.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_project_settings.py +27 -1
- lightning_sdk/lightning_cloud/openapi/models/v1_user_features.py +79 -183
- lightning_sdk/mmt/base.py +7 -0
- lightning_sdk/mmt/mmt.py +8 -0
- lightning_sdk/mmt/v1.py +3 -1
- lightning_sdk/mmt/v2.py +4 -0
- lightning_sdk/pipeline/steps.py +6 -1
- lightning_sdk/plugin.py +4 -0
- lightning_sdk/studio.py +7 -2
- lightning_sdk/utils/logging.py +72 -0
- {lightning_sdk-2025.10.23.dist-info → lightning_sdk-2025.10.31.dist-info}/METADATA +1 -1
- {lightning_sdk-2025.10.23.dist-info → lightning_sdk-2025.10.31.dist-info}/RECORD +46 -37
- {lightning_sdk-2025.10.23.dist-info → lightning_sdk-2025.10.31.dist-info}/LICENSE +0 -0
- {lightning_sdk-2025.10.23.dist-info → lightning_sdk-2025.10.31.dist-info}/WHEEL +0 -0
- {lightning_sdk-2025.10.23.dist-info → lightning_sdk-2025.10.31.dist-info}/entry_points.txt +0 -0
- {lightning_sdk-2025.10.23.dist-info → lightning_sdk-2025.10.31.dist-info}/top_level.txt +0 -0
lightning_sdk/__init__.py
CHANGED
|
@@ -58,6 +58,10 @@ class TokenAuth(Auth):
|
|
|
58
58
|
self.token = token
|
|
59
59
|
|
|
60
60
|
|
|
61
|
+
class ApiKeyAuth(Auth):
|
|
62
|
+
"""The ApiKeyAuth describes that the user requires a Lightning API Key to authenticate."""
|
|
63
|
+
|
|
64
|
+
|
|
61
65
|
class ReleaseStrategy:
|
|
62
66
|
"""The base class for release strategy."""
|
|
63
67
|
|
|
@@ -300,6 +304,10 @@ class DeploymentApi:
|
|
|
300
304
|
if deployment.strategy is None:
|
|
301
305
|
raise RuntimeError("When doing a new release, a release strategy needs to be defined.")
|
|
302
306
|
|
|
307
|
+
# Force the deployment to make a new snapshot
|
|
308
|
+
if deployment.spec.cloudspace_id != "" and deployment.spec.run_id != "":
|
|
309
|
+
deployment.spec.run_id = ""
|
|
310
|
+
|
|
303
311
|
print("Some core arguments have changed. We are making a new release.")
|
|
304
312
|
|
|
305
313
|
apply_change(deployment.endpoint, "custom_domain", custom_domain)
|
|
@@ -371,11 +379,15 @@ def restore_auth(auth: Optional[V1EndpointAuth] = None) -> Optional[Auth]:
|
|
|
371
379
|
if not auth:
|
|
372
380
|
return None
|
|
373
381
|
|
|
382
|
+
if auth.user_api_key:
|
|
383
|
+
return ApiKeyAuth()
|
|
384
|
+
|
|
374
385
|
if auth.username and auth.password:
|
|
375
386
|
return BasicAuth(username=auth.username, password=auth.password)
|
|
376
387
|
|
|
377
388
|
if auth.token:
|
|
378
389
|
return TokenAuth(token=auth.token)
|
|
390
|
+
|
|
379
391
|
return None
|
|
380
392
|
|
|
381
393
|
|
|
@@ -512,6 +524,10 @@ def to_endpoint_auth(auth: Optional[Auth] = None) -> Optional[V1EndpointAuth]:
|
|
|
512
524
|
raise ValueError("The token should be defined.")
|
|
513
525
|
|
|
514
526
|
return V1EndpointAuth(enabled=True, token=auth.token)
|
|
527
|
+
|
|
528
|
+
if isinstance(auth, ApiKeyAuth):
|
|
529
|
+
return V1EndpointAuth(enabled=True, user_api_key=True)
|
|
530
|
+
|
|
515
531
|
return None
|
|
516
532
|
|
|
517
533
|
|
lightning_sdk/api/mmt_api.py
CHANGED
|
@@ -88,6 +88,7 @@ class MMTApiV2:
|
|
|
88
88
|
artifacts_local: Optional[str], # deprecated in favor of path_mappings
|
|
89
89
|
artifacts_remote: Optional[str], # deprecated in favor of path_mappings
|
|
90
90
|
max_runtime: Optional[int],
|
|
91
|
+
reuse_snapshot: bool,
|
|
91
92
|
) -> V1MultiMachineJob:
|
|
92
93
|
body = self._create_mmt_body(
|
|
93
94
|
name=name,
|
|
@@ -106,6 +107,7 @@ class MMTApiV2:
|
|
|
106
107
|
artifacts_local=artifacts_local, # deprecated in favor of path_mappings
|
|
107
108
|
artifacts_remote=artifacts_remote, # deprecated in favor of path_mappings
|
|
108
109
|
max_runtime=max_runtime,
|
|
110
|
+
reuse_snapshot=reuse_snapshot,
|
|
109
111
|
)
|
|
110
112
|
|
|
111
113
|
job: V1MultiMachineJob = self._client.jobs_service_create_multi_machine_job(project_id=teamspace_id, body=body)
|
|
@@ -128,6 +130,7 @@ class MMTApiV2:
|
|
|
128
130
|
path_mappings: Optional[Dict[str, str]],
|
|
129
131
|
artifacts_local: Optional[str], # deprecated in favor of path_mappings
|
|
130
132
|
artifacts_remote: Optional[str], # deprecated in favor of path_mappings
|
|
133
|
+
reuse_snapshot: bool,
|
|
131
134
|
max_runtime: Optional[int] = None,
|
|
132
135
|
machine_image_version: Optional[str] = None,
|
|
133
136
|
) -> ProjectIdMultimachinejobsBody:
|
|
@@ -138,7 +141,7 @@ class MMTApiV2:
|
|
|
138
141
|
|
|
139
142
|
instance_name = _machine_to_compute_name(machine)
|
|
140
143
|
|
|
141
|
-
run_id = __GLOBAL_LIGHTNING_UNIQUE_IDS_STORE__[studio_id] if studio_id is not None else ""
|
|
144
|
+
run_id = __GLOBAL_LIGHTNING_UNIQUE_IDS_STORE__[studio_id] if (studio_id is not None and reuse_snapshot) else ""
|
|
142
145
|
|
|
143
146
|
path_mappings_list = resolve_path_mappings(
|
|
144
147
|
mappings=path_mappings or {},
|
|
@@ -73,7 +73,7 @@ class TeamspaceApi:
|
|
|
73
73
|
def _get_teamspace_by_id(self, teamspace_id: str) -> V1Project:
|
|
74
74
|
return self._client.projects_service_get_project(teamspace_id)
|
|
75
75
|
|
|
76
|
-
def list_teamspaces(self, owner_id: str, name: Optional[str] = None) -> Optional[V1Project]:
|
|
76
|
+
def list_teamspaces(self, owner_id: str, name: Optional[str] = None) -> Optional[List[V1Project]]:
|
|
77
77
|
"""Lists teamspaces from owner.
|
|
78
78
|
|
|
79
79
|
If name is passed only teamspaces matching that name will be returned
|
|
@@ -73,9 +73,8 @@ def authenticate(mode: _AuthMode, shall_confirm: bool = True) -> None:
|
|
|
73
73
|
|
|
74
74
|
def select_teamspace(teamspace: Optional[str], org: Optional[str], user: Optional[str]) -> Teamspace:
|
|
75
75
|
if teamspace is None:
|
|
76
|
-
user = _get_authed_user()
|
|
77
76
|
menu = TeamspacesMenu()
|
|
78
|
-
possible_teamspaces = menu._get_possible_teamspaces(
|
|
77
|
+
possible_teamspaces = menu._get_possible_teamspaces(_get_authed_user())
|
|
79
78
|
if len(possible_teamspaces) == 1:
|
|
80
79
|
name = next(iter(possible_teamspaces.values()))["name"]
|
|
81
80
|
return Teamspace(name=name, org=org, user=user)
|
|
@@ -50,12 +50,11 @@ class TeamspacesMenu:
|
|
|
50
50
|
|
|
51
51
|
return TerminalMenu(possible_teamspaces, title=title, clear_menu_on_exit=True)
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
def _get_possible_teamspaces(user: User, owner: Owner) -> Dict[str, str]:
|
|
53
|
+
def _get_possible_teamspaces(self, user: User) -> Dict[str, str]:
|
|
55
54
|
user_api = user._user_api
|
|
56
55
|
|
|
57
56
|
memberships = user_api._get_all_teamspace_memberships(
|
|
58
|
-
user_id=user.id, org_id=
|
|
57
|
+
user_id=user.id, org_id=self._owner.id if isinstance(self._owner, Organization) else None
|
|
59
58
|
)
|
|
60
59
|
|
|
61
60
|
teamspaces = {}
|
|
@@ -64,7 +63,7 @@ class TeamspacesMenu:
|
|
|
64
63
|
teamspace_id = membership.project_id
|
|
65
64
|
teamspace_name = membership.name
|
|
66
65
|
|
|
67
|
-
if membership.owner_id ==
|
|
66
|
+
if membership.owner_id == self._owner.id:
|
|
68
67
|
teamspaces[teamspace_id] = teamspace_name
|
|
69
68
|
|
|
70
69
|
return teamspaces
|
|
@@ -106,7 +105,7 @@ class TeamspacesMenu:
|
|
|
106
105
|
try:
|
|
107
106
|
auth_user = _get_authed_user()
|
|
108
107
|
|
|
109
|
-
possible_teamspaces = self._get_possible_teamspaces(auth_user
|
|
108
|
+
possible_teamspaces = self._get_possible_teamspaces(auth_user)
|
|
110
109
|
if teamspace is None:
|
|
111
110
|
teamspace_name = self._get_teamspace_from_interactive_menu(possible_teamspaces=possible_teamspaces)
|
|
112
111
|
else:
|
|
@@ -6,6 +6,7 @@ import requests
|
|
|
6
6
|
|
|
7
7
|
from lightning_sdk.api import UserApi
|
|
8
8
|
from lightning_sdk.api.deployment_api import (
|
|
9
|
+
ApiKeyAuth,
|
|
9
10
|
Auth,
|
|
10
11
|
AutoScaleConfig,
|
|
11
12
|
BasicAuth,
|
|
@@ -121,7 +122,7 @@ class Deployment:
|
|
|
121
122
|
spot: Optional[bool] = None,
|
|
122
123
|
replicas: Optional[int] = None,
|
|
123
124
|
health_check: Optional[Union[HttpHealthCheck, ExecHealthCheck]] = None,
|
|
124
|
-
auth: Optional[Union[BasicAuth, TokenAuth]] = None,
|
|
125
|
+
auth: Optional[Union[BasicAuth, TokenAuth, ApiKeyAuth]] = None,
|
|
125
126
|
cloud_account: Optional[str] = None,
|
|
126
127
|
custom_domain: Optional[str] = None,
|
|
127
128
|
cluster: Optional[str] = None, # deprecated in favor of cloud_account
|
|
@@ -48,6 +48,7 @@ from lightning_sdk.lightning_cloud.openapi.api.lit_dataset_service_api import Li
|
|
|
48
48
|
from lightning_sdk.lightning_cloud.openapi.api.lit_logger_service_api import LitLoggerServiceApi
|
|
49
49
|
from lightning_sdk.lightning_cloud.openapi.api.lit_page_service_api import LitPageServiceApi
|
|
50
50
|
from lightning_sdk.lightning_cloud.openapi.api.lit_registry_service_api import LitRegistryServiceApi
|
|
51
|
+
from lightning_sdk.lightning_cloud.openapi.api.markets_service_api import MarketsServiceApi
|
|
51
52
|
from lightning_sdk.lightning_cloud.openapi.api.models_store_api import ModelsStoreApi
|
|
52
53
|
from lightning_sdk.lightning_cloud.openapi.api.organizations_service_api import OrganizationsServiceApi
|
|
53
54
|
from lightning_sdk.lightning_cloud.openapi.api.pipeline_templates_service_api import PipelineTemplatesServiceApi
|
|
@@ -172,6 +173,7 @@ from lightning_sdk.lightning_cloud.openapi.models.litloggermetrics_id_body impor
|
|
|
172
173
|
from lightning_sdk.lightning_cloud.openapi.models.litpages_id_body import LitpagesIdBody
|
|
173
174
|
from lightning_sdk.lightning_cloud.openapi.models.litregistry_lit_repo_name_body import LitregistryLitRepoNameBody
|
|
174
175
|
from lightning_sdk.lightning_cloud.openapi.models.loggermetrics_id_body import LoggermetricsIdBody
|
|
176
|
+
from lightning_sdk.lightning_cloud.openapi.models.message_id_actions_body import MessageIdActionsBody
|
|
175
177
|
from lightning_sdk.lightning_cloud.openapi.models.messages_id_body import MessagesIdBody
|
|
176
178
|
from lightning_sdk.lightning_cloud.openapi.models.messages_message_id_body import MessagesMessageIdBody
|
|
177
179
|
from lightning_sdk.lightning_cloud.openapi.models.metrics_stream_id_loggerartifacts_body import MetricsStreamIdLoggerartifactsBody
|
|
@@ -600,6 +602,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_get_lit_page_response impor
|
|
|
600
602
|
from lightning_sdk.lightning_cloud.openapi.models.v1_get_logger_metrics_response import V1GetLoggerMetricsResponse
|
|
601
603
|
from lightning_sdk.lightning_cloud.openapi.models.v1_get_long_running_command_in_cloud_space_response import V1GetLongRunningCommandInCloudSpaceResponse
|
|
602
604
|
from lightning_sdk.lightning_cloud.openapi.models.v1_get_machine_response import V1GetMachineResponse
|
|
605
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_get_market_pricing_response import V1GetMarketPricingResponse
|
|
603
606
|
from lightning_sdk.lightning_cloud.openapi.models.v1_get_model_file_upload_urls_response import V1GetModelFileUploadUrlsResponse
|
|
604
607
|
from lightning_sdk.lightning_cloud.openapi.models.v1_get_model_file_url_response import V1GetModelFileUrlResponse
|
|
605
608
|
from lightning_sdk.lightning_cloud.openapi.models.v1_get_model_files_response import V1GetModelFilesResponse
|
|
@@ -662,6 +665,8 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_k8s_incident_indexes import
|
|
|
662
665
|
from lightning_sdk.lightning_cloud.openapi.models.v1_kai_scheduler_queue_metrics import V1KaiSchedulerQueueMetrics
|
|
663
666
|
from lightning_sdk.lightning_cloud.openapi.models.v1_keep_alive_cloud_space_instance_response import V1KeepAliveCloudSpaceInstanceResponse
|
|
664
667
|
from lightning_sdk.lightning_cloud.openapi.models.v1_knowledge_configuration import V1KnowledgeConfiguration
|
|
668
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_kubernetes_aws_config import V1KubernetesAWSConfig
|
|
669
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_kubernetes_direct_settings_v1 import V1KubernetesDirectSettingsV1
|
|
665
670
|
from lightning_sdk.lightning_cloud.openapi.models.v1_kubernetes_direct_v1 import V1KubernetesDirectV1
|
|
666
671
|
from lightning_sdk.lightning_cloud.openapi.models.v1_kubernetes_direct_v1_status import V1KubernetesDirectV1Status
|
|
667
672
|
from lightning_sdk.lightning_cloud.openapi.models.v1_kubernetes_template import V1KubernetesTemplate
|
|
@@ -717,6 +722,7 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_list_cluster_proxies_respon
|
|
|
717
722
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_cluster_usage_restrictions_response import V1ListClusterUsageRestrictionsResponse
|
|
718
723
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_clusters_response import V1ListClustersResponse
|
|
719
724
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_container_metrics_response import V1ListContainerMetricsResponse
|
|
725
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_list_conversation_message_actions_response import V1ListConversationMessageActionsResponse
|
|
720
726
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_conversations_response import V1ListConversationsResponse
|
|
721
727
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_data_connection_artifacts_response import V1ListDataConnectionArtifactsResponse
|
|
722
728
|
from lightning_sdk.lightning_cloud.openapi.models.v1_list_data_connections_response import V1ListDataConnectionsResponse
|
|
@@ -831,8 +837,10 @@ from lightning_sdk.lightning_cloud.openapi.models.v1_magic_link_login_response i
|
|
|
831
837
|
from lightning_sdk.lightning_cloud.openapi.models.v1_managed_endpoint import V1ManagedEndpoint
|
|
832
838
|
from lightning_sdk.lightning_cloud.openapi.models.v1_managed_model import V1ManagedModel
|
|
833
839
|
from lightning_sdk.lightning_cloud.openapi.models.v1_managed_model_abilities import V1ManagedModelAbilities
|
|
840
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_market_price import V1MarketPrice
|
|
834
841
|
from lightning_sdk.lightning_cloud.openapi.models.v1_membership import V1Membership
|
|
835
842
|
from lightning_sdk.lightning_cloud.openapi.models.v1_message import V1Message
|
|
843
|
+
from lightning_sdk.lightning_cloud.openapi.models.v1_message_action import V1MessageAction
|
|
836
844
|
from lightning_sdk.lightning_cloud.openapi.models.v1_message_author import V1MessageAuthor
|
|
837
845
|
from lightning_sdk.lightning_cloud.openapi.models.v1_message_content import V1MessageContent
|
|
838
846
|
from lightning_sdk.lightning_cloud.openapi.models.v1_message_content_type import V1MessageContentType
|
|
@@ -29,6 +29,7 @@ from lightning_sdk.lightning_cloud.openapi.api.lit_dataset_service_api import Li
|
|
|
29
29
|
from lightning_sdk.lightning_cloud.openapi.api.lit_logger_service_api import LitLoggerServiceApi
|
|
30
30
|
from lightning_sdk.lightning_cloud.openapi.api.lit_page_service_api import LitPageServiceApi
|
|
31
31
|
from lightning_sdk.lightning_cloud.openapi.api.lit_registry_service_api import LitRegistryServiceApi
|
|
32
|
+
from lightning_sdk.lightning_cloud.openapi.api.markets_service_api import MarketsServiceApi
|
|
32
33
|
from lightning_sdk.lightning_cloud.openapi.api.models_store_api import ModelsStoreApi
|
|
33
34
|
from lightning_sdk.lightning_cloud.openapi.api.organizations_service_api import OrganizationsServiceApi
|
|
34
35
|
from lightning_sdk.lightning_cloud.openapi.api.pipeline_templates_service_api import PipelineTemplatesServiceApi
|
|
@@ -358,6 +358,127 @@ class AssistantsServiceApi(object):
|
|
|
358
358
|
_request_timeout=params.get('_request_timeout'),
|
|
359
359
|
collection_formats=collection_formats)
|
|
360
360
|
|
|
361
|
+
def assistants_service_create_conversation_message_action(self, body: 'MessageIdActionsBody', assistant_id: 'str', conversation_id: 'str', message_id: 'str', **kwargs) -> 'V1MessageAction': # noqa: E501
|
|
362
|
+
"""assistants_service_create_conversation_message_action # noqa: E501
|
|
363
|
+
|
|
364
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
365
|
+
asynchronous HTTP request, please pass async_req=True
|
|
366
|
+
>>> thread = api.assistants_service_create_conversation_message_action(body, assistant_id, conversation_id, message_id, async_req=True)
|
|
367
|
+
>>> result = thread.get()
|
|
368
|
+
|
|
369
|
+
:param async_req bool
|
|
370
|
+
:param MessageIdActionsBody body: (required)
|
|
371
|
+
:param str assistant_id: (required)
|
|
372
|
+
:param str conversation_id: (required)
|
|
373
|
+
:param str message_id: (required)
|
|
374
|
+
:return: V1MessageAction
|
|
375
|
+
If the method is called asynchronously,
|
|
376
|
+
returns the request thread.
|
|
377
|
+
"""
|
|
378
|
+
kwargs['_return_http_data_only'] = True
|
|
379
|
+
if kwargs.get('async_req'):
|
|
380
|
+
return self.assistants_service_create_conversation_message_action_with_http_info(body, assistant_id, conversation_id, message_id, **kwargs) # noqa: E501
|
|
381
|
+
else:
|
|
382
|
+
(data) = self.assistants_service_create_conversation_message_action_with_http_info(body, assistant_id, conversation_id, message_id, **kwargs) # noqa: E501
|
|
383
|
+
return data
|
|
384
|
+
|
|
385
|
+
def assistants_service_create_conversation_message_action_with_http_info(self, body: 'MessageIdActionsBody', assistant_id: 'str', conversation_id: 'str', message_id: 'str', **kwargs) -> 'V1MessageAction': # noqa: E501
|
|
386
|
+
"""assistants_service_create_conversation_message_action # noqa: E501
|
|
387
|
+
|
|
388
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
389
|
+
asynchronous HTTP request, please pass async_req=True
|
|
390
|
+
>>> thread = api.assistants_service_create_conversation_message_action_with_http_info(body, assistant_id, conversation_id, message_id, async_req=True)
|
|
391
|
+
>>> result = thread.get()
|
|
392
|
+
|
|
393
|
+
:param async_req bool
|
|
394
|
+
:param MessageIdActionsBody body: (required)
|
|
395
|
+
:param str assistant_id: (required)
|
|
396
|
+
:param str conversation_id: (required)
|
|
397
|
+
:param str message_id: (required)
|
|
398
|
+
:return: V1MessageAction
|
|
399
|
+
If the method is called asynchronously,
|
|
400
|
+
returns the request thread.
|
|
401
|
+
"""
|
|
402
|
+
|
|
403
|
+
all_params = ['body', 'assistant_id', 'conversation_id', 'message_id'] # noqa: E501
|
|
404
|
+
all_params.append('async_req')
|
|
405
|
+
all_params.append('_return_http_data_only')
|
|
406
|
+
all_params.append('_preload_content')
|
|
407
|
+
all_params.append('_request_timeout')
|
|
408
|
+
|
|
409
|
+
params = locals()
|
|
410
|
+
for key, val in six.iteritems(params['kwargs']):
|
|
411
|
+
if key not in all_params:
|
|
412
|
+
raise TypeError(
|
|
413
|
+
"Got an unexpected keyword argument '%s'"
|
|
414
|
+
" to method assistants_service_create_conversation_message_action" % key
|
|
415
|
+
)
|
|
416
|
+
params[key] = val
|
|
417
|
+
del params['kwargs']
|
|
418
|
+
# verify the required parameter 'body' is set
|
|
419
|
+
if ('body' not in params or
|
|
420
|
+
params['body'] is None):
|
|
421
|
+
raise ValueError("Missing the required parameter `body` when calling `assistants_service_create_conversation_message_action`") # noqa: E501
|
|
422
|
+
# verify the required parameter 'assistant_id' is set
|
|
423
|
+
if ('assistant_id' not in params or
|
|
424
|
+
params['assistant_id'] is None):
|
|
425
|
+
raise ValueError("Missing the required parameter `assistant_id` when calling `assistants_service_create_conversation_message_action`") # noqa: E501
|
|
426
|
+
# verify the required parameter 'conversation_id' is set
|
|
427
|
+
if ('conversation_id' not in params or
|
|
428
|
+
params['conversation_id'] is None):
|
|
429
|
+
raise ValueError("Missing the required parameter `conversation_id` when calling `assistants_service_create_conversation_message_action`") # noqa: E501
|
|
430
|
+
# verify the required parameter 'message_id' is set
|
|
431
|
+
if ('message_id' not in params or
|
|
432
|
+
params['message_id'] is None):
|
|
433
|
+
raise ValueError("Missing the required parameter `message_id` when calling `assistants_service_create_conversation_message_action`") # noqa: E501
|
|
434
|
+
|
|
435
|
+
collection_formats = {}
|
|
436
|
+
|
|
437
|
+
path_params = {}
|
|
438
|
+
if 'assistant_id' in params:
|
|
439
|
+
path_params['assistantId'] = params['assistant_id'] # noqa: E501
|
|
440
|
+
if 'conversation_id' in params:
|
|
441
|
+
path_params['conversationId'] = params['conversation_id'] # noqa: E501
|
|
442
|
+
if 'message_id' in params:
|
|
443
|
+
path_params['messageId'] = params['message_id'] # noqa: E501
|
|
444
|
+
|
|
445
|
+
query_params = []
|
|
446
|
+
|
|
447
|
+
header_params = {}
|
|
448
|
+
|
|
449
|
+
form_params = []
|
|
450
|
+
local_var_files = {}
|
|
451
|
+
|
|
452
|
+
body_params = None
|
|
453
|
+
if 'body' in params:
|
|
454
|
+
body_params = params['body']
|
|
455
|
+
# HTTP header `Accept`
|
|
456
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
457
|
+
['application/json']) # noqa: E501
|
|
458
|
+
|
|
459
|
+
# HTTP header `Content-Type`
|
|
460
|
+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
|
461
|
+
['application/json']) # noqa: E501
|
|
462
|
+
|
|
463
|
+
# Authentication setting
|
|
464
|
+
auth_settings = [] # noqa: E501
|
|
465
|
+
|
|
466
|
+
return self.api_client.call_api(
|
|
467
|
+
'/v1/agents/{assistantId}/conversations/{conversationId}/messages/{messageId}/actions', 'POST',
|
|
468
|
+
path_params,
|
|
469
|
+
query_params,
|
|
470
|
+
header_params,
|
|
471
|
+
body=body_params,
|
|
472
|
+
post_params=form_params,
|
|
473
|
+
files=local_var_files,
|
|
474
|
+
response_type='V1MessageAction', # noqa: E501
|
|
475
|
+
auth_settings=auth_settings,
|
|
476
|
+
async_req=params.get('async_req'),
|
|
477
|
+
_return_http_data_only=params.get('_return_http_data_only'),
|
|
478
|
+
_preload_content=params.get('_preload_content', True),
|
|
479
|
+
_request_timeout=params.get('_request_timeout'),
|
|
480
|
+
collection_formats=collection_formats)
|
|
481
|
+
|
|
361
482
|
def assistants_service_create_model_metrics(self, body: 'ModelsModelIdBody', model_id: 'str', **kwargs) -> 'V1CreateModelMetricsResponse': # noqa: E501
|
|
362
483
|
"""assistants_service_create_model_metrics # noqa: E501
|
|
363
484
|
|
|
@@ -1873,6 +1994,119 @@ class AssistantsServiceApi(object):
|
|
|
1873
1994
|
_request_timeout=params.get('_request_timeout'),
|
|
1874
1995
|
collection_formats=collection_formats)
|
|
1875
1996
|
|
|
1997
|
+
def assistants_service_list_conversation_message_actions(self, assistant_id: 'str', conversation_id: 'str', message_id: 'str', **kwargs) -> 'V1ListConversationMessageActionsResponse': # noqa: E501
|
|
1998
|
+
"""assistants_service_list_conversation_message_actions # noqa: E501
|
|
1999
|
+
|
|
2000
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
2001
|
+
asynchronous HTTP request, please pass async_req=True
|
|
2002
|
+
>>> thread = api.assistants_service_list_conversation_message_actions(assistant_id, conversation_id, message_id, async_req=True)
|
|
2003
|
+
>>> result = thread.get()
|
|
2004
|
+
|
|
2005
|
+
:param async_req bool
|
|
2006
|
+
:param str assistant_id: (required)
|
|
2007
|
+
:param str conversation_id: (required)
|
|
2008
|
+
:param str message_id: (required)
|
|
2009
|
+
:param str project_id:
|
|
2010
|
+
:return: V1ListConversationMessageActionsResponse
|
|
2011
|
+
If the method is called asynchronously,
|
|
2012
|
+
returns the request thread.
|
|
2013
|
+
"""
|
|
2014
|
+
kwargs['_return_http_data_only'] = True
|
|
2015
|
+
if kwargs.get('async_req'):
|
|
2016
|
+
return self.assistants_service_list_conversation_message_actions_with_http_info(assistant_id, conversation_id, message_id, **kwargs) # noqa: E501
|
|
2017
|
+
else:
|
|
2018
|
+
(data) = self.assistants_service_list_conversation_message_actions_with_http_info(assistant_id, conversation_id, message_id, **kwargs) # noqa: E501
|
|
2019
|
+
return data
|
|
2020
|
+
|
|
2021
|
+
def assistants_service_list_conversation_message_actions_with_http_info(self, assistant_id: 'str', conversation_id: 'str', message_id: 'str', **kwargs) -> 'V1ListConversationMessageActionsResponse': # noqa: E501
|
|
2022
|
+
"""assistants_service_list_conversation_message_actions # noqa: E501
|
|
2023
|
+
|
|
2024
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
2025
|
+
asynchronous HTTP request, please pass async_req=True
|
|
2026
|
+
>>> thread = api.assistants_service_list_conversation_message_actions_with_http_info(assistant_id, conversation_id, message_id, async_req=True)
|
|
2027
|
+
>>> result = thread.get()
|
|
2028
|
+
|
|
2029
|
+
:param async_req bool
|
|
2030
|
+
:param str assistant_id: (required)
|
|
2031
|
+
:param str conversation_id: (required)
|
|
2032
|
+
:param str message_id: (required)
|
|
2033
|
+
:param str project_id:
|
|
2034
|
+
:return: V1ListConversationMessageActionsResponse
|
|
2035
|
+
If the method is called asynchronously,
|
|
2036
|
+
returns the request thread.
|
|
2037
|
+
"""
|
|
2038
|
+
|
|
2039
|
+
all_params = ['assistant_id', 'conversation_id', 'message_id', 'project_id'] # noqa: E501
|
|
2040
|
+
all_params.append('async_req')
|
|
2041
|
+
all_params.append('_return_http_data_only')
|
|
2042
|
+
all_params.append('_preload_content')
|
|
2043
|
+
all_params.append('_request_timeout')
|
|
2044
|
+
|
|
2045
|
+
params = locals()
|
|
2046
|
+
for key, val in six.iteritems(params['kwargs']):
|
|
2047
|
+
if key not in all_params:
|
|
2048
|
+
raise TypeError(
|
|
2049
|
+
"Got an unexpected keyword argument '%s'"
|
|
2050
|
+
" to method assistants_service_list_conversation_message_actions" % key
|
|
2051
|
+
)
|
|
2052
|
+
params[key] = val
|
|
2053
|
+
del params['kwargs']
|
|
2054
|
+
# verify the required parameter 'assistant_id' is set
|
|
2055
|
+
if ('assistant_id' not in params or
|
|
2056
|
+
params['assistant_id'] is None):
|
|
2057
|
+
raise ValueError("Missing the required parameter `assistant_id` when calling `assistants_service_list_conversation_message_actions`") # noqa: E501
|
|
2058
|
+
# verify the required parameter 'conversation_id' is set
|
|
2059
|
+
if ('conversation_id' not in params or
|
|
2060
|
+
params['conversation_id'] is None):
|
|
2061
|
+
raise ValueError("Missing the required parameter `conversation_id` when calling `assistants_service_list_conversation_message_actions`") # noqa: E501
|
|
2062
|
+
# verify the required parameter 'message_id' is set
|
|
2063
|
+
if ('message_id' not in params or
|
|
2064
|
+
params['message_id'] is None):
|
|
2065
|
+
raise ValueError("Missing the required parameter `message_id` when calling `assistants_service_list_conversation_message_actions`") # noqa: E501
|
|
2066
|
+
|
|
2067
|
+
collection_formats = {}
|
|
2068
|
+
|
|
2069
|
+
path_params = {}
|
|
2070
|
+
if 'assistant_id' in params:
|
|
2071
|
+
path_params['assistantId'] = params['assistant_id'] # noqa: E501
|
|
2072
|
+
if 'conversation_id' in params:
|
|
2073
|
+
path_params['conversationId'] = params['conversation_id'] # noqa: E501
|
|
2074
|
+
if 'message_id' in params:
|
|
2075
|
+
path_params['messageId'] = params['message_id'] # noqa: E501
|
|
2076
|
+
|
|
2077
|
+
query_params = []
|
|
2078
|
+
if 'project_id' in params:
|
|
2079
|
+
query_params.append(('projectId', params['project_id'])) # noqa: E501
|
|
2080
|
+
|
|
2081
|
+
header_params = {}
|
|
2082
|
+
|
|
2083
|
+
form_params = []
|
|
2084
|
+
local_var_files = {}
|
|
2085
|
+
|
|
2086
|
+
body_params = None
|
|
2087
|
+
# HTTP header `Accept`
|
|
2088
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
2089
|
+
['application/json']) # noqa: E501
|
|
2090
|
+
|
|
2091
|
+
# Authentication setting
|
|
2092
|
+
auth_settings = [] # noqa: E501
|
|
2093
|
+
|
|
2094
|
+
return self.api_client.call_api(
|
|
2095
|
+
'/v1/agents/{assistantId}/conversations/{conversationId}/messages/{messageId}/actions', 'GET',
|
|
2096
|
+
path_params,
|
|
2097
|
+
query_params,
|
|
2098
|
+
header_params,
|
|
2099
|
+
body=body_params,
|
|
2100
|
+
post_params=form_params,
|
|
2101
|
+
files=local_var_files,
|
|
2102
|
+
response_type='V1ListConversationMessageActionsResponse', # noqa: E501
|
|
2103
|
+
auth_settings=auth_settings,
|
|
2104
|
+
async_req=params.get('async_req'),
|
|
2105
|
+
_return_http_data_only=params.get('_return_http_data_only'),
|
|
2106
|
+
_preload_content=params.get('_preload_content', True),
|
|
2107
|
+
_request_timeout=params.get('_request_timeout'),
|
|
2108
|
+
collection_formats=collection_formats)
|
|
2109
|
+
|
|
1876
2110
|
def assistants_service_list_conversations(self, assistant_id: 'str', **kwargs) -> 'V1ListConversationsResponse': # noqa: E501
|
|
1877
2111
|
"""Conversations # noqa: E501
|
|
1878
2112
|
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
external/v1/auth_service.proto
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
|
|
7
|
+
|
|
8
|
+
OpenAPI spec version: version not set
|
|
9
|
+
|
|
10
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
11
|
+
|
|
12
|
+
NOTE
|
|
13
|
+
----
|
|
14
|
+
standard swagger-codegen-cli for this python client has been modified
|
|
15
|
+
by custom templates. The purpose of these templates is to include
|
|
16
|
+
typing information in the API and Model code. Please refer to the
|
|
17
|
+
main grid repository for more info
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
from __future__ import absolute_import
|
|
21
|
+
|
|
22
|
+
import re # noqa: F401
|
|
23
|
+
from typing import TYPE_CHECKING, Any
|
|
24
|
+
|
|
25
|
+
# python 2 and python 3 compatibility library
|
|
26
|
+
import six
|
|
27
|
+
|
|
28
|
+
from lightning_sdk.lightning_cloud.openapi.api_client import ApiClient
|
|
29
|
+
|
|
30
|
+
if TYPE_CHECKING:
|
|
31
|
+
from datetime import datetime
|
|
32
|
+
from lightning_sdk.lightning_cloud.openapi.models import *
|
|
33
|
+
|
|
34
|
+
class MarketsServiceApi(object):
|
|
35
|
+
"""NOTE: This class is auto generated by the swagger code generator program.
|
|
36
|
+
|
|
37
|
+
Do not edit the class manually.
|
|
38
|
+
Ref: https://github.com/swagger-api/swagger-codegen
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
def __init__(self, api_client=None):
|
|
42
|
+
if api_client is None:
|
|
43
|
+
api_client = ApiClient()
|
|
44
|
+
self.api_client = api_client
|
|
45
|
+
|
|
46
|
+
def markets_service_get_market_pricing(self, asset: 'str', **kwargs) -> 'V1GetMarketPricingResponse': # noqa: E501
|
|
47
|
+
"""markets_service_get_market_pricing # noqa: E501
|
|
48
|
+
|
|
49
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
50
|
+
asynchronous HTTP request, please pass async_req=True
|
|
51
|
+
>>> thread = api.markets_service_get_market_pricing(asset, async_req=True)
|
|
52
|
+
>>> result = thread.get()
|
|
53
|
+
|
|
54
|
+
:param async_req bool
|
|
55
|
+
:param str asset: (required)
|
|
56
|
+
:param datetime start_date:
|
|
57
|
+
:param datetime end_date:
|
|
58
|
+
:return: V1GetMarketPricingResponse
|
|
59
|
+
If the method is called asynchronously,
|
|
60
|
+
returns the request thread.
|
|
61
|
+
"""
|
|
62
|
+
kwargs['_return_http_data_only'] = True
|
|
63
|
+
if kwargs.get('async_req'):
|
|
64
|
+
return self.markets_service_get_market_pricing_with_http_info(asset, **kwargs) # noqa: E501
|
|
65
|
+
else:
|
|
66
|
+
(data) = self.markets_service_get_market_pricing_with_http_info(asset, **kwargs) # noqa: E501
|
|
67
|
+
return data
|
|
68
|
+
|
|
69
|
+
def markets_service_get_market_pricing_with_http_info(self, asset: 'str', **kwargs) -> 'V1GetMarketPricingResponse': # noqa: E501
|
|
70
|
+
"""markets_service_get_market_pricing # noqa: E501
|
|
71
|
+
|
|
72
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
73
|
+
asynchronous HTTP request, please pass async_req=True
|
|
74
|
+
>>> thread = api.markets_service_get_market_pricing_with_http_info(asset, async_req=True)
|
|
75
|
+
>>> result = thread.get()
|
|
76
|
+
|
|
77
|
+
:param async_req bool
|
|
78
|
+
:param str asset: (required)
|
|
79
|
+
:param datetime start_date:
|
|
80
|
+
:param datetime end_date:
|
|
81
|
+
:return: V1GetMarketPricingResponse
|
|
82
|
+
If the method is called asynchronously,
|
|
83
|
+
returns the request thread.
|
|
84
|
+
"""
|
|
85
|
+
|
|
86
|
+
all_params = ['asset', 'start_date', 'end_date'] # noqa: E501
|
|
87
|
+
all_params.append('async_req')
|
|
88
|
+
all_params.append('_return_http_data_only')
|
|
89
|
+
all_params.append('_preload_content')
|
|
90
|
+
all_params.append('_request_timeout')
|
|
91
|
+
|
|
92
|
+
params = locals()
|
|
93
|
+
for key, val in six.iteritems(params['kwargs']):
|
|
94
|
+
if key not in all_params:
|
|
95
|
+
raise TypeError(
|
|
96
|
+
"Got an unexpected keyword argument '%s'"
|
|
97
|
+
" to method markets_service_get_market_pricing" % key
|
|
98
|
+
)
|
|
99
|
+
params[key] = val
|
|
100
|
+
del params['kwargs']
|
|
101
|
+
# verify the required parameter 'asset' is set
|
|
102
|
+
if ('asset' not in params or
|
|
103
|
+
params['asset'] is None):
|
|
104
|
+
raise ValueError("Missing the required parameter `asset` when calling `markets_service_get_market_pricing`") # noqa: E501
|
|
105
|
+
|
|
106
|
+
collection_formats = {}
|
|
107
|
+
|
|
108
|
+
path_params = {}
|
|
109
|
+
if 'asset' in params:
|
|
110
|
+
path_params['asset'] = params['asset'] # noqa: E501
|
|
111
|
+
|
|
112
|
+
query_params = []
|
|
113
|
+
if 'start_date' in params:
|
|
114
|
+
query_params.append(('startDate', params['start_date'])) # noqa: E501
|
|
115
|
+
if 'end_date' in params:
|
|
116
|
+
query_params.append(('endDate', params['end_date'])) # noqa: E501
|
|
117
|
+
|
|
118
|
+
header_params = {}
|
|
119
|
+
|
|
120
|
+
form_params = []
|
|
121
|
+
local_var_files = {}
|
|
122
|
+
|
|
123
|
+
body_params = None
|
|
124
|
+
# HTTP header `Accept`
|
|
125
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
126
|
+
['application/json']) # noqa: E501
|
|
127
|
+
|
|
128
|
+
# Authentication setting
|
|
129
|
+
auth_settings = [] # noqa: E501
|
|
130
|
+
|
|
131
|
+
return self.api_client.call_api(
|
|
132
|
+
'/v1/markets/{asset}', 'GET',
|
|
133
|
+
path_params,
|
|
134
|
+
query_params,
|
|
135
|
+
header_params,
|
|
136
|
+
body=body_params,
|
|
137
|
+
post_params=form_params,
|
|
138
|
+
files=local_var_files,
|
|
139
|
+
response_type='V1GetMarketPricingResponse', # noqa: E501
|
|
140
|
+
auth_settings=auth_settings,
|
|
141
|
+
async_req=params.get('async_req'),
|
|
142
|
+
_return_http_data_only=params.get('_return_http_data_only'),
|
|
143
|
+
_preload_content=params.get('_preload_content', True),
|
|
144
|
+
_request_timeout=params.get('_request_timeout'),
|
|
145
|
+
collection_formats=collection_formats)
|