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
adaline_api/rest.py
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
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
|
+
import io
|
|
16
|
+
import json
|
|
17
|
+
import re
|
|
18
|
+
import ssl
|
|
19
|
+
from typing import Optional, Union
|
|
20
|
+
|
|
21
|
+
import aiohttp
|
|
22
|
+
import aiohttp_retry
|
|
23
|
+
|
|
24
|
+
from adaline_api.exceptions import ApiException, ApiValueError
|
|
25
|
+
|
|
26
|
+
RESTResponseType = aiohttp.ClientResponse
|
|
27
|
+
|
|
28
|
+
ALLOW_RETRY_METHODS = frozenset({'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PUT', 'TRACE'})
|
|
29
|
+
|
|
30
|
+
class RESTResponse(io.IOBase):
|
|
31
|
+
|
|
32
|
+
def __init__(self, resp) -> None:
|
|
33
|
+
self.response = resp
|
|
34
|
+
self.status = resp.status
|
|
35
|
+
self.reason = resp.reason
|
|
36
|
+
self.data = None
|
|
37
|
+
|
|
38
|
+
async def read(self):
|
|
39
|
+
if self.data is None:
|
|
40
|
+
self.data = await self.response.read()
|
|
41
|
+
return self.data
|
|
42
|
+
|
|
43
|
+
def getheaders(self):
|
|
44
|
+
"""Returns a CIMultiDictProxy of the response headers."""
|
|
45
|
+
return self.response.headers
|
|
46
|
+
|
|
47
|
+
def getheader(self, name, default=None):
|
|
48
|
+
"""Returns a given response header."""
|
|
49
|
+
return self.response.headers.get(name, default)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class RESTClientObject:
|
|
53
|
+
|
|
54
|
+
def __init__(self, configuration) -> None:
|
|
55
|
+
|
|
56
|
+
# maxsize is number of requests to host that are allowed in parallel
|
|
57
|
+
self.maxsize = configuration.connection_pool_maxsize
|
|
58
|
+
|
|
59
|
+
self.ssl_context = ssl.create_default_context(
|
|
60
|
+
cafile=configuration.ssl_ca_cert,
|
|
61
|
+
cadata=configuration.ca_cert_data,
|
|
62
|
+
)
|
|
63
|
+
if configuration.cert_file:
|
|
64
|
+
self.ssl_context.load_cert_chain(
|
|
65
|
+
configuration.cert_file, keyfile=configuration.key_file
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
if not configuration.verify_ssl:
|
|
69
|
+
self.ssl_context.check_hostname = False
|
|
70
|
+
self.ssl_context.verify_mode = ssl.CERT_NONE
|
|
71
|
+
|
|
72
|
+
self.proxy = configuration.proxy
|
|
73
|
+
self.proxy_headers = configuration.proxy_headers
|
|
74
|
+
|
|
75
|
+
self.retries = configuration.retries
|
|
76
|
+
|
|
77
|
+
self.pool_manager: Optional[aiohttp.ClientSession] = None
|
|
78
|
+
self.retry_client: Optional[aiohttp_retry.RetryClient] = None
|
|
79
|
+
|
|
80
|
+
async def close(self) -> None:
|
|
81
|
+
if self.pool_manager:
|
|
82
|
+
await self.pool_manager.close()
|
|
83
|
+
if self.retry_client is not None:
|
|
84
|
+
await self.retry_client.close()
|
|
85
|
+
|
|
86
|
+
async def request(
|
|
87
|
+
self,
|
|
88
|
+
method,
|
|
89
|
+
url,
|
|
90
|
+
headers=None,
|
|
91
|
+
body=None,
|
|
92
|
+
post_params=None,
|
|
93
|
+
_request_timeout=None
|
|
94
|
+
):
|
|
95
|
+
"""Execute request
|
|
96
|
+
|
|
97
|
+
:param method: http request method
|
|
98
|
+
:param url: http request url
|
|
99
|
+
:param headers: http request headers
|
|
100
|
+
:param body: request json body, for `application/json`
|
|
101
|
+
:param post_params: request post parameters,
|
|
102
|
+
`application/x-www-form-urlencoded`
|
|
103
|
+
and `multipart/form-data`
|
|
104
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
105
|
+
number provided, it will be total request
|
|
106
|
+
timeout. It can also be a pair (tuple) of
|
|
107
|
+
(connection, read) timeouts.
|
|
108
|
+
"""
|
|
109
|
+
method = method.upper()
|
|
110
|
+
assert method in [
|
|
111
|
+
'GET',
|
|
112
|
+
'HEAD',
|
|
113
|
+
'DELETE',
|
|
114
|
+
'POST',
|
|
115
|
+
'PUT',
|
|
116
|
+
'PATCH',
|
|
117
|
+
'OPTIONS'
|
|
118
|
+
]
|
|
119
|
+
|
|
120
|
+
if post_params and body:
|
|
121
|
+
raise ApiValueError(
|
|
122
|
+
"body parameter cannot be used with post_params parameter."
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
post_params = post_params or {}
|
|
126
|
+
headers = headers or {}
|
|
127
|
+
# url already contains the URL query string
|
|
128
|
+
timeout = _request_timeout or 5 * 60
|
|
129
|
+
|
|
130
|
+
if 'Content-Type' not in headers:
|
|
131
|
+
headers['Content-Type'] = 'application/json'
|
|
132
|
+
|
|
133
|
+
args = {
|
|
134
|
+
"method": method,
|
|
135
|
+
"url": url,
|
|
136
|
+
"timeout": timeout,
|
|
137
|
+
"headers": headers
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if self.proxy:
|
|
141
|
+
args["proxy"] = self.proxy
|
|
142
|
+
if self.proxy_headers:
|
|
143
|
+
args["proxy_headers"] = self.proxy_headers
|
|
144
|
+
|
|
145
|
+
# For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
|
|
146
|
+
if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
|
|
147
|
+
if re.search('json', headers['Content-Type'], re.IGNORECASE):
|
|
148
|
+
if body is not None:
|
|
149
|
+
body = json.dumps(body)
|
|
150
|
+
args["data"] = body
|
|
151
|
+
elif headers['Content-Type'] == 'application/x-www-form-urlencoded':
|
|
152
|
+
args["data"] = aiohttp.FormData(post_params)
|
|
153
|
+
elif headers['Content-Type'] == 'multipart/form-data':
|
|
154
|
+
# must del headers['Content-Type'], or the correct
|
|
155
|
+
# Content-Type which generated by aiohttp
|
|
156
|
+
del headers['Content-Type']
|
|
157
|
+
data = aiohttp.FormData()
|
|
158
|
+
for param in post_params:
|
|
159
|
+
k, v = param
|
|
160
|
+
if isinstance(v, tuple) and len(v) == 3:
|
|
161
|
+
data.add_field(
|
|
162
|
+
k,
|
|
163
|
+
value=v[1],
|
|
164
|
+
filename=v[0],
|
|
165
|
+
content_type=v[2]
|
|
166
|
+
)
|
|
167
|
+
else:
|
|
168
|
+
# Ensures that dict objects are serialized
|
|
169
|
+
if isinstance(v, dict):
|
|
170
|
+
v = json.dumps(v)
|
|
171
|
+
elif isinstance(v, int):
|
|
172
|
+
v = str(v)
|
|
173
|
+
data.add_field(k, v)
|
|
174
|
+
args["data"] = data
|
|
175
|
+
|
|
176
|
+
# Pass a `bytes` or `str` parameter directly in the body to support
|
|
177
|
+
# other content types than Json when `body` argument is provided
|
|
178
|
+
# in serialized form
|
|
179
|
+
elif isinstance(body, str) or isinstance(body, bytes):
|
|
180
|
+
args["data"] = body
|
|
181
|
+
else:
|
|
182
|
+
# Cannot generate the request from given parameters
|
|
183
|
+
msg = """Cannot prepare a request message for provided
|
|
184
|
+
arguments. Please check that your arguments match
|
|
185
|
+
declared content type."""
|
|
186
|
+
raise ApiException(status=0, reason=msg)
|
|
187
|
+
|
|
188
|
+
pool_manager: Union[aiohttp.ClientSession, aiohttp_retry.RetryClient]
|
|
189
|
+
|
|
190
|
+
# https pool manager
|
|
191
|
+
if self.pool_manager is None:
|
|
192
|
+
self.pool_manager = aiohttp.ClientSession(
|
|
193
|
+
connector=aiohttp.TCPConnector(limit=self.maxsize, ssl=self.ssl_context),
|
|
194
|
+
trust_env=True,
|
|
195
|
+
)
|
|
196
|
+
pool_manager = self.pool_manager
|
|
197
|
+
|
|
198
|
+
if self.retries is not None and method in ALLOW_RETRY_METHODS:
|
|
199
|
+
if self.retry_client is None:
|
|
200
|
+
self.retry_client = aiohttp_retry.RetryClient(
|
|
201
|
+
client_session=self.pool_manager,
|
|
202
|
+
retry_options=aiohttp_retry.ExponentialRetry(
|
|
203
|
+
attempts=self.retries,
|
|
204
|
+
factor=2.0,
|
|
205
|
+
start_timeout=0.1,
|
|
206
|
+
max_timeout=120.0
|
|
207
|
+
)
|
|
208
|
+
)
|
|
209
|
+
pool_manager = self.retry_client
|
|
210
|
+
|
|
211
|
+
r = await pool_manager.request(**args)
|
|
212
|
+
|
|
213
|
+
return RESTResponse(r)
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: adaline-api
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Adaline API - Auto-generated Python client for the Adaline platform
|
|
5
|
+
Home-page:
|
|
6
|
+
Author: OpenAPI Generator community
|
|
7
|
+
Author-email: Adaline <akshay@adaline.ai>
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://github.com/adaline/sdk
|
|
10
|
+
Project-URL: Repository, https://github.com/adaline/sdk.git
|
|
11
|
+
Project-URL: Issues, https://github.com/adaline/sdk/issues
|
|
12
|
+
Keywords: adaline,sdk,api,ai,llm,OpenAPI
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Requires-Python: >=3.9
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
Requires-Dist: urllib3<3.0.0,>=2.1.0
|
|
24
|
+
Requires-Dist: python-dateutil>=2.8.2
|
|
25
|
+
Requires-Dist: aiohttp>=3.8.4
|
|
26
|
+
Requires-Dist: aiohttp-retry>=2.8.3
|
|
27
|
+
Requires-Dist: pydantic>=2
|
|
28
|
+
Requires-Dist: typing-extensions>=4.7.1
|
|
29
|
+
Dynamic: author
|
|
30
|
+
|
|
31
|
+
# adaline-api
|
|
32
|
+
API for managing Adaline deployments, logs, and core type definitions.
|
|
33
|
+
|
|
34
|
+
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
|
35
|
+
|
|
36
|
+
- API version: 1.0.0
|
|
37
|
+
- Package version: 1.0.0
|
|
38
|
+
- Generator version: 7.14.0
|
|
39
|
+
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
|
|
40
|
+
|
|
41
|
+
## Requirements.
|
|
42
|
+
|
|
43
|
+
Python 3.9+
|
|
44
|
+
|
|
45
|
+
## Installation & Usage
|
|
46
|
+
### pip install
|
|
47
|
+
|
|
48
|
+
If the python package is hosted on a repository, you can install directly using:
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
|
|
52
|
+
```
|
|
53
|
+
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)
|
|
54
|
+
|
|
55
|
+
Then import the package:
|
|
56
|
+
```python
|
|
57
|
+
import adaline_api
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Setuptools
|
|
61
|
+
|
|
62
|
+
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
python setup.py install --user
|
|
66
|
+
```
|
|
67
|
+
(or `sudo python setup.py install` to install the package for all users)
|
|
68
|
+
|
|
69
|
+
Then import the package:
|
|
70
|
+
```python
|
|
71
|
+
import adaline_api
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Tests
|
|
75
|
+
|
|
76
|
+
Execute `pytest` to run the tests.
|
|
77
|
+
|
|
78
|
+
## Getting Started
|
|
79
|
+
|
|
80
|
+
Please follow the [installation procedure](#installation--usage) and then run the following:
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
|
|
84
|
+
import adaline_api
|
|
85
|
+
from adaline_api.rest import ApiException
|
|
86
|
+
from pprint import pprint
|
|
87
|
+
|
|
88
|
+
# Defining the host is optional and defaults to https://api.adaline.ai/v2
|
|
89
|
+
# See configuration.py for a list of all supported configuration parameters.
|
|
90
|
+
configuration = adaline_api.Configuration(
|
|
91
|
+
host = "https://api.adaline.ai/v2"
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
# The client must configure the authentication and authorization parameters
|
|
95
|
+
# in accordance with the API server security policy.
|
|
96
|
+
# Examples for each auth method are provided below, use the example that
|
|
97
|
+
# satisfies your auth use case.
|
|
98
|
+
|
|
99
|
+
# Configure Bearer authorization (JWT): bearerAuth
|
|
100
|
+
configuration = adaline_api.Configuration(
|
|
101
|
+
access_token = os.environ["BEARER_TOKEN"]
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
# Enter a context with an instance of the API client
|
|
106
|
+
async with adaline_api.ApiClient(configuration) as api_client:
|
|
107
|
+
# Create an instance of the API class
|
|
108
|
+
api_instance = adaline_api.DefaultApi(api_client)
|
|
109
|
+
prompt_id = 'prompt_id_example' # str | The unique identifier of the prompt. Required for both specific and latest deployment retrieval.
|
|
110
|
+
deployment_id = 'deployment_id_example' # str | The unique identifier of the deployment. Set to 'latest' to retrieve the latest deployment in the given environment.
|
|
111
|
+
deployment_environment_id = 'deployment_environment_id_example' # str | The unique identifier of the deployment environment. Required when retrieving the latest deployment (deploymentId=latest). (optional)
|
|
112
|
+
|
|
113
|
+
try:
|
|
114
|
+
# Retrieve a specific or latest deployment
|
|
115
|
+
api_response = await api_instance.deployments_get(prompt_id, deployment_id, deployment_environment_id=deployment_environment_id)
|
|
116
|
+
print("The response of DefaultApi->deployments_get:\n")
|
|
117
|
+
pprint(api_response)
|
|
118
|
+
except ApiException as e:
|
|
119
|
+
print("Exception when calling DefaultApi->deployments_get: %s\n" % e)
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Documentation for API Endpoints
|
|
124
|
+
|
|
125
|
+
All URIs are relative to *https://api.adaline.ai/v2*
|
|
126
|
+
|
|
127
|
+
Class | Method | HTTP request | Description
|
|
128
|
+
------------ | ------------- | ------------- | -------------
|
|
129
|
+
*DefaultApi* | [**deployments_get**](docs/DefaultApi.md#deployments_get) | **GET** /deployments | Retrieve a specific or latest deployment
|
|
130
|
+
*DefaultApi* | [**logs_span_post**](docs/DefaultApi.md#logs_span_post) | **POST** /logs/span | Create span log
|
|
131
|
+
*DefaultApi* | [**logs_trace_patch**](docs/DefaultApi.md#logs_trace_patch) | **PATCH** /logs/trace | Update trace log
|
|
132
|
+
*DefaultApi* | [**logs_trace_post**](docs/DefaultApi.md#logs_trace_post) | **POST** /logs/trace | Create trace log
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
## Documentation For Models
|
|
136
|
+
|
|
137
|
+
- [Base64ImageContentValue](docs/Base64ImageContentValue.md)
|
|
138
|
+
- [Base64PdfContentValue](docs/Base64PdfContentValue.md)
|
|
139
|
+
- [BaseEntity](docs/BaseEntity.md)
|
|
140
|
+
- [Content](docs/Content.md)
|
|
141
|
+
- [CreateLogSpanRequest](docs/CreateLogSpanRequest.md)
|
|
142
|
+
- [CreateLogSpanRequestSpan](docs/CreateLogSpanRequestSpan.md)
|
|
143
|
+
- [CreateLogSpanResponse](docs/CreateLogSpanResponse.md)
|
|
144
|
+
- [CreateLogTraceRequest](docs/CreateLogTraceRequest.md)
|
|
145
|
+
- [CreateLogTraceRequestSpan](docs/CreateLogTraceRequestSpan.md)
|
|
146
|
+
- [CreateLogTraceRequestTrace](docs/CreateLogTraceRequestTrace.md)
|
|
147
|
+
- [CreateLogTraceResponse](docs/CreateLogTraceResponse.md)
|
|
148
|
+
- [Deployment](docs/Deployment.md)
|
|
149
|
+
- [DeploymentPrompt](docs/DeploymentPrompt.md)
|
|
150
|
+
- [DeploymentPromptConfig](docs/DeploymentPromptConfig.md)
|
|
151
|
+
- [DeploymentPromptVariables](docs/DeploymentPromptVariables.md)
|
|
152
|
+
- [ErrorResponse](docs/ErrorResponse.md)
|
|
153
|
+
- [Function](docs/Function.md)
|
|
154
|
+
- [FunctionParameter](docs/FunctionParameter.md)
|
|
155
|
+
- [FunctionParameters](docs/FunctionParameters.md)
|
|
156
|
+
- [FunctionRequestHttp](docs/FunctionRequestHttp.md)
|
|
157
|
+
- [FunctionRequestRetry](docs/FunctionRequestRetry.md)
|
|
158
|
+
- [FunctionTool](docs/FunctionTool.md)
|
|
159
|
+
- [FunctionToolDefinition](docs/FunctionToolDefinition.md)
|
|
160
|
+
- [ImageContent](docs/ImageContent.md)
|
|
161
|
+
- [ImageContentValue](docs/ImageContentValue.md)
|
|
162
|
+
- [LogAttributesValue](docs/LogAttributesValue.md)
|
|
163
|
+
- [LogFeedbackComment](docs/LogFeedbackComment.md)
|
|
164
|
+
- [LogSpanContent](docs/LogSpanContent.md)
|
|
165
|
+
- [LogSpanEmbeddingsContent](docs/LogSpanEmbeddingsContent.md)
|
|
166
|
+
- [LogSpanEvent](docs/LogSpanEvent.md)
|
|
167
|
+
- [LogSpanFunctionContent](docs/LogSpanFunctionContent.md)
|
|
168
|
+
- [LogSpanGuardrailContent](docs/LogSpanGuardrailContent.md)
|
|
169
|
+
- [LogSpanModelContent](docs/LogSpanModelContent.md)
|
|
170
|
+
- [LogSpanModelStreamContent](docs/LogSpanModelStreamContent.md)
|
|
171
|
+
- [LogSpanOtherContent](docs/LogSpanOtherContent.md)
|
|
172
|
+
- [LogSpanParsedContent](docs/LogSpanParsedContent.md)
|
|
173
|
+
- [LogSpanRetrievalContent](docs/LogSpanRetrievalContent.md)
|
|
174
|
+
- [LogSpanToolContent](docs/LogSpanToolContent.md)
|
|
175
|
+
- [McpServer](docs/McpServer.md)
|
|
176
|
+
- [McpServerToolConfiguration](docs/McpServerToolConfiguration.md)
|
|
177
|
+
- [Message](docs/Message.md)
|
|
178
|
+
- [ModalityEnum](docs/ModalityEnum.md)
|
|
179
|
+
- [PdfContent](docs/PdfContent.md)
|
|
180
|
+
- [PdfContentFile](docs/PdfContentFile.md)
|
|
181
|
+
- [PdfContentValue](docs/PdfContentValue.md)
|
|
182
|
+
- [ReasoningContent](docs/ReasoningContent.md)
|
|
183
|
+
- [ReasoningContentValue](docs/ReasoningContentValue.md)
|
|
184
|
+
- [ReasoningContentValueUnion](docs/ReasoningContentValueUnion.md)
|
|
185
|
+
- [RedactedReasoningContentValue](docs/RedactedReasoningContentValue.md)
|
|
186
|
+
- [ResponseSchema](docs/ResponseSchema.md)
|
|
187
|
+
- [ResponseSchemaProperty](docs/ResponseSchemaProperty.md)
|
|
188
|
+
- [ResponseSchemaPropertyEnumInner](docs/ResponseSchemaPropertyEnumInner.md)
|
|
189
|
+
- [ResponseSchemaPropertyType](docs/ResponseSchemaPropertyType.md)
|
|
190
|
+
- [ResponseSchemaStructure](docs/ResponseSchemaStructure.md)
|
|
191
|
+
- [RoleEnum](docs/RoleEnum.md)
|
|
192
|
+
- [TextContent](docs/TextContent.md)
|
|
193
|
+
- [ToolCallContent](docs/ToolCallContent.md)
|
|
194
|
+
- [ToolResponseContent](docs/ToolResponseContent.md)
|
|
195
|
+
- [ToolResponseContentApiResponse](docs/ToolResponseContentApiResponse.md)
|
|
196
|
+
- [UpdateLogTraceRequest](docs/UpdateLogTraceRequest.md)
|
|
197
|
+
- [UpdateLogTraceRequestAttributeItem](docs/UpdateLogTraceRequestAttributeItem.md)
|
|
198
|
+
- [UpdateLogTraceRequestAttributeItemOneOf](docs/UpdateLogTraceRequestAttributeItemOneOf.md)
|
|
199
|
+
- [UpdateLogTraceRequestAttributeItemOneOf1](docs/UpdateLogTraceRequestAttributeItemOneOf1.md)
|
|
200
|
+
- [UpdateLogTraceRequestAttributeItemOneOfValue](docs/UpdateLogTraceRequestAttributeItemOneOfValue.md)
|
|
201
|
+
- [UpdateLogTraceRequestTagItem](docs/UpdateLogTraceRequestTagItem.md)
|
|
202
|
+
- [UpdateLogTraceRequestTagItemOneOf](docs/UpdateLogTraceRequestTagItemOneOf.md)
|
|
203
|
+
- [UpdateLogTraceRequestTagItemOneOf1](docs/UpdateLogTraceRequestTagItemOneOf1.md)
|
|
204
|
+
- [UpdateLogTraceRequestTrace](docs/UpdateLogTraceRequestTrace.md)
|
|
205
|
+
- [UpdateLogTraceResponse](docs/UpdateLogTraceResponse.md)
|
|
206
|
+
- [UrlImageContentValue](docs/UrlImageContentValue.md)
|
|
207
|
+
- [UrlPdfContentValue](docs/UrlPdfContentValue.md)
|
|
208
|
+
- [Variable](docs/Variable.md)
|
|
209
|
+
- [VariableValue](docs/VariableValue.md)
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
<a id="documentation-for-authorization"></a>
|
|
213
|
+
## Documentation For Authorization
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
Authentication schemes defined for the API:
|
|
217
|
+
<a id="bearerAuth"></a>
|
|
218
|
+
### bearerAuth
|
|
219
|
+
|
|
220
|
+
- **Type**: Bearer authentication (JWT)
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
## Author
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|