label-studio-sdk 1.0.5__py3-none-any.whl → 1.0.8__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.

Files changed (77) hide show
  1. label_studio_sdk/__init__.py +76 -0
  2. label_studio_sdk/_extensions/eval/categorical.py +83 -0
  3. label_studio_sdk/_extensions/label_studio_tools/core/label_config.py +13 -4
  4. label_studio_sdk/_extensions/label_studio_tools/core/utils/io.py +35 -17
  5. label_studio_sdk/_extensions/label_studio_tools/core/utils/json_schema.py +86 -0
  6. label_studio_sdk/_legacy/schema/label_config_schema.json +42 -11
  7. label_studio_sdk/annotations/__init__.py +3 -0
  8. label_studio_sdk/annotations/client.py +109 -0
  9. label_studio_sdk/annotations/types/__init__.py +5 -0
  10. label_studio_sdk/annotations/types/annotations_create_bulk_response_item.py +29 -0
  11. label_studio_sdk/base_client.py +9 -0
  12. label_studio_sdk/comments/__init__.py +2 -0
  13. label_studio_sdk/comments/client.py +512 -0
  14. label_studio_sdk/converter/converter.py +11 -4
  15. label_studio_sdk/converter/imports/coco.py +14 -13
  16. label_studio_sdk/converter/utils.py +72 -3
  17. label_studio_sdk/core/client_wrapper.py +1 -1
  18. label_studio_sdk/files/client.py +26 -16
  19. label_studio_sdk/label_interface/control_tags.py +205 -10
  20. label_studio_sdk/label_interface/interface.py +117 -10
  21. label_studio_sdk/label_interface/region.py +1 -10
  22. label_studio_sdk/model_providers/__init__.py +2 -0
  23. label_studio_sdk/model_providers/client.py +708 -0
  24. label_studio_sdk/projects/client.py +32 -16
  25. label_studio_sdk/projects/exports/client.py +133 -40
  26. label_studio_sdk/prompts/__init__.py +21 -0
  27. label_studio_sdk/prompts/client.py +862 -0
  28. label_studio_sdk/prompts/indicators/__init__.py +2 -0
  29. label_studio_sdk/prompts/indicators/client.py +194 -0
  30. label_studio_sdk/prompts/runs/__init__.py +5 -0
  31. label_studio_sdk/prompts/runs/client.py +354 -0
  32. label_studio_sdk/prompts/runs/types/__init__.py +5 -0
  33. label_studio_sdk/prompts/runs/types/runs_list_request_project_subset.py +5 -0
  34. label_studio_sdk/prompts/types/__init__.py +15 -0
  35. label_studio_sdk/prompts/types/prompts_batch_failed_predictions_request_failed_predictions_item.py +42 -0
  36. label_studio_sdk/prompts/types/prompts_batch_failed_predictions_response.py +29 -0
  37. label_studio_sdk/prompts/types/prompts_batch_predictions_request_results_item.py +62 -0
  38. label_studio_sdk/prompts/types/prompts_batch_predictions_response.py +29 -0
  39. label_studio_sdk/prompts/versions/__init__.py +2 -0
  40. label_studio_sdk/prompts/versions/client.py +1046 -0
  41. label_studio_sdk/types/__init__.py +58 -0
  42. label_studio_sdk/types/comment.py +39 -0
  43. label_studio_sdk/types/comment_created_by.py +5 -0
  44. label_studio_sdk/types/inference_run.py +43 -0
  45. label_studio_sdk/types/inference_run_cost_estimate.py +57 -0
  46. label_studio_sdk/types/inference_run_created_by.py +5 -0
  47. label_studio_sdk/types/inference_run_organization.py +5 -0
  48. label_studio_sdk/types/inference_run_project_subset.py +5 -0
  49. label_studio_sdk/types/inference_run_status.py +7 -0
  50. label_studio_sdk/types/key_indicator_value.py +30 -0
  51. label_studio_sdk/types/key_indicators.py +7 -0
  52. label_studio_sdk/types/key_indicators_item.py +51 -0
  53. label_studio_sdk/types/key_indicators_item_additional_kpis_item.py +37 -0
  54. label_studio_sdk/types/key_indicators_item_extra_kpis_item.py +37 -0
  55. label_studio_sdk/types/model_provider_connection.py +71 -0
  56. label_studio_sdk/types/model_provider_connection_budget_reset_period.py +5 -0
  57. label_studio_sdk/types/model_provider_connection_created_by.py +5 -0
  58. label_studio_sdk/types/model_provider_connection_organization.py +5 -0
  59. label_studio_sdk/types/model_provider_connection_provider.py +5 -0
  60. label_studio_sdk/types/model_provider_connection_scope.py +5 -0
  61. label_studio_sdk/types/prompt.py +79 -0
  62. label_studio_sdk/types/prompt_created_by.py +5 -0
  63. label_studio_sdk/types/prompt_organization.py +5 -0
  64. label_studio_sdk/types/prompt_version.py +41 -0
  65. label_studio_sdk/types/prompt_version_created_by.py +5 -0
  66. label_studio_sdk/types/prompt_version_organization.py +5 -0
  67. label_studio_sdk/types/prompt_version_provider.py +5 -0
  68. label_studio_sdk/types/refined_prompt_response.py +64 -0
  69. label_studio_sdk/types/refined_prompt_response_refinement_status.py +7 -0
  70. label_studio_sdk/types/task.py +3 -2
  71. label_studio_sdk/types/task_comment_authors_item.py +5 -0
  72. label_studio_sdk/webhooks/client.py +245 -36
  73. label_studio_sdk/workspaces/client.py +20 -20
  74. label_studio_sdk-1.0.8.dist-info/LICENSE +201 -0
  75. {label_studio_sdk-1.0.5.dist-info → label_studio_sdk-1.0.8.dist-info}/METADATA +19 -3
  76. {label_studio_sdk-1.0.5.dist-info → label_studio_sdk-1.0.8.dist-info}/RECORD +77 -24
  77. {label_studio_sdk-1.0.5.dist-info → label_studio_sdk-1.0.8.dist-info}/WHEEL +1 -1
@@ -13,6 +13,8 @@ from .base_task import BaseTask
13
13
  from .base_task_file_upload import BaseTaskFileUpload
14
14
  from .base_task_updated_by import BaseTaskUpdatedBy
15
15
  from .base_user import BaseUser
16
+ from .comment import Comment
17
+ from .comment_created_by import CommentCreatedBy
16
18
  from .converted_format import ConvertedFormat
17
19
  from .converted_format_status import ConvertedFormatStatus
18
20
  from .data_manager_task_serializer import DataManagerTaskSerializer
@@ -31,6 +33,17 @@ from .gcs_export_storage import GcsExportStorage
31
33
  from .gcs_export_storage_status import GcsExportStorageStatus
32
34
  from .gcs_import_storage import GcsImportStorage
33
35
  from .gcs_import_storage_status import GcsImportStorageStatus
36
+ from .inference_run import InferenceRun
37
+ from .inference_run_cost_estimate import InferenceRunCostEstimate
38
+ from .inference_run_created_by import InferenceRunCreatedBy
39
+ from .inference_run_organization import InferenceRunOrganization
40
+ from .inference_run_project_subset import InferenceRunProjectSubset
41
+ from .inference_run_status import InferenceRunStatus
42
+ from .key_indicator_value import KeyIndicatorValue
43
+ from .key_indicators import KeyIndicators
44
+ from .key_indicators_item import KeyIndicatorsItem
45
+ from .key_indicators_item_additional_kpis_item import KeyIndicatorsItemAdditionalKpisItem
46
+ from .key_indicators_item_extra_kpis_item import KeyIndicatorsItemExtraKpisItem
34
47
  from .local_files_export_storage import LocalFilesExportStorage
35
48
  from .local_files_export_storage_status import LocalFilesExportStorageStatus
36
49
  from .local_files_import_storage import LocalFilesImportStorage
@@ -38,6 +51,12 @@ from .local_files_import_storage_status import LocalFilesImportStorageStatus
38
51
  from .ml_backend import MlBackend
39
52
  from .ml_backend_auth_method import MlBackendAuthMethod
40
53
  from .ml_backend_state import MlBackendState
54
+ from .model_provider_connection import ModelProviderConnection
55
+ from .model_provider_connection_budget_reset_period import ModelProviderConnectionBudgetResetPeriod
56
+ from .model_provider_connection_created_by import ModelProviderConnectionCreatedBy
57
+ from .model_provider_connection_organization import ModelProviderConnectionOrganization
58
+ from .model_provider_connection_provider import ModelProviderConnectionProvider
59
+ from .model_provider_connection_scope import ModelProviderConnectionScope
41
60
  from .prediction import Prediction
42
61
  from .project import Project
43
62
  from .project_import import ProjectImport
@@ -45,10 +64,19 @@ from .project_import_status import ProjectImportStatus
45
64
  from .project_label_config import ProjectLabelConfig
46
65
  from .project_sampling import ProjectSampling
47
66
  from .project_skip_queue import ProjectSkipQueue
67
+ from .prompt import Prompt
68
+ from .prompt_created_by import PromptCreatedBy
69
+ from .prompt_organization import PromptOrganization
70
+ from .prompt_version import PromptVersion
71
+ from .prompt_version_created_by import PromptVersionCreatedBy
72
+ from .prompt_version_organization import PromptVersionOrganization
73
+ from .prompt_version_provider import PromptVersionProvider
48
74
  from .redis_export_storage import RedisExportStorage
49
75
  from .redis_export_storage_status import RedisExportStorageStatus
50
76
  from .redis_import_storage import RedisImportStorage
51
77
  from .redis_import_storage_status import RedisImportStorageStatus
78
+ from .refined_prompt_response import RefinedPromptResponse
79
+ from .refined_prompt_response_refinement_status import RefinedPromptResponseRefinementStatus
52
80
  from .s3export_storage import S3ExportStorage
53
81
  from .s3export_storage_status import S3ExportStorageStatus
54
82
  from .s3import_storage import S3ImportStorage
@@ -60,6 +88,7 @@ from .serialization_option import SerializationOption
60
88
  from .serialization_options import SerializationOptions
61
89
  from .task import Task
62
90
  from .task_annotators_item import TaskAnnotatorsItem
91
+ from .task_comment_authors_item import TaskCommentAuthorsItem
63
92
  from .task_filter_options import TaskFilterOptions
64
93
  from .user_simple import UserSimple
65
94
  from .view import View
@@ -83,6 +112,8 @@ __all__ = [
83
112
  "BaseTaskFileUpload",
84
113
  "BaseTaskUpdatedBy",
85
114
  "BaseUser",
115
+ "Comment",
116
+ "CommentCreatedBy",
86
117
  "ConvertedFormat",
87
118
  "ConvertedFormatStatus",
88
119
  "DataManagerTaskSerializer",
@@ -101,6 +132,17 @@ __all__ = [
101
132
  "GcsExportStorageStatus",
102
133
  "GcsImportStorage",
103
134
  "GcsImportStorageStatus",
135
+ "InferenceRun",
136
+ "InferenceRunCostEstimate",
137
+ "InferenceRunCreatedBy",
138
+ "InferenceRunOrganization",
139
+ "InferenceRunProjectSubset",
140
+ "InferenceRunStatus",
141
+ "KeyIndicatorValue",
142
+ "KeyIndicators",
143
+ "KeyIndicatorsItem",
144
+ "KeyIndicatorsItemAdditionalKpisItem",
145
+ "KeyIndicatorsItemExtraKpisItem",
104
146
  "LocalFilesExportStorage",
105
147
  "LocalFilesExportStorageStatus",
106
148
  "LocalFilesImportStorage",
@@ -108,6 +150,12 @@ __all__ = [
108
150
  "MlBackend",
109
151
  "MlBackendAuthMethod",
110
152
  "MlBackendState",
153
+ "ModelProviderConnection",
154
+ "ModelProviderConnectionBudgetResetPeriod",
155
+ "ModelProviderConnectionCreatedBy",
156
+ "ModelProviderConnectionOrganization",
157
+ "ModelProviderConnectionProvider",
158
+ "ModelProviderConnectionScope",
111
159
  "Prediction",
112
160
  "Project",
113
161
  "ProjectImport",
@@ -115,10 +163,19 @@ __all__ = [
115
163
  "ProjectLabelConfig",
116
164
  "ProjectSampling",
117
165
  "ProjectSkipQueue",
166
+ "Prompt",
167
+ "PromptCreatedBy",
168
+ "PromptOrganization",
169
+ "PromptVersion",
170
+ "PromptVersionCreatedBy",
171
+ "PromptVersionOrganization",
172
+ "PromptVersionProvider",
118
173
  "RedisExportStorage",
119
174
  "RedisExportStorageStatus",
120
175
  "RedisImportStorage",
121
176
  "RedisImportStorageStatus",
177
+ "RefinedPromptResponse",
178
+ "RefinedPromptResponseRefinementStatus",
122
179
  "S3ExportStorage",
123
180
  "S3ExportStorageStatus",
124
181
  "S3ImportStorage",
@@ -130,6 +187,7 @@ __all__ = [
130
187
  "SerializationOptions",
131
188
  "Task",
132
189
  "TaskAnnotatorsItem",
190
+ "TaskCommentAuthorsItem",
133
191
  "TaskFilterOptions",
134
192
  "UserSimple",
135
193
  "View",
@@ -0,0 +1,39 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8
+ from .comment_created_by import CommentCreatedBy
9
+
10
+
11
+ class Comment(pydantic_v1.BaseModel):
12
+ id: int
13
+ text: str
14
+ project: int
15
+ task: int
16
+ annotation: int
17
+ created_by: CommentCreatedBy
18
+ created_at: dt.datetime
19
+ updated_at: dt.datetime
20
+ is_resolved: typing.Optional[bool] = None
21
+ resolved_at: typing.Optional[dt.datetime] = None
22
+
23
+ def json(self, **kwargs: typing.Any) -> str:
24
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
25
+ return super().json(**kwargs_with_defaults)
26
+
27
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
28
+ kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
29
+ kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
30
+
31
+ return deep_union_pydantic_dicts(
32
+ super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
33
+ )
34
+
35
+ class Config:
36
+ frozen = True
37
+ smart_union = True
38
+ extra = pydantic_v1.Extra.allow
39
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ CommentCreatedBy = typing.Union[int, typing.Dict[str, typing.Any]]
@@ -0,0 +1,43 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8
+ from .inference_run_created_by import InferenceRunCreatedBy
9
+ from .inference_run_organization import InferenceRunOrganization
10
+ from .inference_run_project_subset import InferenceRunProjectSubset
11
+ from .inference_run_status import InferenceRunStatus
12
+
13
+
14
+ class InferenceRun(pydantic_v1.BaseModel):
15
+ organization: typing.Optional[InferenceRunOrganization] = None
16
+ project: int
17
+ model_version: typing.Optional[str] = None
18
+ created_by: typing.Optional[InferenceRunCreatedBy] = None
19
+ project_subset: InferenceRunProjectSubset
20
+ status: typing.Optional[InferenceRunStatus] = None
21
+ job_id: typing.Optional[str] = None
22
+ created_at: typing.Optional[dt.datetime] = None
23
+ triggered_at: typing.Optional[dt.datetime] = None
24
+ predictions_updated_at: typing.Optional[dt.datetime] = None
25
+ completed_at: typing.Optional[dt.datetime] = None
26
+
27
+ def json(self, **kwargs: typing.Any) -> str:
28
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
29
+ return super().json(**kwargs_with_defaults)
30
+
31
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
32
+ kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
33
+ kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
34
+
35
+ return deep_union_pydantic_dicts(
36
+ super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
37
+ )
38
+
39
+ class Config:
40
+ frozen = True
41
+ smart_union = True
42
+ extra = pydantic_v1.Extra.allow
43
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,57 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8
+
9
+
10
+ class InferenceRunCostEstimate(pydantic_v1.BaseModel):
11
+ prompt_cost_usd: typing.Optional[str] = pydantic_v1.Field(default=None)
12
+ """
13
+ Cost of the prompt (in USD)
14
+ """
15
+
16
+ completion_cost_usd: typing.Optional[str] = pydantic_v1.Field(default=None)
17
+ """
18
+ Cost of the completion (in USD)
19
+ """
20
+
21
+ total_cost_usd: typing.Optional[str] = pydantic_v1.Field(default=None)
22
+ """
23
+ Total cost of the inference (in USD)
24
+ """
25
+
26
+ is_error: typing.Optional[bool] = pydantic_v1.Field(default=None)
27
+ """
28
+ Whether an error occurred or not
29
+ """
30
+
31
+ error_type: typing.Optional[str] = pydantic_v1.Field(default=None)
32
+ """
33
+ Type of error (e.g. "Timeout", "Rate Limit", etc)
34
+ """
35
+
36
+ error_message: typing.Optional[str] = pydantic_v1.Field(default=None)
37
+ """
38
+ Error message details
39
+ """
40
+
41
+ def json(self, **kwargs: typing.Any) -> str:
42
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
43
+ return super().json(**kwargs_with_defaults)
44
+
45
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
46
+ kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
47
+ kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
48
+
49
+ return deep_union_pydantic_dicts(
50
+ super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
51
+ )
52
+
53
+ class Config:
54
+ frozen = True
55
+ smart_union = True
56
+ extra = pydantic_v1.Extra.allow
57
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ InferenceRunCreatedBy = typing.Union[int, typing.Dict[str, typing.Any]]
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ InferenceRunOrganization = typing.Union[int, typing.Dict[str, typing.Any]]
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ InferenceRunProjectSubset = typing.Union[typing.Literal["All", "HasGT", "Sample"], typing.Any]
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ InferenceRunStatus = typing.Union[
6
+ typing.Literal["Pending", "InProgress", "Completed", "Failed", "Canceled"], typing.Any
7
+ ]
@@ -0,0 +1,30 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8
+
9
+
10
+ class KeyIndicatorValue(pydantic_v1.BaseModel):
11
+ title: typing.Optional[str] = None
12
+ values: typing.Optional[typing.Dict[str, typing.Any]] = None
13
+
14
+ def json(self, **kwargs: typing.Any) -> str:
15
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
16
+ return super().json(**kwargs_with_defaults)
17
+
18
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
19
+ kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
20
+ kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
21
+
22
+ return deep_union_pydantic_dicts(
23
+ super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
24
+ )
25
+
26
+ class Config:
27
+ frozen = True
28
+ smart_union = True
29
+ extra = pydantic_v1.Extra.allow
30
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ from .key_indicators_item import KeyIndicatorsItem
6
+
7
+ KeyIndicators = typing.List[KeyIndicatorsItem]
@@ -0,0 +1,51 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8
+ from .key_indicators_item_additional_kpis_item import KeyIndicatorsItemAdditionalKpisItem
9
+ from .key_indicators_item_extra_kpis_item import KeyIndicatorsItemExtraKpisItem
10
+
11
+
12
+ class KeyIndicatorsItem(pydantic_v1.BaseModel):
13
+ key: str = pydantic_v1.Field()
14
+ """
15
+ The key for this KPI, where you can find the value from inside main_kpi
16
+ """
17
+
18
+ title: str = pydantic_v1.Field()
19
+ """
20
+ The title for this metric, to be displayed to the user
21
+ """
22
+
23
+ main_kpi: str
24
+ secondary_kpi: typing.Optional[str] = None
25
+ additional_kpis: typing.Optional[typing.List[KeyIndicatorsItemAdditionalKpisItem]] = pydantic_v1.Field(default=None)
26
+ """
27
+ Additional KPIs to be displayed at the bottom of the box
28
+ """
29
+
30
+ extra_kpis: typing.Optional[typing.List[KeyIndicatorsItemExtraKpisItem]] = pydantic_v1.Field(default=None)
31
+ """
32
+ Extra KPIs to be displayed in the hover-tootip for that indicator
33
+ """
34
+
35
+ def json(self, **kwargs: typing.Any) -> str:
36
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
37
+ return super().json(**kwargs_with_defaults)
38
+
39
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
40
+ kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
41
+ kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
42
+
43
+ return deep_union_pydantic_dicts(
44
+ super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
45
+ )
46
+
47
+ class Config:
48
+ frozen = True
49
+ smart_union = True
50
+ extra = pydantic_v1.Extra.allow
51
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,37 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8
+
9
+
10
+ class KeyIndicatorsItemAdditionalKpisItem(pydantic_v1.BaseModel):
11
+ key: typing.Optional[str] = pydantic_v1.Field(default=None)
12
+ """
13
+ The key for this KPI, where you can find the value from inside main_kpi
14
+ """
15
+
16
+ label: typing.Optional[str] = pydantic_v1.Field(default=None)
17
+ """
18
+ The label for this KPI, to be displayed to the user
19
+ """
20
+
21
+ def json(self, **kwargs: typing.Any) -> str:
22
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23
+ return super().json(**kwargs_with_defaults)
24
+
25
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
26
+ kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
27
+ kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
28
+
29
+ return deep_union_pydantic_dicts(
30
+ super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
31
+ )
32
+
33
+ class Config:
34
+ frozen = True
35
+ smart_union = True
36
+ extra = pydantic_v1.Extra.allow
37
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,37 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8
+
9
+
10
+ class KeyIndicatorsItemExtraKpisItem(pydantic_v1.BaseModel):
11
+ key: typing.Optional[str] = pydantic_v1.Field(default=None)
12
+ """
13
+ The key for this KPI, where you can find the value from inside main_kpi
14
+ """
15
+
16
+ label: typing.Optional[str] = pydantic_v1.Field(default=None)
17
+ """
18
+ The label for this KPI, to be displayed to the user
19
+ """
20
+
21
+ def json(self, **kwargs: typing.Any) -> str:
22
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23
+ return super().json(**kwargs_with_defaults)
24
+
25
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
26
+ kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
27
+ kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
28
+
29
+ return deep_union_pydantic_dicts(
30
+ super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
31
+ )
32
+
33
+ class Config:
34
+ frozen = True
35
+ smart_union = True
36
+ extra = pydantic_v1.Extra.allow
37
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,71 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8
+ from .model_provider_connection_budget_reset_period import ModelProviderConnectionBudgetResetPeriod
9
+ from .model_provider_connection_created_by import ModelProviderConnectionCreatedBy
10
+ from .model_provider_connection_organization import ModelProviderConnectionOrganization
11
+ from .model_provider_connection_provider import ModelProviderConnectionProvider
12
+ from .model_provider_connection_scope import ModelProviderConnectionScope
13
+
14
+
15
+ class ModelProviderConnection(pydantic_v1.BaseModel):
16
+ provider: ModelProviderConnectionProvider
17
+ api_key: typing.Optional[str] = None
18
+ deployment_name: typing.Optional[str] = None
19
+ endpoint: typing.Optional[str] = None
20
+ scope: typing.Optional[ModelProviderConnectionScope] = None
21
+ organization: typing.Optional[ModelProviderConnectionOrganization] = None
22
+ created_by: typing.Optional[ModelProviderConnectionCreatedBy] = None
23
+ created_at: typing.Optional[dt.datetime] = None
24
+ updated_at: typing.Optional[dt.datetime] = None
25
+ is_internal: typing.Optional[bool] = pydantic_v1.Field(default=None)
26
+ """
27
+ Whether the model provider connection is internal, not visible to the user.
28
+ """
29
+
30
+ budget_limit: typing.Optional[float] = pydantic_v1.Field(default=None)
31
+ """
32
+ Budget limit for the model provider connection (null if unlimited)
33
+ """
34
+
35
+ budget_last_reset_date: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
36
+ """
37
+ Date and time the budget was last reset
38
+ """
39
+
40
+ budget_reset_period: typing.Optional[ModelProviderConnectionBudgetResetPeriod] = pydantic_v1.Field(default=None)
41
+ """
42
+ Budget reset period for the model provider connection (null if not reset)
43
+ """
44
+
45
+ budget_total_spent: typing.Optional[float] = pydantic_v1.Field(default=None)
46
+ """
47
+ Tracked total budget spent for the given provider connection within the current budget period
48
+ """
49
+
50
+ budget_alert_threshold: typing.Optional[float] = pydantic_v1.Field(default=None)
51
+ """
52
+ Budget alert threshold for the given provider connection
53
+ """
54
+
55
+ def json(self, **kwargs: typing.Any) -> str:
56
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
57
+ return super().json(**kwargs_with_defaults)
58
+
59
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
60
+ kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
61
+ kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
62
+
63
+ return deep_union_pydantic_dicts(
64
+ super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
65
+ )
66
+
67
+ class Config:
68
+ frozen = True
69
+ smart_union = True
70
+ extra = pydantic_v1.Extra.allow
71
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ModelProviderConnectionBudgetResetPeriod = typing.Union[typing.Literal["Monthly", "Yearly", "None"], typing.Any]
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ModelProviderConnectionCreatedBy = typing.Union[int, typing.Dict[str, typing.Any]]
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ModelProviderConnectionOrganization = typing.Union[int, typing.Dict[str, typing.Any]]
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ModelProviderConnectionProvider = typing.Union[typing.Literal["OpenAI", "AzureOpenAI", "Custom"], typing.Any]
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ModelProviderConnectionScope = typing.Union[typing.Literal["Organization", "User", "Model"], typing.Any]
@@ -0,0 +1,79 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ from ..core.datetime_utils import serialize_datetime
7
+ from ..core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1
8
+ from .prompt_created_by import PromptCreatedBy
9
+ from .prompt_organization import PromptOrganization
10
+
11
+
12
+ class Prompt(pydantic_v1.BaseModel):
13
+ title: str = pydantic_v1.Field()
14
+ """
15
+ Title of the prompt
16
+ """
17
+
18
+ description: typing.Optional[str] = pydantic_v1.Field(default=None)
19
+ """
20
+ Description of the prompt
21
+ """
22
+
23
+ created_by: typing.Optional[PromptCreatedBy] = pydantic_v1.Field(default=None)
24
+ """
25
+ User ID of the creator of the prompt
26
+ """
27
+
28
+ created_at: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
29
+ """
30
+ Date and time the prompt was created
31
+ """
32
+
33
+ updated_at: typing.Optional[dt.datetime] = pydantic_v1.Field(default=None)
34
+ """
35
+ Date and time the prompt was last updated
36
+ """
37
+
38
+ organization: typing.Optional[PromptOrganization] = pydantic_v1.Field(default=None)
39
+ """
40
+ Organization ID of the prompt
41
+ """
42
+
43
+ input_fields: typing.List[str] = pydantic_v1.Field()
44
+ """
45
+ List of input fields
46
+ """
47
+
48
+ output_classes: typing.List[str] = pydantic_v1.Field()
49
+ """
50
+ List of output classes
51
+ """
52
+
53
+ associated_projects: typing.Optional[typing.List[int]] = pydantic_v1.Field(default=None)
54
+ """
55
+ List of associated projects IDs
56
+ """
57
+
58
+ skill_name: typing.Optional[str] = pydantic_v1.Field(default=None)
59
+ """
60
+ Name of the skill
61
+ """
62
+
63
+ def json(self, **kwargs: typing.Any) -> str:
64
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
65
+ return super().json(**kwargs_with_defaults)
66
+
67
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
68
+ kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
69
+ kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
70
+
71
+ return deep_union_pydantic_dicts(
72
+ super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
73
+ )
74
+
75
+ class Config:
76
+ frozen = True
77
+ smart_union = True
78
+ extra = pydantic_v1.Extra.allow
79
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ PromptCreatedBy = typing.Union[int, typing.Dict[str, typing.Any]]