adaline-api 1.0.0__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.
Files changed (233) hide show
  1. adaline_api/__init__.py +193 -0
  2. adaline_api/api/__init__.py +5 -0
  3. adaline_api/api/default_api.py +1221 -0
  4. adaline_api/api_client.py +804 -0
  5. adaline_api/api_response.py +21 -0
  6. adaline_api/configuration.py +582 -0
  7. adaline_api/exceptions.py +216 -0
  8. adaline_api/models/__init__.py +89 -0
  9. adaline_api/models/api_message_content.py +113 -0
  10. adaline_api/models/api_message_content_type.py +113 -0
  11. adaline_api/models/base64_hosted_image_content_value.py +99 -0
  12. adaline_api/models/base64_hosted_image_content_value_type.py +99 -0
  13. adaline_api/models/base64_hosted_pdf_content_value.py +99 -0
  14. adaline_api/models/base64_hosted_pdf_content_value_type.py +99 -0
  15. adaline_api/models/base64_image_content_value.py +105 -0
  16. adaline_api/models/base64_image_content_value_type.py +105 -0
  17. adaline_api/models/base64_media.py +118 -0
  18. adaline_api/models/base64_media_type.py +118 -0
  19. adaline_api/models/base64_pdf_content_value.py +96 -0
  20. adaline_api/models/base64_pdf_content_value_type.py +96 -0
  21. adaline_api/models/base_entity.py +96 -0
  22. adaline_api/models/config_type.py +94 -0
  23. adaline_api/models/content.py +196 -0
  24. adaline_api/models/content_type.py +196 -0
  25. adaline_api/models/create_log_span_request.py +94 -0
  26. adaline_api/models/create_log_span_request_span.py +150 -0
  27. adaline_api/models/create_log_span_request_type.py +94 -0
  28. adaline_api/models/create_log_span_response.py +88 -0
  29. adaline_api/models/create_log_span_response_type.py +88 -0
  30. adaline_api/models/create_log_trace_request.py +104 -0
  31. adaline_api/models/create_log_trace_request_span.py +146 -0
  32. adaline_api/models/create_log_trace_request_trace.py +122 -0
  33. adaline_api/models/create_log_trace_request_type.py +104 -0
  34. adaline_api/models/create_log_trace_response.py +90 -0
  35. adaline_api/models/create_log_trace_response_type.py +90 -0
  36. adaline_api/models/deployment.py +107 -0
  37. adaline_api/models/deployment_prompt.py +121 -0
  38. adaline_api/models/deployment_prompt_config.py +94 -0
  39. adaline_api/models/deployment_prompt_config_type.py +94 -0
  40. adaline_api/models/deployment_prompt_type.py +121 -0
  41. adaline_api/models/deployment_prompt_variables.py +96 -0
  42. adaline_api/models/deployment_prompt_variables_type.py +96 -0
  43. adaline_api/models/deployment_type.py +107 -0
  44. adaline_api/models/deployment_type_prompt.py +121 -0
  45. adaline_api/models/enum_value.py +166 -0
  46. adaline_api/models/enum_value_type.py +166 -0
  47. adaline_api/models/error_response.py +91 -0
  48. adaline_api/models/error_response_type.py +91 -0
  49. adaline_api/models/function.py +101 -0
  50. adaline_api/models/function_parameter.py +139 -0
  51. adaline_api/models/function_parameter_type.py +139 -0
  52. adaline_api/models/function_parameters.py +115 -0
  53. adaline_api/models/function_parameters_type.py +115 -0
  54. adaline_api/models/function_request_http.py +121 -0
  55. adaline_api/models/function_request_http_type.py +121 -0
  56. adaline_api/models/function_request_retry.py +92 -0
  57. adaline_api/models/function_request_retry_type.py +92 -0
  58. adaline_api/models/function_tool.py +106 -0
  59. adaline_api/models/function_tool_definition.py +91 -0
  60. adaline_api/models/function_tool_definition_type.py +104 -0
  61. adaline_api/models/function_tool_type.py +106 -0
  62. adaline_api/models/function_tool_type_definition.py +91 -0
  63. adaline_api/models/function_type.py +106 -0
  64. adaline_api/models/image_content.py +109 -0
  65. adaline_api/models/image_content_type.py +109 -0
  66. adaline_api/models/image_content_value.py +140 -0
  67. adaline_api/models/image_content_value_type.py +140 -0
  68. adaline_api/models/image_message_content.py +111 -0
  69. adaline_api/models/image_message_content_type.py +111 -0
  70. adaline_api/models/image_message_content_type_value.py +154 -0
  71. adaline_api/models/image_message_content_value.py +154 -0
  72. adaline_api/models/image_source.py +140 -0
  73. adaline_api/models/image_source_type.py +140 -0
  74. adaline_api/models/log_attributes_value.py +160 -0
  75. adaline_api/models/log_feedback_comment.py +98 -0
  76. adaline_api/models/log_span.py +180 -0
  77. adaline_api/models/log_span_all_of_internal_feedback.py +98 -0
  78. adaline_api/models/log_span_content.py +224 -0
  79. adaline_api/models/log_span_embeddings_content.py +101 -0
  80. adaline_api/models/log_span_event.py +96 -0
  81. adaline_api/models/log_span_function_content.py +101 -0
  82. adaline_api/models/log_span_guardrail_content.py +101 -0
  83. adaline_api/models/log_span_model_content.py +109 -0
  84. adaline_api/models/log_span_model_stream_content.py +111 -0
  85. adaline_api/models/log_span_other_content.py +101 -0
  86. adaline_api/models/log_span_parsed_content.py +101 -0
  87. adaline_api/models/log_span_retrieval_content.py +101 -0
  88. adaline_api/models/log_span_tool_content.py +101 -0
  89. adaline_api/models/log_trace.py +132 -0
  90. adaline_api/models/log_trace_attributes_inner.py +102 -0
  91. adaline_api/models/log_trace_attributes_value.py +160 -0
  92. adaline_api/models/log_trace_attributes_value_type.py +160 -0
  93. adaline_api/models/log_trace_tags_inner.py +96 -0
  94. adaline_api/models/log_trace_type.py +132 -0
  95. adaline_api/models/log_trace_type_attributes_inner.py +102 -0
  96. adaline_api/models/log_trace_type_tags_inner.py +96 -0
  97. adaline_api/models/mcp_server.py +114 -0
  98. adaline_api/models/mcp_server_tool_configuration.py +90 -0
  99. adaline_api/models/mcp_server_tool_configuration_type.py +90 -0
  100. adaline_api/models/mcp_server_type.py +114 -0
  101. adaline_api/models/message.py +98 -0
  102. adaline_api/models/message_content_inner.py +182 -0
  103. adaline_api/models/message_content_type_inner.py +182 -0
  104. adaline_api/models/message_type.py +98 -0
  105. adaline_api/models/modality_enum.py +41 -0
  106. adaline_api/models/modality_enum_type.py +41 -0
  107. adaline_api/models/pdf_content.py +106 -0
  108. adaline_api/models/pdf_content_file.py +91 -0
  109. adaline_api/models/pdf_content_type.py +106 -0
  110. adaline_api/models/pdf_content_type_file.py +91 -0
  111. adaline_api/models/pdf_content_value.py +140 -0
  112. adaline_api/models/pdf_content_value_type.py +140 -0
  113. adaline_api/models/pdf_message_content.py +108 -0
  114. adaline_api/models/pdf_message_content_file.py +91 -0
  115. adaline_api/models/pdf_message_content_type.py +108 -0
  116. adaline_api/models/pdf_message_content_type_file.py +91 -0
  117. adaline_api/models/pdf_message_content_type_value.py +154 -0
  118. adaline_api/models/pdf_message_content_value.py +154 -0
  119. adaline_api/models/prompt_variable.py +96 -0
  120. adaline_api/models/prompt_variable_value.py +210 -0
  121. adaline_api/models/reasoning_content.py +100 -0
  122. adaline_api/models/reasoning_content_type.py +100 -0
  123. adaline_api/models/reasoning_content_value.py +98 -0
  124. adaline_api/models/reasoning_content_value_type.py +98 -0
  125. adaline_api/models/reasoning_content_value_union.py +140 -0
  126. adaline_api/models/reasoning_content_value_union_type.py +140 -0
  127. adaline_api/models/reasoning_message_content.py +102 -0
  128. adaline_api/models/reasoning_message_content_type.py +102 -0
  129. adaline_api/models/reasoning_message_content_type_value.py +140 -0
  130. adaline_api/models/reasoning_message_content_value.py +140 -0
  131. adaline_api/models/reasoning_redacted_value.py +109 -0
  132. adaline_api/models/reasoning_redacted_value_type.py +109 -0
  133. adaline_api/models/reasoning_thinking_value.py +111 -0
  134. adaline_api/models/reasoning_thinking_value_type.py +111 -0
  135. adaline_api/models/reasoning_value.py +140 -0
  136. adaline_api/models/reasoning_value_type.py +140 -0
  137. adaline_api/models/redacted_reasoning_content_value.py +96 -0
  138. adaline_api/models/redacted_reasoning_content_value_type.py +96 -0
  139. adaline_api/models/response_schema.py +105 -0
  140. adaline_api/models/response_schema_property.py +135 -0
  141. adaline_api/models/response_schema_property_enum_inner.py +166 -0
  142. adaline_api/models/response_schema_property_type.py +143 -0
  143. adaline_api/models/response_schema_property_type_enum_inner.py +166 -0
  144. adaline_api/models/response_schema_property_type_type.py +143 -0
  145. adaline_api/models/response_schema_structure.py +122 -0
  146. adaline_api/models/response_schema_structure_type.py +122 -0
  147. adaline_api/models/response_schema_type.py +105 -0
  148. adaline_api/models/role_enum.py +39 -0
  149. adaline_api/models/role_enum_type.py +39 -0
  150. adaline_api/models/span_content_detailed.py +112 -0
  151. adaline_api/models/span_content_detailed_type.py +112 -0
  152. adaline_api/models/span_content_detailed_type_variables_value.py +94 -0
  153. adaline_api/models/span_content_detailed_variables_value.py +94 -0
  154. adaline_api/models/span_content_minimal.py +91 -0
  155. adaline_api/models/span_content_minimal_type.py +91 -0
  156. adaline_api/models/span_log_req_attributes.py +160 -0
  157. adaline_api/models/span_log_req_attributes_type.py +160 -0
  158. adaline_api/models/span_log_req_content.py +137 -0
  159. adaline_api/models/span_log_req_content_type.py +137 -0
  160. adaline_api/models/span_log_request.py +93 -0
  161. adaline_api/models/span_log_request_span.py +139 -0
  162. adaline_api/models/span_log_request_type.py +93 -0
  163. adaline_api/models/span_log_request_type_span.py +139 -0
  164. adaline_api/models/span_log_response.py +87 -0
  165. adaline_api/models/span_log_response_type.py +87 -0
  166. adaline_api/models/spans_request_attribute_value.py +160 -0
  167. adaline_api/models/spans_request_attribute_value_type.py +160 -0
  168. adaline_api/models/spans_request_content_value.py +143 -0
  169. adaline_api/models/spans_request_content_value_type.py +143 -0
  170. adaline_api/models/text_content.py +96 -0
  171. adaline_api/models/text_content_type.py +96 -0
  172. adaline_api/models/text_message_content.py +98 -0
  173. adaline_api/models/text_message_content_type.py +98 -0
  174. adaline_api/models/tool_call_content.py +105 -0
  175. adaline_api/models/tool_call_content_type.py +105 -0
  176. adaline_api/models/tool_call_message_content.py +107 -0
  177. adaline_api/models/tool_call_message_content_type.py +107 -0
  178. adaline_api/models/tool_response_content.py +109 -0
  179. adaline_api/models/tool_response_content_api_response.py +88 -0
  180. adaline_api/models/tool_response_content_type.py +109 -0
  181. adaline_api/models/tool_response_content_type_api_response.py +88 -0
  182. adaline_api/models/tool_response_message_content.py +111 -0
  183. adaline_api/models/tool_response_message_content_api_response.py +87 -0
  184. adaline_api/models/tool_response_message_content_type.py +111 -0
  185. adaline_api/models/tool_response_message_content_type_api_response.py +87 -0
  186. adaline_api/models/tool_type.py +113 -0
  187. adaline_api/models/trace_log_patch_request.py +137 -0
  188. adaline_api/models/trace_log_patch_request_one_of.py +97 -0
  189. adaline_api/models/trace_log_patch_request_one_of1.py +97 -0
  190. adaline_api/models/trace_log_patch_request_type.py +137 -0
  191. adaline_api/models/trace_log_patch_request_type_one_of.py +97 -0
  192. adaline_api/models/trace_log_patch_request_type_one_of1.py +97 -0
  193. adaline_api/models/trace_log_patch_response.py +87 -0
  194. adaline_api/models/trace_log_patch_response_type.py +87 -0
  195. adaline_api/models/trace_log_request.py +103 -0
  196. adaline_api/models/trace_log_request_spans_inner.py +135 -0
  197. adaline_api/models/trace_log_request_trace.py +121 -0
  198. adaline_api/models/trace_log_request_type.py +103 -0
  199. adaline_api/models/trace_log_request_type_spans_inner.py +135 -0
  200. adaline_api/models/trace_log_request_type_trace.py +121 -0
  201. adaline_api/models/trace_log_response.py +89 -0
  202. adaline_api/models/trace_log_response_type.py +89 -0
  203. adaline_api/models/trace_request_attribute_value.py +160 -0
  204. adaline_api/models/trace_request_attribute_value_type.py +160 -0
  205. adaline_api/models/update_log_trace_request.py +98 -0
  206. adaline_api/models/update_log_trace_request_attribute_item.py +140 -0
  207. adaline_api/models/update_log_trace_request_attribute_item_one_of.py +102 -0
  208. adaline_api/models/update_log_trace_request_attribute_item_one_of1.py +96 -0
  209. adaline_api/models/update_log_trace_request_attribute_item_one_of_value.py +160 -0
  210. adaline_api/models/update_log_trace_request_tag_item.py +140 -0
  211. adaline_api/models/update_log_trace_request_tag_item_one_of.py +97 -0
  212. adaline_api/models/update_log_trace_request_tag_item_one_of1.py +97 -0
  213. adaline_api/models/update_log_trace_request_trace.py +120 -0
  214. adaline_api/models/update_log_trace_request_type.py +98 -0
  215. adaline_api/models/update_log_trace_response.py +87 -0
  216. adaline_api/models/update_log_trace_response_type.py +87 -0
  217. adaline_api/models/url_image_content_value.py +96 -0
  218. adaline_api/models/url_image_content_value_type.py +96 -0
  219. adaline_api/models/url_media.py +109 -0
  220. adaline_api/models/url_media_type.py +109 -0
  221. adaline_api/models/url_pdf_content_value.py +96 -0
  222. adaline_api/models/url_pdf_content_value_type.py +96 -0
  223. adaline_api/models/variable.py +96 -0
  224. adaline_api/models/variable_type.py +96 -0
  225. adaline_api/models/variable_type_value.py +196 -0
  226. adaline_api/models/variable_value.py +196 -0
  227. adaline_api/models/variables_type.py +96 -0
  228. adaline_api/py.typed +0 -0
  229. adaline_api/rest.py +213 -0
  230. adaline_api-1.0.0.dist-info/METADATA +227 -0
  231. adaline_api-1.0.0.dist-info/RECORD +233 -0
  232. adaline_api-1.0.0.dist-info/WHEEL +5 -0
  233. adaline_api-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,140 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Adaline API
5
+
6
+ API for managing Adaline deployments, logs, and core type definitions.
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import json
17
+ import pprint
18
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
19
+ from typing import Any, List, Optional
20
+ from adaline_api.models.base64_media_type import Base64MediaType
21
+ from adaline_api.models.url_media_type import UrlMediaType
22
+ from pydantic import StrictStr, Field
23
+ from typing import Union, List, Set, Optional, Dict
24
+ from typing_extensions import Literal, Self
25
+
26
+ IMAGESOURCETYPE_ONE_OF_SCHEMAS = ["Base64MediaType", "UrlMediaType"]
27
+
28
+ class ImageSourceType(BaseModel):
29
+ """
30
+ The value field for ImageContent, which can be either Base64 or URL media.
31
+ """
32
+ # data type: Base64MediaType
33
+ oneof_schema_1_validator: Optional[Base64MediaType] = None
34
+ # data type: UrlMediaType
35
+ oneof_schema_2_validator: Optional[UrlMediaType] = None
36
+ actual_instance: Optional[Union[Base64MediaType, UrlMediaType]] = None
37
+ one_of_schemas: Set[str] = { "Base64MediaType", "UrlMediaType" }
38
+
39
+ model_config = ConfigDict(
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ discriminator_value_class_map: Dict[str, str] = {
46
+ }
47
+
48
+ def __init__(self, *args, **kwargs) -> None:
49
+ if args:
50
+ if len(args) > 1:
51
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
52
+ if kwargs:
53
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
54
+ super().__init__(actual_instance=args[0])
55
+ else:
56
+ super().__init__(**kwargs)
57
+
58
+ @field_validator('actual_instance')
59
+ def actual_instance_must_validate_oneof(cls, v):
60
+ instance = ImageSourceType.model_construct()
61
+ error_messages = []
62
+ match = 0
63
+ # validate data type: Base64MediaType
64
+ if not isinstance(v, Base64MediaType):
65
+ error_messages.append(f"Error! Input type `{type(v)}` is not `Base64MediaType`")
66
+ else:
67
+ match += 1
68
+ # validate data type: UrlMediaType
69
+ if not isinstance(v, UrlMediaType):
70
+ error_messages.append(f"Error! Input type `{type(v)}` is not `UrlMediaType`")
71
+ else:
72
+ match += 1
73
+ if match > 1:
74
+ # more than 1 match
75
+ raise ValueError("Multiple matches found when setting `actual_instance` in ImageSourceType with oneOf schemas: Base64MediaType, UrlMediaType. Details: " + ", ".join(error_messages))
76
+ elif match == 0:
77
+ # no match
78
+ raise ValueError("No match found when setting `actual_instance` in ImageSourceType with oneOf schemas: Base64MediaType, UrlMediaType. Details: " + ", ".join(error_messages))
79
+ else:
80
+ return v
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
84
+ return cls.from_json(json.dumps(obj))
85
+
86
+ @classmethod
87
+ def from_json(cls, json_str: str) -> Self:
88
+ """Returns the object represented by the json string"""
89
+ instance = cls.model_construct()
90
+ error_messages = []
91
+ match = 0
92
+
93
+ # deserialize data into Base64MediaType
94
+ try:
95
+ instance.actual_instance = Base64MediaType.from_json(json_str)
96
+ match += 1
97
+ except (ValidationError, ValueError) as e:
98
+ error_messages.append(str(e))
99
+ # deserialize data into UrlMediaType
100
+ try:
101
+ instance.actual_instance = UrlMediaType.from_json(json_str)
102
+ match += 1
103
+ except (ValidationError, ValueError) as e:
104
+ error_messages.append(str(e))
105
+
106
+ if match > 1:
107
+ # more than 1 match
108
+ raise ValueError("Multiple matches found when deserializing the JSON string into ImageSourceType with oneOf schemas: Base64MediaType, UrlMediaType. Details: " + ", ".join(error_messages))
109
+ elif match == 0:
110
+ # no match
111
+ raise ValueError("No match found when deserializing the JSON string into ImageSourceType with oneOf schemas: Base64MediaType, UrlMediaType. Details: " + ", ".join(error_messages))
112
+ else:
113
+ return instance
114
+
115
+ def to_json(self) -> str:
116
+ """Returns the JSON representation of the actual instance"""
117
+ if self.actual_instance is None:
118
+ return "null"
119
+
120
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
121
+ return self.actual_instance.to_json()
122
+ else:
123
+ return json.dumps(self.actual_instance)
124
+
125
+ def to_dict(self) -> Optional[Union[Dict[str, Any], Base64MediaType, UrlMediaType]]:
126
+ """Returns the dict representation of the actual instance"""
127
+ if self.actual_instance is None:
128
+ return None
129
+
130
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
131
+ return self.actual_instance.to_dict()
132
+ else:
133
+ # primitive type
134
+ return self.actual_instance
135
+
136
+ def to_str(self) -> str:
137
+ """Returns the string representation of the actual instance"""
138
+ return pprint.pformat(self.model_dump())
139
+
140
+
@@ -0,0 +1,160 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Adaline API
5
+
6
+ API for managing Adaline deployments, logs, and core type definitions.
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import json
17
+ import pprint
18
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator
19
+ from typing import Any, List, Optional, Union
20
+ from pydantic import StrictStr, Field
21
+ from typing import Union, List, Set, Optional, Dict
22
+ from typing_extensions import Literal, Self
23
+
24
+ LOGATTRIBUTESVALUE_ONE_OF_SCHEMAS = ["bool", "float", "str"]
25
+
26
+ class LogAttributesValue(BaseModel):
27
+ """
28
+ LogAttributesValue
29
+ """
30
+ # data type: str
31
+ oneof_schema_1_validator: Optional[StrictStr] = None
32
+ # data type: float
33
+ oneof_schema_2_validator: Optional[Union[StrictFloat, StrictInt]] = None
34
+ # data type: bool
35
+ oneof_schema_3_validator: Optional[StrictBool] = None
36
+ actual_instance: Optional[Union[bool, float, str]] = None
37
+ one_of_schemas: Set[str] = { "bool", "float", "str" }
38
+
39
+ model_config = ConfigDict(
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def __init__(self, *args, **kwargs) -> None:
46
+ if args:
47
+ if len(args) > 1:
48
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
49
+ if kwargs:
50
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
51
+ super().__init__(actual_instance=args[0])
52
+ else:
53
+ super().__init__(**kwargs)
54
+
55
+ @field_validator('actual_instance')
56
+ def actual_instance_must_validate_oneof(cls, v):
57
+ instance = LogAttributesValue.model_construct()
58
+ error_messages = []
59
+ match = 0
60
+ # validate data type: str
61
+ try:
62
+ instance.oneof_schema_1_validator = v
63
+ match += 1
64
+ except (ValidationError, ValueError) as e:
65
+ error_messages.append(str(e))
66
+ # validate data type: float
67
+ try:
68
+ instance.oneof_schema_2_validator = v
69
+ match += 1
70
+ except (ValidationError, ValueError) as e:
71
+ error_messages.append(str(e))
72
+ # validate data type: bool
73
+ try:
74
+ instance.oneof_schema_3_validator = v
75
+ match += 1
76
+ except (ValidationError, ValueError) as e:
77
+ error_messages.append(str(e))
78
+ if match > 1:
79
+ # more than 1 match
80
+ raise ValueError("Multiple matches found when setting `actual_instance` in LogAttributesValue with oneOf schemas: bool, float, str. Details: " + ", ".join(error_messages))
81
+ elif match == 0:
82
+ # no match
83
+ raise ValueError("No match found when setting `actual_instance` in LogAttributesValue with oneOf schemas: bool, float, str. Details: " + ", ".join(error_messages))
84
+ else:
85
+ return v
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
89
+ return cls.from_json(json.dumps(obj))
90
+
91
+ @classmethod
92
+ def from_json(cls, json_str: str) -> Self:
93
+ """Returns the object represented by the json string"""
94
+ instance = cls.model_construct()
95
+ error_messages = []
96
+ match = 0
97
+
98
+ # deserialize data into str
99
+ try:
100
+ # validation
101
+ instance.oneof_schema_1_validator = json.loads(json_str)
102
+ # assign value to actual_instance
103
+ instance.actual_instance = instance.oneof_schema_1_validator
104
+ match += 1
105
+ except (ValidationError, ValueError) as e:
106
+ error_messages.append(str(e))
107
+ # deserialize data into float
108
+ try:
109
+ # validation
110
+ instance.oneof_schema_2_validator = json.loads(json_str)
111
+ # assign value to actual_instance
112
+ instance.actual_instance = instance.oneof_schema_2_validator
113
+ match += 1
114
+ except (ValidationError, ValueError) as e:
115
+ error_messages.append(str(e))
116
+ # deserialize data into bool
117
+ try:
118
+ # validation
119
+ instance.oneof_schema_3_validator = json.loads(json_str)
120
+ # assign value to actual_instance
121
+ instance.actual_instance = instance.oneof_schema_3_validator
122
+ match += 1
123
+ except (ValidationError, ValueError) as e:
124
+ error_messages.append(str(e))
125
+
126
+ if match > 1:
127
+ # more than 1 match
128
+ raise ValueError("Multiple matches found when deserializing the JSON string into LogAttributesValue with oneOf schemas: bool, float, str. Details: " + ", ".join(error_messages))
129
+ elif match == 0:
130
+ # no match
131
+ raise ValueError("No match found when deserializing the JSON string into LogAttributesValue with oneOf schemas: bool, float, str. Details: " + ", ".join(error_messages))
132
+ else:
133
+ return instance
134
+
135
+ def to_json(self) -> str:
136
+ """Returns the JSON representation of the actual instance"""
137
+ if self.actual_instance is None:
138
+ return "null"
139
+
140
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
141
+ return self.actual_instance.to_json()
142
+ else:
143
+ return json.dumps(self.actual_instance)
144
+
145
+ def to_dict(self) -> Optional[Union[Dict[str, Any], bool, float, str]]:
146
+ """Returns the dict representation of the actual instance"""
147
+ if self.actual_instance is None:
148
+ return None
149
+
150
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
151
+ return self.actual_instance.to_dict()
152
+ else:
153
+ # primitive type
154
+ return self.actual_instance
155
+
156
+ def to_str(self) -> str:
157
+ """Returns the string representation of the actual instance"""
158
+ return pprint.pformat(self.model_dump())
159
+
160
+
@@ -0,0 +1,98 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Adaline API
5
+
6
+ API for managing Adaline deployments, logs, and core type definitions.
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing_extensions import Annotated
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class LogFeedbackComment(BaseModel):
27
+ """
28
+ User feedback comment on trace/span for quality evaluation and monitoring
29
+ """ # noqa: E501
30
+ created_at: Annotated[int, Field(le=33229420200000, strict=True, ge=1672511400000)] = Field(description="Unix timestamp in milliseconds", alias="createdAt")
31
+ updated_at: Annotated[int, Field(le=33229420200000, strict=True, ge=1672511400000)] = Field(description="Unix timestamp in milliseconds", alias="updatedAt")
32
+ created_by_user_id: Annotated[str, Field(min_length=20, strict=True, max_length=80)] = Field(description="Unique identifier for entities. Supports composite IDs with two UUIDs.", alias="createdByUserId")
33
+ updated_by_user_id: Annotated[str, Field(min_length=20, strict=True, max_length=80)] = Field(description="Unique identifier for entities. Supports composite IDs with two UUIDs.", alias="updatedByUserId")
34
+ comment_id: Annotated[str, Field(min_length=20, strict=True, max_length=80)] = Field(description="Unique identifier for entities. Supports composite IDs with two UUIDs.", alias="commentId")
35
+ comment: Annotated[str, Field(min_length=1, strict=True, max_length=8192)]
36
+ __properties: ClassVar[List[str]] = ["createdAt", "updatedAt", "createdByUserId", "updatedByUserId", "commentId", "comment"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
+ """Create an instance of LogFeedbackComment from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ ])
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81
+ """Create an instance of LogFeedbackComment from a dict"""
82
+ if obj is None:
83
+ return None
84
+
85
+ if not isinstance(obj, dict):
86
+ return cls.model_validate(obj)
87
+
88
+ _obj = cls.model_validate({
89
+ "createdAt": obj.get("createdAt"),
90
+ "updatedAt": obj.get("updatedAt"),
91
+ "createdByUserId": obj.get("createdByUserId"),
92
+ "updatedByUserId": obj.get("updatedByUserId"),
93
+ "commentId": obj.get("commentId"),
94
+ "comment": obj.get("comment")
95
+ })
96
+ return _obj
97
+
98
+
@@ -0,0 +1,180 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Adaline API
5
+
6
+ API for managing Adaline deployments, logs, and core type definitions.
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional, Union
22
+ from typing_extensions import Annotated
23
+ from adaline_api.models.log_attributes_value import LogAttributesValue
24
+ from adaline_api.models.log_span_all_of_internal_feedback import LogSpanAllOfInternalFeedback
25
+ from adaline_api.models.log_span_content import LogSpanContent
26
+ from adaline_api.models.log_span_event import LogSpanEvent
27
+ from adaline_api.models.log_span_parsed_content import LogSpanParsedContent
28
+ from typing import Optional, Set
29
+ from typing_extensions import Self
30
+
31
+ class LogSpan(BaseModel):
32
+ """
33
+ LogSpan
34
+ """ # noqa: E501
35
+ id: Annotated[str, Field(min_length=20, strict=True, max_length=80)] = Field(description="Unique identifier for entities. Supports composite IDs with two UUIDs.")
36
+ created_at: Annotated[int, Field(le=33229420200000, strict=True, ge=1672511400000)] = Field(description="Unix timestamp in milliseconds", alias="createdAt")
37
+ updated_at: Annotated[int, Field(le=33229420200000, strict=True, ge=1672511400000)] = Field(description="Unix timestamp in milliseconds", alias="updatedAt")
38
+ created_by_user_id: Annotated[str, Field(min_length=20, strict=True, max_length=80)] = Field(description="Unique identifier for entities. Supports composite IDs with two UUIDs.", alias="createdByUserId")
39
+ updated_by_user_id: Annotated[str, Field(min_length=20, strict=True, max_length=80)] = Field(description="Unique identifier for entities. Supports composite IDs with two UUIDs.", alias="updatedByUserId")
40
+ metadata: Optional[Dict[str, Any]] = None
41
+ prompt_bench_id: Optional[Annotated[str, Field(min_length=20, strict=True, max_length=80)]] = Field(default=None, description="Unique identifier for entities. Supports composite IDs with two UUIDs.", alias="promptBenchId")
42
+ deployment_id: Optional[Annotated[str, Field(min_length=20, strict=True, max_length=80)]] = Field(default=None, description="Unique identifier for entities. Supports composite IDs with two UUIDs.", alias="deploymentId")
43
+ deployment_environment_id: Optional[Annotated[str, Field(min_length=20, strict=True, max_length=80)]] = Field(default=None, description="Unique identifier for entities. Supports composite IDs with two UUIDs.", alias="deploymentEnvironmentId")
44
+ log_trace_id: Annotated[str, Field(min_length=20, strict=True, max_length=80)] = Field(description="Unique identifier for entities. Supports composite IDs with two UUIDs.", alias="logTraceId")
45
+ log_trace_reference_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]] = Field(default=None, alias="logTraceReferenceId")
46
+ started_at: Annotated[int, Field(le=33229420200000, strict=True, ge=1672511400000)] = Field(description="Unix timestamp in milliseconds", alias="startedAt")
47
+ ended_at: Annotated[int, Field(le=33229420200000, strict=True, ge=1672511400000)] = Field(description="Unix timestamp in milliseconds", alias="endedAt")
48
+ latency: Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]] = Field(description="Latency in milliseconds")
49
+ name: Annotated[str, Field(min_length=1, strict=True, max_length=256)]
50
+ status: StrictStr
51
+ content: LogSpanContent
52
+ parsed_content: Optional[LogSpanParsedContent] = Field(default=None, alias="parsedContent")
53
+ run_evaluation: Optional[StrictBool] = Field(default=None, alias="runEvaluation")
54
+ parent_reference_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]] = Field(default=None, alias="parentReferenceId")
55
+ reference_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]] = Field(default=None, alias="referenceId")
56
+ session_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=128)]] = Field(default=None, alias="sessionId")
57
+ attributes: Optional[Dict[str, LogAttributesValue]] = Field(default=None, description="Key-value pairs for log metadata where values can be strings, numbers, or booleans")
58
+ tags: Optional[List[Annotated[str, Field(min_length=1, strict=True, max_length=256)]]] = Field(default=None, description="Array of string tags for categorizing logs")
59
+ events: Optional[List[LogSpanEvent]] = None
60
+ internal_feedback: LogSpanAllOfInternalFeedback = Field(alias="internalFeedback")
61
+ update_version: Union[Annotated[float, Field(strict=True, ge=1)], Annotated[int, Field(strict=True, ge=1)]] = Field(alias="updateVersion")
62
+ __properties: ClassVar[List[str]] = ["id", "createdAt", "updatedAt", "createdByUserId", "updatedByUserId", "metadata", "promptBenchId", "deploymentId", "deploymentEnvironmentId", "logTraceId", "logTraceReferenceId", "startedAt", "endedAt", "latency", "name", "status", "content", "parsedContent", "runEvaluation", "parentReferenceId", "referenceId", "sessionId", "attributes", "tags", "events", "internalFeedback", "updateVersion"]
63
+
64
+ @field_validator('status')
65
+ def status_validate_enum(cls, value):
66
+ """Validates the enum"""
67
+ if value not in set(['success', 'failure', 'aborted', 'cancelled', 'unknown']):
68
+ raise ValueError("must be one of enum values ('success', 'failure', 'aborted', 'cancelled', 'unknown')")
69
+ return value
70
+
71
+ model_config = ConfigDict(
72
+ populate_by_name=True,
73
+ validate_assignment=True,
74
+ protected_namespaces=(),
75
+ )
76
+
77
+
78
+ def to_str(self) -> str:
79
+ """Returns the string representation of the model using alias"""
80
+ return pprint.pformat(self.model_dump(by_alias=True))
81
+
82
+ def to_json(self) -> str:
83
+ """Returns the JSON representation of the model using alias"""
84
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
85
+ return json.dumps(self.to_dict())
86
+
87
+ @classmethod
88
+ def from_json(cls, json_str: str) -> Optional[Self]:
89
+ """Create an instance of LogSpan from a JSON string"""
90
+ return cls.from_dict(json.loads(json_str))
91
+
92
+ def to_dict(self) -> Dict[str, Any]:
93
+ """Return the dictionary representation of the model using alias.
94
+
95
+ This has the following differences from calling pydantic's
96
+ `self.model_dump(by_alias=True)`:
97
+
98
+ * `None` is only added to the output dict for nullable fields that
99
+ were set at model initialization. Other fields with value `None`
100
+ are ignored.
101
+ """
102
+ excluded_fields: Set[str] = set([
103
+ ])
104
+
105
+ _dict = self.model_dump(
106
+ by_alias=True,
107
+ exclude=excluded_fields,
108
+ exclude_none=True,
109
+ )
110
+ # override the default output from pydantic by calling `to_dict()` of content
111
+ if self.content:
112
+ _dict['content'] = self.content.to_dict()
113
+ # override the default output from pydantic by calling `to_dict()` of parsed_content
114
+ if self.parsed_content:
115
+ _dict['parsedContent'] = self.parsed_content.to_dict()
116
+ # override the default output from pydantic by calling `to_dict()` of each value in attributes (dict)
117
+ _field_dict = {}
118
+ if self.attributes:
119
+ for _key_attributes in self.attributes:
120
+ if self.attributes[_key_attributes]:
121
+ _field_dict[_key_attributes] = self.attributes[_key_attributes].to_dict()
122
+ _dict['attributes'] = _field_dict
123
+ # override the default output from pydantic by calling `to_dict()` of each item in events (list)
124
+ _items = []
125
+ if self.events:
126
+ for _item_events in self.events:
127
+ if _item_events:
128
+ _items.append(_item_events.to_dict())
129
+ _dict['events'] = _items
130
+ # override the default output from pydantic by calling `to_dict()` of internal_feedback
131
+ if self.internal_feedback:
132
+ _dict['internalFeedback'] = self.internal_feedback.to_dict()
133
+ return _dict
134
+
135
+ @classmethod
136
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
137
+ """Create an instance of LogSpan from a dict"""
138
+ if obj is None:
139
+ return None
140
+
141
+ if not isinstance(obj, dict):
142
+ return cls.model_validate(obj)
143
+
144
+ _obj = cls.model_validate({
145
+ "id": obj.get("id"),
146
+ "createdAt": obj.get("createdAt"),
147
+ "updatedAt": obj.get("updatedAt"),
148
+ "createdByUserId": obj.get("createdByUserId"),
149
+ "updatedByUserId": obj.get("updatedByUserId"),
150
+ "metadata": obj.get("metadata"),
151
+ "promptBenchId": obj.get("promptBenchId"),
152
+ "deploymentId": obj.get("deploymentId"),
153
+ "deploymentEnvironmentId": obj.get("deploymentEnvironmentId"),
154
+ "logTraceId": obj.get("logTraceId"),
155
+ "logTraceReferenceId": obj.get("logTraceReferenceId"),
156
+ "startedAt": obj.get("startedAt"),
157
+ "endedAt": obj.get("endedAt"),
158
+ "latency": obj.get("latency"),
159
+ "name": obj.get("name"),
160
+ "status": obj.get("status"),
161
+ "content": LogSpanContent.from_dict(obj["content"]) if obj.get("content") is not None else None,
162
+ "parsedContent": LogSpanParsedContent.from_dict(obj["parsedContent"]) if obj.get("parsedContent") is not None else None,
163
+ "runEvaluation": obj.get("runEvaluation"),
164
+ "parentReferenceId": obj.get("parentReferenceId"),
165
+ "referenceId": obj.get("referenceId"),
166
+ "sessionId": obj.get("sessionId"),
167
+ "attributes": dict(
168
+ (_k, LogAttributesValue.from_dict(_v))
169
+ for _k, _v in obj["attributes"].items()
170
+ )
171
+ if obj.get("attributes") is not None
172
+ else None,
173
+ "tags": obj.get("tags"),
174
+ "events": [LogSpanEvent.from_dict(_item) for _item in obj["events"]] if obj.get("events") is not None else None,
175
+ "internalFeedback": LogSpanAllOfInternalFeedback.from_dict(obj["internalFeedback"]) if obj.get("internalFeedback") is not None else None,
176
+ "updateVersion": obj.get("updateVersion")
177
+ })
178
+ return _obj
179
+
180
+
@@ -0,0 +1,98 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Adaline API
5
+
6
+ API for managing Adaline deployments, logs, and core type definitions.
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field
21
+ from typing import Any, ClassVar, Dict, List, Optional, Union
22
+ from typing_extensions import Annotated
23
+ from adaline_api.models.log_feedback_comment import LogFeedbackComment
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class LogSpanAllOfInternalFeedback(BaseModel):
28
+ """
29
+ LogSpanAllOfInternalFeedback
30
+ """ # noqa: E501
31
+ score: Optional[Union[Annotated[float, Field(le=1.0, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = Field(default=None, description="Normalized feedback score between 0 and 1")
32
+ comments: Optional[List[LogFeedbackComment]] = None
33
+ __properties: ClassVar[List[str]] = ["score", "comments"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
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 LogSpanAllOfInternalFeedback 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
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ # override the default output from pydantic by calling `to_dict()` of each item in comments (list)
75
+ _items = []
76
+ if self.comments:
77
+ for _item_comments in self.comments:
78
+ if _item_comments:
79
+ _items.append(_item_comments.to_dict())
80
+ _dict['comments'] = _items
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of LogSpanAllOfInternalFeedback from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "score": obj.get("score"),
94
+ "comments": [LogFeedbackComment.from_dict(_item) for _item in obj["comments"]] if obj.get("comments") is not None else None
95
+ })
96
+ return _obj
97
+
98
+