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.

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