Skip to content

Commit 9a50c71

Browse files
authored
chore: regenerate SDK client core from Otari OpenAPI spec (#30)
1 parent 3663545 commit 9a50c71

12 files changed

Lines changed: 597 additions & 16 deletions

sdk-endpoints.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ DELETE /v1/usage # not yet wrapped
120120
POST /v1/usage/external-events # not yet wrapped
121121
POST /v1/usage/set-price # not yet wrapped
122122
GET /v1/usage/in-flight # dashboard-only, per-worker live view
123+
# Agent telemetry purge
124+
DELETE /v1/agent-telemetry # not yet wrapped
123125
# Routing policies
124126
GET /v1/routing/policies # not yet wrapped
125127
POST /v1/routing/policies # not yet wrapped

src/otari/_client/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
# Define package exports
2020
__all__ = [
21+
"AgentTelemetryApi",
2122
"AliasesApi",
2223
"AudioApi",
2324
"AuthApi",
@@ -53,6 +54,8 @@
5354
"ApiKeyError",
5455
"ApiAttributeError",
5556
"ApiException",
57+
"AgentTelemetryDeleteRequest",
58+
"AgentTelemetryDeleteResult",
5659
"AliasRequest",
5760
"AliasResponse",
5861
"ApiKeyId",
@@ -373,6 +376,7 @@
373376
]
374377

375378
# import apis into sdk package
379+
from otari._client.api.agent_telemetry_api import AgentTelemetryApi as AgentTelemetryApi
376380
from otari._client.api.aliases_api import AliasesApi as AliasesApi
377381
from otari._client.api.audio_api import AudioApi as AudioApi
378382
from otari._client.api.auth_api import AuthApi as AuthApi
@@ -412,6 +416,8 @@
412416
from otari._client.exceptions import ApiException as ApiException
413417

414418
# import models into sdk package
419+
from otari._client.models.agent_telemetry_delete_request import AgentTelemetryDeleteRequest as AgentTelemetryDeleteRequest
420+
from otari._client.models.agent_telemetry_delete_result import AgentTelemetryDeleteResult as AgentTelemetryDeleteResult
415421
from otari._client.models.alias_request import AliasRequest as AliasRequest
416422
from otari._client.models.alias_response import AliasResponse as AliasResponse
417423
from otari._client.models.api_key_id import ApiKeyId as ApiKeyId

src/otari/_client/api/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# flake8: noqa
22

33
# import apis into api package
4+
from otari._client.api.agent_telemetry_api import AgentTelemetryApi
45
from otari._client.api.aliases_api import AliasesApi
56
from otari._client.api.audio_api import AudioApi
67
from otari._client.api.auth_api import AuthApi
Lines changed: 314 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,314 @@
1+
"""
2+
otari
3+
4+
Otari, an OpenAI-compatible LLM gateway with API key management
5+
6+
The version of the OpenAPI document: 0.0.0-dev
7+
Generated by OpenAPI Generator (https://openapi-generator.tech)
8+
9+
Do not edit the class manually.
10+
""" # noqa: E501
11+
12+
13+
import warnings
14+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
15+
from typing import Any, Dict, List, Optional, Tuple, Union
16+
from typing_extensions import Annotated
17+
18+
from otari._client.models.agent_telemetry_delete_request import AgentTelemetryDeleteRequest
19+
from otari._client.models.agent_telemetry_delete_result import AgentTelemetryDeleteResult
20+
21+
from otari._client.api_client import ApiClient, RequestSerialized
22+
from otari._client.api_response import ApiResponse
23+
from otari._client.rest import RESTResponseType
24+
25+
26+
class AgentTelemetryApi:
27+
"""NOTE: This class is auto generated by OpenAPI Generator
28+
Ref: https://openapi-generator.tech
29+
30+
Do not edit the class manually.
31+
"""
32+
33+
def __init__(self, api_client=None) -> None:
34+
if api_client is None:
35+
api_client = ApiClient.get_default()
36+
self.api_client = api_client
37+
38+
39+
@validate_call
40+
def delete_agent_telemetry_rows_v1_agent_telemetry_delete(
41+
self,
42+
agent_telemetry_delete_request: AgentTelemetryDeleteRequest,
43+
_request_timeout: Union[
44+
None,
45+
Annotated[StrictFloat, Field(gt=0)],
46+
Tuple[
47+
Annotated[StrictFloat, Field(gt=0)],
48+
Annotated[StrictFloat, Field(gt=0)]
49+
]
50+
] = None,
51+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
52+
_content_type: Optional[StrictStr] = None,
53+
_headers: Optional[Dict[StrictStr, Any]] = None,
54+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
55+
) -> AgentTelemetryDeleteResult:
56+
"""Delete Agent Telemetry Rows
57+
58+
Delete agent_telemetry rows by explicit ids or by filter (standalone). Target either an explicit selection (`ids`) or everything matching a filter (`by_filter: true` plus optional `user_id` / `api_key_id` / `name` / date range). A selection matching zero rows succeeds with `deleted: 0`. Master-key only.
59+
60+
:param agent_telemetry_delete_request: (required)
61+
:type agent_telemetry_delete_request: AgentTelemetryDeleteRequest
62+
:param _request_timeout: timeout setting for this request. If one
63+
number provided, it will be total request
64+
timeout. It can also be a pair (tuple) of
65+
(connection, read) timeouts.
66+
:type _request_timeout: int, tuple(int, int), optional
67+
:param _request_auth: set to override the auth_settings for an a single
68+
request; this effectively ignores the
69+
authentication in the spec for a single request.
70+
:type _request_auth: dict, optional
71+
:param _content_type: force content-type for the request.
72+
:type _content_type: str, Optional
73+
:param _headers: set to override the headers for a single
74+
request; this effectively ignores the headers
75+
in the spec for a single request.
76+
:type _headers: dict, optional
77+
:param _host_index: set to override the host_index for a single
78+
request; this effectively ignores the host_index
79+
in the spec for a single request.
80+
:type _host_index: int, optional
81+
:return: Returns the result object.
82+
""" # noqa: E501
83+
84+
_param = self._delete_agent_telemetry_rows_v1_agent_telemetry_delete_serialize(
85+
agent_telemetry_delete_request=agent_telemetry_delete_request,
86+
_request_auth=_request_auth,
87+
_content_type=_content_type,
88+
_headers=_headers,
89+
_host_index=_host_index
90+
)
91+
92+
_response_types_map: Dict[str, Optional[str]] = {
93+
'200': "AgentTelemetryDeleteResult",
94+
'422': "HTTPValidationError",
95+
}
96+
response_data = self.api_client.call_api(
97+
*_param,
98+
_request_timeout=_request_timeout
99+
)
100+
response_data.read()
101+
return self.api_client.response_deserialize(
102+
response_data=response_data,
103+
response_types_map=_response_types_map,
104+
).data
105+
106+
107+
@validate_call
108+
def delete_agent_telemetry_rows_v1_agent_telemetry_delete_with_http_info(
109+
self,
110+
agent_telemetry_delete_request: AgentTelemetryDeleteRequest,
111+
_request_timeout: Union[
112+
None,
113+
Annotated[StrictFloat, Field(gt=0)],
114+
Tuple[
115+
Annotated[StrictFloat, Field(gt=0)],
116+
Annotated[StrictFloat, Field(gt=0)]
117+
]
118+
] = None,
119+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
120+
_content_type: Optional[StrictStr] = None,
121+
_headers: Optional[Dict[StrictStr, Any]] = None,
122+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
123+
) -> ApiResponse[AgentTelemetryDeleteResult]:
124+
"""Delete Agent Telemetry Rows
125+
126+
Delete agent_telemetry rows by explicit ids or by filter (standalone). Target either an explicit selection (`ids`) or everything matching a filter (`by_filter: true` plus optional `user_id` / `api_key_id` / `name` / date range). A selection matching zero rows succeeds with `deleted: 0`. Master-key only.
127+
128+
:param agent_telemetry_delete_request: (required)
129+
:type agent_telemetry_delete_request: AgentTelemetryDeleteRequest
130+
:param _request_timeout: timeout setting for this request. If one
131+
number provided, it will be total request
132+
timeout. It can also be a pair (tuple) of
133+
(connection, read) timeouts.
134+
:type _request_timeout: int, tuple(int, int), optional
135+
:param _request_auth: set to override the auth_settings for an a single
136+
request; this effectively ignores the
137+
authentication in the spec for a single request.
138+
:type _request_auth: dict, optional
139+
:param _content_type: force content-type for the request.
140+
:type _content_type: str, Optional
141+
:param _headers: set to override the headers for a single
142+
request; this effectively ignores the headers
143+
in the spec for a single request.
144+
:type _headers: dict, optional
145+
:param _host_index: set to override the host_index for a single
146+
request; this effectively ignores the host_index
147+
in the spec for a single request.
148+
:type _host_index: int, optional
149+
:return: Returns the result object.
150+
""" # noqa: E501
151+
152+
_param = self._delete_agent_telemetry_rows_v1_agent_telemetry_delete_serialize(
153+
agent_telemetry_delete_request=agent_telemetry_delete_request,
154+
_request_auth=_request_auth,
155+
_content_type=_content_type,
156+
_headers=_headers,
157+
_host_index=_host_index
158+
)
159+
160+
_response_types_map: Dict[str, Optional[str]] = {
161+
'200': "AgentTelemetryDeleteResult",
162+
'422': "HTTPValidationError",
163+
}
164+
response_data = self.api_client.call_api(
165+
*_param,
166+
_request_timeout=_request_timeout
167+
)
168+
response_data.read()
169+
return self.api_client.response_deserialize(
170+
response_data=response_data,
171+
response_types_map=_response_types_map,
172+
)
173+
174+
175+
@validate_call
176+
def delete_agent_telemetry_rows_v1_agent_telemetry_delete_without_preload_content(
177+
self,
178+
agent_telemetry_delete_request: AgentTelemetryDeleteRequest,
179+
_request_timeout: Union[
180+
None,
181+
Annotated[StrictFloat, Field(gt=0)],
182+
Tuple[
183+
Annotated[StrictFloat, Field(gt=0)],
184+
Annotated[StrictFloat, Field(gt=0)]
185+
]
186+
] = None,
187+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
188+
_content_type: Optional[StrictStr] = None,
189+
_headers: Optional[Dict[StrictStr, Any]] = None,
190+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
191+
) -> RESTResponseType:
192+
"""Delete Agent Telemetry Rows
193+
194+
Delete agent_telemetry rows by explicit ids or by filter (standalone). Target either an explicit selection (`ids`) or everything matching a filter (`by_filter: true` plus optional `user_id` / `api_key_id` / `name` / date range). A selection matching zero rows succeeds with `deleted: 0`. Master-key only.
195+
196+
:param agent_telemetry_delete_request: (required)
197+
:type agent_telemetry_delete_request: AgentTelemetryDeleteRequest
198+
:param _request_timeout: timeout setting for this request. If one
199+
number provided, it will be total request
200+
timeout. It can also be a pair (tuple) of
201+
(connection, read) timeouts.
202+
:type _request_timeout: int, tuple(int, int), optional
203+
:param _request_auth: set to override the auth_settings for an a single
204+
request; this effectively ignores the
205+
authentication in the spec for a single request.
206+
:type _request_auth: dict, optional
207+
:param _content_type: force content-type for the request.
208+
:type _content_type: str, Optional
209+
:param _headers: set to override the headers for a single
210+
request; this effectively ignores the headers
211+
in the spec for a single request.
212+
:type _headers: dict, optional
213+
:param _host_index: set to override the host_index for a single
214+
request; this effectively ignores the host_index
215+
in the spec for a single request.
216+
:type _host_index: int, optional
217+
:return: Returns the result object.
218+
""" # noqa: E501
219+
220+
_param = self._delete_agent_telemetry_rows_v1_agent_telemetry_delete_serialize(
221+
agent_telemetry_delete_request=agent_telemetry_delete_request,
222+
_request_auth=_request_auth,
223+
_content_type=_content_type,
224+
_headers=_headers,
225+
_host_index=_host_index
226+
)
227+
228+
_response_types_map: Dict[str, Optional[str]] = {
229+
'200': "AgentTelemetryDeleteResult",
230+
'422': "HTTPValidationError",
231+
}
232+
response_data = self.api_client.call_api(
233+
*_param,
234+
_request_timeout=_request_timeout
235+
)
236+
return response_data.response
237+
238+
239+
def _delete_agent_telemetry_rows_v1_agent_telemetry_delete_serialize(
240+
self,
241+
agent_telemetry_delete_request,
242+
_request_auth,
243+
_content_type,
244+
_headers,
245+
_host_index,
246+
) -> RequestSerialized:
247+
248+
_host = None
249+
250+
_collection_formats: Dict[str, str] = {
251+
}
252+
253+
_path_params: Dict[str, str] = {}
254+
_query_params: List[Tuple[str, str]] = []
255+
_header_params: Dict[str, Optional[str]] = _headers or {}
256+
_form_params: List[Tuple[str, str]] = []
257+
_files: Dict[
258+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
259+
] = {}
260+
_body_params: Optional[bytes] = None
261+
262+
# process the path parameters
263+
# process the query parameters
264+
# process the header parameters
265+
# process the form parameters
266+
# process the body parameter
267+
if agent_telemetry_delete_request is not None:
268+
_body_params = agent_telemetry_delete_request
269+
270+
271+
# set the HTTP header `Accept`
272+
if 'Accept' not in _header_params:
273+
_header_params['Accept'] = self.api_client.select_header_accept(
274+
[
275+
'application/json'
276+
]
277+
)
278+
279+
# set the HTTP header `Content-Type`
280+
if _content_type:
281+
_header_params['Content-Type'] = _content_type
282+
else:
283+
_default_content_type = (
284+
self.api_client.select_header_content_type(
285+
[
286+
'application/json'
287+
]
288+
)
289+
)
290+
if _default_content_type is not None:
291+
_header_params['Content-Type'] = _default_content_type
292+
293+
# authentication setting
294+
_auth_settings: List[str] = [
295+
'XApiKeyAuth',
296+
'ApiKeyAuth'
297+
]
298+
299+
return self.api_client.param_serialize(
300+
method='DELETE',
301+
resource_path='/v1/agent-telemetry',
302+
path_params=_path_params,
303+
query_params=_query_params,
304+
header_params=_header_params,
305+
body=_body_params,
306+
post_params=_form_params,
307+
files=_files,
308+
auth_settings=_auth_settings,
309+
collection_formats=_collection_formats,
310+
_host=_host,
311+
_request_auth=_request_auth
312+
)
313+
314+

0 commit comments

Comments
 (0)