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,273 @@
|
|
|
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
|
|
21
|
+
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
23
|
+
from typing_extensions import Annotated, Self
|
|
24
|
+
|
|
25
|
+
from root.generated.openapi_aclient.models.evaluator_demonstrations import EvaluatorDemonstrations
|
|
26
|
+
from root.generated.openapi_aclient.models.evaluator_inputs_value import EvaluatorInputsValue
|
|
27
|
+
from root.generated.openapi_aclient.models.input_variable import InputVariable
|
|
28
|
+
from root.generated.openapi_aclient.models.model_params import ModelParams
|
|
29
|
+
from root.generated.openapi_aclient.models.nested_user_details import NestedUserDetails
|
|
30
|
+
from root.generated.openapi_aclient.models.objective import Objective
|
|
31
|
+
from root.generated.openapi_aclient.models.reference_variable import ReferenceVariable
|
|
32
|
+
from root.generated.openapi_aclient.models.skill_type_enum import SkillTypeEnum
|
|
33
|
+
from root.generated.openapi_aclient.models.status_enum import StatusEnum
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class Evaluator(BaseModel):
|
|
37
|
+
"""
|
|
38
|
+
Evaluator
|
|
39
|
+
""" # noqa: E501
|
|
40
|
+
|
|
41
|
+
change_note: Optional[StrictStr] = None
|
|
42
|
+
created_at: datetime
|
|
43
|
+
evaluator_demonstrations: Optional[List[EvaluatorDemonstrations]] = None
|
|
44
|
+
id: StrictStr
|
|
45
|
+
input_variables: Optional[List[InputVariable]] = None
|
|
46
|
+
model_params: Optional[ModelParams] = None
|
|
47
|
+
models: Optional[List[StrictStr]] = Field(
|
|
48
|
+
default=None,
|
|
49
|
+
description="Primary model (index 0) and an optional list of fallback models to use if the primary model is not available. If not provided, a default model will be used.",
|
|
50
|
+
)
|
|
51
|
+
name: Annotated[str, Field(min_length=2, strict=True, max_length=1000)]
|
|
52
|
+
objective: Optional[Objective]
|
|
53
|
+
owner: NestedUserDetails
|
|
54
|
+
prompt: Annotated[str, Field(strict=True, max_length=100000)]
|
|
55
|
+
reference_variables: Optional[List[ReferenceVariable]] = None
|
|
56
|
+
skill_type: SkillTypeEnum
|
|
57
|
+
status: Optional[StatusEnum] = None
|
|
58
|
+
system_message: Optional[StrictStr] = None
|
|
59
|
+
updated_at: Optional[datetime]
|
|
60
|
+
updated_by: Optional[NestedUserDetails]
|
|
61
|
+
version_id: StrictStr
|
|
62
|
+
meta: Optional[Any] = Field(alias="_meta")
|
|
63
|
+
inputs: Dict[str, EvaluatorInputsValue] = Field(
|
|
64
|
+
description="Schema defining the input parameters required for execution. The schema consists of variables defined in the prompt template (predicate) and special variables like functions, contexts, and expected output."
|
|
65
|
+
)
|
|
66
|
+
__properties: ClassVar[List[str]] = [
|
|
67
|
+
"change_note",
|
|
68
|
+
"created_at",
|
|
69
|
+
"evaluator_demonstrations",
|
|
70
|
+
"id",
|
|
71
|
+
"input_variables",
|
|
72
|
+
"model_params",
|
|
73
|
+
"models",
|
|
74
|
+
"name",
|
|
75
|
+
"objective",
|
|
76
|
+
"owner",
|
|
77
|
+
"prompt",
|
|
78
|
+
"reference_variables",
|
|
79
|
+
"skill_type",
|
|
80
|
+
"status",
|
|
81
|
+
"system_message",
|
|
82
|
+
"updated_at",
|
|
83
|
+
"updated_by",
|
|
84
|
+
"version_id",
|
|
85
|
+
"_meta",
|
|
86
|
+
"inputs",
|
|
87
|
+
]
|
|
88
|
+
|
|
89
|
+
model_config = ConfigDict(
|
|
90
|
+
populate_by_name=True,
|
|
91
|
+
validate_assignment=True,
|
|
92
|
+
protected_namespaces=(),
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
def to_str(self) -> str:
|
|
96
|
+
"""Returns the string representation of the model using alias"""
|
|
97
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
98
|
+
|
|
99
|
+
def to_json(self) -> str:
|
|
100
|
+
"""Returns the JSON representation of the model using alias"""
|
|
101
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
102
|
+
return json.dumps(self.to_dict())
|
|
103
|
+
|
|
104
|
+
@classmethod
|
|
105
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
106
|
+
"""Create an instance of Evaluator from a JSON string"""
|
|
107
|
+
return cls.from_dict(json.loads(json_str))
|
|
108
|
+
|
|
109
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
110
|
+
"""Return the dictionary representation of the model using alias.
|
|
111
|
+
|
|
112
|
+
This has the following differences from calling pydantic's
|
|
113
|
+
`self.model_dump(by_alias=True)`:
|
|
114
|
+
|
|
115
|
+
* `None` is only added to the output dict for nullable fields that
|
|
116
|
+
were set at model initialization. Other fields with value `None`
|
|
117
|
+
are ignored.
|
|
118
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
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
|
+
"""
|
|
129
|
+
excluded_fields: Set[str] = set(
|
|
130
|
+
[
|
|
131
|
+
"created_at",
|
|
132
|
+
"id",
|
|
133
|
+
"objective",
|
|
134
|
+
"owner",
|
|
135
|
+
"skill_type",
|
|
136
|
+
"updated_at",
|
|
137
|
+
"updated_by",
|
|
138
|
+
"version_id",
|
|
139
|
+
"meta",
|
|
140
|
+
"inputs",
|
|
141
|
+
]
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
_dict = self.model_dump(
|
|
145
|
+
by_alias=True,
|
|
146
|
+
exclude=excluded_fields,
|
|
147
|
+
exclude_none=True,
|
|
148
|
+
)
|
|
149
|
+
# override the default output from pydantic by calling `to_dict()` of each item in evaluator_demonstrations (list)
|
|
150
|
+
_items = []
|
|
151
|
+
if self.evaluator_demonstrations:
|
|
152
|
+
for _item in self.evaluator_demonstrations:
|
|
153
|
+
if _item:
|
|
154
|
+
_items.append(_item.to_dict())
|
|
155
|
+
_dict["evaluator_demonstrations"] = _items
|
|
156
|
+
# override the default output from pydantic by calling `to_dict()` of each item in input_variables (list)
|
|
157
|
+
_items = []
|
|
158
|
+
if self.input_variables:
|
|
159
|
+
for _item in self.input_variables:
|
|
160
|
+
if _item:
|
|
161
|
+
_items.append(_item.to_dict())
|
|
162
|
+
_dict["input_variables"] = _items
|
|
163
|
+
# override the default output from pydantic by calling `to_dict()` of model_params
|
|
164
|
+
if self.model_params:
|
|
165
|
+
_dict["model_params"] = self.model_params.to_dict()
|
|
166
|
+
# override the default output from pydantic by calling `to_dict()` of objective
|
|
167
|
+
if self.objective:
|
|
168
|
+
_dict["objective"] = self.objective.to_dict()
|
|
169
|
+
# override the default output from pydantic by calling `to_dict()` of owner
|
|
170
|
+
if self.owner:
|
|
171
|
+
_dict["owner"] = self.owner.to_dict()
|
|
172
|
+
# override the default output from pydantic by calling `to_dict()` of each item in reference_variables (list)
|
|
173
|
+
_items = []
|
|
174
|
+
if self.reference_variables:
|
|
175
|
+
for _item in self.reference_variables:
|
|
176
|
+
if _item:
|
|
177
|
+
_items.append(_item.to_dict())
|
|
178
|
+
_dict["reference_variables"] = _items
|
|
179
|
+
# override the default output from pydantic by calling `to_dict()` of updated_by
|
|
180
|
+
if self.updated_by:
|
|
181
|
+
_dict["updated_by"] = self.updated_by.to_dict()
|
|
182
|
+
# override the default output from pydantic by calling `to_dict()` of each value in inputs (dict)
|
|
183
|
+
_field_dict = {}
|
|
184
|
+
if self.inputs:
|
|
185
|
+
for _key in self.inputs:
|
|
186
|
+
if self.inputs[_key]:
|
|
187
|
+
_field_dict[_key] = self.inputs[_key].to_dict()
|
|
188
|
+
_dict["inputs"] = _field_dict
|
|
189
|
+
# set to None if change_note (nullable) is None
|
|
190
|
+
# and model_fields_set contains the field
|
|
191
|
+
if self.change_note is None and "change_note" in self.model_fields_set:
|
|
192
|
+
_dict["change_note"] = None
|
|
193
|
+
|
|
194
|
+
# set to None if evaluator_demonstrations (nullable) is None
|
|
195
|
+
# and model_fields_set contains the field
|
|
196
|
+
if self.evaluator_demonstrations is None and "evaluator_demonstrations" in self.model_fields_set:
|
|
197
|
+
_dict["evaluator_demonstrations"] = None
|
|
198
|
+
|
|
199
|
+
# set to None if model_params (nullable) is None
|
|
200
|
+
# and model_fields_set contains the field
|
|
201
|
+
if self.model_params is None and "model_params" in self.model_fields_set:
|
|
202
|
+
_dict["model_params"] = None
|
|
203
|
+
|
|
204
|
+
# set to None if objective (nullable) is None
|
|
205
|
+
# and model_fields_set contains the field
|
|
206
|
+
if self.objective is None and "objective" in self.model_fields_set:
|
|
207
|
+
_dict["objective"] = None
|
|
208
|
+
|
|
209
|
+
# set to None if updated_at (nullable) is None
|
|
210
|
+
# and model_fields_set contains the field
|
|
211
|
+
if self.updated_at is None and "updated_at" in self.model_fields_set:
|
|
212
|
+
_dict["updated_at"] = None
|
|
213
|
+
|
|
214
|
+
# set to None if updated_by (nullable) is None
|
|
215
|
+
# and model_fields_set contains the field
|
|
216
|
+
if self.updated_by is None and "updated_by" in self.model_fields_set:
|
|
217
|
+
_dict["updated_by"] = None
|
|
218
|
+
|
|
219
|
+
# set to None if meta (nullable) is None
|
|
220
|
+
# and model_fields_set contains the field
|
|
221
|
+
if self.meta is None and "meta" in self.model_fields_set:
|
|
222
|
+
_dict["_meta"] = None
|
|
223
|
+
|
|
224
|
+
return _dict
|
|
225
|
+
|
|
226
|
+
@classmethod
|
|
227
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
228
|
+
"""Create an instance of Evaluator from a dict"""
|
|
229
|
+
if obj is None:
|
|
230
|
+
return None
|
|
231
|
+
|
|
232
|
+
if not isinstance(obj, dict):
|
|
233
|
+
return cls.model_validate(obj)
|
|
234
|
+
|
|
235
|
+
_obj = cls.model_validate(
|
|
236
|
+
{
|
|
237
|
+
"change_note": obj.get("change_note"),
|
|
238
|
+
"created_at": obj.get("created_at"),
|
|
239
|
+
"evaluator_demonstrations": [
|
|
240
|
+
EvaluatorDemonstrations.from_dict(_item) for _item in obj["evaluator_demonstrations"]
|
|
241
|
+
]
|
|
242
|
+
if obj.get("evaluator_demonstrations") is not None
|
|
243
|
+
else None,
|
|
244
|
+
"id": obj.get("id"),
|
|
245
|
+
"input_variables": [InputVariable.from_dict(_item) for _item in obj["input_variables"]]
|
|
246
|
+
if obj.get("input_variables") is not None
|
|
247
|
+
else None,
|
|
248
|
+
"model_params": ModelParams.from_dict(obj["model_params"])
|
|
249
|
+
if obj.get("model_params") is not None
|
|
250
|
+
else None,
|
|
251
|
+
"models": obj.get("models"),
|
|
252
|
+
"name": obj.get("name"),
|
|
253
|
+
"objective": Objective.from_dict(obj["objective"]) if obj.get("objective") is not None else None,
|
|
254
|
+
"owner": NestedUserDetails.from_dict(obj["owner"]) if obj.get("owner") is not None else None,
|
|
255
|
+
"prompt": obj.get("prompt"),
|
|
256
|
+
"reference_variables": [ReferenceVariable.from_dict(_item) for _item in obj["reference_variables"]]
|
|
257
|
+
if obj.get("reference_variables") is not None
|
|
258
|
+
else None,
|
|
259
|
+
"skill_type": obj.get("skill_type"),
|
|
260
|
+
"status": obj.get("status"),
|
|
261
|
+
"system_message": obj.get("system_message"),
|
|
262
|
+
"updated_at": obj.get("updated_at"),
|
|
263
|
+
"updated_by": NestedUserDetails.from_dict(obj["updated_by"])
|
|
264
|
+
if obj.get("updated_by") is not None
|
|
265
|
+
else None,
|
|
266
|
+
"version_id": obj.get("version_id"),
|
|
267
|
+
"_meta": obj.get("_meta"),
|
|
268
|
+
"inputs": dict((_k, EvaluatorInputsValue.from_dict(_v)) for _k, _v in obj["inputs"].items())
|
|
269
|
+
if obj.get("inputs") is not None
|
|
270
|
+
else None,
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
return _obj
|
|
@@ -0,0 +1,101 @@
|
|
|
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, Field, StrictFloat, StrictInt
|
|
22
|
+
from typing_extensions import Self
|
|
23
|
+
|
|
24
|
+
from root.generated.openapi_aclient.models.evaluator_calibration_result import EvaluatorCalibrationResult
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class EvaluatorCalibrationOutput(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
EvaluatorCalibrationOutput
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
|
|
32
|
+
variables: Dict[str, Any]
|
|
33
|
+
model_call_duration: Optional[Union[StrictFloat, StrictInt]] = Field(
|
|
34
|
+
default=None, description="Deprecated, use result.model_call_duration instead."
|
|
35
|
+
)
|
|
36
|
+
row_number: StrictInt
|
|
37
|
+
result: EvaluatorCalibrationResult
|
|
38
|
+
__properties: ClassVar[List[str]] = ["variables", "model_call_duration", "row_number", "result"]
|
|
39
|
+
|
|
40
|
+
model_config = ConfigDict(
|
|
41
|
+
populate_by_name=True,
|
|
42
|
+
validate_assignment=True,
|
|
43
|
+
protected_namespaces=(),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
def to_str(self) -> str:
|
|
47
|
+
"""Returns the string representation of the model using alias"""
|
|
48
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
49
|
+
|
|
50
|
+
def to_json(self) -> str:
|
|
51
|
+
"""Returns the JSON representation of the model using alias"""
|
|
52
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
53
|
+
return json.dumps(self.to_dict())
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
57
|
+
"""Create an instance of EvaluatorCalibrationOutput from a JSON string"""
|
|
58
|
+
return cls.from_dict(json.loads(json_str))
|
|
59
|
+
|
|
60
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
61
|
+
"""Return the dictionary representation of the model using alias.
|
|
62
|
+
|
|
63
|
+
This has the following differences from calling pydantic's
|
|
64
|
+
`self.model_dump(by_alias=True)`:
|
|
65
|
+
|
|
66
|
+
* `None` is only added to the output dict for nullable fields that
|
|
67
|
+
were set at model initialization. Other fields with value `None`
|
|
68
|
+
are ignored.
|
|
69
|
+
"""
|
|
70
|
+
excluded_fields: Set[str] = set([])
|
|
71
|
+
|
|
72
|
+
_dict = self.model_dump(
|
|
73
|
+
by_alias=True,
|
|
74
|
+
exclude=excluded_fields,
|
|
75
|
+
exclude_none=True,
|
|
76
|
+
)
|
|
77
|
+
# override the default output from pydantic by calling `to_dict()` of result
|
|
78
|
+
if self.result:
|
|
79
|
+
_dict["result"] = self.result.to_dict()
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of EvaluatorCalibrationOutput from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate(
|
|
92
|
+
{
|
|
93
|
+
"variables": obj.get("variables"),
|
|
94
|
+
"model_call_duration": obj.get("model_call_duration"),
|
|
95
|
+
"row_number": obj.get("row_number"),
|
|
96
|
+
"result": EvaluatorCalibrationResult.from_dict(obj["result"])
|
|
97
|
+
if obj.get("result") is not None
|
|
98
|
+
else None,
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
return _obj
|
|
@@ -0,0 +1,134 @@
|
|
|
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 EvaluatorCalibrationResult(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
EvaluatorCalibrationResult
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
|
|
30
|
+
llm_output: StrictStr
|
|
31
|
+
model: StrictStr
|
|
32
|
+
execution_log_id: StrictStr
|
|
33
|
+
rendered_prompt: StrictStr
|
|
34
|
+
cost: Optional[Union[StrictFloat, StrictInt]]
|
|
35
|
+
model_call_duration: Optional[Union[StrictFloat, StrictInt]] = None
|
|
36
|
+
expected_score: Union[StrictFloat, StrictInt]
|
|
37
|
+
score: Optional[Union[StrictFloat, StrictInt]]
|
|
38
|
+
justification: Optional[StrictStr] = None
|
|
39
|
+
__properties: ClassVar[List[str]] = [
|
|
40
|
+
"llm_output",
|
|
41
|
+
"model",
|
|
42
|
+
"execution_log_id",
|
|
43
|
+
"rendered_prompt",
|
|
44
|
+
"cost",
|
|
45
|
+
"model_call_duration",
|
|
46
|
+
"expected_score",
|
|
47
|
+
"score",
|
|
48
|
+
"justification",
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
model_config = ConfigDict(
|
|
52
|
+
populate_by_name=True,
|
|
53
|
+
validate_assignment=True,
|
|
54
|
+
protected_namespaces=(),
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
def to_str(self) -> str:
|
|
58
|
+
"""Returns the string representation of the model using alias"""
|
|
59
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
60
|
+
|
|
61
|
+
def to_json(self) -> str:
|
|
62
|
+
"""Returns the JSON representation of the model using alias"""
|
|
63
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
64
|
+
return json.dumps(self.to_dict())
|
|
65
|
+
|
|
66
|
+
@classmethod
|
|
67
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
68
|
+
"""Create an instance of EvaluatorCalibrationResult from a JSON string"""
|
|
69
|
+
return cls.from_dict(json.loads(json_str))
|
|
70
|
+
|
|
71
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
72
|
+
"""Return the dictionary representation of the model using alias.
|
|
73
|
+
|
|
74
|
+
This has the following differences from calling pydantic's
|
|
75
|
+
`self.model_dump(by_alias=True)`:
|
|
76
|
+
|
|
77
|
+
* `None` is only added to the output dict for nullable fields that
|
|
78
|
+
were set at model initialization. Other fields with value `None`
|
|
79
|
+
are ignored.
|
|
80
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
81
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
82
|
+
"""
|
|
83
|
+
excluded_fields: Set[str] = set(
|
|
84
|
+
[
|
|
85
|
+
"model",
|
|
86
|
+
"rendered_prompt",
|
|
87
|
+
]
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
_dict = self.model_dump(
|
|
91
|
+
by_alias=True,
|
|
92
|
+
exclude=excluded_fields,
|
|
93
|
+
exclude_none=True,
|
|
94
|
+
)
|
|
95
|
+
# set to None if cost (nullable) is None
|
|
96
|
+
# and model_fields_set contains the field
|
|
97
|
+
if self.cost is None and "cost" in self.model_fields_set:
|
|
98
|
+
_dict["cost"] = None
|
|
99
|
+
|
|
100
|
+
# set to None if score (nullable) is None
|
|
101
|
+
# and model_fields_set contains the field
|
|
102
|
+
if self.score is None and "score" in self.model_fields_set:
|
|
103
|
+
_dict["score"] = None
|
|
104
|
+
|
|
105
|
+
# set to None if justification (nullable) is None
|
|
106
|
+
# and model_fields_set contains the field
|
|
107
|
+
if self.justification is None and "justification" in self.model_fields_set:
|
|
108
|
+
_dict["justification"] = None
|
|
109
|
+
|
|
110
|
+
return _dict
|
|
111
|
+
|
|
112
|
+
@classmethod
|
|
113
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
114
|
+
"""Create an instance of EvaluatorCalibrationResult from a dict"""
|
|
115
|
+
if obj is None:
|
|
116
|
+
return None
|
|
117
|
+
|
|
118
|
+
if not isinstance(obj, dict):
|
|
119
|
+
return cls.model_validate(obj)
|
|
120
|
+
|
|
121
|
+
_obj = cls.model_validate(
|
|
122
|
+
{
|
|
123
|
+
"llm_output": obj.get("llm_output"),
|
|
124
|
+
"model": obj.get("model"),
|
|
125
|
+
"execution_log_id": obj.get("execution_log_id"),
|
|
126
|
+
"rendered_prompt": obj.get("rendered_prompt"),
|
|
127
|
+
"cost": obj.get("cost"),
|
|
128
|
+
"model_call_duration": obj.get("model_call_duration"),
|
|
129
|
+
"expected_score": obj.get("expected_score"),
|
|
130
|
+
"score": obj.get("score"),
|
|
131
|
+
"justification": obj.get("justification"),
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
return _obj
|
|
@@ -0,0 +1,107 @@
|
|
|
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, Field, StrictStr
|
|
22
|
+
from typing_extensions import Annotated, Self
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class EvaluatorDemonstrations(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
EvaluatorDemonstrations
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
|
|
30
|
+
request: Optional[StrictStr] = None
|
|
31
|
+
response: Optional[StrictStr] = None
|
|
32
|
+
score: Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]
|
|
33
|
+
justification: Optional[StrictStr] = None
|
|
34
|
+
__properties: ClassVar[List[str]] = ["request", "response", "score", "justification"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
49
|
+
return json.dumps(self.to_dict())
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of EvaluatorDemonstrations from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
# set to None if request (nullable) is None
|
|
74
|
+
# and model_fields_set contains the field
|
|
75
|
+
if self.request is None and "request" in self.model_fields_set:
|
|
76
|
+
_dict["request"] = None
|
|
77
|
+
|
|
78
|
+
# set to None if response (nullable) is None
|
|
79
|
+
# and model_fields_set contains the field
|
|
80
|
+
if self.response is None and "response" in self.model_fields_set:
|
|
81
|
+
_dict["response"] = None
|
|
82
|
+
|
|
83
|
+
# set to None if justification (nullable) is None
|
|
84
|
+
# and model_fields_set contains the field
|
|
85
|
+
if self.justification is None and "justification" in self.model_fields_set:
|
|
86
|
+
_dict["justification"] = None
|
|
87
|
+
|
|
88
|
+
return _dict
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
92
|
+
"""Create an instance of EvaluatorDemonstrations from a dict"""
|
|
93
|
+
if obj is None:
|
|
94
|
+
return None
|
|
95
|
+
|
|
96
|
+
if not isinstance(obj, dict):
|
|
97
|
+
return cls.model_validate(obj)
|
|
98
|
+
|
|
99
|
+
_obj = cls.model_validate(
|
|
100
|
+
{
|
|
101
|
+
"request": obj.get("request"),
|
|
102
|
+
"response": obj.get("response"),
|
|
103
|
+
"score": obj.get("score"),
|
|
104
|
+
"justification": obj.get("justification"),
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
return _obj
|