Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sdk-endpoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ DELETE /v1/usage # not yet wrapped
POST /v1/usage/external-events # not yet wrapped
POST /v1/usage/set-price # not yet wrapped
GET /v1/usage/in-flight # dashboard-only, per-worker live view
# Agent telemetry purge
DELETE /v1/agent-telemetry # not yet wrapped
# Routing policies
GET /v1/routing/policies # not yet wrapped
POST /v1/routing/policies # not yet wrapped
Expand Down
6 changes: 6 additions & 0 deletions src/otari/_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

# Define package exports
__all__ = [
"AgentTelemetryApi",
"AliasesApi",
"AudioApi",
"AuthApi",
Expand Down Expand Up @@ -53,6 +54,8 @@
"ApiKeyError",
"ApiAttributeError",
"ApiException",
"AgentTelemetryDeleteRequest",
"AgentTelemetryDeleteResult",
"AliasRequest",
"AliasResponse",
"ApiKeyId",
Expand Down Expand Up @@ -373,6 +376,7 @@
]

# import apis into sdk package
from otari._client.api.agent_telemetry_api import AgentTelemetryApi as AgentTelemetryApi
from otari._client.api.aliases_api import AliasesApi as AliasesApi
from otari._client.api.audio_api import AudioApi as AudioApi
from otari._client.api.auth_api import AuthApi as AuthApi
Expand Down Expand Up @@ -412,6 +416,8 @@
from otari._client.exceptions import ApiException as ApiException

# import models into sdk package
from otari._client.models.agent_telemetry_delete_request import AgentTelemetryDeleteRequest as AgentTelemetryDeleteRequest
from otari._client.models.agent_telemetry_delete_result import AgentTelemetryDeleteResult as AgentTelemetryDeleteResult
from otari._client.models.alias_request import AliasRequest as AliasRequest
from otari._client.models.alias_response import AliasResponse as AliasResponse
from otari._client.models.api_key_id import ApiKeyId as ApiKeyId
Expand Down
1 change: 1 addition & 0 deletions src/otari/_client/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# flake8: noqa

# import apis into api package
from otari._client.api.agent_telemetry_api import AgentTelemetryApi
from otari._client.api.aliases_api import AliasesApi
from otari._client.api.audio_api import AudioApi
from otari._client.api.auth_api import AuthApi
Expand Down
314 changes: 314 additions & 0 deletions src/otari/_client/api/agent_telemetry_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,314 @@
"""
otari

Otari, an OpenAI-compatible LLM gateway with API key management

The version of the OpenAPI document: 0.0.0-dev
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501


import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

from otari._client.models.agent_telemetry_delete_request import AgentTelemetryDeleteRequest
from otari._client.models.agent_telemetry_delete_result import AgentTelemetryDeleteResult

from otari._client.api_client import ApiClient, RequestSerialized
from otari._client.api_response import ApiResponse
from otari._client.rest import RESTResponseType


class AgentTelemetryApi:
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech

Do not edit the class manually.
"""

def __init__(self, api_client=None) -> None:
if api_client is None:
api_client = ApiClient.get_default()
self.api_client = api_client


@validate_call
def delete_agent_telemetry_rows_v1_agent_telemetry_delete(
self,
agent_telemetry_delete_request: AgentTelemetryDeleteRequest,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> AgentTelemetryDeleteResult:
"""Delete Agent Telemetry Rows

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.

:param agent_telemetry_delete_request: (required)
:type agent_telemetry_delete_request: AgentTelemetryDeleteRequest
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._delete_agent_telemetry_rows_v1_agent_telemetry_delete_serialize(
agent_telemetry_delete_request=agent_telemetry_delete_request,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "AgentTelemetryDeleteResult",
'422': "HTTPValidationError",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data


@validate_call
def delete_agent_telemetry_rows_v1_agent_telemetry_delete_with_http_info(
self,
agent_telemetry_delete_request: AgentTelemetryDeleteRequest,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[AgentTelemetryDeleteResult]:
"""Delete Agent Telemetry Rows

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.

:param agent_telemetry_delete_request: (required)
:type agent_telemetry_delete_request: AgentTelemetryDeleteRequest
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._delete_agent_telemetry_rows_v1_agent_telemetry_delete_serialize(
agent_telemetry_delete_request=agent_telemetry_delete_request,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "AgentTelemetryDeleteResult",
'422': "HTTPValidationError",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)


@validate_call
def delete_agent_telemetry_rows_v1_agent_telemetry_delete_without_preload_content(
self,
agent_telemetry_delete_request: AgentTelemetryDeleteRequest,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Delete Agent Telemetry Rows

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.

:param agent_telemetry_delete_request: (required)
:type agent_telemetry_delete_request: AgentTelemetryDeleteRequest
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501

_param = self._delete_agent_telemetry_rows_v1_agent_telemetry_delete_serialize(
agent_telemetry_delete_request=agent_telemetry_delete_request,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)

_response_types_map: Dict[str, Optional[str]] = {
'200': "AgentTelemetryDeleteResult",
'422': "HTTPValidationError",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response


def _delete_agent_telemetry_rows_v1_agent_telemetry_delete_serialize(
self,
agent_telemetry_delete_request,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:

_host = None

_collection_formats: Dict[str, str] = {
}

_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None

# process the path parameters
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
if agent_telemetry_delete_request is not None:
_body_params = agent_telemetry_delete_request


# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/json'
]
)

# set the HTTP header `Content-Type`
if _content_type:
_header_params['Content-Type'] = _content_type
else:
_default_content_type = (
self.api_client.select_header_content_type(
[
'application/json'
]
)
)
if _default_content_type is not None:
_header_params['Content-Type'] = _default_content_type

# authentication setting
_auth_settings: List[str] = [
'XApiKeyAuth',
'ApiKeyAuth'
]

return self.api_client.param_serialize(
method='DELETE',
resource_path='/v1/agent-telemetry',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)


Loading
Loading