label-studio-sdk 2.0.1__py3-none-any.whl → 2.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of label-studio-sdk might be problematic. Click here for more details.
- label_studio_sdk/__init__.py +4 -0
- label_studio_sdk/actions/client.py +13 -13
- label_studio_sdk/actions/types/actions_list_response_item.py +3 -3
- label_studio_sdk/actions/types/actions_list_response_item_dialog.py +2 -2
- label_studio_sdk/annotations/client.py +441 -441
- label_studio_sdk/comments/client.py +176 -176
- label_studio_sdk/export_storage/azure/client.py +274 -274
- label_studio_sdk/export_storage/gcs/client.py +263 -263
- label_studio_sdk/export_storage/local/client.py +206 -206
- label_studio_sdk/export_storage/redis/client.py +287 -287
- label_studio_sdk/export_storage/s3/client.py +347 -347
- label_studio_sdk/export_storage/s3s/client.py +678 -678
- label_studio_sdk/import_storage/azure/client.py +357 -357
- label_studio_sdk/import_storage/gcs/client.py +357 -357
- label_studio_sdk/import_storage/local/client.py +206 -206
- label_studio_sdk/import_storage/redis/client.py +309 -309
- label_studio_sdk/import_storage/s3/client.py +452 -452
- label_studio_sdk/import_storage/s3s/client.py +735 -735
- label_studio_sdk/jwt_settings/client.py +10 -10
- label_studio_sdk/ml/client.py +118 -118
- label_studio_sdk/ml/types/ml_list_model_versions_response.py +1 -1
- label_studio_sdk/model_providers/client.py +181 -181
- label_studio_sdk/organizations/members/client.py +8 -8
- label_studio_sdk/predictions/client.py +60 -60
- label_studio_sdk/projects/__init__.py +30 -1
- label_studio_sdk/projects/assignments/__init__.py +33 -0
- label_studio_sdk/projects/assignments/client.py +764 -0
- label_studio_sdk/projects/assignments/types/__init__.py +35 -0
- label_studio_sdk/projects/assignments/types/assignments_assign_request_type.py +5 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters.py +33 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_conjunction.py +5 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item.py +44 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_filter.py +31 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_operator.py +23 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_filters_items_item_value.py +7 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items.py +9 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items_excluded.py +29 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_selected_items_included.py +29 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_request_type.py +5 -0
- label_studio_sdk/projects/assignments/types/assignments_bulk_assign_response.py +22 -0
- label_studio_sdk/projects/assignments/types/assignments_update_request_type.py +5 -0
- label_studio_sdk/projects/client.py +441 -425
- label_studio_sdk/projects/exports/client.py +55 -55
- label_studio_sdk/projects/exports/types/exports_convert_response.py +1 -1
- label_studio_sdk/projects/stats/types/stats_iaa_response.py +5 -5
- label_studio_sdk/projects/types/projects_import_tasks_response.py +12 -12
- label_studio_sdk/prompts/client.py +211 -211
- label_studio_sdk/prompts/runs/client.py +33 -33
- label_studio_sdk/prompts/versions/client.py +72 -72
- label_studio_sdk/tasks/client.py +174 -174
- label_studio_sdk/types/__init__.py +4 -0
- label_studio_sdk/types/all_roles_project_list.py +94 -94
- label_studio_sdk/types/annotation.py +35 -35
- label_studio_sdk/types/annotation_request.py +27 -27
- label_studio_sdk/types/azure_blob_export_storage.py +29 -29
- label_studio_sdk/types/azure_blob_import_storage.py +33 -33
- label_studio_sdk/types/batch_failed_predictions.py +1 -1
- label_studio_sdk/types/billing_checks.py +14 -14
- label_studio_sdk/types/billing_flags.py +16 -16
- label_studio_sdk/types/blueprint_list.py +7 -8
- label_studio_sdk/types/child_filter.py +11 -10
- label_studio_sdk/types/comment.py +15 -15
- label_studio_sdk/types/comment_request.py +7 -8
- label_studio_sdk/types/comment_serializer_with_expanded_user.py +17 -18
- label_studio_sdk/types/converted_format.py +1 -1
- label_studio_sdk/types/converted_format_request.py +1 -1
- label_studio_sdk/types/export.py +8 -8
- label_studio_sdk/types/file_upload.py +3 -2
- label_studio_sdk/types/filter.py +10 -9
- label_studio_sdk/types/filter_group.py +4 -3
- label_studio_sdk/types/gcs_export_storage.py +23 -23
- label_studio_sdk/types/gcs_import_storage.py +27 -27
- label_studio_sdk/types/import_api_request.py +26 -26
- label_studio_sdk/types/inference_run_cost_estimate.py +10 -10
- label_studio_sdk/types/local_files_export_storage.py +23 -23
- label_studio_sdk/types/local_files_import_storage.py +26 -26
- label_studio_sdk/types/lse_annotation_filter_options.py +10 -10
- label_studio_sdk/types/lse_annotation_filter_options_request.py +10 -10
- label_studio_sdk/types/lse_export_create.py +12 -12
- label_studio_sdk/types/lse_fields.py +14 -14
- label_studio_sdk/types/lse_organization.py +17 -17
- label_studio_sdk/types/lse_organization_member_list.py +1 -1
- label_studio_sdk/types/lse_project_create.py +72 -72
- label_studio_sdk/types/lse_project_update.py +89 -89
- label_studio_sdk/types/lse_s3export_storage.py +46 -46
- label_studio_sdk/types/lse_s3export_storage_request.py +43 -43
- label_studio_sdk/types/lse_s3import_storage.py +53 -53
- label_studio_sdk/types/lse_s3import_storage_request.py +49 -49
- label_studio_sdk/types/lse_task.py +49 -49
- label_studio_sdk/types/lse_task_drafts_item.py +1 -1
- label_studio_sdk/types/lse_task_filter_options.py +14 -14
- label_studio_sdk/types/lse_task_filter_options_request.py +14 -14
- label_studio_sdk/types/lse_task_predictions_item.py +5 -5
- label_studio_sdk/types/lse_task_serializer_for_annotators.py +12 -12
- label_studio_sdk/types/lse_task_serializer_for_annotators_drafts_item.py +1 -1
- label_studio_sdk/types/lse_task_serializer_for_annotators_predictions_item.py +5 -5
- label_studio_sdk/types/lse_task_serializer_for_reviewers.py +49 -49
- label_studio_sdk/types/lse_task_serializer_for_reviewers_drafts_item.py +1 -1
- label_studio_sdk/types/lse_task_serializer_for_reviewers_predictions_item.py +5 -5
- label_studio_sdk/types/lse_user.py +13 -13
- label_studio_sdk/types/lse_user_api.py +11 -11
- label_studio_sdk/types/lse_user_organization_member_list.py +13 -13
- label_studio_sdk/types/lseapi_token_create.py +1 -1
- label_studio_sdk/types/lseapi_token_list.py +1 -1
- label_studio_sdk/types/lsejwt_settings.py +5 -5
- label_studio_sdk/types/ml_backend.py +27 -28
- label_studio_sdk/types/model_interface.py +12 -12
- label_studio_sdk/types/model_interface_request.py +7 -8
- label_studio_sdk/types/model_interface_serializer_get.py +13 -13
- label_studio_sdk/types/model_provider_connection.py +34 -34
- label_studio_sdk/types/model_provider_connection_request.py +15 -14
- label_studio_sdk/types/model_run.py +12 -12
- label_studio_sdk/types/organization_billing.py +1 -1
- label_studio_sdk/types/organization_id.py +2 -2
- label_studio_sdk/types/organization_invite.py +1 -1
- label_studio_sdk/types/organization_member.py +8 -9
- label_studio_sdk/types/organization_membership.py +2 -1
- label_studio_sdk/types/pause.py +23 -23
- label_studio_sdk/types/prediction.py +21 -21
- label_studio_sdk/types/prediction_request.py +16 -16
- label_studio_sdk/types/project.py +72 -72
- label_studio_sdk/types/project_import.py +21 -21
- label_studio_sdk/types/redis_export_storage.py +34 -34
- label_studio_sdk/types/redis_import_storage.py +37 -37
- label_studio_sdk/types/refined_prompt_response.py +11 -11
- label_studio_sdk/types/review_settings.py +29 -30
- label_studio_sdk/types/review_settings_request.py +29 -30
- label_studio_sdk/types/s3export_storage.py +45 -45
- label_studio_sdk/types/s3import_storage.py +44 -44
- label_studio_sdk/types/selected_items_request.py +1 -1
- label_studio_sdk/types/serialization_options.py +10 -10
- label_studio_sdk/types/serialization_options_request.py +10 -10
- label_studio_sdk/types/task_assignment.py +43 -0
- label_studio_sdk/types/third_party_model_version.py +11 -11
- label_studio_sdk/types/third_party_model_version_request.py +6 -7
- label_studio_sdk/types/type_enum.py +5 -0
- label_studio_sdk/types/user_simple.py +3 -3
- label_studio_sdk/types/user_simple_request.py +1 -1
- label_studio_sdk/types/version_response.py +19 -20
- label_studio_sdk/types/view.py +8 -8
- label_studio_sdk/types/webhook.py +16 -16
- label_studio_sdk/types/webhook_serializer_for_update.py +16 -16
- label_studio_sdk/types/workspace.py +10 -11
- label_studio_sdk/users/client.py +160 -160
- label_studio_sdk/views/client.py +164 -164
- label_studio_sdk/webhooks/client.py +183 -183
- label_studio_sdk/webhooks/types/webhooks_info_response.py +32 -32
- label_studio_sdk/webhooks/types/webhooks_info_response_annotation_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_annotation_updated.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_annotations_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_annotations_deleted.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_label_link_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_label_link_deleted.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_label_link_updated.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_project_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_project_deleted.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_project_updated.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_review_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_review_updated.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_reviews_deleted.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_tasks_created.py +1 -1
- label_studio_sdk/webhooks/types/webhooks_info_response_tasks_deleted.py +1 -1
- label_studio_sdk/workspaces/client.py +40 -40
- {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.2.dist-info}/METADATA +1 -1
- {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.2.dist-info}/RECORD +167 -149
- {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.2.dist-info}/LICENSE +0 -0
- {label_studio_sdk-2.0.1.dist-info → label_studio_sdk-2.0.2.dist-info}/WHEEL +0 -0
|
@@ -9,8 +9,8 @@ from ...core.jsonable_encoder import jsonable_encoder
|
|
|
9
9
|
from ...core.unchecked_base_model import construct_type
|
|
10
10
|
from json.decoder import JSONDecodeError
|
|
11
11
|
from ...core.api_error import ApiError
|
|
12
|
-
from ...types.project_subset_enum import ProjectSubsetEnum
|
|
13
12
|
import datetime as dt
|
|
13
|
+
from ...types.project_subset_enum import ProjectSubsetEnum
|
|
14
14
|
from ...core.client_wrapper import AsyncClientWrapper
|
|
15
15
|
|
|
16
16
|
# this is used as the default value for optional parameters
|
|
@@ -104,13 +104,13 @@ class RunsClient:
|
|
|
104
104
|
version_id: int,
|
|
105
105
|
*,
|
|
106
106
|
project: int,
|
|
107
|
-
project_subset: typing.Optional[ProjectSubsetEnum] = OMIT,
|
|
108
107
|
job_id: typing.Optional[str] = OMIT,
|
|
109
|
-
|
|
108
|
+
organization: typing.Optional[int] = OMIT,
|
|
109
|
+
predictions_updated_at: typing.Optional[dt.datetime] = OMIT,
|
|
110
|
+
project_subset: typing.Optional[ProjectSubsetEnum] = OMIT,
|
|
110
111
|
total_correct_predictions: typing.Optional[int] = OMIT,
|
|
112
|
+
total_predictions: typing.Optional[int] = OMIT,
|
|
111
113
|
total_tasks: typing.Optional[int] = OMIT,
|
|
112
|
-
predictions_updated_at: typing.Optional[dt.datetime] = OMIT,
|
|
113
|
-
organization: typing.Optional[int] = OMIT,
|
|
114
114
|
request_options: typing.Optional[RequestOptions] = None,
|
|
115
115
|
) -> ModelRun:
|
|
116
116
|
"""
|
|
@@ -124,20 +124,20 @@ class RunsClient:
|
|
|
124
124
|
|
|
125
125
|
project : int
|
|
126
126
|
|
|
127
|
-
project_subset : typing.Optional[ProjectSubsetEnum]
|
|
128
|
-
|
|
129
127
|
job_id : typing.Optional[str]
|
|
130
128
|
Job ID for inference job for a ModelRun e.g. Adala job ID
|
|
131
129
|
|
|
132
|
-
|
|
130
|
+
organization : typing.Optional[int]
|
|
133
131
|
|
|
134
|
-
|
|
132
|
+
predictions_updated_at : typing.Optional[dt.datetime]
|
|
135
133
|
|
|
136
|
-
|
|
134
|
+
project_subset : typing.Optional[ProjectSubsetEnum]
|
|
137
135
|
|
|
138
|
-
|
|
136
|
+
total_correct_predictions : typing.Optional[int]
|
|
139
137
|
|
|
140
|
-
|
|
138
|
+
total_predictions : typing.Optional[int]
|
|
139
|
+
|
|
140
|
+
total_tasks : typing.Optional[int]
|
|
141
141
|
|
|
142
142
|
request_options : typing.Optional[RequestOptions]
|
|
143
143
|
Request-specific configuration.
|
|
@@ -164,14 +164,14 @@ class RunsClient:
|
|
|
164
164
|
f"api/prompts/{jsonable_encoder(prompt_id)}/versions/{jsonable_encoder(version_id)}/inference-runs",
|
|
165
165
|
method="POST",
|
|
166
166
|
json={
|
|
167
|
-
"project_subset": project_subset,
|
|
168
167
|
"job_id": job_id,
|
|
169
|
-
"total_predictions": total_predictions,
|
|
170
|
-
"total_correct_predictions": total_correct_predictions,
|
|
171
|
-
"total_tasks": total_tasks,
|
|
172
|
-
"predictions_updated_at": predictions_updated_at,
|
|
173
168
|
"organization": organization,
|
|
169
|
+
"predictions_updated_at": predictions_updated_at,
|
|
174
170
|
"project": project,
|
|
171
|
+
"project_subset": project_subset,
|
|
172
|
+
"total_correct_predictions": total_correct_predictions,
|
|
173
|
+
"total_predictions": total_predictions,
|
|
174
|
+
"total_tasks": total_tasks,
|
|
175
175
|
},
|
|
176
176
|
headers={
|
|
177
177
|
"content-type": "application/json",
|
|
@@ -289,13 +289,13 @@ class AsyncRunsClient:
|
|
|
289
289
|
version_id: int,
|
|
290
290
|
*,
|
|
291
291
|
project: int,
|
|
292
|
-
project_subset: typing.Optional[ProjectSubsetEnum] = OMIT,
|
|
293
292
|
job_id: typing.Optional[str] = OMIT,
|
|
294
|
-
|
|
293
|
+
organization: typing.Optional[int] = OMIT,
|
|
294
|
+
predictions_updated_at: typing.Optional[dt.datetime] = OMIT,
|
|
295
|
+
project_subset: typing.Optional[ProjectSubsetEnum] = OMIT,
|
|
295
296
|
total_correct_predictions: typing.Optional[int] = OMIT,
|
|
297
|
+
total_predictions: typing.Optional[int] = OMIT,
|
|
296
298
|
total_tasks: typing.Optional[int] = OMIT,
|
|
297
|
-
predictions_updated_at: typing.Optional[dt.datetime] = OMIT,
|
|
298
|
-
organization: typing.Optional[int] = OMIT,
|
|
299
299
|
request_options: typing.Optional[RequestOptions] = None,
|
|
300
300
|
) -> ModelRun:
|
|
301
301
|
"""
|
|
@@ -309,20 +309,20 @@ class AsyncRunsClient:
|
|
|
309
309
|
|
|
310
310
|
project : int
|
|
311
311
|
|
|
312
|
-
project_subset : typing.Optional[ProjectSubsetEnum]
|
|
313
|
-
|
|
314
312
|
job_id : typing.Optional[str]
|
|
315
313
|
Job ID for inference job for a ModelRun e.g. Adala job ID
|
|
316
314
|
|
|
317
|
-
|
|
315
|
+
organization : typing.Optional[int]
|
|
318
316
|
|
|
319
|
-
|
|
317
|
+
predictions_updated_at : typing.Optional[dt.datetime]
|
|
320
318
|
|
|
321
|
-
|
|
319
|
+
project_subset : typing.Optional[ProjectSubsetEnum]
|
|
322
320
|
|
|
323
|
-
|
|
321
|
+
total_correct_predictions : typing.Optional[int]
|
|
324
322
|
|
|
325
|
-
|
|
323
|
+
total_predictions : typing.Optional[int]
|
|
324
|
+
|
|
325
|
+
total_tasks : typing.Optional[int]
|
|
326
326
|
|
|
327
327
|
request_options : typing.Optional[RequestOptions]
|
|
328
328
|
Request-specific configuration.
|
|
@@ -357,14 +357,14 @@ class AsyncRunsClient:
|
|
|
357
357
|
f"api/prompts/{jsonable_encoder(prompt_id)}/versions/{jsonable_encoder(version_id)}/inference-runs",
|
|
358
358
|
method="POST",
|
|
359
359
|
json={
|
|
360
|
-
"project_subset": project_subset,
|
|
361
360
|
"job_id": job_id,
|
|
362
|
-
"total_predictions": total_predictions,
|
|
363
|
-
"total_correct_predictions": total_correct_predictions,
|
|
364
|
-
"total_tasks": total_tasks,
|
|
365
|
-
"predictions_updated_at": predictions_updated_at,
|
|
366
361
|
"organization": organization,
|
|
362
|
+
"predictions_updated_at": predictions_updated_at,
|
|
367
363
|
"project": project,
|
|
364
|
+
"project_subset": project_subset,
|
|
365
|
+
"total_correct_predictions": total_correct_predictions,
|
|
366
|
+
"total_predictions": total_predictions,
|
|
367
|
+
"total_tasks": total_tasks,
|
|
368
368
|
},
|
|
369
369
|
headers={
|
|
370
370
|
"content-type": "application/json",
|
|
@@ -128,13 +128,13 @@ class VersionsClient:
|
|
|
128
128
|
self,
|
|
129
129
|
prompt_id: int,
|
|
130
130
|
*,
|
|
131
|
-
title: str,
|
|
132
131
|
prompt: str,
|
|
133
132
|
provider_model_id: str,
|
|
134
|
-
|
|
135
|
-
provider: typing.Optional[ProviderEnum] = OMIT,
|
|
133
|
+
title: str,
|
|
136
134
|
model_provider_connection: typing.Optional[int] = OMIT,
|
|
137
135
|
organization: typing.Optional[int] = OMIT,
|
|
136
|
+
parent_model: typing.Optional[int] = OMIT,
|
|
137
|
+
provider: typing.Optional[ProviderEnum] = OMIT,
|
|
138
138
|
request_options: typing.Optional[RequestOptions] = None,
|
|
139
139
|
) -> ThirdPartyModelVersion:
|
|
140
140
|
"""
|
|
@@ -144,15 +144,19 @@ class VersionsClient:
|
|
|
144
144
|
----------
|
|
145
145
|
prompt_id : int
|
|
146
146
|
|
|
147
|
-
title : str
|
|
148
|
-
Model name
|
|
149
|
-
|
|
150
147
|
prompt : str
|
|
151
148
|
Prompt to execute
|
|
152
149
|
|
|
153
150
|
provider_model_id : str
|
|
154
151
|
The model ID to use within the given provider, e.g. gpt-3.5
|
|
155
152
|
|
|
153
|
+
title : str
|
|
154
|
+
Model name
|
|
155
|
+
|
|
156
|
+
model_provider_connection : typing.Optional[int]
|
|
157
|
+
|
|
158
|
+
organization : typing.Optional[int]
|
|
159
|
+
|
|
156
160
|
parent_model : typing.Optional[int]
|
|
157
161
|
Parent model interface ID
|
|
158
162
|
|
|
@@ -167,10 +171,6 @@ class VersionsClient:
|
|
|
167
171
|
* `Anthropic` - Anthropic
|
|
168
172
|
* `Custom` - Custom
|
|
169
173
|
|
|
170
|
-
model_provider_connection : typing.Optional[int]
|
|
171
|
-
|
|
172
|
-
organization : typing.Optional[int]
|
|
173
|
-
|
|
174
174
|
request_options : typing.Optional[RequestOptions]
|
|
175
175
|
Request-specific configuration.
|
|
176
176
|
|
|
@@ -188,22 +188,22 @@ class VersionsClient:
|
|
|
188
188
|
)
|
|
189
189
|
client.prompts.versions.create(
|
|
190
190
|
prompt_id=1,
|
|
191
|
-
title="title",
|
|
192
191
|
prompt="prompt",
|
|
193
192
|
provider_model_id="provider_model_id",
|
|
193
|
+
title="title",
|
|
194
194
|
)
|
|
195
195
|
"""
|
|
196
196
|
_response = self._client_wrapper.httpx_client.request(
|
|
197
197
|
f"api/prompts/{jsonable_encoder(prompt_id)}/versions",
|
|
198
198
|
method="POST",
|
|
199
199
|
json={
|
|
200
|
+
"model_provider_connection": model_provider_connection,
|
|
201
|
+
"organization": organization,
|
|
200
202
|
"parent_model": parent_model,
|
|
201
|
-
"title": title,
|
|
202
203
|
"prompt": prompt,
|
|
203
204
|
"provider": provider,
|
|
204
205
|
"provider_model_id": provider_model_id,
|
|
205
|
-
"
|
|
206
|
-
"organization": organization,
|
|
206
|
+
"title": title,
|
|
207
207
|
},
|
|
208
208
|
request_options=request_options,
|
|
209
209
|
omit=OMIT,
|
|
@@ -322,13 +322,13 @@ class VersionsClient:
|
|
|
322
322
|
prompt_id: int,
|
|
323
323
|
version_id: int,
|
|
324
324
|
*,
|
|
325
|
+
model_provider_connection: typing.Optional[int] = OMIT,
|
|
326
|
+
organization: typing.Optional[int] = OMIT,
|
|
325
327
|
parent_model: typing.Optional[int] = OMIT,
|
|
326
|
-
title: typing.Optional[str] = OMIT,
|
|
327
328
|
prompt: typing.Optional[str] = OMIT,
|
|
328
329
|
provider: typing.Optional[ProviderEnum] = OMIT,
|
|
329
330
|
provider_model_id: typing.Optional[str] = OMIT,
|
|
330
|
-
|
|
331
|
-
organization: typing.Optional[int] = OMIT,
|
|
331
|
+
title: typing.Optional[str] = OMIT,
|
|
332
332
|
request_options: typing.Optional[RequestOptions] = None,
|
|
333
333
|
) -> ThirdPartyModelVersion:
|
|
334
334
|
"""
|
|
@@ -340,12 +340,13 @@ class VersionsClient:
|
|
|
340
340
|
|
|
341
341
|
version_id : int
|
|
342
342
|
|
|
343
|
+
model_provider_connection : typing.Optional[int]
|
|
344
|
+
|
|
345
|
+
organization : typing.Optional[int]
|
|
346
|
+
|
|
343
347
|
parent_model : typing.Optional[int]
|
|
344
348
|
Parent model interface ID
|
|
345
349
|
|
|
346
|
-
title : typing.Optional[str]
|
|
347
|
-
Model name
|
|
348
|
-
|
|
349
350
|
prompt : typing.Optional[str]
|
|
350
351
|
Prompt to execute
|
|
351
352
|
|
|
@@ -363,9 +364,8 @@ class VersionsClient:
|
|
|
363
364
|
provider_model_id : typing.Optional[str]
|
|
364
365
|
The model ID to use within the given provider, e.g. gpt-3.5
|
|
365
366
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
organization : typing.Optional[int]
|
|
367
|
+
title : typing.Optional[str]
|
|
368
|
+
Model name
|
|
369
369
|
|
|
370
370
|
request_options : typing.Optional[RequestOptions]
|
|
371
371
|
Request-specific configuration.
|
|
@@ -391,13 +391,13 @@ class VersionsClient:
|
|
|
391
391
|
f"api/prompts/{jsonable_encoder(prompt_id)}/versions/{jsonable_encoder(version_id)}",
|
|
392
392
|
method="PATCH",
|
|
393
393
|
json={
|
|
394
|
+
"model_provider_connection": model_provider_connection,
|
|
395
|
+
"organization": organization,
|
|
394
396
|
"parent_model": parent_model,
|
|
395
|
-
"title": title,
|
|
396
397
|
"prompt": prompt,
|
|
397
398
|
"provider": provider,
|
|
398
399
|
"provider_model_id": provider_model_id,
|
|
399
|
-
"
|
|
400
|
-
"organization": organization,
|
|
400
|
+
"title": title,
|
|
401
401
|
},
|
|
402
402
|
headers={
|
|
403
403
|
"content-type": "application/json",
|
|
@@ -537,9 +537,9 @@ class VersionsClient:
|
|
|
537
537
|
prompt_id: int,
|
|
538
538
|
version_id: int,
|
|
539
539
|
*,
|
|
540
|
-
teacher_model_provider_connection_id: int,
|
|
541
|
-
teacher_model_name: str,
|
|
542
540
|
project_id: int,
|
|
541
|
+
teacher_model_name: str,
|
|
542
|
+
teacher_model_provider_connection_id: int,
|
|
543
543
|
async_: typing.Optional[bool] = None,
|
|
544
544
|
request_options: typing.Optional[RequestOptions] = None,
|
|
545
545
|
) -> RefinedPromptResponse:
|
|
@@ -552,14 +552,14 @@ class VersionsClient:
|
|
|
552
552
|
|
|
553
553
|
version_id : int
|
|
554
554
|
|
|
555
|
-
|
|
556
|
-
|
|
555
|
+
project_id : int
|
|
556
|
+
Project ID to target the refined prompt for
|
|
557
557
|
|
|
558
558
|
teacher_model_name : str
|
|
559
559
|
Name of the model to use to refine the prompt
|
|
560
560
|
|
|
561
|
-
|
|
562
|
-
|
|
561
|
+
teacher_model_provider_connection_id : int
|
|
562
|
+
Model Provider Connection ID to use to refine the prompt
|
|
563
563
|
|
|
564
564
|
async_ : typing.Optional[bool]
|
|
565
565
|
Whether to run the refinement asynchronously
|
|
@@ -582,9 +582,9 @@ class VersionsClient:
|
|
|
582
582
|
client.prompts.versions.refine_prompt(
|
|
583
583
|
prompt_id=1,
|
|
584
584
|
version_id=1,
|
|
585
|
-
teacher_model_provider_connection_id=1,
|
|
586
|
-
teacher_model_name="teacher_model_name",
|
|
587
585
|
project_id=1,
|
|
586
|
+
teacher_model_name="teacher_model_name",
|
|
587
|
+
teacher_model_provider_connection_id=1,
|
|
588
588
|
)
|
|
589
589
|
"""
|
|
590
590
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -594,9 +594,9 @@ class VersionsClient:
|
|
|
594
594
|
"async": async_,
|
|
595
595
|
},
|
|
596
596
|
json={
|
|
597
|
-
"teacher_model_provider_connection_id": teacher_model_provider_connection_id,
|
|
598
|
-
"teacher_model_name": teacher_model_name,
|
|
599
597
|
"project_id": project_id,
|
|
598
|
+
"teacher_model_name": teacher_model_name,
|
|
599
|
+
"teacher_model_provider_connection_id": teacher_model_provider_connection_id,
|
|
600
600
|
},
|
|
601
601
|
headers={
|
|
602
602
|
"content-type": "application/json",
|
|
@@ -748,13 +748,13 @@ class AsyncVersionsClient:
|
|
|
748
748
|
self,
|
|
749
749
|
prompt_id: int,
|
|
750
750
|
*,
|
|
751
|
-
title: str,
|
|
752
751
|
prompt: str,
|
|
753
752
|
provider_model_id: str,
|
|
754
|
-
|
|
755
|
-
provider: typing.Optional[ProviderEnum] = OMIT,
|
|
753
|
+
title: str,
|
|
756
754
|
model_provider_connection: typing.Optional[int] = OMIT,
|
|
757
755
|
organization: typing.Optional[int] = OMIT,
|
|
756
|
+
parent_model: typing.Optional[int] = OMIT,
|
|
757
|
+
provider: typing.Optional[ProviderEnum] = OMIT,
|
|
758
758
|
request_options: typing.Optional[RequestOptions] = None,
|
|
759
759
|
) -> ThirdPartyModelVersion:
|
|
760
760
|
"""
|
|
@@ -764,15 +764,19 @@ class AsyncVersionsClient:
|
|
|
764
764
|
----------
|
|
765
765
|
prompt_id : int
|
|
766
766
|
|
|
767
|
-
title : str
|
|
768
|
-
Model name
|
|
769
|
-
|
|
770
767
|
prompt : str
|
|
771
768
|
Prompt to execute
|
|
772
769
|
|
|
773
770
|
provider_model_id : str
|
|
774
771
|
The model ID to use within the given provider, e.g. gpt-3.5
|
|
775
772
|
|
|
773
|
+
title : str
|
|
774
|
+
Model name
|
|
775
|
+
|
|
776
|
+
model_provider_connection : typing.Optional[int]
|
|
777
|
+
|
|
778
|
+
organization : typing.Optional[int]
|
|
779
|
+
|
|
776
780
|
parent_model : typing.Optional[int]
|
|
777
781
|
Parent model interface ID
|
|
778
782
|
|
|
@@ -787,10 +791,6 @@ class AsyncVersionsClient:
|
|
|
787
791
|
* `Anthropic` - Anthropic
|
|
788
792
|
* `Custom` - Custom
|
|
789
793
|
|
|
790
|
-
model_provider_connection : typing.Optional[int]
|
|
791
|
-
|
|
792
|
-
organization : typing.Optional[int]
|
|
793
|
-
|
|
794
794
|
request_options : typing.Optional[RequestOptions]
|
|
795
795
|
Request-specific configuration.
|
|
796
796
|
|
|
@@ -813,9 +813,9 @@ class AsyncVersionsClient:
|
|
|
813
813
|
async def main() -> None:
|
|
814
814
|
await client.prompts.versions.create(
|
|
815
815
|
prompt_id=1,
|
|
816
|
-
title="title",
|
|
817
816
|
prompt="prompt",
|
|
818
817
|
provider_model_id="provider_model_id",
|
|
818
|
+
title="title",
|
|
819
819
|
)
|
|
820
820
|
|
|
821
821
|
|
|
@@ -825,13 +825,13 @@ class AsyncVersionsClient:
|
|
|
825
825
|
f"api/prompts/{jsonable_encoder(prompt_id)}/versions",
|
|
826
826
|
method="POST",
|
|
827
827
|
json={
|
|
828
|
+
"model_provider_connection": model_provider_connection,
|
|
829
|
+
"organization": organization,
|
|
828
830
|
"parent_model": parent_model,
|
|
829
|
-
"title": title,
|
|
830
831
|
"prompt": prompt,
|
|
831
832
|
"provider": provider,
|
|
832
833
|
"provider_model_id": provider_model_id,
|
|
833
|
-
"
|
|
834
|
-
"organization": organization,
|
|
834
|
+
"title": title,
|
|
835
835
|
},
|
|
836
836
|
request_options=request_options,
|
|
837
837
|
omit=OMIT,
|
|
@@ -966,13 +966,13 @@ class AsyncVersionsClient:
|
|
|
966
966
|
prompt_id: int,
|
|
967
967
|
version_id: int,
|
|
968
968
|
*,
|
|
969
|
+
model_provider_connection: typing.Optional[int] = OMIT,
|
|
970
|
+
organization: typing.Optional[int] = OMIT,
|
|
969
971
|
parent_model: typing.Optional[int] = OMIT,
|
|
970
|
-
title: typing.Optional[str] = OMIT,
|
|
971
972
|
prompt: typing.Optional[str] = OMIT,
|
|
972
973
|
provider: typing.Optional[ProviderEnum] = OMIT,
|
|
973
974
|
provider_model_id: typing.Optional[str] = OMIT,
|
|
974
|
-
|
|
975
|
-
organization: typing.Optional[int] = OMIT,
|
|
975
|
+
title: typing.Optional[str] = OMIT,
|
|
976
976
|
request_options: typing.Optional[RequestOptions] = None,
|
|
977
977
|
) -> ThirdPartyModelVersion:
|
|
978
978
|
"""
|
|
@@ -984,12 +984,13 @@ class AsyncVersionsClient:
|
|
|
984
984
|
|
|
985
985
|
version_id : int
|
|
986
986
|
|
|
987
|
+
model_provider_connection : typing.Optional[int]
|
|
988
|
+
|
|
989
|
+
organization : typing.Optional[int]
|
|
990
|
+
|
|
987
991
|
parent_model : typing.Optional[int]
|
|
988
992
|
Parent model interface ID
|
|
989
993
|
|
|
990
|
-
title : typing.Optional[str]
|
|
991
|
-
Model name
|
|
992
|
-
|
|
993
994
|
prompt : typing.Optional[str]
|
|
994
995
|
Prompt to execute
|
|
995
996
|
|
|
@@ -1007,9 +1008,8 @@ class AsyncVersionsClient:
|
|
|
1007
1008
|
provider_model_id : typing.Optional[str]
|
|
1008
1009
|
The model ID to use within the given provider, e.g. gpt-3.5
|
|
1009
1010
|
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
organization : typing.Optional[int]
|
|
1011
|
+
title : typing.Optional[str]
|
|
1012
|
+
Model name
|
|
1013
1013
|
|
|
1014
1014
|
request_options : typing.Optional[RequestOptions]
|
|
1015
1015
|
Request-specific configuration.
|
|
@@ -1043,13 +1043,13 @@ class AsyncVersionsClient:
|
|
|
1043
1043
|
f"api/prompts/{jsonable_encoder(prompt_id)}/versions/{jsonable_encoder(version_id)}",
|
|
1044
1044
|
method="PATCH",
|
|
1045
1045
|
json={
|
|
1046
|
+
"model_provider_connection": model_provider_connection,
|
|
1047
|
+
"organization": organization,
|
|
1046
1048
|
"parent_model": parent_model,
|
|
1047
|
-
"title": title,
|
|
1048
1049
|
"prompt": prompt,
|
|
1049
1050
|
"provider": provider,
|
|
1050
1051
|
"provider_model_id": provider_model_id,
|
|
1051
|
-
"
|
|
1052
|
-
"organization": organization,
|
|
1052
|
+
"title": title,
|
|
1053
1053
|
},
|
|
1054
1054
|
headers={
|
|
1055
1055
|
"content-type": "application/json",
|
|
@@ -1205,9 +1205,9 @@ class AsyncVersionsClient:
|
|
|
1205
1205
|
prompt_id: int,
|
|
1206
1206
|
version_id: int,
|
|
1207
1207
|
*,
|
|
1208
|
-
teacher_model_provider_connection_id: int,
|
|
1209
|
-
teacher_model_name: str,
|
|
1210
1208
|
project_id: int,
|
|
1209
|
+
teacher_model_name: str,
|
|
1210
|
+
teacher_model_provider_connection_id: int,
|
|
1211
1211
|
async_: typing.Optional[bool] = None,
|
|
1212
1212
|
request_options: typing.Optional[RequestOptions] = None,
|
|
1213
1213
|
) -> RefinedPromptResponse:
|
|
@@ -1220,14 +1220,14 @@ class AsyncVersionsClient:
|
|
|
1220
1220
|
|
|
1221
1221
|
version_id : int
|
|
1222
1222
|
|
|
1223
|
-
|
|
1224
|
-
|
|
1223
|
+
project_id : int
|
|
1224
|
+
Project ID to target the refined prompt for
|
|
1225
1225
|
|
|
1226
1226
|
teacher_model_name : str
|
|
1227
1227
|
Name of the model to use to refine the prompt
|
|
1228
1228
|
|
|
1229
|
-
|
|
1230
|
-
|
|
1229
|
+
teacher_model_provider_connection_id : int
|
|
1230
|
+
Model Provider Connection ID to use to refine the prompt
|
|
1231
1231
|
|
|
1232
1232
|
async_ : typing.Optional[bool]
|
|
1233
1233
|
Whether to run the refinement asynchronously
|
|
@@ -1255,9 +1255,9 @@ class AsyncVersionsClient:
|
|
|
1255
1255
|
await client.prompts.versions.refine_prompt(
|
|
1256
1256
|
prompt_id=1,
|
|
1257
1257
|
version_id=1,
|
|
1258
|
-
teacher_model_provider_connection_id=1,
|
|
1259
|
-
teacher_model_name="teacher_model_name",
|
|
1260
1258
|
project_id=1,
|
|
1259
|
+
teacher_model_name="teacher_model_name",
|
|
1260
|
+
teacher_model_provider_connection_id=1,
|
|
1261
1261
|
)
|
|
1262
1262
|
|
|
1263
1263
|
|
|
@@ -1270,9 +1270,9 @@ class AsyncVersionsClient:
|
|
|
1270
1270
|
"async": async_,
|
|
1271
1271
|
},
|
|
1272
1272
|
json={
|
|
1273
|
-
"teacher_model_provider_connection_id": teacher_model_provider_connection_id,
|
|
1274
|
-
"teacher_model_name": teacher_model_name,
|
|
1275
1273
|
"project_id": project_id,
|
|
1274
|
+
"teacher_model_name": teacher_model_name,
|
|
1275
|
+
"teacher_model_provider_connection_id": teacher_model_provider_connection_id,
|
|
1276
1276
|
},
|
|
1277
1277
|
headers={
|
|
1278
1278
|
"content-type": "application/json",
|