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.
- adaline_api/__init__.py +193 -0
- adaline_api/api/__init__.py +5 -0
- adaline_api/api/default_api.py +1221 -0
- adaline_api/api_client.py +804 -0
- adaline_api/api_response.py +21 -0
- adaline_api/configuration.py +582 -0
- adaline_api/exceptions.py +216 -0
- adaline_api/models/__init__.py +89 -0
- adaline_api/models/api_message_content.py +113 -0
- adaline_api/models/api_message_content_type.py +113 -0
- adaline_api/models/base64_hosted_image_content_value.py +99 -0
- adaline_api/models/base64_hosted_image_content_value_type.py +99 -0
- adaline_api/models/base64_hosted_pdf_content_value.py +99 -0
- adaline_api/models/base64_hosted_pdf_content_value_type.py +99 -0
- adaline_api/models/base64_image_content_value.py +105 -0
- adaline_api/models/base64_image_content_value_type.py +105 -0
- adaline_api/models/base64_media.py +118 -0
- adaline_api/models/base64_media_type.py +118 -0
- adaline_api/models/base64_pdf_content_value.py +96 -0
- adaline_api/models/base64_pdf_content_value_type.py +96 -0
- adaline_api/models/base_entity.py +96 -0
- adaline_api/models/config_type.py +94 -0
- adaline_api/models/content.py +196 -0
- adaline_api/models/content_type.py +196 -0
- adaline_api/models/create_log_span_request.py +94 -0
- adaline_api/models/create_log_span_request_span.py +150 -0
- adaline_api/models/create_log_span_request_type.py +94 -0
- adaline_api/models/create_log_span_response.py +88 -0
- adaline_api/models/create_log_span_response_type.py +88 -0
- adaline_api/models/create_log_trace_request.py +104 -0
- adaline_api/models/create_log_trace_request_span.py +146 -0
- adaline_api/models/create_log_trace_request_trace.py +122 -0
- adaline_api/models/create_log_trace_request_type.py +104 -0
- adaline_api/models/create_log_trace_response.py +90 -0
- adaline_api/models/create_log_trace_response_type.py +90 -0
- adaline_api/models/deployment.py +107 -0
- adaline_api/models/deployment_prompt.py +121 -0
- adaline_api/models/deployment_prompt_config.py +94 -0
- adaline_api/models/deployment_prompt_config_type.py +94 -0
- adaline_api/models/deployment_prompt_type.py +121 -0
- adaline_api/models/deployment_prompt_variables.py +96 -0
- adaline_api/models/deployment_prompt_variables_type.py +96 -0
- adaline_api/models/deployment_type.py +107 -0
- adaline_api/models/deployment_type_prompt.py +121 -0
- adaline_api/models/enum_value.py +166 -0
- adaline_api/models/enum_value_type.py +166 -0
- adaline_api/models/error_response.py +91 -0
- adaline_api/models/error_response_type.py +91 -0
- adaline_api/models/function.py +101 -0
- adaline_api/models/function_parameter.py +139 -0
- adaline_api/models/function_parameter_type.py +139 -0
- adaline_api/models/function_parameters.py +115 -0
- adaline_api/models/function_parameters_type.py +115 -0
- adaline_api/models/function_request_http.py +121 -0
- adaline_api/models/function_request_http_type.py +121 -0
- adaline_api/models/function_request_retry.py +92 -0
- adaline_api/models/function_request_retry_type.py +92 -0
- adaline_api/models/function_tool.py +106 -0
- adaline_api/models/function_tool_definition.py +91 -0
- adaline_api/models/function_tool_definition_type.py +104 -0
- adaline_api/models/function_tool_type.py +106 -0
- adaline_api/models/function_tool_type_definition.py +91 -0
- adaline_api/models/function_type.py +106 -0
- adaline_api/models/image_content.py +109 -0
- adaline_api/models/image_content_type.py +109 -0
- adaline_api/models/image_content_value.py +140 -0
- adaline_api/models/image_content_value_type.py +140 -0
- adaline_api/models/image_message_content.py +111 -0
- adaline_api/models/image_message_content_type.py +111 -0
- adaline_api/models/image_message_content_type_value.py +154 -0
- adaline_api/models/image_message_content_value.py +154 -0
- adaline_api/models/image_source.py +140 -0
- adaline_api/models/image_source_type.py +140 -0
- adaline_api/models/log_attributes_value.py +160 -0
- adaline_api/models/log_feedback_comment.py +98 -0
- adaline_api/models/log_span.py +180 -0
- adaline_api/models/log_span_all_of_internal_feedback.py +98 -0
- adaline_api/models/log_span_content.py +224 -0
- adaline_api/models/log_span_embeddings_content.py +101 -0
- adaline_api/models/log_span_event.py +96 -0
- adaline_api/models/log_span_function_content.py +101 -0
- adaline_api/models/log_span_guardrail_content.py +101 -0
- adaline_api/models/log_span_model_content.py +109 -0
- adaline_api/models/log_span_model_stream_content.py +111 -0
- adaline_api/models/log_span_other_content.py +101 -0
- adaline_api/models/log_span_parsed_content.py +101 -0
- adaline_api/models/log_span_retrieval_content.py +101 -0
- adaline_api/models/log_span_tool_content.py +101 -0
- adaline_api/models/log_trace.py +132 -0
- adaline_api/models/log_trace_attributes_inner.py +102 -0
- adaline_api/models/log_trace_attributes_value.py +160 -0
- adaline_api/models/log_trace_attributes_value_type.py +160 -0
- adaline_api/models/log_trace_tags_inner.py +96 -0
- adaline_api/models/log_trace_type.py +132 -0
- adaline_api/models/log_trace_type_attributes_inner.py +102 -0
- adaline_api/models/log_trace_type_tags_inner.py +96 -0
- adaline_api/models/mcp_server.py +114 -0
- adaline_api/models/mcp_server_tool_configuration.py +90 -0
- adaline_api/models/mcp_server_tool_configuration_type.py +90 -0
- adaline_api/models/mcp_server_type.py +114 -0
- adaline_api/models/message.py +98 -0
- adaline_api/models/message_content_inner.py +182 -0
- adaline_api/models/message_content_type_inner.py +182 -0
- adaline_api/models/message_type.py +98 -0
- adaline_api/models/modality_enum.py +41 -0
- adaline_api/models/modality_enum_type.py +41 -0
- adaline_api/models/pdf_content.py +106 -0
- adaline_api/models/pdf_content_file.py +91 -0
- adaline_api/models/pdf_content_type.py +106 -0
- adaline_api/models/pdf_content_type_file.py +91 -0
- adaline_api/models/pdf_content_value.py +140 -0
- adaline_api/models/pdf_content_value_type.py +140 -0
- adaline_api/models/pdf_message_content.py +108 -0
- adaline_api/models/pdf_message_content_file.py +91 -0
- adaline_api/models/pdf_message_content_type.py +108 -0
- adaline_api/models/pdf_message_content_type_file.py +91 -0
- adaline_api/models/pdf_message_content_type_value.py +154 -0
- adaline_api/models/pdf_message_content_value.py +154 -0
- adaline_api/models/prompt_variable.py +96 -0
- adaline_api/models/prompt_variable_value.py +210 -0
- adaline_api/models/reasoning_content.py +100 -0
- adaline_api/models/reasoning_content_type.py +100 -0
- adaline_api/models/reasoning_content_value.py +98 -0
- adaline_api/models/reasoning_content_value_type.py +98 -0
- adaline_api/models/reasoning_content_value_union.py +140 -0
- adaline_api/models/reasoning_content_value_union_type.py +140 -0
- adaline_api/models/reasoning_message_content.py +102 -0
- adaline_api/models/reasoning_message_content_type.py +102 -0
- adaline_api/models/reasoning_message_content_type_value.py +140 -0
- adaline_api/models/reasoning_message_content_value.py +140 -0
- adaline_api/models/reasoning_redacted_value.py +109 -0
- adaline_api/models/reasoning_redacted_value_type.py +109 -0
- adaline_api/models/reasoning_thinking_value.py +111 -0
- adaline_api/models/reasoning_thinking_value_type.py +111 -0
- adaline_api/models/reasoning_value.py +140 -0
- adaline_api/models/reasoning_value_type.py +140 -0
- adaline_api/models/redacted_reasoning_content_value.py +96 -0
- adaline_api/models/redacted_reasoning_content_value_type.py +96 -0
- adaline_api/models/response_schema.py +105 -0
- adaline_api/models/response_schema_property.py +135 -0
- adaline_api/models/response_schema_property_enum_inner.py +166 -0
- adaline_api/models/response_schema_property_type.py +143 -0
- adaline_api/models/response_schema_property_type_enum_inner.py +166 -0
- adaline_api/models/response_schema_property_type_type.py +143 -0
- adaline_api/models/response_schema_structure.py +122 -0
- adaline_api/models/response_schema_structure_type.py +122 -0
- adaline_api/models/response_schema_type.py +105 -0
- adaline_api/models/role_enum.py +39 -0
- adaline_api/models/role_enum_type.py +39 -0
- adaline_api/models/span_content_detailed.py +112 -0
- adaline_api/models/span_content_detailed_type.py +112 -0
- adaline_api/models/span_content_detailed_type_variables_value.py +94 -0
- adaline_api/models/span_content_detailed_variables_value.py +94 -0
- adaline_api/models/span_content_minimal.py +91 -0
- adaline_api/models/span_content_minimal_type.py +91 -0
- adaline_api/models/span_log_req_attributes.py +160 -0
- adaline_api/models/span_log_req_attributes_type.py +160 -0
- adaline_api/models/span_log_req_content.py +137 -0
- adaline_api/models/span_log_req_content_type.py +137 -0
- adaline_api/models/span_log_request.py +93 -0
- adaline_api/models/span_log_request_span.py +139 -0
- adaline_api/models/span_log_request_type.py +93 -0
- adaline_api/models/span_log_request_type_span.py +139 -0
- adaline_api/models/span_log_response.py +87 -0
- adaline_api/models/span_log_response_type.py +87 -0
- adaline_api/models/spans_request_attribute_value.py +160 -0
- adaline_api/models/spans_request_attribute_value_type.py +160 -0
- adaline_api/models/spans_request_content_value.py +143 -0
- adaline_api/models/spans_request_content_value_type.py +143 -0
- adaline_api/models/text_content.py +96 -0
- adaline_api/models/text_content_type.py +96 -0
- adaline_api/models/text_message_content.py +98 -0
- adaline_api/models/text_message_content_type.py +98 -0
- adaline_api/models/tool_call_content.py +105 -0
- adaline_api/models/tool_call_content_type.py +105 -0
- adaline_api/models/tool_call_message_content.py +107 -0
- adaline_api/models/tool_call_message_content_type.py +107 -0
- adaline_api/models/tool_response_content.py +109 -0
- adaline_api/models/tool_response_content_api_response.py +88 -0
- adaline_api/models/tool_response_content_type.py +109 -0
- adaline_api/models/tool_response_content_type_api_response.py +88 -0
- adaline_api/models/tool_response_message_content.py +111 -0
- adaline_api/models/tool_response_message_content_api_response.py +87 -0
- adaline_api/models/tool_response_message_content_type.py +111 -0
- adaline_api/models/tool_response_message_content_type_api_response.py +87 -0
- adaline_api/models/tool_type.py +113 -0
- adaline_api/models/trace_log_patch_request.py +137 -0
- adaline_api/models/trace_log_patch_request_one_of.py +97 -0
- adaline_api/models/trace_log_patch_request_one_of1.py +97 -0
- adaline_api/models/trace_log_patch_request_type.py +137 -0
- adaline_api/models/trace_log_patch_request_type_one_of.py +97 -0
- adaline_api/models/trace_log_patch_request_type_one_of1.py +97 -0
- adaline_api/models/trace_log_patch_response.py +87 -0
- adaline_api/models/trace_log_patch_response_type.py +87 -0
- adaline_api/models/trace_log_request.py +103 -0
- adaline_api/models/trace_log_request_spans_inner.py +135 -0
- adaline_api/models/trace_log_request_trace.py +121 -0
- adaline_api/models/trace_log_request_type.py +103 -0
- adaline_api/models/trace_log_request_type_spans_inner.py +135 -0
- adaline_api/models/trace_log_request_type_trace.py +121 -0
- adaline_api/models/trace_log_response.py +89 -0
- adaline_api/models/trace_log_response_type.py +89 -0
- adaline_api/models/trace_request_attribute_value.py +160 -0
- adaline_api/models/trace_request_attribute_value_type.py +160 -0
- adaline_api/models/update_log_trace_request.py +98 -0
- adaline_api/models/update_log_trace_request_attribute_item.py +140 -0
- adaline_api/models/update_log_trace_request_attribute_item_one_of.py +102 -0
- adaline_api/models/update_log_trace_request_attribute_item_one_of1.py +96 -0
- adaline_api/models/update_log_trace_request_attribute_item_one_of_value.py +160 -0
- adaline_api/models/update_log_trace_request_tag_item.py +140 -0
- adaline_api/models/update_log_trace_request_tag_item_one_of.py +97 -0
- adaline_api/models/update_log_trace_request_tag_item_one_of1.py +97 -0
- adaline_api/models/update_log_trace_request_trace.py +120 -0
- adaline_api/models/update_log_trace_request_type.py +98 -0
- adaline_api/models/update_log_trace_response.py +87 -0
- adaline_api/models/update_log_trace_response_type.py +87 -0
- adaline_api/models/url_image_content_value.py +96 -0
- adaline_api/models/url_image_content_value_type.py +96 -0
- adaline_api/models/url_media.py +109 -0
- adaline_api/models/url_media_type.py +109 -0
- adaline_api/models/url_pdf_content_value.py +96 -0
- adaline_api/models/url_pdf_content_value_type.py +96 -0
- adaline_api/models/variable.py +96 -0
- adaline_api/models/variable_type.py +96 -0
- adaline_api/models/variable_type_value.py +196 -0
- adaline_api/models/variable_value.py +196 -0
- adaline_api/models/variables_type.py +96 -0
- adaline_api/py.typed +0 -0
- adaline_api/rest.py +213 -0
- adaline_api-1.0.0.dist-info/METADATA +227 -0
- adaline_api-1.0.0.dist-info/RECORD +233 -0
- adaline_api-1.0.0.dist-info/WHEEL +5 -0
- adaline_api-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,106 @@
|
|
|
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, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class FunctionType(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
FunctionType
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
name: Annotated[str, Field(strict=True, max_length=64)]
|
|
31
|
+
description: Annotated[str, Field(strict=True, max_length=4096)]
|
|
32
|
+
parameters: Optional[Any]
|
|
33
|
+
strict: Optional[StrictBool] = None
|
|
34
|
+
__properties: ClassVar[List[str]] = ["name", "description", "parameters", "strict"]
|
|
35
|
+
|
|
36
|
+
@field_validator('name')
|
|
37
|
+
def name_validate_regular_expression(cls, value):
|
|
38
|
+
"""Validates the regular expression"""
|
|
39
|
+
if not re.match(r"^[a-zA-Z0-9_]{1,64}$", value):
|
|
40
|
+
raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9_]{1,64}$/")
|
|
41
|
+
return value
|
|
42
|
+
|
|
43
|
+
model_config = ConfigDict(
|
|
44
|
+
populate_by_name=True,
|
|
45
|
+
validate_assignment=True,
|
|
46
|
+
protected_namespaces=(),
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def to_str(self) -> str:
|
|
51
|
+
"""Returns the string representation of the model using alias"""
|
|
52
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
53
|
+
|
|
54
|
+
def to_json(self) -> str:
|
|
55
|
+
"""Returns the JSON representation of the model using alias"""
|
|
56
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
57
|
+
return json.dumps(self.to_dict())
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
61
|
+
"""Create an instance of FunctionType from a JSON string"""
|
|
62
|
+
return cls.from_dict(json.loads(json_str))
|
|
63
|
+
|
|
64
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
65
|
+
"""Return the dictionary representation of the model using alias.
|
|
66
|
+
|
|
67
|
+
This has the following differences from calling pydantic's
|
|
68
|
+
`self.model_dump(by_alias=True)`:
|
|
69
|
+
|
|
70
|
+
* `None` is only added to the output dict for nullable fields that
|
|
71
|
+
were set at model initialization. Other fields with value `None`
|
|
72
|
+
are ignored.
|
|
73
|
+
"""
|
|
74
|
+
excluded_fields: Set[str] = set([
|
|
75
|
+
])
|
|
76
|
+
|
|
77
|
+
_dict = self.model_dump(
|
|
78
|
+
by_alias=True,
|
|
79
|
+
exclude=excluded_fields,
|
|
80
|
+
exclude_none=True,
|
|
81
|
+
)
|
|
82
|
+
# set to None if parameters (nullable) is None
|
|
83
|
+
# and model_fields_set contains the field
|
|
84
|
+
if self.parameters is None and "parameters" in self.model_fields_set:
|
|
85
|
+
_dict['parameters'] = None
|
|
86
|
+
|
|
87
|
+
return _dict
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
91
|
+
"""Create an instance of FunctionType from a dict"""
|
|
92
|
+
if obj is None:
|
|
93
|
+
return None
|
|
94
|
+
|
|
95
|
+
if not isinstance(obj, dict):
|
|
96
|
+
return cls.model_validate(obj)
|
|
97
|
+
|
|
98
|
+
_obj = cls.model_validate({
|
|
99
|
+
"name": obj.get("name"),
|
|
100
|
+
"description": obj.get("description"),
|
|
101
|
+
"parameters": obj.get("parameters"),
|
|
102
|
+
"strict": obj.get("strict")
|
|
103
|
+
})
|
|
104
|
+
return _obj
|
|
105
|
+
|
|
106
|
+
|
|
@@ -0,0 +1,109 @@
|
|
|
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, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from adaline_api.models.image_content_value import ImageContentValue
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class ImageContent(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
Image content type for prompt messages with detail level specification
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
modality: StrictStr
|
|
31
|
+
detail: StrictStr
|
|
32
|
+
value: ImageContentValue
|
|
33
|
+
__properties: ClassVar[List[str]] = ["modality", "detail", "value"]
|
|
34
|
+
|
|
35
|
+
@field_validator('modality')
|
|
36
|
+
def modality_validate_enum(cls, value):
|
|
37
|
+
"""Validates the enum"""
|
|
38
|
+
if value not in set(['image']):
|
|
39
|
+
raise ValueError("must be one of enum values ('image')")
|
|
40
|
+
return value
|
|
41
|
+
|
|
42
|
+
@field_validator('detail')
|
|
43
|
+
def detail_validate_enum(cls, value):
|
|
44
|
+
"""Validates the enum"""
|
|
45
|
+
if value not in set(['low', 'medium', 'high', 'auto']):
|
|
46
|
+
raise ValueError("must be one of enum values ('low', 'medium', 'high', 'auto')")
|
|
47
|
+
return value
|
|
48
|
+
|
|
49
|
+
model_config = ConfigDict(
|
|
50
|
+
populate_by_name=True,
|
|
51
|
+
validate_assignment=True,
|
|
52
|
+
protected_namespaces=(),
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def to_str(self) -> str:
|
|
57
|
+
"""Returns the string representation of the model using alias"""
|
|
58
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
59
|
+
|
|
60
|
+
def to_json(self) -> str:
|
|
61
|
+
"""Returns the JSON representation of the model using alias"""
|
|
62
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
63
|
+
return json.dumps(self.to_dict())
|
|
64
|
+
|
|
65
|
+
@classmethod
|
|
66
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
67
|
+
"""Create an instance of ImageContent from a JSON string"""
|
|
68
|
+
return cls.from_dict(json.loads(json_str))
|
|
69
|
+
|
|
70
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
71
|
+
"""Return the dictionary representation of the model using alias.
|
|
72
|
+
|
|
73
|
+
This has the following differences from calling pydantic's
|
|
74
|
+
`self.model_dump(by_alias=True)`:
|
|
75
|
+
|
|
76
|
+
* `None` is only added to the output dict for nullable fields that
|
|
77
|
+
were set at model initialization. Other fields with value `None`
|
|
78
|
+
are ignored.
|
|
79
|
+
"""
|
|
80
|
+
excluded_fields: Set[str] = set([
|
|
81
|
+
])
|
|
82
|
+
|
|
83
|
+
_dict = self.model_dump(
|
|
84
|
+
by_alias=True,
|
|
85
|
+
exclude=excluded_fields,
|
|
86
|
+
exclude_none=True,
|
|
87
|
+
)
|
|
88
|
+
# override the default output from pydantic by calling `to_dict()` of value
|
|
89
|
+
if self.value:
|
|
90
|
+
_dict['value'] = self.value.to_dict()
|
|
91
|
+
return _dict
|
|
92
|
+
|
|
93
|
+
@classmethod
|
|
94
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
95
|
+
"""Create an instance of ImageContent from a dict"""
|
|
96
|
+
if obj is None:
|
|
97
|
+
return None
|
|
98
|
+
|
|
99
|
+
if not isinstance(obj, dict):
|
|
100
|
+
return cls.model_validate(obj)
|
|
101
|
+
|
|
102
|
+
_obj = cls.model_validate({
|
|
103
|
+
"modality": obj.get("modality"),
|
|
104
|
+
"detail": obj.get("detail"),
|
|
105
|
+
"value": ImageContentValue.from_dict(obj["value"]) if obj.get("value") is not None else None
|
|
106
|
+
})
|
|
107
|
+
return _obj
|
|
108
|
+
|
|
109
|
+
|
|
@@ -0,0 +1,109 @@
|
|
|
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, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from adaline_api.models.image_content_value_type import ImageContentValueType
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class ImageContentType(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
ImageContentType
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
modality: StrictStr
|
|
31
|
+
detail: StrictStr
|
|
32
|
+
value: ImageContentValueType
|
|
33
|
+
__properties: ClassVar[List[str]] = ["modality", "detail", "value"]
|
|
34
|
+
|
|
35
|
+
@field_validator('modality')
|
|
36
|
+
def modality_validate_enum(cls, value):
|
|
37
|
+
"""Validates the enum"""
|
|
38
|
+
if value not in set(['image']):
|
|
39
|
+
raise ValueError("must be one of enum values ('image')")
|
|
40
|
+
return value
|
|
41
|
+
|
|
42
|
+
@field_validator('detail')
|
|
43
|
+
def detail_validate_enum(cls, value):
|
|
44
|
+
"""Validates the enum"""
|
|
45
|
+
if value not in set(['low', 'medium', 'high', 'auto']):
|
|
46
|
+
raise ValueError("must be one of enum values ('low', 'medium', 'high', 'auto')")
|
|
47
|
+
return value
|
|
48
|
+
|
|
49
|
+
model_config = ConfigDict(
|
|
50
|
+
populate_by_name=True,
|
|
51
|
+
validate_assignment=True,
|
|
52
|
+
protected_namespaces=(),
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def to_str(self) -> str:
|
|
57
|
+
"""Returns the string representation of the model using alias"""
|
|
58
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
59
|
+
|
|
60
|
+
def to_json(self) -> str:
|
|
61
|
+
"""Returns the JSON representation of the model using alias"""
|
|
62
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
63
|
+
return json.dumps(self.to_dict())
|
|
64
|
+
|
|
65
|
+
@classmethod
|
|
66
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
67
|
+
"""Create an instance of ImageContentType from a JSON string"""
|
|
68
|
+
return cls.from_dict(json.loads(json_str))
|
|
69
|
+
|
|
70
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
71
|
+
"""Return the dictionary representation of the model using alias.
|
|
72
|
+
|
|
73
|
+
This has the following differences from calling pydantic's
|
|
74
|
+
`self.model_dump(by_alias=True)`:
|
|
75
|
+
|
|
76
|
+
* `None` is only added to the output dict for nullable fields that
|
|
77
|
+
were set at model initialization. Other fields with value `None`
|
|
78
|
+
are ignored.
|
|
79
|
+
"""
|
|
80
|
+
excluded_fields: Set[str] = set([
|
|
81
|
+
])
|
|
82
|
+
|
|
83
|
+
_dict = self.model_dump(
|
|
84
|
+
by_alias=True,
|
|
85
|
+
exclude=excluded_fields,
|
|
86
|
+
exclude_none=True,
|
|
87
|
+
)
|
|
88
|
+
# override the default output from pydantic by calling `to_dict()` of value
|
|
89
|
+
if self.value:
|
|
90
|
+
_dict['value'] = self.value.to_dict()
|
|
91
|
+
return _dict
|
|
92
|
+
|
|
93
|
+
@classmethod
|
|
94
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
95
|
+
"""Create an instance of ImageContentType from a dict"""
|
|
96
|
+
if obj is None:
|
|
97
|
+
return None
|
|
98
|
+
|
|
99
|
+
if not isinstance(obj, dict):
|
|
100
|
+
return cls.model_validate(obj)
|
|
101
|
+
|
|
102
|
+
_obj = cls.model_validate({
|
|
103
|
+
"modality": obj.get("modality"),
|
|
104
|
+
"detail": obj.get("detail"),
|
|
105
|
+
"value": ImageContentValueType.from_dict(obj["value"]) if obj.get("value") is not None else None
|
|
106
|
+
})
|
|
107
|
+
return _obj
|
|
108
|
+
|
|
109
|
+
|
|
@@ -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_image_content_value import Base64ImageContentValue
|
|
21
|
+
from adaline_api.models.url_image_content_value import UrlImageContentValue
|
|
22
|
+
from pydantic import StrictStr, Field
|
|
23
|
+
from typing import Union, List, Set, Optional, Dict
|
|
24
|
+
from typing_extensions import Literal, Self
|
|
25
|
+
|
|
26
|
+
IMAGECONTENTVALUE_ONE_OF_SCHEMAS = ["Base64ImageContentValue", "UrlImageContentValue"]
|
|
27
|
+
|
|
28
|
+
class ImageContentValue(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
Union type for image content - either base64 encoded or URL reference
|
|
31
|
+
"""
|
|
32
|
+
# data type: Base64ImageContentValue
|
|
33
|
+
oneof_schema_1_validator: Optional[Base64ImageContentValue] = None
|
|
34
|
+
# data type: UrlImageContentValue
|
|
35
|
+
oneof_schema_2_validator: Optional[UrlImageContentValue] = None
|
|
36
|
+
actual_instance: Optional[Union[Base64ImageContentValue, UrlImageContentValue]] = None
|
|
37
|
+
one_of_schemas: Set[str] = { "Base64ImageContentValue", "UrlImageContentValue" }
|
|
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 = ImageContentValue.model_construct()
|
|
61
|
+
error_messages = []
|
|
62
|
+
match = 0
|
|
63
|
+
# validate data type: Base64ImageContentValue
|
|
64
|
+
if not isinstance(v, Base64ImageContentValue):
|
|
65
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `Base64ImageContentValue`")
|
|
66
|
+
else:
|
|
67
|
+
match += 1
|
|
68
|
+
# validate data type: UrlImageContentValue
|
|
69
|
+
if not isinstance(v, UrlImageContentValue):
|
|
70
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `UrlImageContentValue`")
|
|
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 ImageContentValue with oneOf schemas: Base64ImageContentValue, UrlImageContentValue. Details: " + ", ".join(error_messages))
|
|
76
|
+
elif match == 0:
|
|
77
|
+
# no match
|
|
78
|
+
raise ValueError("No match found when setting `actual_instance` in ImageContentValue with oneOf schemas: Base64ImageContentValue, UrlImageContentValue. 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 Base64ImageContentValue
|
|
94
|
+
try:
|
|
95
|
+
instance.actual_instance = Base64ImageContentValue.from_json(json_str)
|
|
96
|
+
match += 1
|
|
97
|
+
except (ValidationError, ValueError) as e:
|
|
98
|
+
error_messages.append(str(e))
|
|
99
|
+
# deserialize data into UrlImageContentValue
|
|
100
|
+
try:
|
|
101
|
+
instance.actual_instance = UrlImageContentValue.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 ImageContentValue with oneOf schemas: Base64ImageContentValue, UrlImageContentValue. Details: " + ", ".join(error_messages))
|
|
109
|
+
elif match == 0:
|
|
110
|
+
# no match
|
|
111
|
+
raise ValueError("No match found when deserializing the JSON string into ImageContentValue with oneOf schemas: Base64ImageContentValue, UrlImageContentValue. 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], Base64ImageContentValue, UrlImageContentValue]]:
|
|
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,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_image_content_value_type import Base64ImageContentValueType
|
|
21
|
+
from adaline_api.models.url_image_content_value_type import UrlImageContentValueType
|
|
22
|
+
from pydantic import StrictStr, Field
|
|
23
|
+
from typing import Union, List, Set, Optional, Dict
|
|
24
|
+
from typing_extensions import Literal, Self
|
|
25
|
+
|
|
26
|
+
IMAGECONTENTVALUETYPE_ONE_OF_SCHEMAS = ["Base64ImageContentValueType", "UrlImageContentValueType"]
|
|
27
|
+
|
|
28
|
+
class ImageContentValueType(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
ImageContentValueType
|
|
31
|
+
"""
|
|
32
|
+
# data type: Base64ImageContentValueType
|
|
33
|
+
oneof_schema_1_validator: Optional[Base64ImageContentValueType] = None
|
|
34
|
+
# data type: UrlImageContentValueType
|
|
35
|
+
oneof_schema_2_validator: Optional[UrlImageContentValueType] = None
|
|
36
|
+
actual_instance: Optional[Union[Base64ImageContentValueType, UrlImageContentValueType]] = None
|
|
37
|
+
one_of_schemas: Set[str] = { "Base64ImageContentValueType", "UrlImageContentValueType" }
|
|
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 = ImageContentValueType.model_construct()
|
|
61
|
+
error_messages = []
|
|
62
|
+
match = 0
|
|
63
|
+
# validate data type: Base64ImageContentValueType
|
|
64
|
+
if not isinstance(v, Base64ImageContentValueType):
|
|
65
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `Base64ImageContentValueType`")
|
|
66
|
+
else:
|
|
67
|
+
match += 1
|
|
68
|
+
# validate data type: UrlImageContentValueType
|
|
69
|
+
if not isinstance(v, UrlImageContentValueType):
|
|
70
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `UrlImageContentValueType`")
|
|
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 ImageContentValueType with oneOf schemas: Base64ImageContentValueType, UrlImageContentValueType. Details: " + ", ".join(error_messages))
|
|
76
|
+
elif match == 0:
|
|
77
|
+
# no match
|
|
78
|
+
raise ValueError("No match found when setting `actual_instance` in ImageContentValueType with oneOf schemas: Base64ImageContentValueType, UrlImageContentValueType. 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 Base64ImageContentValueType
|
|
94
|
+
try:
|
|
95
|
+
instance.actual_instance = Base64ImageContentValueType.from_json(json_str)
|
|
96
|
+
match += 1
|
|
97
|
+
except (ValidationError, ValueError) as e:
|
|
98
|
+
error_messages.append(str(e))
|
|
99
|
+
# deserialize data into UrlImageContentValueType
|
|
100
|
+
try:
|
|
101
|
+
instance.actual_instance = UrlImageContentValueType.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 ImageContentValueType with oneOf schemas: Base64ImageContentValueType, UrlImageContentValueType. Details: " + ", ".join(error_messages))
|
|
109
|
+
elif match == 0:
|
|
110
|
+
# no match
|
|
111
|
+
raise ValueError("No match found when deserializing the JSON string into ImageContentValueType with oneOf schemas: Base64ImageContentValueType, UrlImageContentValueType. 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], Base64ImageContentValueType, UrlImageContentValueType]]:
|
|
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
|
+
|