lightningrod-ai 0.1.6__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.
- lightningrod/__init__.py +66 -0
- lightningrod/_display.py +204 -0
- lightningrod/_errors.py +67 -0
- lightningrod/_generated/__init__.py +8 -0
- lightningrod/_generated/api/__init__.py +1 -0
- lightningrod/_generated/api/datasets/__init__.py +1 -0
- lightningrod/_generated/api/datasets/create_dataset_datasets_post.py +133 -0
- lightningrod/_generated/api/datasets/get_dataset_datasets_dataset_id_get.py +168 -0
- lightningrod/_generated/api/datasets/get_dataset_samples_datasets_dataset_id_samples_get.py +209 -0
- lightningrod/_generated/api/datasets/upload_samples_datasets_dataset_id_samples_post.py +190 -0
- lightningrod/_generated/api/file_sets/__init__.py +1 -0
- lightningrod/_generated/api/file_sets/add_file_to_set_filesets_file_set_id_files_post.py +190 -0
- lightningrod/_generated/api/file_sets/create_file_set_filesets_post.py +174 -0
- lightningrod/_generated/api/file_sets/get_file_set_filesets_file_set_id_get.py +168 -0
- lightningrod/_generated/api/file_sets/list_file_sets_filesets_get.py +173 -0
- lightningrod/_generated/api/file_sets/list_files_in_set_filesets_file_set_id_files_get.py +209 -0
- lightningrod/_generated/api/files/__init__.py +1 -0
- lightningrod/_generated/api/files/create_file_upload_files_post.py +174 -0
- lightningrod/_generated/api/open_ai_compatible/__init__.py +1 -0
- lightningrod/_generated/api/open_ai_compatible/chat_completions_openai_chat_completions_post.py +174 -0
- lightningrod/_generated/api/organizations/__init__.py +1 -0
- lightningrod/_generated/api/organizations/get_balance_organizations_balance_get.py +131 -0
- lightningrod/_generated/api/samples/__init__.py +1 -0
- lightningrod/_generated/api/samples/validate_sample_samples_validate_post.py +174 -0
- lightningrod/_generated/api/transform_jobs/__init__.py +1 -0
- lightningrod/_generated/api/transform_jobs/cost_estimation_transform_jobs_cost_estimation_post.py +174 -0
- lightningrod/_generated/api/transform_jobs/create_transform_job_transform_jobs_post.py +174 -0
- lightningrod/_generated/api/transform_jobs/get_transform_job_metrics_transform_jobs_job_id_metrics_get.py +172 -0
- lightningrod/_generated/api/transform_jobs/get_transform_job_transform_jobs_job_id_get.py +168 -0
- lightningrod/_generated/client.py +268 -0
- lightningrod/_generated/errors.py +16 -0
- lightningrod/_generated/models/__init__.py +147 -0
- lightningrod/_generated/models/answer_type.py +129 -0
- lightningrod/_generated/models/answer_type_enum.py +11 -0
- lightningrod/_generated/models/balance_response.py +61 -0
- lightningrod/_generated/models/chat_completion_request.py +216 -0
- lightningrod/_generated/models/chat_completion_response.py +146 -0
- lightningrod/_generated/models/chat_message.py +69 -0
- lightningrod/_generated/models/choice.py +97 -0
- lightningrod/_generated/models/create_dataset_response.py +61 -0
- lightningrod/_generated/models/create_file_set_file_request.py +101 -0
- lightningrod/_generated/models/create_file_set_file_request_metadata_type_0.py +46 -0
- lightningrod/_generated/models/create_file_set_request.py +83 -0
- lightningrod/_generated/models/create_file_upload_request.py +91 -0
- lightningrod/_generated/models/create_file_upload_response.py +165 -0
- lightningrod/_generated/models/create_file_upload_response_metadata_type_0.py +46 -0
- lightningrod/_generated/models/create_transform_job_request.py +312 -0
- lightningrod/_generated/models/dataset_metadata.py +69 -0
- lightningrod/_generated/models/estimate_cost_request.py +243 -0
- lightningrod/_generated/models/estimate_cost_response.py +117 -0
- lightningrod/_generated/models/event_usage_summary.py +80 -0
- lightningrod/_generated/models/file_set.py +128 -0
- lightningrod/_generated/models/file_set_file.py +203 -0
- lightningrod/_generated/models/file_set_file_metadata_type_0.py +57 -0
- lightningrod/_generated/models/file_set_query_seed_generator.py +136 -0
- lightningrod/_generated/models/file_set_seed_generator.py +126 -0
- lightningrod/_generated/models/filter_criteria.py +83 -0
- lightningrod/_generated/models/forward_looking_question.py +130 -0
- lightningrod/_generated/models/forward_looking_question_generator.py +217 -0
- lightningrod/_generated/models/gdelt_seed_generator.py +103 -0
- lightningrod/_generated/models/http_validation_error.py +79 -0
- lightningrod/_generated/models/job_usage.py +185 -0
- lightningrod/_generated/models/job_usage_by_step_type_0.py +59 -0
- lightningrod/_generated/models/label.py +143 -0
- lightningrod/_generated/models/list_file_set_files_response.py +113 -0
- lightningrod/_generated/models/list_file_sets_response.py +75 -0
- lightningrod/_generated/models/llm_model_usage_summary.py +98 -0
- lightningrod/_generated/models/mock_transform_config.py +243 -0
- lightningrod/_generated/models/mock_transform_config_metadata_additions.py +46 -0
- lightningrod/_generated/models/model_config.py +316 -0
- lightningrod/_generated/models/model_source_type.py +16 -0
- lightningrod/_generated/models/news_context.py +82 -0
- lightningrod/_generated/models/news_context_generator.py +127 -0
- lightningrod/_generated/models/news_seed_generator.py +220 -0
- lightningrod/_generated/models/paginated_samples_response.py +113 -0
- lightningrod/_generated/models/pipeline_metrics_response.py +99 -0
- lightningrod/_generated/models/question.py +74 -0
- lightningrod/_generated/models/question_and_label_generator.py +217 -0
- lightningrod/_generated/models/question_generator.py +217 -0
- lightningrod/_generated/models/question_pipeline.py +417 -0
- lightningrod/_generated/models/question_renderer.py +123 -0
- lightningrod/_generated/models/rag_context.py +82 -0
- lightningrod/_generated/models/response_message.py +69 -0
- lightningrod/_generated/models/rollout.py +130 -0
- lightningrod/_generated/models/rollout_generator.py +139 -0
- lightningrod/_generated/models/rollout_parsed_output_type_0.py +46 -0
- lightningrod/_generated/models/sample.py +323 -0
- lightningrod/_generated/models/sample_meta.py +46 -0
- lightningrod/_generated/models/seed.py +135 -0
- lightningrod/_generated/models/step_cost_breakdown.py +109 -0
- lightningrod/_generated/models/transform_job.py +268 -0
- lightningrod/_generated/models/transform_job_status.py +11 -0
- lightningrod/_generated/models/transform_step_metrics_response.py +131 -0
- lightningrod/_generated/models/transform_type.py +25 -0
- lightningrod/_generated/models/upload_samples_request.py +75 -0
- lightningrod/_generated/models/upload_samples_response.py +69 -0
- lightningrod/_generated/models/usage.py +77 -0
- lightningrod/_generated/models/usage_summary.py +102 -0
- lightningrod/_generated/models/usage_summary_events.py +59 -0
- lightningrod/_generated/models/usage_summary_llm_by_model.py +59 -0
- lightningrod/_generated/models/validate_sample_response.py +69 -0
- lightningrod/_generated/models/validation_error.py +90 -0
- lightningrod/_generated/models/web_search_labeler.py +120 -0
- lightningrod/_generated/py.typed +1 -0
- lightningrod/_generated/types.py +54 -0
- lightningrod/client.py +48 -0
- lightningrod/datasets/__init__.py +4 -0
- lightningrod/datasets/client.py +174 -0
- lightningrod/datasets/dataset.py +255 -0
- lightningrod/files/__init__.py +0 -0
- lightningrod/files/client.py +58 -0
- lightningrod/filesets/__init__.py +0 -0
- lightningrod/filesets/client.py +106 -0
- lightningrod/organization/__init__.py +0 -0
- lightningrod/organization/client.py +17 -0
- lightningrod/py.typed +0 -0
- lightningrod/transforms/__init__.py +0 -0
- lightningrod/transforms/client.py +154 -0
- lightningrod_ai-0.1.6.dist-info/METADATA +122 -0
- lightningrod_ai-0.1.6.dist-info/RECORD +123 -0
- lightningrod_ai-0.1.6.dist-info/WHEEL +5 -0
- lightningrod_ai-0.1.6.dist-info/licenses/LICENSE +23 -0
- lightningrod_ai-0.1.6.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from ..models.sample import Sample
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="UploadSamplesRequest")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class UploadSamplesRequest:
|
|
18
|
+
"""
|
|
19
|
+
Attributes:
|
|
20
|
+
samples (list[Sample]):
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
samples: list[Sample]
|
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
25
|
+
|
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
|
27
|
+
samples = []
|
|
28
|
+
for samples_item_data in self.samples:
|
|
29
|
+
samples_item = samples_item_data.to_dict()
|
|
30
|
+
samples.append(samples_item)
|
|
31
|
+
|
|
32
|
+
field_dict: dict[str, Any] = {}
|
|
33
|
+
field_dict.update(self.additional_properties)
|
|
34
|
+
field_dict.update(
|
|
35
|
+
{
|
|
36
|
+
"samples": samples,
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
return field_dict
|
|
41
|
+
|
|
42
|
+
@classmethod
|
|
43
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
44
|
+
from ..models.sample import Sample
|
|
45
|
+
|
|
46
|
+
d = dict(src_dict)
|
|
47
|
+
samples = []
|
|
48
|
+
_samples = d.pop("samples")
|
|
49
|
+
for samples_item_data in _samples:
|
|
50
|
+
samples_item = Sample.from_dict(samples_item_data)
|
|
51
|
+
|
|
52
|
+
samples.append(samples_item)
|
|
53
|
+
|
|
54
|
+
upload_samples_request = cls(
|
|
55
|
+
samples=samples,
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
upload_samples_request.additional_properties = d
|
|
59
|
+
return upload_samples_request
|
|
60
|
+
|
|
61
|
+
@property
|
|
62
|
+
def additional_keys(self) -> list[str]:
|
|
63
|
+
return list(self.additional_properties.keys())
|
|
64
|
+
|
|
65
|
+
def __getitem__(self, key: str) -> Any:
|
|
66
|
+
return self.additional_properties[key]
|
|
67
|
+
|
|
68
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
69
|
+
self.additional_properties[key] = value
|
|
70
|
+
|
|
71
|
+
def __delitem__(self, key: str) -> None:
|
|
72
|
+
del self.additional_properties[key]
|
|
73
|
+
|
|
74
|
+
def __contains__(self, key: str) -> bool:
|
|
75
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="UploadSamplesResponse")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class UploadSamplesResponse:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
count (int):
|
|
17
|
+
total (int):
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
count: int
|
|
21
|
+
total: int
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
count = self.count
|
|
26
|
+
|
|
27
|
+
total = self.total
|
|
28
|
+
|
|
29
|
+
field_dict: dict[str, Any] = {}
|
|
30
|
+
field_dict.update(self.additional_properties)
|
|
31
|
+
field_dict.update(
|
|
32
|
+
{
|
|
33
|
+
"count": count,
|
|
34
|
+
"total": total,
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
return field_dict
|
|
39
|
+
|
|
40
|
+
@classmethod
|
|
41
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
42
|
+
d = dict(src_dict)
|
|
43
|
+
count = d.pop("count")
|
|
44
|
+
|
|
45
|
+
total = d.pop("total")
|
|
46
|
+
|
|
47
|
+
upload_samples_response = cls(
|
|
48
|
+
count=count,
|
|
49
|
+
total=total,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
upload_samples_response.additional_properties = d
|
|
53
|
+
return upload_samples_response
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
def additional_keys(self) -> list[str]:
|
|
57
|
+
return list(self.additional_properties.keys())
|
|
58
|
+
|
|
59
|
+
def __getitem__(self, key: str) -> Any:
|
|
60
|
+
return self.additional_properties[key]
|
|
61
|
+
|
|
62
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
63
|
+
self.additional_properties[key] = value
|
|
64
|
+
|
|
65
|
+
def __delitem__(self, key: str) -> None:
|
|
66
|
+
del self.additional_properties[key]
|
|
67
|
+
|
|
68
|
+
def __contains__(self, key: str) -> bool:
|
|
69
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="Usage")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class Usage:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
prompt_tokens (int): Number of tokens in the prompt
|
|
17
|
+
completion_tokens (int): Number of tokens in the completion
|
|
18
|
+
total_tokens (int): Total number of tokens used
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
prompt_tokens: int
|
|
22
|
+
completion_tokens: int
|
|
23
|
+
total_tokens: int
|
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
25
|
+
|
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
|
27
|
+
prompt_tokens = self.prompt_tokens
|
|
28
|
+
|
|
29
|
+
completion_tokens = self.completion_tokens
|
|
30
|
+
|
|
31
|
+
total_tokens = self.total_tokens
|
|
32
|
+
|
|
33
|
+
field_dict: dict[str, Any] = {}
|
|
34
|
+
field_dict.update(self.additional_properties)
|
|
35
|
+
field_dict.update(
|
|
36
|
+
{
|
|
37
|
+
"prompt_tokens": prompt_tokens,
|
|
38
|
+
"completion_tokens": completion_tokens,
|
|
39
|
+
"total_tokens": total_tokens,
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
return field_dict
|
|
44
|
+
|
|
45
|
+
@classmethod
|
|
46
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
47
|
+
d = dict(src_dict)
|
|
48
|
+
prompt_tokens = d.pop("prompt_tokens")
|
|
49
|
+
|
|
50
|
+
completion_tokens = d.pop("completion_tokens")
|
|
51
|
+
|
|
52
|
+
total_tokens = d.pop("total_tokens")
|
|
53
|
+
|
|
54
|
+
usage = cls(
|
|
55
|
+
prompt_tokens=prompt_tokens,
|
|
56
|
+
completion_tokens=completion_tokens,
|
|
57
|
+
total_tokens=total_tokens,
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
usage.additional_properties = d
|
|
61
|
+
return usage
|
|
62
|
+
|
|
63
|
+
@property
|
|
64
|
+
def additional_keys(self) -> list[str]:
|
|
65
|
+
return list(self.additional_properties.keys())
|
|
66
|
+
|
|
67
|
+
def __getitem__(self, key: str) -> Any:
|
|
68
|
+
return self.additional_properties[key]
|
|
69
|
+
|
|
70
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
71
|
+
self.additional_properties[key] = value
|
|
72
|
+
|
|
73
|
+
def __delitem__(self, key: str) -> None:
|
|
74
|
+
del self.additional_properties[key]
|
|
75
|
+
|
|
76
|
+
def __contains__(self, key: str) -> bool:
|
|
77
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from ..models.usage_summary_events import UsageSummaryEvents
|
|
13
|
+
from ..models.usage_summary_llm_by_model import UsageSummaryLlmByModel
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
T = TypeVar("T", bound="UsageSummary")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@_attrs_define
|
|
20
|
+
class UsageSummary:
|
|
21
|
+
"""Flexible usage statistics by event type and LLM model.
|
|
22
|
+
|
|
23
|
+
Attributes:
|
|
24
|
+
events (UsageSummaryEvents | Unset):
|
|
25
|
+
llm_by_model (UsageSummaryLlmByModel | Unset):
|
|
26
|
+
total_cost (float | Unset): Default: 0.0.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
events: UsageSummaryEvents | Unset = UNSET
|
|
30
|
+
llm_by_model: UsageSummaryLlmByModel | Unset = UNSET
|
|
31
|
+
total_cost: float | Unset = 0.0
|
|
32
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
33
|
+
|
|
34
|
+
def to_dict(self) -> dict[str, Any]:
|
|
35
|
+
events: dict[str, Any] | Unset = UNSET
|
|
36
|
+
if not isinstance(self.events, Unset):
|
|
37
|
+
events = self.events.to_dict()
|
|
38
|
+
|
|
39
|
+
llm_by_model: dict[str, Any] | Unset = UNSET
|
|
40
|
+
if not isinstance(self.llm_by_model, Unset):
|
|
41
|
+
llm_by_model = self.llm_by_model.to_dict()
|
|
42
|
+
|
|
43
|
+
total_cost = self.total_cost
|
|
44
|
+
|
|
45
|
+
field_dict: dict[str, Any] = {}
|
|
46
|
+
field_dict.update(self.additional_properties)
|
|
47
|
+
field_dict.update({})
|
|
48
|
+
if events is not UNSET:
|
|
49
|
+
field_dict["events"] = events
|
|
50
|
+
if llm_by_model is not UNSET:
|
|
51
|
+
field_dict["llm_by_model"] = llm_by_model
|
|
52
|
+
if total_cost is not UNSET:
|
|
53
|
+
field_dict["total_cost"] = total_cost
|
|
54
|
+
|
|
55
|
+
return field_dict
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
59
|
+
from ..models.usage_summary_events import UsageSummaryEvents
|
|
60
|
+
from ..models.usage_summary_llm_by_model import UsageSummaryLlmByModel
|
|
61
|
+
|
|
62
|
+
d = dict(src_dict)
|
|
63
|
+
_events = d.pop("events", UNSET)
|
|
64
|
+
events: UsageSummaryEvents | Unset
|
|
65
|
+
if isinstance(_events, Unset):
|
|
66
|
+
events = UNSET
|
|
67
|
+
else:
|
|
68
|
+
events = UsageSummaryEvents.from_dict(_events)
|
|
69
|
+
|
|
70
|
+
_llm_by_model = d.pop("llm_by_model", UNSET)
|
|
71
|
+
llm_by_model: UsageSummaryLlmByModel | Unset
|
|
72
|
+
if isinstance(_llm_by_model, Unset):
|
|
73
|
+
llm_by_model = UNSET
|
|
74
|
+
else:
|
|
75
|
+
llm_by_model = UsageSummaryLlmByModel.from_dict(_llm_by_model)
|
|
76
|
+
|
|
77
|
+
total_cost = d.pop("total_cost", UNSET)
|
|
78
|
+
|
|
79
|
+
usage_summary = cls(
|
|
80
|
+
events=events,
|
|
81
|
+
llm_by_model=llm_by_model,
|
|
82
|
+
total_cost=total_cost,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
usage_summary.additional_properties = d
|
|
86
|
+
return usage_summary
|
|
87
|
+
|
|
88
|
+
@property
|
|
89
|
+
def additional_keys(self) -> list[str]:
|
|
90
|
+
return list(self.additional_properties.keys())
|
|
91
|
+
|
|
92
|
+
def __getitem__(self, key: str) -> Any:
|
|
93
|
+
return self.additional_properties[key]
|
|
94
|
+
|
|
95
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
96
|
+
self.additional_properties[key] = value
|
|
97
|
+
|
|
98
|
+
def __delitem__(self, key: str) -> None:
|
|
99
|
+
del self.additional_properties[key]
|
|
100
|
+
|
|
101
|
+
def __contains__(self, key: str) -> bool:
|
|
102
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from ..models.event_usage_summary import EventUsageSummary
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="UsageSummaryEvents")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class UsageSummaryEvents:
|
|
18
|
+
""" """
|
|
19
|
+
|
|
20
|
+
additional_properties: dict[str, EventUsageSummary] = _attrs_field(init=False, factory=dict)
|
|
21
|
+
|
|
22
|
+
def to_dict(self) -> dict[str, Any]:
|
|
23
|
+
field_dict: dict[str, Any] = {}
|
|
24
|
+
for prop_name, prop in self.additional_properties.items():
|
|
25
|
+
field_dict[prop_name] = prop.to_dict()
|
|
26
|
+
|
|
27
|
+
return field_dict
|
|
28
|
+
|
|
29
|
+
@classmethod
|
|
30
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
31
|
+
from ..models.event_usage_summary import EventUsageSummary
|
|
32
|
+
|
|
33
|
+
d = dict(src_dict)
|
|
34
|
+
usage_summary_events = cls()
|
|
35
|
+
|
|
36
|
+
additional_properties = {}
|
|
37
|
+
for prop_name, prop_dict in d.items():
|
|
38
|
+
additional_property = EventUsageSummary.from_dict(prop_dict)
|
|
39
|
+
|
|
40
|
+
additional_properties[prop_name] = additional_property
|
|
41
|
+
|
|
42
|
+
usage_summary_events.additional_properties = additional_properties
|
|
43
|
+
return usage_summary_events
|
|
44
|
+
|
|
45
|
+
@property
|
|
46
|
+
def additional_keys(self) -> list[str]:
|
|
47
|
+
return list(self.additional_properties.keys())
|
|
48
|
+
|
|
49
|
+
def __getitem__(self, key: str) -> EventUsageSummary:
|
|
50
|
+
return self.additional_properties[key]
|
|
51
|
+
|
|
52
|
+
def __setitem__(self, key: str, value: EventUsageSummary) -> None:
|
|
53
|
+
self.additional_properties[key] = value
|
|
54
|
+
|
|
55
|
+
def __delitem__(self, key: str) -> None:
|
|
56
|
+
del self.additional_properties[key]
|
|
57
|
+
|
|
58
|
+
def __contains__(self, key: str) -> bool:
|
|
59
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from ..models.llm_model_usage_summary import LLMModelUsageSummary
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="UsageSummaryLlmByModel")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class UsageSummaryLlmByModel:
|
|
18
|
+
""" """
|
|
19
|
+
|
|
20
|
+
additional_properties: dict[str, LLMModelUsageSummary] = _attrs_field(init=False, factory=dict)
|
|
21
|
+
|
|
22
|
+
def to_dict(self) -> dict[str, Any]:
|
|
23
|
+
field_dict: dict[str, Any] = {}
|
|
24
|
+
for prop_name, prop in self.additional_properties.items():
|
|
25
|
+
field_dict[prop_name] = prop.to_dict()
|
|
26
|
+
|
|
27
|
+
return field_dict
|
|
28
|
+
|
|
29
|
+
@classmethod
|
|
30
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
31
|
+
from ..models.llm_model_usage_summary import LLMModelUsageSummary
|
|
32
|
+
|
|
33
|
+
d = dict(src_dict)
|
|
34
|
+
usage_summary_llm_by_model = cls()
|
|
35
|
+
|
|
36
|
+
additional_properties = {}
|
|
37
|
+
for prop_name, prop_dict in d.items():
|
|
38
|
+
additional_property = LLMModelUsageSummary.from_dict(prop_dict)
|
|
39
|
+
|
|
40
|
+
additional_properties[prop_name] = additional_property
|
|
41
|
+
|
|
42
|
+
usage_summary_llm_by_model.additional_properties = additional_properties
|
|
43
|
+
return usage_summary_llm_by_model
|
|
44
|
+
|
|
45
|
+
@property
|
|
46
|
+
def additional_keys(self) -> list[str]:
|
|
47
|
+
return list(self.additional_properties.keys())
|
|
48
|
+
|
|
49
|
+
def __getitem__(self, key: str) -> LLMModelUsageSummary:
|
|
50
|
+
return self.additional_properties[key]
|
|
51
|
+
|
|
52
|
+
def __setitem__(self, key: str, value: LLMModelUsageSummary) -> None:
|
|
53
|
+
self.additional_properties[key] = value
|
|
54
|
+
|
|
55
|
+
def __delitem__(self, key: str) -> None:
|
|
56
|
+
del self.additional_properties[key]
|
|
57
|
+
|
|
58
|
+
def __contains__(self, key: str) -> bool:
|
|
59
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="ValidateSampleResponse")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class ValidateSampleResponse:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
valid (bool):
|
|
17
|
+
message (str):
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
valid: bool
|
|
21
|
+
message: str
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
valid = self.valid
|
|
26
|
+
|
|
27
|
+
message = self.message
|
|
28
|
+
|
|
29
|
+
field_dict: dict[str, Any] = {}
|
|
30
|
+
field_dict.update(self.additional_properties)
|
|
31
|
+
field_dict.update(
|
|
32
|
+
{
|
|
33
|
+
"valid": valid,
|
|
34
|
+
"message": message,
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
return field_dict
|
|
39
|
+
|
|
40
|
+
@classmethod
|
|
41
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
42
|
+
d = dict(src_dict)
|
|
43
|
+
valid = d.pop("valid")
|
|
44
|
+
|
|
45
|
+
message = d.pop("message")
|
|
46
|
+
|
|
47
|
+
validate_sample_response = cls(
|
|
48
|
+
valid=valid,
|
|
49
|
+
message=message,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
validate_sample_response.additional_properties = d
|
|
53
|
+
return validate_sample_response
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
def additional_keys(self) -> list[str]:
|
|
57
|
+
return list(self.additional_properties.keys())
|
|
58
|
+
|
|
59
|
+
def __getitem__(self, key: str) -> Any:
|
|
60
|
+
return self.additional_properties[key]
|
|
61
|
+
|
|
62
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
63
|
+
self.additional_properties[key] = value
|
|
64
|
+
|
|
65
|
+
def __delitem__(self, key: str) -> None:
|
|
66
|
+
del self.additional_properties[key]
|
|
67
|
+
|
|
68
|
+
def __contains__(self, key: str) -> bool:
|
|
69
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, cast
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="ValidationError")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class ValidationError:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
loc (list[int | str]):
|
|
17
|
+
msg (str):
|
|
18
|
+
type_ (str):
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
loc: list[int | str]
|
|
22
|
+
msg: str
|
|
23
|
+
type_: str
|
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
25
|
+
|
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
|
27
|
+
loc = []
|
|
28
|
+
for loc_item_data in self.loc:
|
|
29
|
+
loc_item: int | str
|
|
30
|
+
loc_item = loc_item_data
|
|
31
|
+
loc.append(loc_item)
|
|
32
|
+
|
|
33
|
+
msg = self.msg
|
|
34
|
+
|
|
35
|
+
type_ = self.type_
|
|
36
|
+
|
|
37
|
+
field_dict: dict[str, Any] = {}
|
|
38
|
+
field_dict.update(self.additional_properties)
|
|
39
|
+
field_dict.update(
|
|
40
|
+
{
|
|
41
|
+
"loc": loc,
|
|
42
|
+
"msg": msg,
|
|
43
|
+
"type": type_,
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
return field_dict
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
51
|
+
d = dict(src_dict)
|
|
52
|
+
loc = []
|
|
53
|
+
_loc = d.pop("loc")
|
|
54
|
+
for loc_item_data in _loc:
|
|
55
|
+
|
|
56
|
+
def _parse_loc_item(data: object) -> int | str:
|
|
57
|
+
return cast(int | str, data)
|
|
58
|
+
|
|
59
|
+
loc_item = _parse_loc_item(loc_item_data)
|
|
60
|
+
|
|
61
|
+
loc.append(loc_item)
|
|
62
|
+
|
|
63
|
+
msg = d.pop("msg")
|
|
64
|
+
|
|
65
|
+
type_ = d.pop("type")
|
|
66
|
+
|
|
67
|
+
validation_error = cls(
|
|
68
|
+
loc=loc,
|
|
69
|
+
msg=msg,
|
|
70
|
+
type_=type_,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
validation_error.additional_properties = d
|
|
74
|
+
return validation_error
|
|
75
|
+
|
|
76
|
+
@property
|
|
77
|
+
def additional_keys(self) -> list[str]:
|
|
78
|
+
return list(self.additional_properties.keys())
|
|
79
|
+
|
|
80
|
+
def __getitem__(self, key: str) -> Any:
|
|
81
|
+
return self.additional_properties[key]
|
|
82
|
+
|
|
83
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
84
|
+
self.additional_properties[key] = value
|
|
85
|
+
|
|
86
|
+
def __delitem__(self, key: str) -> None:
|
|
87
|
+
del self.additional_properties[key]
|
|
88
|
+
|
|
89
|
+
def __contains__(self, key: str) -> bool:
|
|
90
|
+
return key in self.additional_properties
|