scorable 1.6.4__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 scorable might be problematic. Click here for more details.
- root/__about__.py +4 -0
- root/__init__.py +17 -0
- root/client.py +207 -0
- root/datasets.py +231 -0
- root/execution_logs.py +162 -0
- root/generated/__init__.py +0 -0
- root/generated/openapi_aclient/__init__.py +1 -0
- root/generated/openapi_aclient/api/__init__.py +1 -0
- root/generated/openapi_aclient/api/datasets_api.py +1274 -0
- root/generated/openapi_aclient/api/evaluators_api.py +3641 -0
- root/generated/openapi_aclient/api/execution_logs_api.py +751 -0
- root/generated/openapi_aclient/api/judges_api.py +3794 -0
- root/generated/openapi_aclient/api/models_api.py +1473 -0
- root/generated/openapi_aclient/api/objectives_api.py +1767 -0
- root/generated/openapi_aclient/api_client.py +662 -0
- root/generated/openapi_aclient/api_response.py +22 -0
- root/generated/openapi_aclient/configuration.py +470 -0
- root/generated/openapi_aclient/exceptions.py +197 -0
- root/generated/openapi_aclient/models/__init__.py +122 -0
- root/generated/openapi_aclient/models/data_set_create.py +118 -0
- root/generated/openapi_aclient/models/data_set_create_request.py +105 -0
- root/generated/openapi_aclient/models/data_set_list.py +129 -0
- root/generated/openapi_aclient/models/data_set_type.py +36 -0
- root/generated/openapi_aclient/models/dataset_range_request.py +93 -0
- root/generated/openapi_aclient/models/evaluator.py +273 -0
- root/generated/openapi_aclient/models/evaluator_calibration_output.py +101 -0
- root/generated/openapi_aclient/models/evaluator_calibration_result.py +134 -0
- root/generated/openapi_aclient/models/evaluator_demonstrations.py +107 -0
- root/generated/openapi_aclient/models/evaluator_demonstrations_request.py +107 -0
- root/generated/openapi_aclient/models/evaluator_execution_function_parameter_property_request.py +86 -0
- root/generated/openapi_aclient/models/evaluator_execution_function_parameter_request.py +109 -0
- root/generated/openapi_aclient/models/evaluator_execution_function_parameter_type_enum.py +35 -0
- root/generated/openapi_aclient/models/evaluator_execution_function_request.py +99 -0
- root/generated/openapi_aclient/models/evaluator_execution_functions_request.py +98 -0
- root/generated/openapi_aclient/models/evaluator_execution_functions_type_enum.py +35 -0
- root/generated/openapi_aclient/models/evaluator_execution_request.py +134 -0
- root/generated/openapi_aclient/models/evaluator_execution_result.py +114 -0
- root/generated/openapi_aclient/models/evaluator_inputs_value.py +100 -0
- root/generated/openapi_aclient/models/evaluator_inputs_value_items.py +89 -0
- root/generated/openapi_aclient/models/evaluator_list_output.py +198 -0
- root/generated/openapi_aclient/models/evaluator_reference.py +90 -0
- root/generated/openapi_aclient/models/evaluator_reference_request.py +90 -0
- root/generated/openapi_aclient/models/evaluator_request.py +194 -0
- root/generated/openapi_aclient/models/evaluator_result.py +110 -0
- root/generated/openapi_aclient/models/execution_log_details.py +291 -0
- root/generated/openapi_aclient/models/execution_log_details_evaluation_context.py +83 -0
- root/generated/openapi_aclient/models/execution_log_details_evaluator_latencies_inner.py +83 -0
- root/generated/openapi_aclient/models/execution_log_list.py +217 -0
- root/generated/openapi_aclient/models/execution_log_list_evaluation_context.py +83 -0
- root/generated/openapi_aclient/models/generation_model_params_request.py +93 -0
- root/generated/openapi_aclient/models/id.py +87 -0
- root/generated/openapi_aclient/models/input_variable.py +121 -0
- root/generated/openapi_aclient/models/input_variable_request.py +82 -0
- root/generated/openapi_aclient/models/judge.py +178 -0
- root/generated/openapi_aclient/models/judge_execution_request.py +114 -0
- root/generated/openapi_aclient/models/judge_execution_response.py +97 -0
- root/generated/openapi_aclient/models/judge_files_inner.py +84 -0
- root/generated/openapi_aclient/models/judge_generator_request.py +142 -0
- root/generated/openapi_aclient/models/judge_generator_response.py +88 -0
- root/generated/openapi_aclient/models/judge_invite_request.py +87 -0
- root/generated/openapi_aclient/models/judge_list.py +156 -0
- root/generated/openapi_aclient/models/judge_rectifier_request_request.py +114 -0
- root/generated/openapi_aclient/models/judge_rectifier_response.py +121 -0
- root/generated/openapi_aclient/models/judge_request.py +108 -0
- root/generated/openapi_aclient/models/model.py +126 -0
- root/generated/openapi_aclient/models/model_list.py +115 -0
- root/generated/openapi_aclient/models/model_params.py +89 -0
- root/generated/openapi_aclient/models/model_params_request.py +89 -0
- root/generated/openapi_aclient/models/model_request.py +118 -0
- root/generated/openapi_aclient/models/nested_evaluator.py +110 -0
- root/generated/openapi_aclient/models/nested_evaluator_objective.py +87 -0
- root/generated/openapi_aclient/models/nested_evaluator_request.py +92 -0
- root/generated/openapi_aclient/models/nested_objective_evaluator.py +105 -0
- root/generated/openapi_aclient/models/nested_objective_evaluator_request.py +92 -0
- root/generated/openapi_aclient/models/nested_objective_list.py +111 -0
- root/generated/openapi_aclient/models/nested_user_details.py +88 -0
- root/generated/openapi_aclient/models/nested_user_details_request.py +82 -0
- root/generated/openapi_aclient/models/nested_vector_objective.py +88 -0
- root/generated/openapi_aclient/models/nested_vector_objective_request.py +82 -0
- root/generated/openapi_aclient/models/objective.py +157 -0
- root/generated/openapi_aclient/models/objective_list.py +128 -0
- root/generated/openapi_aclient/models/objective_request.py +113 -0
- root/generated/openapi_aclient/models/objective_validator.py +100 -0
- root/generated/openapi_aclient/models/objective_validator_request.py +90 -0
- root/generated/openapi_aclient/models/paginated_data_set_list_list.py +111 -0
- root/generated/openapi_aclient/models/paginated_evaluator_list.py +111 -0
- root/generated/openapi_aclient/models/paginated_evaluator_list_output_list.py +111 -0
- root/generated/openapi_aclient/models/paginated_execution_log_list_list.py +111 -0
- root/generated/openapi_aclient/models/paginated_judge_list_list.py +111 -0
- root/generated/openapi_aclient/models/paginated_model_list_list.py +111 -0
- root/generated/openapi_aclient/models/paginated_objective_list.py +111 -0
- root/generated/openapi_aclient/models/paginated_objective_list_list.py +111 -0
- root/generated/openapi_aclient/models/patched_evaluator_request.py +194 -0
- root/generated/openapi_aclient/models/patched_judge_request.py +110 -0
- root/generated/openapi_aclient/models/patched_model_request.py +118 -0
- root/generated/openapi_aclient/models/patched_objective_request.py +113 -0
- root/generated/openapi_aclient/models/provider.py +99 -0
- root/generated/openapi_aclient/models/reference_variable.py +123 -0
- root/generated/openapi_aclient/models/reference_variable_request.py +83 -0
- root/generated/openapi_aclient/models/skill_execution_validator_result.py +130 -0
- root/generated/openapi_aclient/models/skill_test_data_request.py +107 -0
- root/generated/openapi_aclient/models/skill_test_data_request_dataset_range.py +93 -0
- root/generated/openapi_aclient/models/skill_test_input_request.py +171 -0
- root/generated/openapi_aclient/models/skill_type_enum.py +36 -0
- root/generated/openapi_aclient/models/status_change.py +84 -0
- root/generated/openapi_aclient/models/status_change_request.py +84 -0
- root/generated/openapi_aclient/models/status_change_status_enum.py +36 -0
- root/generated/openapi_aclient/models/status_enum.py +38 -0
- root/generated/openapi_aclient/models/validation_result_status.py +36 -0
- root/generated/openapi_aclient/models/visibility_enum.py +38 -0
- root/generated/openapi_aclient/rest.py +166 -0
- root/generated/openapi_aclient_README.md +239 -0
- root/generated/openapi_client/__init__.py +1 -0
- root/generated/openapi_client/api/__init__.py +1 -0
- root/generated/openapi_client/api/datasets_api.py +1274 -0
- root/generated/openapi_client/api/evaluators_api.py +3641 -0
- root/generated/openapi_client/api/execution_logs_api.py +751 -0
- root/generated/openapi_client/api/judges_api.py +3794 -0
- root/generated/openapi_client/api/models_api.py +1473 -0
- root/generated/openapi_client/api/objectives_api.py +1767 -0
- root/generated/openapi_client/api_client.py +659 -0
- root/generated/openapi_client/api_response.py +22 -0
- root/generated/openapi_client/configuration.py +474 -0
- root/generated/openapi_client/exceptions.py +197 -0
- root/generated/openapi_client/models/__init__.py +120 -0
- root/generated/openapi_client/models/data_set_create.py +118 -0
- root/generated/openapi_client/models/data_set_create_request.py +105 -0
- root/generated/openapi_client/models/data_set_list.py +129 -0
- root/generated/openapi_client/models/data_set_type.py +36 -0
- root/generated/openapi_client/models/dataset_range_request.py +93 -0
- root/generated/openapi_client/models/evaluator.py +273 -0
- root/generated/openapi_client/models/evaluator_calibration_output.py +101 -0
- root/generated/openapi_client/models/evaluator_calibration_result.py +134 -0
- root/generated/openapi_client/models/evaluator_demonstrations.py +107 -0
- root/generated/openapi_client/models/evaluator_demonstrations_request.py +107 -0
- root/generated/openapi_client/models/evaluator_execution_function_parameter_property_request.py +86 -0
- root/generated/openapi_client/models/evaluator_execution_function_parameter_request.py +109 -0
- root/generated/openapi_client/models/evaluator_execution_function_parameter_type_enum.py +35 -0
- root/generated/openapi_client/models/evaluator_execution_function_request.py +99 -0
- root/generated/openapi_client/models/evaluator_execution_functions_request.py +98 -0
- root/generated/openapi_client/models/evaluator_execution_functions_type_enum.py +35 -0
- root/generated/openapi_client/models/evaluator_execution_request.py +134 -0
- root/generated/openapi_client/models/evaluator_execution_result.py +114 -0
- root/generated/openapi_client/models/evaluator_inputs_value.py +100 -0
- root/generated/openapi_client/models/evaluator_inputs_value_items.py +89 -0
- root/generated/openapi_client/models/evaluator_list_output.py +198 -0
- root/generated/openapi_client/models/evaluator_reference.py +90 -0
- root/generated/openapi_client/models/evaluator_reference_request.py +90 -0
- root/generated/openapi_client/models/evaluator_request.py +194 -0
- root/generated/openapi_client/models/evaluator_result.py +110 -0
- root/generated/openapi_client/models/execution_log_details.py +291 -0
- root/generated/openapi_client/models/execution_log_details_evaluation_context.py +83 -0
- root/generated/openapi_client/models/execution_log_details_evaluator_latencies_inner.py +83 -0
- root/generated/openapi_client/models/execution_log_list.py +215 -0
- root/generated/openapi_client/models/execution_log_list_evaluation_context.py +83 -0
- root/generated/openapi_client/models/generation_model_params_request.py +93 -0
- root/generated/openapi_client/models/id.py +87 -0
- root/generated/openapi_client/models/input_variable.py +121 -0
- root/generated/openapi_client/models/input_variable_request.py +82 -0
- root/generated/openapi_client/models/judge.py +178 -0
- root/generated/openapi_client/models/judge_execution_request.py +114 -0
- root/generated/openapi_client/models/judge_execution_response.py +97 -0
- root/generated/openapi_client/models/judge_files_inner.py +84 -0
- root/generated/openapi_client/models/judge_generator_request.py +142 -0
- root/generated/openapi_client/models/judge_generator_response.py +88 -0
- root/generated/openapi_client/models/judge_invite_request.py +87 -0
- root/generated/openapi_client/models/judge_list.py +156 -0
- root/generated/openapi_client/models/judge_rectifier_request_request.py +114 -0
- root/generated/openapi_client/models/judge_rectifier_response.py +121 -0
- root/generated/openapi_client/models/judge_request.py +108 -0
- root/generated/openapi_client/models/model.py +126 -0
- root/generated/openapi_client/models/model_list.py +115 -0
- root/generated/openapi_client/models/model_params.py +89 -0
- root/generated/openapi_client/models/model_params_request.py +89 -0
- root/generated/openapi_client/models/model_request.py +118 -0
- root/generated/openapi_client/models/nested_evaluator.py +110 -0
- root/generated/openapi_client/models/nested_evaluator_objective.py +87 -0
- root/generated/openapi_client/models/nested_evaluator_request.py +92 -0
- root/generated/openapi_client/models/nested_objective_evaluator.py +105 -0
- root/generated/openapi_client/models/nested_objective_evaluator_request.py +92 -0
- root/generated/openapi_client/models/nested_objective_list.py +111 -0
- root/generated/openapi_client/models/nested_user_details.py +88 -0
- root/generated/openapi_client/models/nested_user_details_request.py +82 -0
- root/generated/openapi_client/models/nested_vector_objective.py +88 -0
- root/generated/openapi_client/models/nested_vector_objective_request.py +82 -0
- root/generated/openapi_client/models/objective.py +157 -0
- root/generated/openapi_client/models/objective_list.py +128 -0
- root/generated/openapi_client/models/objective_request.py +113 -0
- root/generated/openapi_client/models/objective_validator.py +100 -0
- root/generated/openapi_client/models/objective_validator_request.py +90 -0
- root/generated/openapi_client/models/paginated_data_set_list_list.py +111 -0
- root/generated/openapi_client/models/paginated_evaluator_list.py +111 -0
- root/generated/openapi_client/models/paginated_evaluator_list_output_list.py +111 -0
- root/generated/openapi_client/models/paginated_execution_log_list_list.py +111 -0
- root/generated/openapi_client/models/paginated_judge_list_list.py +111 -0
- root/generated/openapi_client/models/paginated_model_list_list.py +111 -0
- root/generated/openapi_client/models/paginated_objective_list.py +111 -0
- root/generated/openapi_client/models/paginated_objective_list_list.py +111 -0
- root/generated/openapi_client/models/patched_evaluator_request.py +194 -0
- root/generated/openapi_client/models/patched_judge_request.py +110 -0
- root/generated/openapi_client/models/patched_model_request.py +118 -0
- root/generated/openapi_client/models/patched_objective_request.py +113 -0
- root/generated/openapi_client/models/provider.py +99 -0
- root/generated/openapi_client/models/reference_variable.py +123 -0
- root/generated/openapi_client/models/reference_variable_request.py +83 -0
- root/generated/openapi_client/models/skill_execution_validator_result.py +130 -0
- root/generated/openapi_client/models/skill_test_data_request.py +107 -0
- root/generated/openapi_client/models/skill_test_data_request_dataset_range.py +93 -0
- root/generated/openapi_client/models/skill_test_input_request.py +171 -0
- root/generated/openapi_client/models/skill_type_enum.py +36 -0
- root/generated/openapi_client/models/status_change.py +84 -0
- root/generated/openapi_client/models/status_change_request.py +84 -0
- root/generated/openapi_client/models/status_change_status_enum.py +36 -0
- root/generated/openapi_client/models/status_enum.py +38 -0
- root/generated/openapi_client/models/validation_result_status.py +36 -0
- root/generated/openapi_client/models/visibility_enum.py +38 -0
- root/generated/openapi_client/rest.py +203 -0
- root/generated/openapi_client_README.md +238 -0
- root/judges.py +681 -0
- root/models.py +197 -0
- root/objectives.py +343 -0
- root/py.typed +0 -0
- root/skills.py +1707 -0
- root/utils.py +90 -0
- scorable-1.6.4.dist-info/METADATA +395 -0
- scorable-1.6.4.dist-info/RECORD +228 -0
- scorable-1.6.4.dist-info/WHEEL +4 -0
- scorable-1.6.4.dist-info/licenses/LICENSE +202 -0
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Root Signals API
|
|
5
|
+
|
|
6
|
+
Root Signals JSON API provides a way to access Root Signals using provisioned API token
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0 (latest)
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
from datetime import datetime
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set, Union
|
|
21
|
+
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
from root.generated.openapi_aclient.models.execution_log_details_evaluation_context import (
|
|
26
|
+
ExecutionLogDetailsEvaluationContext,
|
|
27
|
+
)
|
|
28
|
+
from root.generated.openapi_aclient.models.execution_log_details_evaluator_latencies_inner import (
|
|
29
|
+
ExecutionLogDetailsEvaluatorLatenciesInner,
|
|
30
|
+
)
|
|
31
|
+
from root.generated.openapi_aclient.models.model_params import ModelParams
|
|
32
|
+
from root.generated.openapi_aclient.models.nested_user_details import NestedUserDetails
|
|
33
|
+
from root.generated.openapi_aclient.models.skill_execution_validator_result import SkillExecutionValidatorResult
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class ExecutionLogDetails(BaseModel):
|
|
37
|
+
"""
|
|
38
|
+
ExecutionLogDetails
|
|
39
|
+
""" # noqa: E501
|
|
40
|
+
|
|
41
|
+
chat_id: Optional[StrictStr]
|
|
42
|
+
cost: Optional[Union[StrictFloat, StrictInt]]
|
|
43
|
+
created_at: Optional[datetime]
|
|
44
|
+
evaluation_context: ExecutionLogDetailsEvaluationContext
|
|
45
|
+
evaluator_latencies: Optional[List[ExecutionLogDetailsEvaluatorLatenciesInner]]
|
|
46
|
+
executed_item_id: Optional[StrictStr]
|
|
47
|
+
executed_item_name: StrictStr
|
|
48
|
+
executed_item_version_id: Optional[StrictStr]
|
|
49
|
+
execution_type: StrictStr
|
|
50
|
+
id: StrictStr
|
|
51
|
+
justification: StrictStr
|
|
52
|
+
llm_output: StrictStr
|
|
53
|
+
model_call_duration: Union[StrictFloat, StrictInt]
|
|
54
|
+
model_params: Optional[ModelParams] = None
|
|
55
|
+
model: StrictStr
|
|
56
|
+
owner: NestedUserDetails
|
|
57
|
+
parent_execution_log_id: Optional[StrictStr] = None
|
|
58
|
+
prompt_template: StrictStr
|
|
59
|
+
rendered_prompt: StrictStr
|
|
60
|
+
score: Optional[Union[StrictFloat, StrictInt]]
|
|
61
|
+
tags: List[StrictStr]
|
|
62
|
+
validation_results: List[SkillExecutionValidatorResult]
|
|
63
|
+
variables: Optional[Dict[str, StrictStr]]
|
|
64
|
+
__properties: ClassVar[List[str]] = [
|
|
65
|
+
"chat_id",
|
|
66
|
+
"cost",
|
|
67
|
+
"created_at",
|
|
68
|
+
"evaluation_context",
|
|
69
|
+
"evaluator_latencies",
|
|
70
|
+
"executed_item_id",
|
|
71
|
+
"executed_item_name",
|
|
72
|
+
"executed_item_version_id",
|
|
73
|
+
"execution_type",
|
|
74
|
+
"id",
|
|
75
|
+
"justification",
|
|
76
|
+
"llm_output",
|
|
77
|
+
"model_call_duration",
|
|
78
|
+
"model_params",
|
|
79
|
+
"model",
|
|
80
|
+
"owner",
|
|
81
|
+
"parent_execution_log_id",
|
|
82
|
+
"prompt_template",
|
|
83
|
+
"rendered_prompt",
|
|
84
|
+
"score",
|
|
85
|
+
"tags",
|
|
86
|
+
"validation_results",
|
|
87
|
+
"variables",
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
model_config = ConfigDict(
|
|
91
|
+
populate_by_name=True,
|
|
92
|
+
validate_assignment=True,
|
|
93
|
+
protected_namespaces=(),
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
def to_str(self) -> str:
|
|
97
|
+
"""Returns the string representation of the model using alias"""
|
|
98
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
99
|
+
|
|
100
|
+
def to_json(self) -> str:
|
|
101
|
+
"""Returns the JSON representation of the model using alias"""
|
|
102
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
103
|
+
return json.dumps(self.to_dict())
|
|
104
|
+
|
|
105
|
+
@classmethod
|
|
106
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
107
|
+
"""Create an instance of ExecutionLogDetails from a JSON string"""
|
|
108
|
+
return cls.from_dict(json.loads(json_str))
|
|
109
|
+
|
|
110
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
111
|
+
"""Return the dictionary representation of the model using alias.
|
|
112
|
+
|
|
113
|
+
This has the following differences from calling pydantic's
|
|
114
|
+
`self.model_dump(by_alias=True)`:
|
|
115
|
+
|
|
116
|
+
* `None` is only added to the output dict for nullable fields that
|
|
117
|
+
were set at model initialization. Other fields with value `None`
|
|
118
|
+
are ignored.
|
|
119
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
120
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
121
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
122
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
123
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
124
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
125
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
126
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
127
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
128
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
129
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
130
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
131
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
132
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
133
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
134
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
135
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
136
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
137
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
138
|
+
"""
|
|
139
|
+
excluded_fields: Set[str] = set(
|
|
140
|
+
[
|
|
141
|
+
"chat_id",
|
|
142
|
+
"cost",
|
|
143
|
+
"created_at",
|
|
144
|
+
"evaluator_latencies",
|
|
145
|
+
"executed_item_id",
|
|
146
|
+
"executed_item_name",
|
|
147
|
+
"executed_item_version_id",
|
|
148
|
+
"execution_type",
|
|
149
|
+
"id",
|
|
150
|
+
"justification",
|
|
151
|
+
"llm_output",
|
|
152
|
+
"model",
|
|
153
|
+
"owner",
|
|
154
|
+
"prompt_template",
|
|
155
|
+
"rendered_prompt",
|
|
156
|
+
"score",
|
|
157
|
+
"tags",
|
|
158
|
+
"validation_results",
|
|
159
|
+
"variables",
|
|
160
|
+
]
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
_dict = self.model_dump(
|
|
164
|
+
by_alias=True,
|
|
165
|
+
exclude=excluded_fields,
|
|
166
|
+
exclude_none=True,
|
|
167
|
+
)
|
|
168
|
+
# override the default output from pydantic by calling `to_dict()` of evaluation_context
|
|
169
|
+
if self.evaluation_context:
|
|
170
|
+
_dict["evaluation_context"] = self.evaluation_context.to_dict()
|
|
171
|
+
# override the default output from pydantic by calling `to_dict()` of each item in evaluator_latencies (list)
|
|
172
|
+
_items = []
|
|
173
|
+
if self.evaluator_latencies:
|
|
174
|
+
for _item in self.evaluator_latencies:
|
|
175
|
+
if _item:
|
|
176
|
+
_items.append(_item.to_dict())
|
|
177
|
+
_dict["evaluator_latencies"] = _items
|
|
178
|
+
# override the default output from pydantic by calling `to_dict()` of model_params
|
|
179
|
+
if self.model_params:
|
|
180
|
+
_dict["model_params"] = self.model_params.to_dict()
|
|
181
|
+
# override the default output from pydantic by calling `to_dict()` of owner
|
|
182
|
+
if self.owner:
|
|
183
|
+
_dict["owner"] = self.owner.to_dict()
|
|
184
|
+
# override the default output from pydantic by calling `to_dict()` of each item in validation_results (list)
|
|
185
|
+
_items = []
|
|
186
|
+
if self.validation_results:
|
|
187
|
+
for _item in self.validation_results:
|
|
188
|
+
if _item:
|
|
189
|
+
_items.append(_item.to_dict())
|
|
190
|
+
_dict["validation_results"] = _items
|
|
191
|
+
# set to None if chat_id (nullable) is None
|
|
192
|
+
# and model_fields_set contains the field
|
|
193
|
+
if self.chat_id is None and "chat_id" in self.model_fields_set:
|
|
194
|
+
_dict["chat_id"] = None
|
|
195
|
+
|
|
196
|
+
# set to None if cost (nullable) is None
|
|
197
|
+
# and model_fields_set contains the field
|
|
198
|
+
if self.cost is None and "cost" in self.model_fields_set:
|
|
199
|
+
_dict["cost"] = None
|
|
200
|
+
|
|
201
|
+
# set to None if created_at (nullable) is None
|
|
202
|
+
# and model_fields_set contains the field
|
|
203
|
+
if self.created_at is None and "created_at" in self.model_fields_set:
|
|
204
|
+
_dict["created_at"] = None
|
|
205
|
+
|
|
206
|
+
# set to None if evaluator_latencies (nullable) is None
|
|
207
|
+
# and model_fields_set contains the field
|
|
208
|
+
if self.evaluator_latencies is None and "evaluator_latencies" in self.model_fields_set:
|
|
209
|
+
_dict["evaluator_latencies"] = None
|
|
210
|
+
|
|
211
|
+
# set to None if executed_item_id (nullable) is None
|
|
212
|
+
# and model_fields_set contains the field
|
|
213
|
+
if self.executed_item_id is None and "executed_item_id" in self.model_fields_set:
|
|
214
|
+
_dict["executed_item_id"] = None
|
|
215
|
+
|
|
216
|
+
# set to None if executed_item_version_id (nullable) is None
|
|
217
|
+
# and model_fields_set contains the field
|
|
218
|
+
if self.executed_item_version_id is None and "executed_item_version_id" in self.model_fields_set:
|
|
219
|
+
_dict["executed_item_version_id"] = None
|
|
220
|
+
|
|
221
|
+
# set to None if model_params (nullable) is None
|
|
222
|
+
# and model_fields_set contains the field
|
|
223
|
+
if self.model_params is None and "model_params" in self.model_fields_set:
|
|
224
|
+
_dict["model_params"] = None
|
|
225
|
+
|
|
226
|
+
# set to None if parent_execution_log_id (nullable) is None
|
|
227
|
+
# and model_fields_set contains the field
|
|
228
|
+
if self.parent_execution_log_id is None and "parent_execution_log_id" in self.model_fields_set:
|
|
229
|
+
_dict["parent_execution_log_id"] = None
|
|
230
|
+
|
|
231
|
+
# set to None if score (nullable) is None
|
|
232
|
+
# and model_fields_set contains the field
|
|
233
|
+
if self.score is None and "score" in self.model_fields_set:
|
|
234
|
+
_dict["score"] = None
|
|
235
|
+
|
|
236
|
+
# set to None if variables (nullable) is None
|
|
237
|
+
# and model_fields_set contains the field
|
|
238
|
+
if self.variables is None and "variables" in self.model_fields_set:
|
|
239
|
+
_dict["variables"] = None
|
|
240
|
+
|
|
241
|
+
return _dict
|
|
242
|
+
|
|
243
|
+
@classmethod
|
|
244
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
245
|
+
"""Create an instance of ExecutionLogDetails from a dict"""
|
|
246
|
+
if obj is None:
|
|
247
|
+
return None
|
|
248
|
+
|
|
249
|
+
if not isinstance(obj, dict):
|
|
250
|
+
return cls.model_validate(obj)
|
|
251
|
+
|
|
252
|
+
_obj = cls.model_validate(
|
|
253
|
+
{
|
|
254
|
+
"chat_id": obj.get("chat_id"),
|
|
255
|
+
"cost": obj.get("cost"),
|
|
256
|
+
"created_at": obj.get("created_at"),
|
|
257
|
+
"evaluation_context": ExecutionLogDetailsEvaluationContext.from_dict(obj["evaluation_context"])
|
|
258
|
+
if obj.get("evaluation_context") is not None
|
|
259
|
+
else None,
|
|
260
|
+
"evaluator_latencies": [
|
|
261
|
+
ExecutionLogDetailsEvaluatorLatenciesInner.from_dict(_item) for _item in obj["evaluator_latencies"]
|
|
262
|
+
]
|
|
263
|
+
if obj.get("evaluator_latencies") is not None
|
|
264
|
+
else None,
|
|
265
|
+
"executed_item_id": obj.get("executed_item_id"),
|
|
266
|
+
"executed_item_name": obj.get("executed_item_name"),
|
|
267
|
+
"executed_item_version_id": obj.get("executed_item_version_id"),
|
|
268
|
+
"execution_type": obj.get("execution_type"),
|
|
269
|
+
"id": obj.get("id"),
|
|
270
|
+
"justification": obj.get("justification"),
|
|
271
|
+
"llm_output": obj.get("llm_output"),
|
|
272
|
+
"model_call_duration": obj.get("model_call_duration"),
|
|
273
|
+
"model_params": ModelParams.from_dict(obj["model_params"])
|
|
274
|
+
if obj.get("model_params") is not None
|
|
275
|
+
else None,
|
|
276
|
+
"model": obj.get("model"),
|
|
277
|
+
"owner": NestedUserDetails.from_dict(obj["owner"]) if obj.get("owner") is not None else None,
|
|
278
|
+
"parent_execution_log_id": obj.get("parent_execution_log_id"),
|
|
279
|
+
"prompt_template": obj.get("prompt_template"),
|
|
280
|
+
"rendered_prompt": obj.get("rendered_prompt"),
|
|
281
|
+
"score": obj.get("score"),
|
|
282
|
+
"tags": obj.get("tags"),
|
|
283
|
+
"validation_results": [
|
|
284
|
+
SkillExecutionValidatorResult.from_dict(_item) for _item in obj["validation_results"]
|
|
285
|
+
]
|
|
286
|
+
if obj.get("validation_results") is not None
|
|
287
|
+
else None,
|
|
288
|
+
"variables": obj.get("variables"),
|
|
289
|
+
}
|
|
290
|
+
)
|
|
291
|
+
return _obj
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Root Signals API
|
|
5
|
+
|
|
6
|
+
Root Signals JSON API provides a way to access Root Signals using provisioned API token
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0 (latest)
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
22
|
+
from typing_extensions import Self
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class ExecutionLogDetailsEvaluationContext(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
ExecutionLogDetailsEvaluationContext
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
|
|
30
|
+
contexts: Optional[List[StrictStr]] = None
|
|
31
|
+
expected_output: Optional[StrictStr] = None
|
|
32
|
+
__properties: ClassVar[List[str]] = ["contexts", "expected_output"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of ExecutionLogDetailsEvaluationContext from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([])
|
|
65
|
+
|
|
66
|
+
_dict = self.model_dump(
|
|
67
|
+
by_alias=True,
|
|
68
|
+
exclude=excluded_fields,
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
return _dict
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of ExecutionLogDetailsEvaluationContext from a dict"""
|
|
76
|
+
if obj is None:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
if not isinstance(obj, dict):
|
|
80
|
+
return cls.model_validate(obj)
|
|
81
|
+
|
|
82
|
+
_obj = cls.model_validate({"contexts": obj.get("contexts"), "expected_output": obj.get("expected_output")})
|
|
83
|
+
return _obj
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Root Signals API
|
|
5
|
+
|
|
6
|
+
Root Signals JSON API provides a way to access Root Signals using provisioned API token
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0 (latest)
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set, Union
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
|
|
22
|
+
from typing_extensions import Self
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class ExecutionLogDetailsEvaluatorLatenciesInner(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
ExecutionLogDetailsEvaluatorLatenciesInner
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
|
|
30
|
+
evaluator_name: Optional[StrictStr] = None
|
|
31
|
+
duration: Optional[Union[StrictFloat, StrictInt]] = None
|
|
32
|
+
__properties: ClassVar[List[str]] = ["evaluator_name", "duration"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of ExecutionLogDetailsEvaluatorLatenciesInner from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([])
|
|
65
|
+
|
|
66
|
+
_dict = self.model_dump(
|
|
67
|
+
by_alias=True,
|
|
68
|
+
exclude=excluded_fields,
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
return _dict
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of ExecutionLogDetailsEvaluatorLatenciesInner from a dict"""
|
|
76
|
+
if obj is None:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
if not isinstance(obj, dict):
|
|
80
|
+
return cls.model_validate(obj)
|
|
81
|
+
|
|
82
|
+
_obj = cls.model_validate({"evaluator_name": obj.get("evaluator_name"), "duration": obj.get("duration")})
|
|
83
|
+
return _obj
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Root Signals API
|
|
5
|
+
|
|
6
|
+
Root Signals JSON API provides a way to access Root Signals using provisioned API token
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0 (latest)
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
from datetime import datetime
|
|
20
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set, Union
|
|
21
|
+
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
from root.generated.openapi_aclient.models.execution_log_list_evaluation_context import (
|
|
26
|
+
ExecutionLogListEvaluationContext,
|
|
27
|
+
)
|
|
28
|
+
from root.generated.openapi_aclient.models.nested_user_details import NestedUserDetails
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class ExecutionLogList(BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
ExecutionLogList
|
|
34
|
+
""" # noqa: E501
|
|
35
|
+
|
|
36
|
+
cost: Optional[Union[StrictFloat, StrictInt]]
|
|
37
|
+
created_at: Optional[datetime]
|
|
38
|
+
evaluation_context: Optional[ExecutionLogListEvaluationContext]
|
|
39
|
+
executed_item_id: Optional[StrictStr]
|
|
40
|
+
executed_item_name: StrictStr
|
|
41
|
+
executed_item_version_id: Optional[StrictStr]
|
|
42
|
+
execution_type: StrictStr
|
|
43
|
+
id: StrictStr
|
|
44
|
+
llm_output: Optional[StrictStr] = Field(
|
|
45
|
+
description="The raw output from the LLM model. Only included when explicitly requested with include=llm_output parameter."
|
|
46
|
+
)
|
|
47
|
+
owner: NestedUserDetails
|
|
48
|
+
parent_execution_log_id: Optional[StrictStr] = None
|
|
49
|
+
score: Optional[Union[StrictFloat, StrictInt]]
|
|
50
|
+
tags: List[StrictStr]
|
|
51
|
+
variables: Optional[Dict[str, StrictStr]] = Field(
|
|
52
|
+
description="The variables used in the execution. Only included when explicitly requested with include=variables parameter."
|
|
53
|
+
)
|
|
54
|
+
__properties: ClassVar[List[str]] = [
|
|
55
|
+
"cost",
|
|
56
|
+
"created_at",
|
|
57
|
+
"evaluation_context",
|
|
58
|
+
"executed_item_id",
|
|
59
|
+
"executed_item_name",
|
|
60
|
+
"executed_item_version_id",
|
|
61
|
+
"execution_type",
|
|
62
|
+
"id",
|
|
63
|
+
"llm_output",
|
|
64
|
+
"owner",
|
|
65
|
+
"parent_execution_log_id",
|
|
66
|
+
"score",
|
|
67
|
+
"tags",
|
|
68
|
+
"variables",
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
model_config = ConfigDict(
|
|
72
|
+
populate_by_name=True,
|
|
73
|
+
validate_assignment=True,
|
|
74
|
+
protected_namespaces=(),
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
def to_str(self) -> str:
|
|
78
|
+
"""Returns the string representation of the model using alias"""
|
|
79
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
80
|
+
|
|
81
|
+
def to_json(self) -> str:
|
|
82
|
+
"""Returns the JSON representation of the model using alias"""
|
|
83
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
84
|
+
return json.dumps(self.to_dict())
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
88
|
+
"""Create an instance of ExecutionLogList from a JSON string"""
|
|
89
|
+
return cls.from_dict(json.loads(json_str))
|
|
90
|
+
|
|
91
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
92
|
+
"""Return the dictionary representation of the model using alias.
|
|
93
|
+
|
|
94
|
+
This has the following differences from calling pydantic's
|
|
95
|
+
`self.model_dump(by_alias=True)`:
|
|
96
|
+
|
|
97
|
+
* `None` is only added to the output dict for nullable fields that
|
|
98
|
+
were set at model initialization. Other fields with value `None`
|
|
99
|
+
are ignored.
|
|
100
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
101
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
102
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
103
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
104
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
105
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
106
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
107
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
108
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
109
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
110
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
111
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
112
|
+
"""
|
|
113
|
+
excluded_fields: Set[str] = set(
|
|
114
|
+
[
|
|
115
|
+
"cost",
|
|
116
|
+
"created_at",
|
|
117
|
+
"executed_item_id",
|
|
118
|
+
"executed_item_name",
|
|
119
|
+
"executed_item_version_id",
|
|
120
|
+
"execution_type",
|
|
121
|
+
"id",
|
|
122
|
+
"llm_output",
|
|
123
|
+
"owner",
|
|
124
|
+
"score",
|
|
125
|
+
"tags",
|
|
126
|
+
"variables",
|
|
127
|
+
]
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
_dict = self.model_dump(
|
|
131
|
+
by_alias=True,
|
|
132
|
+
exclude=excluded_fields,
|
|
133
|
+
exclude_none=True,
|
|
134
|
+
)
|
|
135
|
+
# override the default output from pydantic by calling `to_dict()` of evaluation_context
|
|
136
|
+
if self.evaluation_context:
|
|
137
|
+
_dict["evaluation_context"] = self.evaluation_context.to_dict()
|
|
138
|
+
# override the default output from pydantic by calling `to_dict()` of owner
|
|
139
|
+
if self.owner:
|
|
140
|
+
_dict["owner"] = self.owner.to_dict()
|
|
141
|
+
# set to None if cost (nullable) is None
|
|
142
|
+
# and model_fields_set contains the field
|
|
143
|
+
if self.cost is None and "cost" in self.model_fields_set:
|
|
144
|
+
_dict["cost"] = None
|
|
145
|
+
|
|
146
|
+
# set to None if created_at (nullable) is None
|
|
147
|
+
# and model_fields_set contains the field
|
|
148
|
+
if self.created_at is None and "created_at" in self.model_fields_set:
|
|
149
|
+
_dict["created_at"] = None
|
|
150
|
+
|
|
151
|
+
# set to None if evaluation_context (nullable) is None
|
|
152
|
+
# and model_fields_set contains the field
|
|
153
|
+
if self.evaluation_context is None and "evaluation_context" in self.model_fields_set:
|
|
154
|
+
_dict["evaluation_context"] = None
|
|
155
|
+
|
|
156
|
+
# set to None if executed_item_id (nullable) is None
|
|
157
|
+
# and model_fields_set contains the field
|
|
158
|
+
if self.executed_item_id is None and "executed_item_id" in self.model_fields_set:
|
|
159
|
+
_dict["executed_item_id"] = None
|
|
160
|
+
|
|
161
|
+
# set to None if executed_item_version_id (nullable) is None
|
|
162
|
+
# and model_fields_set contains the field
|
|
163
|
+
if self.executed_item_version_id is None and "executed_item_version_id" in self.model_fields_set:
|
|
164
|
+
_dict["executed_item_version_id"] = None
|
|
165
|
+
|
|
166
|
+
# set to None if llm_output (nullable) is None
|
|
167
|
+
# and model_fields_set contains the field
|
|
168
|
+
if self.llm_output is None and "llm_output" in self.model_fields_set:
|
|
169
|
+
_dict["llm_output"] = None
|
|
170
|
+
|
|
171
|
+
# set to None if parent_execution_log_id (nullable) is None
|
|
172
|
+
# and model_fields_set contains the field
|
|
173
|
+
if self.parent_execution_log_id is None and "parent_execution_log_id" in self.model_fields_set:
|
|
174
|
+
_dict["parent_execution_log_id"] = None
|
|
175
|
+
|
|
176
|
+
# set to None if score (nullable) is None
|
|
177
|
+
# and model_fields_set contains the field
|
|
178
|
+
if self.score is None and "score" in self.model_fields_set:
|
|
179
|
+
_dict["score"] = None
|
|
180
|
+
|
|
181
|
+
# set to None if variables (nullable) is None
|
|
182
|
+
# and model_fields_set contains the field
|
|
183
|
+
if self.variables is None and "variables" in self.model_fields_set:
|
|
184
|
+
_dict["variables"] = None
|
|
185
|
+
|
|
186
|
+
return _dict
|
|
187
|
+
|
|
188
|
+
@classmethod
|
|
189
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
190
|
+
"""Create an instance of ExecutionLogList from a dict"""
|
|
191
|
+
if obj is None:
|
|
192
|
+
return None
|
|
193
|
+
|
|
194
|
+
if not isinstance(obj, dict):
|
|
195
|
+
return cls.model_validate(obj)
|
|
196
|
+
|
|
197
|
+
_obj = cls.model_validate(
|
|
198
|
+
{
|
|
199
|
+
"cost": obj.get("cost"),
|
|
200
|
+
"created_at": obj.get("created_at"),
|
|
201
|
+
"evaluation_context": ExecutionLogListEvaluationContext.from_dict(obj["evaluation_context"])
|
|
202
|
+
if obj.get("evaluation_context") is not None
|
|
203
|
+
else None,
|
|
204
|
+
"executed_item_id": obj.get("executed_item_id"),
|
|
205
|
+
"executed_item_name": obj.get("executed_item_name"),
|
|
206
|
+
"executed_item_version_id": obj.get("executed_item_version_id"),
|
|
207
|
+
"execution_type": obj.get("execution_type"),
|
|
208
|
+
"id": obj.get("id"),
|
|
209
|
+
"llm_output": obj.get("llm_output"),
|
|
210
|
+
"owner": NestedUserDetails.from_dict(obj["owner"]) if obj.get("owner") is not None else None,
|
|
211
|
+
"parent_execution_log_id": obj.get("parent_execution_log_id"),
|
|
212
|
+
"score": obj.get("score"),
|
|
213
|
+
"tags": obj.get("tags"),
|
|
214
|
+
"variables": obj.get("variables"),
|
|
215
|
+
}
|
|
216
|
+
)
|
|
217
|
+
return _obj
|