chore(internal): codegen related update

This commit is contained in:
stainless-app[bot]
2025-10-08 03:43:47 +00:00
parent e8731572d2
commit da29c09bd6
73 changed files with 1143 additions and 1119 deletions
+11 -3
View File
@@ -4,10 +4,18 @@ set -e
cd "$(dirname "$0")/.."
if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then
brew bundle check >/dev/null 2>&1 || {
echo "==> Installing Homebrew dependencies…"
brew bundle
echo -n "==> Install Homebrew dependencies? (y/N): "
read -r response
case "$response" in
[yY][eE][sS]|[yY])
brew bundle
;;
*)
;;
esac
echo
}
fi
+3 -1
View File
@@ -3,7 +3,7 @@
import typing as _t
from . import types
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given
from ._utils import file_from_path
from ._client import (
ENVIRONMENTS,
@@ -49,7 +49,9 @@ __all__ = [
"ProxiesTypes",
"NotGiven",
"NOT_GIVEN",
"not_given",
"Omit",
"omit",
"HanzoError",
"APIError",
"APIStatusError",
+9 -9
View File
@@ -42,7 +42,6 @@ from . import _exceptions
from ._qs import Querystring
from ._files import to_httpx_files, async_to_httpx_files
from ._types import (
NOT_GIVEN,
Body,
Omit,
Query,
@@ -57,6 +56,7 @@ from ._types import (
RequestOptions,
HttpxRequestFiles,
ModelBuilderProtocol,
not_given,
)
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
from ._compat import PYDANTIC_V1, model_copy, model_dump
@@ -145,9 +145,9 @@ class PageInfo:
def __init__(
self,
*,
url: URL | NotGiven = NOT_GIVEN,
json: Body | NotGiven = NOT_GIVEN,
params: Query | NotGiven = NOT_GIVEN,
url: URL | NotGiven = not_given,
json: Body | NotGiven = not_given,
params: Query | NotGiven = not_given,
) -> None:
self.url = url
self.json = json
@@ -595,7 +595,7 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
# we internally support defining a temporary header to override the
# default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response`
# see _response.py for implementation details
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, NOT_GIVEN)
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given)
if is_given(override_cast_to):
options.headers = headers
return cast(Type[ResponseT], override_cast_to)
@@ -825,7 +825,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
version: str,
base_url: str | URL,
max_retries: int = DEFAULT_MAX_RETRIES,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.Client | None = None,
custom_headers: Mapping[str, str] | None = None,
custom_query: Mapping[str, object] | None = None,
@@ -1356,7 +1356,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
base_url: str | URL,
_strict_response_validation: bool,
max_retries: int = DEFAULT_MAX_RETRIES,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.AsyncClient | None = None,
custom_headers: Mapping[str, str] | None = None,
custom_query: Mapping[str, object] | None = None,
@@ -1818,8 +1818,8 @@ def make_request_options(
extra_query: Query | None = None,
extra_body: Body | None = None,
idempotency_key: str | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
post_parser: PostParser | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
post_parser: PostParser | NotGiven = not_given,
) -> RequestOptions:
"""Create a dict of type RequestOptions without keys of NotGiven values."""
options: RequestOptions = {}
+14 -14
View File
@@ -3,7 +3,7 @@
from __future__ import annotations
import os
from typing import Any, Dict, Union, Mapping, cast
from typing import Any, Dict, Mapping, cast
from typing_extensions import Self, Literal, override
import httpx
@@ -11,7 +11,6 @@ import httpx
from . import _exceptions
from ._qs import Querystring
from ._types import (
NOT_GIVEN,
Body,
Omit,
Query,
@@ -21,6 +20,7 @@ from ._types import (
Transport,
ProxiesTypes,
RequestOptions,
not_given,
)
from ._utils import is_given, get_async_library
from ._version import __version__
@@ -168,9 +168,9 @@ class Hanzo(SyncAPIClient):
self,
*,
api_key: str | None = None,
environment: Literal["production", "sandbox"] | NotGiven = NOT_GIVEN,
base_url: str | httpx.URL | None | NotGiven = NOT_GIVEN,
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
environment: Literal["production", "sandbox"] | NotGiven = not_given,
base_url: str | httpx.URL | None | NotGiven = not_given,
timeout: float | Timeout | None | NotGiven = not_given,
max_retries: int = DEFAULT_MAX_RETRIES,
default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
@@ -314,9 +314,9 @@ class Hanzo(SyncAPIClient):
api_key: str | None = None,
environment: Literal["production", "sandbox"] | None = None,
base_url: str | httpx.URL | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.Client | None = None,
max_retries: int | NotGiven = NOT_GIVEN,
max_retries: int | NotGiven = not_given,
default_headers: Mapping[str, str] | None = None,
set_default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
@@ -369,7 +369,7 @@ class Hanzo(SyncAPIClient):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Home"""
return self.get(
@@ -475,9 +475,9 @@ class AsyncHanzo(AsyncAPIClient):
self,
*,
api_key: str | None = None,
environment: Literal["production", "sandbox"] | NotGiven = NOT_GIVEN,
base_url: str | httpx.URL | None | NotGiven = NOT_GIVEN,
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
environment: Literal["production", "sandbox"] | NotGiven = not_given,
base_url: str | httpx.URL | None | NotGiven = not_given,
timeout: float | Timeout | None | NotGiven = not_given,
max_retries: int = DEFAULT_MAX_RETRIES,
default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
@@ -621,9 +621,9 @@ class AsyncHanzo(AsyncAPIClient):
api_key: str | None = None,
environment: Literal["production", "sandbox"] | None = None,
base_url: str | httpx.URL | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.AsyncClient | None = None,
max_retries: int | NotGiven = NOT_GIVEN,
max_retries: int | NotGiven = not_given,
default_headers: Mapping[str, str] | None = None,
set_default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
@@ -676,7 +676,7 @@ class AsyncHanzo(AsyncAPIClient):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Home"""
return await self.get(
+7 -7
View File
@@ -4,7 +4,7 @@ from typing import Any, List, Tuple, Union, Mapping, TypeVar
from urllib.parse import parse_qs, urlencode
from typing_extensions import Literal, get_args
from ._types import NOT_GIVEN, NotGiven, NotGivenOr
from ._types import NotGiven, not_given
from ._utils import flatten
_T = TypeVar("_T")
@@ -41,8 +41,8 @@ class Querystring:
self,
params: Params,
*,
array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN,
nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN,
array_format: ArrayFormat | NotGiven = not_given,
nested_format: NestedFormat | NotGiven = not_given,
) -> str:
return urlencode(
self.stringify_items(
@@ -56,8 +56,8 @@ class Querystring:
self,
params: Params,
*,
array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN,
nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN,
array_format: ArrayFormat | NotGiven = not_given,
nested_format: NestedFormat | NotGiven = not_given,
) -> list[tuple[str, str]]:
opts = Options(
qs=self,
@@ -143,8 +143,8 @@ class Options:
self,
qs: Querystring = _qs,
*,
array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN,
nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN,
array_format: ArrayFormat | NotGiven = not_given,
nested_format: NestedFormat | NotGiven = not_given,
) -> None:
self.array_format = qs.array_format if isinstance(array_format, NotGiven) else array_format
self.nested_format = qs.nested_format if isinstance(nested_format, NotGiven) else nested_format
+18 -11
View File
@@ -117,18 +117,21 @@ class RequestOptions(TypedDict, total=False):
# Sentinel class used until PEP 0661 is accepted
class NotGiven:
"""
A sentinel singleton class used to distinguish omitted keyword arguments
from those passed in with the value None (which may have different behavior).
For parameters with a meaningful None value, we need to distinguish between
the user explicitly passing None, and the user not passing the parameter at
all.
User code shouldn't need to use not_given directly.
For example:
```py
def get(timeout: Union[int, NotGiven, None] = NotGiven()) -> Response: ...
def create(timeout: Timeout | None | NotGiven = not_given): ...
get(timeout=1) # 1s timeout
get(timeout=None) # No timeout
get() # Default timeout behavior, which may not be statically known at the method definition.
create(timeout=1) # 1s timeout
create(timeout=None) # No timeout
create() # Default timeout behavior
```
"""
@@ -140,13 +143,14 @@ class NotGiven:
return "NOT_GIVEN"
NotGivenOr = Union[_T, NotGiven]
not_given = NotGiven()
# for backwards compatibility:
NOT_GIVEN = NotGiven()
class Omit:
"""In certain situations you need to be able to represent a case where a default value has
to be explicitly removed and `None` is not an appropriate substitute, for example:
"""
To explicitly omit something from being sent in a request, use `omit`.
```py
# as the default `Content-Type` header is `application/json` that will be sent
@@ -156,8 +160,8 @@ class Omit:
# to look something like: 'multipart/form-data; boundary=0d8382fcf5f8c3be01ca2e11002d2983'
client.post(..., headers={"Content-Type": "multipart/form-data"})
# instead you can remove the default `application/json` header by passing Omit
client.post(..., headers={"Content-Type": Omit()})
# instead you can remove the default `application/json` header by passing omit
client.post(..., headers={"Content-Type": omit})
```
"""
@@ -165,6 +169,9 @@ class Omit:
return False
omit = Omit()
@runtime_checkable
class ModelBuilderProtocol(Protocol):
@classmethod
+2 -2
View File
@@ -268,7 +268,7 @@ def _transform_typeddict(
annotations = get_type_hints(expected_type, include_extras=True)
for key, value in data.items():
if not is_given(value):
# we don't need to include `NotGiven` values here as they'll
# we don't need to include omitted values here as they'll
# be stripped out before the request is sent anyway
continue
@@ -434,7 +434,7 @@ async def _async_transform_typeddict(
annotations = get_type_hints(expected_type, include_extras=True)
for key, value in data.items():
if not is_given(value):
# we don't need to include `NotGiven` values here as they'll
# we don't need to include omitted values here as they'll
# be stripped out before the request is sent anyway
continue
+4 -4
View File
@@ -21,7 +21,7 @@ from typing_extensions import TypeGuard
import sniffio
from .._types import NotGiven, FileTypes, NotGivenOr, HeadersLike
from .._types import Omit, NotGiven, FileTypes, HeadersLike
_T = TypeVar("_T")
_TupleT = TypeVar("_TupleT", bound=Tuple[object, ...])
@@ -63,7 +63,7 @@ def _extract_items(
try:
key = path[index]
except IndexError:
if isinstance(obj, NotGiven):
if not is_given(obj):
# no value was provided - we can safely ignore
return []
@@ -126,8 +126,8 @@ def _extract_items(
return []
def is_given(obj: NotGivenOr[_T]) -> TypeGuard[_T]:
return not isinstance(obj, NotGiven)
def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]:
return not isinstance(obj, NotGiven) and not isinstance(obj, Omit)
# Type safe methods for narrowing types with TypeVars.
+3 -3
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Query, Headers, NotGiven, not_given
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -46,7 +46,7 @@ class ActiveResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Returns a list of llm level settings
@@ -110,7 +110,7 @@ class AsyncActiveResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Returns a list of llm level settings
+3 -3
View File
@@ -5,7 +5,7 @@ from __future__ import annotations
import httpx
from ..types import add_add_allowed_ip_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Query, Headers, NotGiven, not_given
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
@@ -49,7 +49,7 @@ class AddResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Add Allowed Ip
@@ -102,7 +102,7 @@ class AsyncAddResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Add Allowed Ip
+11 -11
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Query, Headers, NotGiven, not_given
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -47,7 +47,7 @@ class AnthropicResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/anthropic_completion)
@@ -80,7 +80,7 @@ class AnthropicResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/anthropic_completion)
@@ -113,7 +113,7 @@ class AnthropicResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/anthropic_completion)
@@ -146,7 +146,7 @@ class AnthropicResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/anthropic_completion)
@@ -179,7 +179,7 @@ class AnthropicResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/anthropic_completion)
@@ -233,7 +233,7 @@ class AsyncAnthropicResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/anthropic_completion)
@@ -266,7 +266,7 @@ class AsyncAnthropicResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/anthropic_completion)
@@ -299,7 +299,7 @@ class AsyncAnthropicResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/anthropic_completion)
@@ -332,7 +332,7 @@ class AsyncAnthropicResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/anthropic_completion)
@@ -365,7 +365,7 @@ class AsyncAnthropicResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/anthropic_completion)
+11 -11
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Query, Headers, NotGiven, not_given
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -47,7 +47,7 @@ class AssemblyaiResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Assemblyai Proxy Route
@@ -80,7 +80,7 @@ class AssemblyaiResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Assemblyai Proxy Route
@@ -113,7 +113,7 @@ class AssemblyaiResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Assemblyai Proxy Route
@@ -146,7 +146,7 @@ class AssemblyaiResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Assemblyai Proxy Route
@@ -179,7 +179,7 @@ class AssemblyaiResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Assemblyai Proxy Route
@@ -233,7 +233,7 @@ class AsyncAssemblyaiResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Assemblyai Proxy Route
@@ -266,7 +266,7 @@ class AsyncAssemblyaiResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Assemblyai Proxy Route
@@ -299,7 +299,7 @@ class AsyncAssemblyaiResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Assemblyai Proxy Route
@@ -332,7 +332,7 @@ class AsyncAssemblyaiResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Assemblyai Proxy Route
@@ -365,7 +365,7 @@ class AsyncAssemblyaiResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Assemblyai Proxy Route
+7 -7
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Query, Headers, NotGiven, not_given
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -46,7 +46,7 @@ class AssistantsResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Create assistant
@@ -70,7 +70,7 @@ class AssistantsResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Returns a list of assistants.
@@ -95,7 +95,7 @@ class AssistantsResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Delete assistant
@@ -151,7 +151,7 @@ class AsyncAssistantsResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Create assistant
@@ -175,7 +175,7 @@ class AsyncAssistantsResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Returns a list of assistants.
@@ -200,7 +200,7 @@ class AsyncAssistantsResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Delete assistant
+3 -3
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Query, Headers, NotGiven, not_given
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -46,7 +46,7 @@ class SpeechResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Same params as:
@@ -90,7 +90,7 @@ class AsyncSpeechResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Same params as:
@@ -6,7 +6,7 @@ from typing import Mapping, cast
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes
from ..._types import Body, Query, Headers, NotGiven, FileTypes, not_given
from ..._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -51,7 +51,7 @@ class TranscriptionsResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Same params as:
@@ -113,7 +113,7 @@ class AsyncTranscriptionsResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Same params as:
+11 -11
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Query, Headers, NotGiven, not_given
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -47,7 +47,7 @@ class AzureResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Call any azure endpoint using the proxy.
@@ -82,7 +82,7 @@ class AzureResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Call any azure endpoint using the proxy.
@@ -117,7 +117,7 @@ class AzureResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Call any azure endpoint using the proxy.
@@ -152,7 +152,7 @@ class AzureResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Call any azure endpoint using the proxy.
@@ -187,7 +187,7 @@ class AzureResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Call any azure endpoint using the proxy.
@@ -243,7 +243,7 @@ class AsyncAzureResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Call any azure endpoint using the proxy.
@@ -278,7 +278,7 @@ class AsyncAzureResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Call any azure endpoint using the proxy.
@@ -313,7 +313,7 @@ class AsyncAzureResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Call any azure endpoint using the proxy.
@@ -348,7 +348,7 @@ class AsyncAzureResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Call any azure endpoint using the proxy.
@@ -383,7 +383,7 @@ class AsyncAzureResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Call any azure endpoint using the proxy.
+29 -29
View File
@@ -15,7 +15,7 @@ from .cancel import (
AsyncCancelResourceWithStreamingResponse,
)
from ...types import batch_list_params, batch_create_params, batch_retrieve_params, batch_list_with_provider_params
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -57,13 +57,13 @@ class BatchesResource(SyncAPIResource):
def create(
self,
*,
provider: Optional[str] | NotGiven = NOT_GIVEN,
provider: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Create large batches of API requests for asynchronous processing.
@@ -106,13 +106,13 @@ class BatchesResource(SyncAPIResource):
self,
batch_id: str,
*,
provider: Optional[str] | NotGiven = NOT_GIVEN,
provider: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Retrieves a batch.
@@ -154,15 +154,15 @@ class BatchesResource(SyncAPIResource):
def list(
self,
*,
after: Optional[str] | NotGiven = NOT_GIVEN,
limit: Optional[int] | NotGiven = NOT_GIVEN,
provider: Optional[str] | NotGiven = NOT_GIVEN,
after: Optional[str] | Omit = omit,
limit: Optional[int] | Omit = omit,
provider: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Lists This is the equivalent of GET https://api.openai.com/v1/batches/ Supports
@@ -212,7 +212,7 @@ class BatchesResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Cancel a batch.
@@ -259,7 +259,7 @@ class BatchesResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Create large batches of API requests for asynchronous processing.
@@ -300,14 +300,14 @@ class BatchesResource(SyncAPIResource):
self,
provider: str,
*,
after: Optional[str] | NotGiven = NOT_GIVEN,
limit: Optional[int] | NotGiven = NOT_GIVEN,
after: Optional[str] | Omit = omit,
limit: Optional[int] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Lists This is the equivalent of GET https://api.openai.com/v1/batches/ Supports
@@ -358,7 +358,7 @@ class BatchesResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Retrieves a batch.
@@ -423,13 +423,13 @@ class AsyncBatchesResource(AsyncAPIResource):
async def create(
self,
*,
provider: Optional[str] | NotGiven = NOT_GIVEN,
provider: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Create large batches of API requests for asynchronous processing.
@@ -472,13 +472,13 @@ class AsyncBatchesResource(AsyncAPIResource):
self,
batch_id: str,
*,
provider: Optional[str] | NotGiven = NOT_GIVEN,
provider: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Retrieves a batch.
@@ -520,15 +520,15 @@ class AsyncBatchesResource(AsyncAPIResource):
async def list(
self,
*,
after: Optional[str] | NotGiven = NOT_GIVEN,
limit: Optional[int] | NotGiven = NOT_GIVEN,
provider: Optional[str] | NotGiven = NOT_GIVEN,
after: Optional[str] | Omit = omit,
limit: Optional[int] | Omit = omit,
provider: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Lists This is the equivalent of GET https://api.openai.com/v1/batches/ Supports
@@ -578,7 +578,7 @@ class AsyncBatchesResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Cancel a batch.
@@ -625,7 +625,7 @@ class AsyncBatchesResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Create large batches of API requests for asynchronous processing.
@@ -666,14 +666,14 @@ class AsyncBatchesResource(AsyncAPIResource):
self,
provider: str,
*,
after: Optional[str] | NotGiven = NOT_GIVEN,
limit: Optional[int] | NotGiven = NOT_GIVEN,
after: Optional[str] | Omit = omit,
limit: Optional[int] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Lists This is the equivalent of GET https://api.openai.com/v1/batches/ Supports
@@ -724,7 +724,7 @@ class AsyncBatchesResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Retrieves a batch.
+5 -5
View File
@@ -6,7 +6,7 @@ from typing import Optional
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -46,13 +46,13 @@ class CancelResource(SyncAPIResource):
self,
batch_id: str,
*,
provider: Optional[str] | NotGiven = NOT_GIVEN,
provider: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Cancel a batch.
@@ -117,13 +117,13 @@ class AsyncCancelResource(AsyncAPIResource):
self,
batch_id: str,
*,
provider: Optional[str] | NotGiven = NOT_GIVEN,
provider: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Cancel a batch.
+11 -11
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Query, Headers, NotGiven, not_given
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -47,7 +47,7 @@ class BedrockResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/bedrock)
@@ -80,7 +80,7 @@ class BedrockResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/bedrock)
@@ -113,7 +113,7 @@ class BedrockResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/bedrock)
@@ -146,7 +146,7 @@ class BedrockResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/bedrock)
@@ -179,7 +179,7 @@ class BedrockResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/bedrock)
@@ -233,7 +233,7 @@ class AsyncBedrockResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/bedrock)
@@ -266,7 +266,7 @@ class AsyncBedrockResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/bedrock)
@@ -299,7 +299,7 @@ class AsyncBedrockResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/bedrock)
@@ -332,7 +332,7 @@ class AsyncBedrockResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/bedrock)
@@ -365,7 +365,7 @@ class AsyncBedrockResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/bedrock)
+45 -45
View File
@@ -13,7 +13,7 @@ from ..types import (
budget_update_params,
budget_settings_params,
)
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
@@ -51,20 +51,20 @@ class BudgetResource(SyncAPIResource):
def create(
self,
*,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
budget_id: Optional[str] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
max_parallel_requests: Optional[int] | NotGiven = NOT_GIVEN,
model_max_budget: Optional[Dict[str, budget_create_params.ModelMaxBudget]] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
soft_budget: Optional[float] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | Omit = omit,
budget_id: Optional[str] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
max_parallel_requests: Optional[int] | Omit = omit,
model_max_budget: Optional[Dict[str, budget_create_params.ModelMaxBudget]] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
soft_budget: Optional[float] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Create a new budget object.
@@ -135,20 +135,20 @@ class BudgetResource(SyncAPIResource):
def update(
self,
*,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
budget_id: Optional[str] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
max_parallel_requests: Optional[int] | NotGiven = NOT_GIVEN,
model_max_budget: Optional[Dict[str, budget_update_params.ModelMaxBudget]] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
soft_budget: Optional[float] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | Omit = omit,
budget_id: Optional[str] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
max_parallel_requests: Optional[int] | Omit = omit,
model_max_budget: Optional[Dict[str, budget_update_params.ModelMaxBudget]] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
soft_budget: Optional[float] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Update an existing budget object.
@@ -223,7 +223,7 @@ class BudgetResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""List all the created budgets in proxy db. Used on Admin UI."""
return self._get(
@@ -243,7 +243,7 @@ class BudgetResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Delete budget
@@ -279,7 +279,7 @@ class BudgetResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Get the budget id specific information
@@ -315,7 +315,7 @@ class BudgetResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Get list of configurable params + current value for a budget item + description
@@ -372,20 +372,20 @@ class AsyncBudgetResource(AsyncAPIResource):
async def create(
self,
*,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
budget_id: Optional[str] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
max_parallel_requests: Optional[int] | NotGiven = NOT_GIVEN,
model_max_budget: Optional[Dict[str, budget_create_params.ModelMaxBudget]] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
soft_budget: Optional[float] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | Omit = omit,
budget_id: Optional[str] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
max_parallel_requests: Optional[int] | Omit = omit,
model_max_budget: Optional[Dict[str, budget_create_params.ModelMaxBudget]] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
soft_budget: Optional[float] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Create a new budget object.
@@ -456,20 +456,20 @@ class AsyncBudgetResource(AsyncAPIResource):
async def update(
self,
*,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
budget_id: Optional[str] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
max_parallel_requests: Optional[int] | NotGiven = NOT_GIVEN,
model_max_budget: Optional[Dict[str, budget_update_params.ModelMaxBudget]] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
soft_budget: Optional[float] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | Omit = omit,
budget_id: Optional[str] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
max_parallel_requests: Optional[int] | Omit = omit,
model_max_budget: Optional[Dict[str, budget_update_params.ModelMaxBudget]] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
soft_budget: Optional[float] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Update an existing budget object.
@@ -544,7 +544,7 @@ class AsyncBudgetResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""List all the created budgets in proxy db. Used on Admin UI."""
return await self._get(
@@ -564,7 +564,7 @@ class AsyncBudgetResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Delete budget
@@ -600,7 +600,7 @@ class AsyncBudgetResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Get the budget id specific information
@@ -636,7 +636,7 @@ class AsyncBudgetResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Get list of configurable params + current value for a budget item + description
+7 -7
View File
@@ -12,7 +12,7 @@ from .redis import (
RedisResourceWithStreamingResponse,
AsyncRedisResourceWithStreamingResponse,
)
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Query, Headers, NotGiven, not_given
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -59,7 +59,7 @@ class CacheResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Endpoint for deleting a key from the cache.
@@ -91,7 +91,7 @@ class CacheResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""A function to flush all items from the cache.
@@ -122,7 +122,7 @@ class CacheResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> CachePingResponse:
"""Endpoint for checking if cache can be pinged"""
return self._get(
@@ -166,7 +166,7 @@ class AsyncCacheResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Endpoint for deleting a key from the cache.
@@ -198,7 +198,7 @@ class AsyncCacheResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""A function to flush all items from the cache.
@@ -229,7 +229,7 @@ class AsyncCacheResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> CachePingResponse:
"""Endpoint for checking if cache can be pinged"""
return await self._get(
+3 -3
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Query, Headers, NotGiven, not_given
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -46,7 +46,7 @@ class RedisResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Endpoint for getting /redis/info"""
return self._get(
@@ -86,7 +86,7 @@ class AsyncRedisResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Endpoint for getting /redis/info"""
return await self._get(
+5 -5
View File
@@ -6,7 +6,7 @@ from typing import Optional
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -45,13 +45,13 @@ class CompletionsResource(SyncAPIResource):
def create(
self,
*,
model: Optional[str] | NotGiven = NOT_GIVEN,
model: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Follows the exact same API spec as
@@ -117,13 +117,13 @@ class AsyncCompletionsResource(AsyncAPIResource):
async def create(
self,
*,
model: Optional[str] | NotGiven = NOT_GIVEN,
model: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Follows the exact same API spec as
+11 -11
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Query, Headers, NotGiven, not_given
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -47,7 +47,7 @@ class CohereResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/cohere)
@@ -80,7 +80,7 @@ class CohereResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/cohere)
@@ -113,7 +113,7 @@ class CohereResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/cohere)
@@ -146,7 +146,7 @@ class CohereResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/cohere)
@@ -179,7 +179,7 @@ class CohereResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/cohere)
@@ -233,7 +233,7 @@ class AsyncCohereResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/cohere)
@@ -266,7 +266,7 @@ class AsyncCohereResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/cohere)
@@ -299,7 +299,7 @@ class AsyncCohereResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/cohere)
@@ -332,7 +332,7 @@ class AsyncCohereResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/cohere)
@@ -365,7 +365,7 @@ class AsyncCohereResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/cohere)
+5 -5
View File
@@ -7,7 +7,7 @@ from typing import Optional
import httpx
from ..types import completion_create_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
@@ -45,13 +45,13 @@ class CompletionsResource(SyncAPIResource):
def create(
self,
*,
model: Optional[str] | NotGiven = NOT_GIVEN,
model: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Follows the exact same API spec as
@@ -114,13 +114,13 @@ class AsyncCompletionsResource(AsyncAPIResource):
async def create(
self,
*,
model: Optional[str] | NotGiven = NOT_GIVEN,
model: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Follows the exact same API spec as
@@ -6,7 +6,7 @@ from typing import Optional
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -58,7 +58,7 @@ class PassThroughEndpointResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Create new pass-through endpoint
@@ -104,7 +104,7 @@ class PassThroughEndpointResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Update a pass-through endpoint
@@ -131,13 +131,13 @@ class PassThroughEndpointResource(SyncAPIResource):
def list(
self,
*,
endpoint_id: Optional[str] | NotGiven = NOT_GIVEN,
endpoint_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> PassThroughEndpointResponse:
"""
GET configured pass through endpoint.
@@ -176,7 +176,7 @@ class PassThroughEndpointResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> PassThroughEndpointResponse:
"""
Delete a pass-through endpoint
@@ -238,7 +238,7 @@ class AsyncPassThroughEndpointResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Create new pass-through endpoint
@@ -284,7 +284,7 @@ class AsyncPassThroughEndpointResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Update a pass-through endpoint
@@ -311,13 +311,13 @@ class AsyncPassThroughEndpointResource(AsyncAPIResource):
async def list(
self,
*,
endpoint_id: Optional[str] | NotGiven = NOT_GIVEN,
endpoint_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> PassThroughEndpointResponse:
"""
GET configured pass through endpoint.
@@ -356,7 +356,7 @@ class AsyncPassThroughEndpointResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> PassThroughEndpointResponse:
"""
Delete a pass-through endpoint
+11 -11
View File
@@ -7,7 +7,7 @@ from typing import Optional
import httpx
from ..types import credential_create_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
@@ -47,14 +47,14 @@ class CredentialsResource(SyncAPIResource):
*,
credential_info: object,
credential_name: str,
credential_values: Optional[object] | NotGiven = NOT_GIVEN,
model_id: Optional[str] | NotGiven = NOT_GIVEN,
credential_values: Optional[object] | Omit = omit,
model_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""[BETA] endpoint.
@@ -95,7 +95,7 @@ class CredentialsResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""[BETA] endpoint. This might change unexpectedly."""
return self._get(
@@ -115,7 +115,7 @@ class CredentialsResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""[BETA] endpoint.
@@ -166,14 +166,14 @@ class AsyncCredentialsResource(AsyncAPIResource):
*,
credential_info: object,
credential_name: str,
credential_values: Optional[object] | NotGiven = NOT_GIVEN,
model_id: Optional[str] | NotGiven = NOT_GIVEN,
credential_values: Optional[object] | Omit = omit,
model_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""[BETA] endpoint.
@@ -214,7 +214,7 @@ class AsyncCredentialsResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""[BETA] endpoint. This might change unexpectedly."""
return await self._get(
@@ -234,7 +234,7 @@ class AsyncCredentialsResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""[BETA] endpoint.
+51 -51
View File
@@ -15,7 +15,7 @@ from ..types import (
customer_unblock_params,
customer_retrieve_info_params,
)
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
@@ -56,24 +56,24 @@ class CustomerResource(SyncAPIResource):
self,
*,
user_id: str,
alias: Optional[str] | NotGiven = NOT_GIVEN,
allowed_model_region: Optional[Literal["eu", "us"]] | NotGiven = NOT_GIVEN,
blocked: bool | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
budget_id: Optional[str] | NotGiven = NOT_GIVEN,
default_model: Optional[str] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
max_parallel_requests: Optional[int] | NotGiven = NOT_GIVEN,
model_max_budget: Optional[Dict[str, customer_create_params.ModelMaxBudget]] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
soft_budget: Optional[float] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
alias: Optional[str] | Omit = omit,
allowed_model_region: Optional[Literal["eu", "us"]] | Omit = omit,
blocked: bool | Omit = omit,
budget_duration: Optional[str] | Omit = omit,
budget_id: Optional[str] | Omit = omit,
default_model: Optional[str] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
max_parallel_requests: Optional[int] | Omit = omit,
model_max_budget: Optional[Dict[str, customer_create_params.ModelMaxBudget]] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
soft_budget: Optional[float] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Allow creating a new Customer
@@ -182,18 +182,18 @@ class CustomerResource(SyncAPIResource):
self,
*,
user_id: str,
alias: Optional[str] | NotGiven = NOT_GIVEN,
allowed_model_region: Optional[Literal["eu", "us"]] | NotGiven = NOT_GIVEN,
blocked: bool | NotGiven = NOT_GIVEN,
budget_id: Optional[str] | NotGiven = NOT_GIVEN,
default_model: Optional[str] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
alias: Optional[str] | Omit = omit,
allowed_model_region: Optional[Literal["eu", "us"]] | Omit = omit,
blocked: bool | Omit = omit,
budget_id: Optional[str] | Omit = omit,
default_model: Optional[str] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Example curl
@@ -258,7 +258,7 @@ class CustomerResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> CustomerListResponse:
"""
[Admin-only] List all available customers
@@ -286,7 +286,7 @@ class CustomerResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Delete multiple end-users.
@@ -332,7 +332,7 @@ class CustomerResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[BETA] Reject calls with this end-user id
@@ -379,7 +379,7 @@ class CustomerResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> CustomerRetrieveInfoResponse:
"""Get information about an end-user.
@@ -430,7 +430,7 @@ class CustomerResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[BETA] Unblock calls with this user id
@@ -488,24 +488,24 @@ class AsyncCustomerResource(AsyncAPIResource):
self,
*,
user_id: str,
alias: Optional[str] | NotGiven = NOT_GIVEN,
allowed_model_region: Optional[Literal["eu", "us"]] | NotGiven = NOT_GIVEN,
blocked: bool | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
budget_id: Optional[str] | NotGiven = NOT_GIVEN,
default_model: Optional[str] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
max_parallel_requests: Optional[int] | NotGiven = NOT_GIVEN,
model_max_budget: Optional[Dict[str, customer_create_params.ModelMaxBudget]] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
soft_budget: Optional[float] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
alias: Optional[str] | Omit = omit,
allowed_model_region: Optional[Literal["eu", "us"]] | Omit = omit,
blocked: bool | Omit = omit,
budget_duration: Optional[str] | Omit = omit,
budget_id: Optional[str] | Omit = omit,
default_model: Optional[str] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
max_parallel_requests: Optional[int] | Omit = omit,
model_max_budget: Optional[Dict[str, customer_create_params.ModelMaxBudget]] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
soft_budget: Optional[float] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Allow creating a new Customer
@@ -614,18 +614,18 @@ class AsyncCustomerResource(AsyncAPIResource):
self,
*,
user_id: str,
alias: Optional[str] | NotGiven = NOT_GIVEN,
allowed_model_region: Optional[Literal["eu", "us"]] | NotGiven = NOT_GIVEN,
blocked: bool | NotGiven = NOT_GIVEN,
budget_id: Optional[str] | NotGiven = NOT_GIVEN,
default_model: Optional[str] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
alias: Optional[str] | Omit = omit,
allowed_model_region: Optional[Literal["eu", "us"]] | Omit = omit,
blocked: bool | Omit = omit,
budget_id: Optional[str] | Omit = omit,
default_model: Optional[str] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Example curl
@@ -690,7 +690,7 @@ class AsyncCustomerResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> CustomerListResponse:
"""
[Admin-only] List all available customers
@@ -718,7 +718,7 @@ class AsyncCustomerResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Delete multiple end-users.
@@ -764,7 +764,7 @@ class AsyncCustomerResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[BETA] Reject calls with this end-user id
@@ -811,7 +811,7 @@ class AsyncCustomerResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> CustomerRetrieveInfoResponse:
"""Get information about an end-user.
@@ -862,7 +862,7 @@ class AsyncCustomerResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[BETA] Unblock calls with this user id
+3 -3
View File
@@ -5,7 +5,7 @@ from __future__ import annotations
import httpx
from ..types import delete_create_allowed_ip_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Query, Headers, NotGiven, not_given
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
@@ -49,7 +49,7 @@ class DeleteResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Delete Allowed Ip
@@ -102,7 +102,7 @@ class AsyncDeleteResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Delete Allowed Ip
+5 -5
View File
@@ -7,7 +7,7 @@ from typing import Optional
import httpx
from ..types import embedding_create_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
@@ -45,13 +45,13 @@ class EmbeddingsResource(SyncAPIResource):
def create(
self,
*,
model: Optional[str] | NotGiven = NOT_GIVEN,
model: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Follows the exact same API spec as
@@ -112,13 +112,13 @@ class AsyncEmbeddingsResource(AsyncAPIResource):
async def create(
self,
*,
model: Optional[str] | NotGiven = NOT_GIVEN,
model: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Follows the exact same API spec as
+3 -3
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Query, Headers, NotGiven, not_given
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -47,7 +47,7 @@ class ChatResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Follows the exact same API spec as
@@ -117,7 +117,7 @@ class AsyncChatResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Follows the exact same API spec as
+5 -5
View File
@@ -12,7 +12,7 @@ from .chat import (
ChatResourceWithStreamingResponse,
AsyncChatResourceWithStreamingResponse,
)
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Query, Headers, NotGiven, not_given
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -59,7 +59,7 @@ class EnginesResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Follows the exact same API spec as
@@ -105,7 +105,7 @@ class EnginesResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Follows the exact same API spec as
@@ -174,7 +174,7 @@ class AsyncEnginesResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Follows the exact same API spec as
@@ -220,7 +220,7 @@ class AsyncEnginesResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Follows the exact same API spec as
+11 -11
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Query, Headers, NotGiven, not_given
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -47,7 +47,7 @@ class EuAssemblyaiResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Assemblyai Proxy Route
@@ -80,7 +80,7 @@ class EuAssemblyaiResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Assemblyai Proxy Route
@@ -113,7 +113,7 @@ class EuAssemblyaiResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Assemblyai Proxy Route
@@ -146,7 +146,7 @@ class EuAssemblyaiResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Assemblyai Proxy Route
@@ -179,7 +179,7 @@ class EuAssemblyaiResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Assemblyai Proxy Route
@@ -233,7 +233,7 @@ class AsyncEuAssemblyaiResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Assemblyai Proxy Route
@@ -266,7 +266,7 @@ class AsyncEuAssemblyaiResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Assemblyai Proxy Route
@@ -299,7 +299,7 @@ class AsyncEuAssemblyaiResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Assemblyai Proxy Route
@@ -332,7 +332,7 @@ class AsyncEuAssemblyaiResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Assemblyai Proxy Route
@@ -365,7 +365,7 @@ class AsyncEuAssemblyaiResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Assemblyai Proxy Route
+3 -3
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Query, Headers, NotGiven, not_given
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -48,7 +48,7 @@ class ContentResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Returns information about a specific file.
@@ -118,7 +118,7 @@ class AsyncContentResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Returns information about a specific file.
+13 -13
View File
@@ -15,7 +15,7 @@ from .content import (
ContentResourceWithStreamingResponse,
AsyncContentResourceWithStreamingResponse,
)
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes
from ..._types import Body, Omit, Query, Headers, NotGiven, FileTypes, omit, not_given
from ..._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -60,13 +60,13 @@ class FilesResource(SyncAPIResource):
*,
file: FileTypes,
purpose: str,
custom_llm_provider: str | NotGiven = NOT_GIVEN,
custom_llm_provider: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Upload a file that can be used across - Assistants API, Batch API This is the
@@ -125,7 +125,7 @@ class FilesResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Returns information about a specific file.
@@ -168,13 +168,13 @@ class FilesResource(SyncAPIResource):
self,
provider: str,
*,
purpose: Optional[str] | NotGiven = NOT_GIVEN,
purpose: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Returns information about a specific file.
@@ -224,7 +224,7 @@ class FilesResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Deletes a specified file.
@@ -293,13 +293,13 @@ class AsyncFilesResource(AsyncAPIResource):
*,
file: FileTypes,
purpose: str,
custom_llm_provider: str | NotGiven = NOT_GIVEN,
custom_llm_provider: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Upload a file that can be used across - Assistants API, Batch API This is the
@@ -358,7 +358,7 @@ class AsyncFilesResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Returns information about a specific file.
@@ -401,13 +401,13 @@ class AsyncFilesResource(AsyncAPIResource):
self,
provider: str,
*,
purpose: Optional[str] | NotGiven = NOT_GIVEN,
purpose: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Returns information about a specific file.
@@ -457,7 +457,7 @@ class AsyncFilesResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Deletes a specified file.
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ...._types import Body, Query, Headers, NotGiven, not_given
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -47,7 +47,7 @@ class CancelResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Cancel a fine-tuning job.
@@ -109,7 +109,7 @@ class AsyncCancelResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Cancel a fine-tuning job.
+21 -21
View File
@@ -15,7 +15,7 @@ from .cancel import (
CancelResourceWithStreamingResponse,
AsyncCancelResourceWithStreamingResponse,
)
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
from ...._utils import maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
@@ -61,17 +61,17 @@ class JobsResource(SyncAPIResource):
custom_llm_provider: Literal["openai", "azure", "vertex_ai"],
model: str,
training_file: str,
hyperparameters: Optional[job_create_params.Hyperparameters] | NotGiven = NOT_GIVEN,
integrations: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
seed: Optional[int] | NotGiven = NOT_GIVEN,
suffix: Optional[str] | NotGiven = NOT_GIVEN,
validation_file: Optional[str] | NotGiven = NOT_GIVEN,
hyperparameters: Optional[job_create_params.Hyperparameters] | Omit = omit,
integrations: Optional[SequenceNotStr[str]] | Omit = omit,
seed: Optional[int] | Omit = omit,
suffix: Optional[str] | Omit = omit,
validation_file: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Creates a fine-tuning job which begins the process of creating a new model from
@@ -133,7 +133,7 @@ class JobsResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Retrieves a fine-tuning job.
@@ -174,14 +174,14 @@ class JobsResource(SyncAPIResource):
self,
*,
custom_llm_provider: Literal["openai", "azure"],
after: Optional[str] | NotGiven = NOT_GIVEN,
limit: Optional[int] | NotGiven = NOT_GIVEN,
after: Optional[str] | Omit = omit,
limit: Optional[int] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Lists fine-tuning jobs for the organization.
@@ -253,17 +253,17 @@ class AsyncJobsResource(AsyncAPIResource):
custom_llm_provider: Literal["openai", "azure", "vertex_ai"],
model: str,
training_file: str,
hyperparameters: Optional[job_create_params.Hyperparameters] | NotGiven = NOT_GIVEN,
integrations: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
seed: Optional[int] | NotGiven = NOT_GIVEN,
suffix: Optional[str] | NotGiven = NOT_GIVEN,
validation_file: Optional[str] | NotGiven = NOT_GIVEN,
hyperparameters: Optional[job_create_params.Hyperparameters] | Omit = omit,
integrations: Optional[SequenceNotStr[str]] | Omit = omit,
seed: Optional[int] | Omit = omit,
suffix: Optional[str] | Omit = omit,
validation_file: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Creates a fine-tuning job which begins the process of creating a new model from
@@ -325,7 +325,7 @@ class AsyncJobsResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Retrieves a fine-tuning job.
@@ -366,14 +366,14 @@ class AsyncJobsResource(AsyncAPIResource):
self,
*,
custom_llm_provider: Literal["openai", "azure"],
after: Optional[str] | NotGiven = NOT_GIVEN,
limit: Optional[int] | NotGiven = NOT_GIVEN,
after: Optional[str] | Omit = omit,
limit: Optional[int] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Lists fine-tuning jobs for the organization.
+11 -11
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Query, Headers, NotGiven, not_given
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -47,7 +47,7 @@ class GeminiResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/google_ai_studio)
@@ -80,7 +80,7 @@ class GeminiResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/google_ai_studio)
@@ -113,7 +113,7 @@ class GeminiResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/google_ai_studio)
@@ -146,7 +146,7 @@ class GeminiResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/google_ai_studio)
@@ -179,7 +179,7 @@ class GeminiResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/google_ai_studio)
@@ -233,7 +233,7 @@ class AsyncGeminiResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/google_ai_studio)
@@ -266,7 +266,7 @@ class AsyncGeminiResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/google_ai_studio)
@@ -299,7 +299,7 @@ class AsyncGeminiResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/google_ai_studio)
@@ -332,7 +332,7 @@ class AsyncGeminiResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/google_ai_studio)
@@ -365,7 +365,7 @@ class AsyncGeminiResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[Docs](https://docs.hanzo.ai/docs/pass_through/google_ai_studio)
+27 -27
View File
@@ -7,7 +7,7 @@ from typing_extensions import Literal
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -48,15 +48,15 @@ class SpendResource(SyncAPIResource):
def list_tags(
self,
*,
end_date: Optional[str] | NotGiven = NOT_GIVEN,
start_date: Optional[str] | NotGiven = NOT_GIVEN,
tags: Optional[str] | NotGiven = NOT_GIVEN,
end_date: Optional[str] | Omit = omit,
start_date: Optional[str] | Omit = omit,
tags: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SpendListTagsResponse:
"""LLM Enterprise - View Spend Per Request Tag.
@@ -116,7 +116,7 @@ class SpendResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
ADMIN ONLY / MASTER KEY Only Endpoint
@@ -139,19 +139,19 @@ class SpendResource(SyncAPIResource):
def retrieve_report(
self,
*,
api_key: Optional[str] | NotGiven = NOT_GIVEN,
customer_id: Optional[str] | NotGiven = NOT_GIVEN,
end_date: Optional[str] | NotGiven = NOT_GIVEN,
group_by: Optional[Literal["team", "customer", "api_key"]] | NotGiven = NOT_GIVEN,
internal_user_id: Optional[str] | NotGiven = NOT_GIVEN,
start_date: Optional[str] | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
api_key: Optional[str] | Omit = omit,
customer_id: Optional[str] | Omit = omit,
end_date: Optional[str] | Omit = omit,
group_by: Optional[Literal["team", "customer", "api_key"]] | Omit = omit,
internal_user_id: Optional[str] | Omit = omit,
start_date: Optional[str] | Omit = omit,
team_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SpendRetrieveReportResponse:
"""Get Daily Spend per Team, based on specific startTime and endTime.
@@ -233,15 +233,15 @@ class AsyncSpendResource(AsyncAPIResource):
async def list_tags(
self,
*,
end_date: Optional[str] | NotGiven = NOT_GIVEN,
start_date: Optional[str] | NotGiven = NOT_GIVEN,
tags: Optional[str] | NotGiven = NOT_GIVEN,
end_date: Optional[str] | Omit = omit,
start_date: Optional[str] | Omit = omit,
tags: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SpendListTagsResponse:
"""LLM Enterprise - View Spend Per Request Tag.
@@ -301,7 +301,7 @@ class AsyncSpendResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
ADMIN ONLY / MASTER KEY Only Endpoint
@@ -324,19 +324,19 @@ class AsyncSpendResource(AsyncAPIResource):
async def retrieve_report(
self,
*,
api_key: Optional[str] | NotGiven = NOT_GIVEN,
customer_id: Optional[str] | NotGiven = NOT_GIVEN,
end_date: Optional[str] | NotGiven = NOT_GIVEN,
group_by: Optional[Literal["team", "customer", "api_key"]] | NotGiven = NOT_GIVEN,
internal_user_id: Optional[str] | NotGiven = NOT_GIVEN,
start_date: Optional[str] | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
api_key: Optional[str] | Omit = omit,
customer_id: Optional[str] | Omit = omit,
end_date: Optional[str] | Omit = omit,
group_by: Optional[Literal["team", "customer", "api_key"]] | Omit = omit,
internal_user_id: Optional[str] | Omit = omit,
start_date: Optional[str] | Omit = omit,
team_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SpendRetrieveReportResponse:
"""Get Daily Spend per Team, based on specific startTime and endTime.
+3 -3
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Query, Headers, NotGiven, not_given
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -47,7 +47,7 @@ class GuardrailsResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> GuardrailListResponse:
"""
List the guardrails that are available on the proxy server
@@ -122,7 +122,7 @@ class AsyncGuardrailsResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> GuardrailListResponse:
"""
List the guardrails that are available on the proxy server
+13 -13
View File
@@ -8,7 +8,7 @@ from typing_extensions import Literal
import httpx
from ..types import health_check_all_params, health_check_services_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
@@ -46,13 +46,13 @@ class HealthResource(SyncAPIResource):
def check_all(
self,
*,
model: Optional[str] | NotGiven = NOT_GIVEN,
model: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
🚨 USE `/health/liveliness` to health check the proxy 🚨
@@ -102,7 +102,7 @@ class HealthResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Unprotected endpoint for checking if worker is alive"""
return self._get(
@@ -121,7 +121,7 @@ class HealthResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Unprotected endpoint for checking if worker is alive"""
return self._get(
@@ -140,7 +140,7 @@ class HealthResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Unprotected endpoint for checking if worker can receive requests"""
return self._get(
@@ -165,7 +165,7 @@ class HealthResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Use this admin-only endpoint to check if the service is healthy.
@@ -223,13 +223,13 @@ class AsyncHealthResource(AsyncAPIResource):
async def check_all(
self,
*,
model: Optional[str] | NotGiven = NOT_GIVEN,
model: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
🚨 USE `/health/liveliness` to health check the proxy 🚨
@@ -279,7 +279,7 @@ class AsyncHealthResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Unprotected endpoint for checking if worker is alive"""
return await self._get(
@@ -298,7 +298,7 @@ class AsyncHealthResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Unprotected endpoint for checking if worker is alive"""
return await self._get(
@@ -317,7 +317,7 @@ class AsyncHealthResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Unprotected endpoint for checking if worker can receive requests"""
return await self._get(
@@ -342,7 +342,7 @@ class AsyncHealthResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Use this admin-only endpoint to check if the service is healthy.
+3 -3
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Query, Headers, NotGiven, not_given
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -46,7 +46,7 @@ class GenerationsResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Image Generation"""
return self._post(
@@ -86,7 +86,7 @@ class AsyncGenerationsResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Image Generation"""
return await self._post(
+215 -215
View File
@@ -17,7 +17,7 @@ from ...types import (
key_retrieve_info_params,
key_regenerate_by_key_params,
)
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
from ..._utils import maybe_transform, strip_not_given, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -60,39 +60,39 @@ class KeyResource(SyncAPIResource):
self,
*,
key: str,
aliases: Optional[object] | NotGiven = NOT_GIVEN,
allowed_cache_controls: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
blocked: Optional[bool] | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
budget_id: Optional[str] | NotGiven = NOT_GIVEN,
config: Optional[object] | NotGiven = NOT_GIVEN,
duration: Optional[str] | NotGiven = NOT_GIVEN,
enforced_params: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
guardrails: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
key_alias: Optional[str] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
max_parallel_requests: Optional[int] | NotGiven = NOT_GIVEN,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
model_max_budget: Optional[object] | NotGiven = NOT_GIVEN,
model_rpm_limit: Optional[object] | NotGiven = NOT_GIVEN,
model_tpm_limit: Optional[object] | NotGiven = NOT_GIVEN,
models: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
permissions: Optional[object] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
spend: Optional[float] | NotGiven = NOT_GIVEN,
tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
temp_budget_expiry: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
temp_budget_increase: Optional[float] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
aliases: Optional[object] | Omit = omit,
allowed_cache_controls: Optional[Iterable[object]] | Omit = omit,
blocked: Optional[bool] | Omit = omit,
budget_duration: Optional[str] | Omit = omit,
budget_id: Optional[str] | Omit = omit,
config: Optional[object] | Omit = omit,
duration: Optional[str] | Omit = omit,
enforced_params: Optional[SequenceNotStr[str]] | Omit = omit,
guardrails: Optional[SequenceNotStr[str]] | Omit = omit,
key_alias: Optional[str] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
max_parallel_requests: Optional[int] | Omit = omit,
metadata: Optional[object] | Omit = omit,
model_max_budget: Optional[object] | Omit = omit,
model_rpm_limit: Optional[object] | Omit = omit,
model_tpm_limit: Optional[object] | Omit = omit,
models: Optional[Iterable[object]] | Omit = omit,
permissions: Optional[object] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
spend: Optional[float] | Omit = omit,
tags: Optional[SequenceNotStr[str]] | Omit = omit,
team_id: Optional[str] | Omit = omit,
temp_budget_expiry: Union[str, datetime, None] | Omit = omit,
temp_budget_increase: Optional[float] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
user_id: Optional[str] | Omit = omit,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Update an existing API key's parameters.
@@ -209,20 +209,20 @@ class KeyResource(SyncAPIResource):
def list(
self,
*,
include_team_keys: bool | NotGiven = NOT_GIVEN,
key_alias: Optional[str] | NotGiven = NOT_GIVEN,
organization_id: Optional[str] | NotGiven = NOT_GIVEN,
page: int | NotGiven = NOT_GIVEN,
return_full_object: bool | NotGiven = NOT_GIVEN,
size: int | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
include_team_keys: bool | Omit = omit,
key_alias: Optional[str] | Omit = omit,
organization_id: Optional[str] | Omit = omit,
page: int | Omit = omit,
return_full_object: bool | Omit = omit,
size: int | Omit = omit,
team_id: Optional[str] | Omit = omit,
user_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> KeyListResponse:
"""
List all keys for a given user / team / organization.
@@ -282,15 +282,15 @@ class KeyResource(SyncAPIResource):
def delete(
self,
*,
key_aliases: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
keys: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
key_aliases: Optional[SequenceNotStr[str]] | Omit = omit,
keys: Optional[SequenceNotStr[str]] | Omit = omit,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Delete a key from the key management system.
@@ -351,13 +351,13 @@ class KeyResource(SyncAPIResource):
self,
*,
key: str,
llm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Optional[KeyBlockResponse]:
"""
Block an Virtual key from making any requests.
@@ -407,7 +407,7 @@ class KeyResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> KeyCheckHealthResponse:
"""
Check the health of the key
@@ -461,40 +461,40 @@ class KeyResource(SyncAPIResource):
def generate(
self,
*,
aliases: Optional[object] | NotGiven = NOT_GIVEN,
allowed_cache_controls: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
blocked: Optional[bool] | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
budget_id: Optional[str] | NotGiven = NOT_GIVEN,
config: Optional[object] | NotGiven = NOT_GIVEN,
duration: Optional[str] | NotGiven = NOT_GIVEN,
enforced_params: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
guardrails: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
key: Optional[str] | NotGiven = NOT_GIVEN,
key_alias: Optional[str] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
max_parallel_requests: Optional[int] | NotGiven = NOT_GIVEN,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
model_max_budget: Optional[object] | NotGiven = NOT_GIVEN,
model_rpm_limit: Optional[object] | NotGiven = NOT_GIVEN,
model_tpm_limit: Optional[object] | NotGiven = NOT_GIVEN,
models: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
permissions: Optional[object] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
send_invite_email: Optional[bool] | NotGiven = NOT_GIVEN,
soft_budget: Optional[float] | NotGiven = NOT_GIVEN,
spend: Optional[float] | NotGiven = NOT_GIVEN,
tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
aliases: Optional[object] | Omit = omit,
allowed_cache_controls: Optional[Iterable[object]] | Omit = omit,
blocked: Optional[bool] | Omit = omit,
budget_duration: Optional[str] | Omit = omit,
budget_id: Optional[str] | Omit = omit,
config: Optional[object] | Omit = omit,
duration: Optional[str] | Omit = omit,
enforced_params: Optional[SequenceNotStr[str]] | Omit = omit,
guardrails: Optional[SequenceNotStr[str]] | Omit = omit,
key: Optional[str] | Omit = omit,
key_alias: Optional[str] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
max_parallel_requests: Optional[int] | Omit = omit,
metadata: Optional[object] | Omit = omit,
model_max_budget: Optional[object] | Omit = omit,
model_rpm_limit: Optional[object] | Omit = omit,
model_tpm_limit: Optional[object] | Omit = omit,
models: Optional[Iterable[object]] | Omit = omit,
permissions: Optional[object] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
send_invite_email: Optional[bool] | Omit = omit,
soft_budget: Optional[float] | Omit = omit,
spend: Optional[float] | Omit = omit,
tags: Optional[SequenceNotStr[str]] | Omit = omit,
team_id: Optional[str] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
user_id: Optional[str] | Omit = omit,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> GenerateKeyResponse:
"""
Generate an API key based on the provided data.
@@ -638,41 +638,41 @@ class KeyResource(SyncAPIResource):
self,
path_key: str,
*,
aliases: Optional[object] | NotGiven = NOT_GIVEN,
allowed_cache_controls: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
blocked: Optional[bool] | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
budget_id: Optional[str] | NotGiven = NOT_GIVEN,
config: Optional[object] | NotGiven = NOT_GIVEN,
duration: Optional[str] | NotGiven = NOT_GIVEN,
enforced_params: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
guardrails: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
body_key: Optional[str] | NotGiven = NOT_GIVEN,
key_alias: Optional[str] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
max_parallel_requests: Optional[int] | NotGiven = NOT_GIVEN,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
model_max_budget: Optional[object] | NotGiven = NOT_GIVEN,
model_rpm_limit: Optional[object] | NotGiven = NOT_GIVEN,
model_tpm_limit: Optional[object] | NotGiven = NOT_GIVEN,
models: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
new_master_key: Optional[str] | NotGiven = NOT_GIVEN,
permissions: Optional[object] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
send_invite_email: Optional[bool] | NotGiven = NOT_GIVEN,
soft_budget: Optional[float] | NotGiven = NOT_GIVEN,
spend: Optional[float] | NotGiven = NOT_GIVEN,
tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
aliases: Optional[object] | Omit = omit,
allowed_cache_controls: Optional[Iterable[object]] | Omit = omit,
blocked: Optional[bool] | Omit = omit,
budget_duration: Optional[str] | Omit = omit,
budget_id: Optional[str] | Omit = omit,
config: Optional[object] | Omit = omit,
duration: Optional[str] | Omit = omit,
enforced_params: Optional[SequenceNotStr[str]] | Omit = omit,
guardrails: Optional[SequenceNotStr[str]] | Omit = omit,
body_key: Optional[str] | Omit = omit,
key_alias: Optional[str] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
max_parallel_requests: Optional[int] | Omit = omit,
metadata: Optional[object] | Omit = omit,
model_max_budget: Optional[object] | Omit = omit,
model_rpm_limit: Optional[object] | Omit = omit,
model_tpm_limit: Optional[object] | Omit = omit,
models: Optional[Iterable[object]] | Omit = omit,
new_master_key: Optional[str] | Omit = omit,
permissions: Optional[object] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
send_invite_email: Optional[bool] | Omit = omit,
soft_budget: Optional[float] | Omit = omit,
spend: Optional[float] | Omit = omit,
tags: Optional[SequenceNotStr[str]] | Omit = omit,
team_id: Optional[str] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
user_id: Optional[str] | Omit = omit,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Optional[GenerateKeyResponse]:
"""
Regenerate an existing API key while optionally updating its parameters.
@@ -785,13 +785,13 @@ class KeyResource(SyncAPIResource):
def retrieve_info(
self,
*,
key: Optional[str] | NotGiven = NOT_GIVEN,
key: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Retrieve information about a key.
@@ -840,13 +840,13 @@ class KeyResource(SyncAPIResource):
self,
*,
key: str,
llm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Unblock a Virtual key to allow it to make requests again.
@@ -913,39 +913,39 @@ class AsyncKeyResource(AsyncAPIResource):
self,
*,
key: str,
aliases: Optional[object] | NotGiven = NOT_GIVEN,
allowed_cache_controls: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
blocked: Optional[bool] | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
budget_id: Optional[str] | NotGiven = NOT_GIVEN,
config: Optional[object] | NotGiven = NOT_GIVEN,
duration: Optional[str] | NotGiven = NOT_GIVEN,
enforced_params: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
guardrails: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
key_alias: Optional[str] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
max_parallel_requests: Optional[int] | NotGiven = NOT_GIVEN,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
model_max_budget: Optional[object] | NotGiven = NOT_GIVEN,
model_rpm_limit: Optional[object] | NotGiven = NOT_GIVEN,
model_tpm_limit: Optional[object] | NotGiven = NOT_GIVEN,
models: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
permissions: Optional[object] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
spend: Optional[float] | NotGiven = NOT_GIVEN,
tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
temp_budget_expiry: Union[str, datetime, None] | NotGiven = NOT_GIVEN,
temp_budget_increase: Optional[float] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
aliases: Optional[object] | Omit = omit,
allowed_cache_controls: Optional[Iterable[object]] | Omit = omit,
blocked: Optional[bool] | Omit = omit,
budget_duration: Optional[str] | Omit = omit,
budget_id: Optional[str] | Omit = omit,
config: Optional[object] | Omit = omit,
duration: Optional[str] | Omit = omit,
enforced_params: Optional[SequenceNotStr[str]] | Omit = omit,
guardrails: Optional[SequenceNotStr[str]] | Omit = omit,
key_alias: Optional[str] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
max_parallel_requests: Optional[int] | Omit = omit,
metadata: Optional[object] | Omit = omit,
model_max_budget: Optional[object] | Omit = omit,
model_rpm_limit: Optional[object] | Omit = omit,
model_tpm_limit: Optional[object] | Omit = omit,
models: Optional[Iterable[object]] | Omit = omit,
permissions: Optional[object] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
spend: Optional[float] | Omit = omit,
tags: Optional[SequenceNotStr[str]] | Omit = omit,
team_id: Optional[str] | Omit = omit,
temp_budget_expiry: Union[str, datetime, None] | Omit = omit,
temp_budget_increase: Optional[float] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
user_id: Optional[str] | Omit = omit,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Update an existing API key's parameters.
@@ -1062,20 +1062,20 @@ class AsyncKeyResource(AsyncAPIResource):
async def list(
self,
*,
include_team_keys: bool | NotGiven = NOT_GIVEN,
key_alias: Optional[str] | NotGiven = NOT_GIVEN,
organization_id: Optional[str] | NotGiven = NOT_GIVEN,
page: int | NotGiven = NOT_GIVEN,
return_full_object: bool | NotGiven = NOT_GIVEN,
size: int | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
include_team_keys: bool | Omit = omit,
key_alias: Optional[str] | Omit = omit,
organization_id: Optional[str] | Omit = omit,
page: int | Omit = omit,
return_full_object: bool | Omit = omit,
size: int | Omit = omit,
team_id: Optional[str] | Omit = omit,
user_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> KeyListResponse:
"""
List all keys for a given user / team / organization.
@@ -1135,15 +1135,15 @@ class AsyncKeyResource(AsyncAPIResource):
async def delete(
self,
*,
key_aliases: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
keys: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
key_aliases: Optional[SequenceNotStr[str]] | Omit = omit,
keys: Optional[SequenceNotStr[str]] | Omit = omit,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Delete a key from the key management system.
@@ -1204,13 +1204,13 @@ class AsyncKeyResource(AsyncAPIResource):
self,
*,
key: str,
llm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Optional[KeyBlockResponse]:
"""
Block an Virtual key from making any requests.
@@ -1260,7 +1260,7 @@ class AsyncKeyResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> KeyCheckHealthResponse:
"""
Check the health of the key
@@ -1314,40 +1314,40 @@ class AsyncKeyResource(AsyncAPIResource):
async def generate(
self,
*,
aliases: Optional[object] | NotGiven = NOT_GIVEN,
allowed_cache_controls: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
blocked: Optional[bool] | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
budget_id: Optional[str] | NotGiven = NOT_GIVEN,
config: Optional[object] | NotGiven = NOT_GIVEN,
duration: Optional[str] | NotGiven = NOT_GIVEN,
enforced_params: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
guardrails: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
key: Optional[str] | NotGiven = NOT_GIVEN,
key_alias: Optional[str] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
max_parallel_requests: Optional[int] | NotGiven = NOT_GIVEN,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
model_max_budget: Optional[object] | NotGiven = NOT_GIVEN,
model_rpm_limit: Optional[object] | NotGiven = NOT_GIVEN,
model_tpm_limit: Optional[object] | NotGiven = NOT_GIVEN,
models: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
permissions: Optional[object] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
send_invite_email: Optional[bool] | NotGiven = NOT_GIVEN,
soft_budget: Optional[float] | NotGiven = NOT_GIVEN,
spend: Optional[float] | NotGiven = NOT_GIVEN,
tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
aliases: Optional[object] | Omit = omit,
allowed_cache_controls: Optional[Iterable[object]] | Omit = omit,
blocked: Optional[bool] | Omit = omit,
budget_duration: Optional[str] | Omit = omit,
budget_id: Optional[str] | Omit = omit,
config: Optional[object] | Omit = omit,
duration: Optional[str] | Omit = omit,
enforced_params: Optional[SequenceNotStr[str]] | Omit = omit,
guardrails: Optional[SequenceNotStr[str]] | Omit = omit,
key: Optional[str] | Omit = omit,
key_alias: Optional[str] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
max_parallel_requests: Optional[int] | Omit = omit,
metadata: Optional[object] | Omit = omit,
model_max_budget: Optional[object] | Omit = omit,
model_rpm_limit: Optional[object] | Omit = omit,
model_tpm_limit: Optional[object] | Omit = omit,
models: Optional[Iterable[object]] | Omit = omit,
permissions: Optional[object] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
send_invite_email: Optional[bool] | Omit = omit,
soft_budget: Optional[float] | Omit = omit,
spend: Optional[float] | Omit = omit,
tags: Optional[SequenceNotStr[str]] | Omit = omit,
team_id: Optional[str] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
user_id: Optional[str] | Omit = omit,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> GenerateKeyResponse:
"""
Generate an API key based on the provided data.
@@ -1491,41 +1491,41 @@ class AsyncKeyResource(AsyncAPIResource):
self,
path_key: str,
*,
aliases: Optional[object] | NotGiven = NOT_GIVEN,
allowed_cache_controls: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
blocked: Optional[bool] | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
budget_id: Optional[str] | NotGiven = NOT_GIVEN,
config: Optional[object] | NotGiven = NOT_GIVEN,
duration: Optional[str] | NotGiven = NOT_GIVEN,
enforced_params: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
guardrails: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
body_key: Optional[str] | NotGiven = NOT_GIVEN,
key_alias: Optional[str] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
max_parallel_requests: Optional[int] | NotGiven = NOT_GIVEN,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
model_max_budget: Optional[object] | NotGiven = NOT_GIVEN,
model_rpm_limit: Optional[object] | NotGiven = NOT_GIVEN,
model_tpm_limit: Optional[object] | NotGiven = NOT_GIVEN,
models: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
new_master_key: Optional[str] | NotGiven = NOT_GIVEN,
permissions: Optional[object] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
send_invite_email: Optional[bool] | NotGiven = NOT_GIVEN,
soft_budget: Optional[float] | NotGiven = NOT_GIVEN,
spend: Optional[float] | NotGiven = NOT_GIVEN,
tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
aliases: Optional[object] | Omit = omit,
allowed_cache_controls: Optional[Iterable[object]] | Omit = omit,
blocked: Optional[bool] | Omit = omit,
budget_duration: Optional[str] | Omit = omit,
budget_id: Optional[str] | Omit = omit,
config: Optional[object] | Omit = omit,
duration: Optional[str] | Omit = omit,
enforced_params: Optional[SequenceNotStr[str]] | Omit = omit,
guardrails: Optional[SequenceNotStr[str]] | Omit = omit,
body_key: Optional[str] | Omit = omit,
key_alias: Optional[str] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
max_parallel_requests: Optional[int] | Omit = omit,
metadata: Optional[object] | Omit = omit,
model_max_budget: Optional[object] | Omit = omit,
model_rpm_limit: Optional[object] | Omit = omit,
model_tpm_limit: Optional[object] | Omit = omit,
models: Optional[Iterable[object]] | Omit = omit,
new_master_key: Optional[str] | Omit = omit,
permissions: Optional[object] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
send_invite_email: Optional[bool] | Omit = omit,
soft_budget: Optional[float] | Omit = omit,
spend: Optional[float] | Omit = omit,
tags: Optional[SequenceNotStr[str]] | Omit = omit,
team_id: Optional[str] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
user_id: Optional[str] | Omit = omit,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Optional[GenerateKeyResponse]:
"""
Regenerate an existing API key while optionally updating its parameters.
@@ -1638,13 +1638,13 @@ class AsyncKeyResource(AsyncAPIResource):
async def retrieve_info(
self,
*,
key: Optional[str] | NotGiven = NOT_GIVEN,
key: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Retrieve information about a key.
@@ -1693,13 +1693,13 @@ class AsyncKeyResource(AsyncAPIResource):
self,
*,
key: str,
llm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Unblock a Virtual key to allow it to make requests again.
+11 -11
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Query, Headers, NotGiven, not_given
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -47,7 +47,7 @@ class LangfuseResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Call Langfuse via LLM proxy.
@@ -83,7 +83,7 @@ class LangfuseResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Call Langfuse via LLM proxy.
@@ -119,7 +119,7 @@ class LangfuseResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Call Langfuse via LLM proxy.
@@ -155,7 +155,7 @@ class LangfuseResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Call Langfuse via LLM proxy.
@@ -191,7 +191,7 @@ class LangfuseResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Call Langfuse via LLM proxy.
@@ -248,7 +248,7 @@ class AsyncLangfuseResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Call Langfuse via LLM proxy.
@@ -284,7 +284,7 @@ class AsyncLangfuseResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Call Langfuse via LLM proxy.
@@ -320,7 +320,7 @@ class AsyncLangfuseResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Call Langfuse via LLM proxy.
@@ -356,7 +356,7 @@ class AsyncLangfuseResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Call Langfuse via LLM proxy.
@@ -392,7 +392,7 @@ class AsyncLangfuseResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Call Langfuse via LLM proxy.
+5 -5
View File
@@ -6,7 +6,7 @@ from typing import Optional
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -45,13 +45,13 @@ class InfoResource(SyncAPIResource):
def list(
self,
*,
llm_model_id: Optional[str] | NotGiven = NOT_GIVEN,
llm_model_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Provides more info about each model in /models, including config.yaml
@@ -130,13 +130,13 @@ class AsyncInfoResource(AsyncAPIResource):
async def list(
self,
*,
llm_model_id: Optional[str] | NotGiven = NOT_GIVEN,
llm_model_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Provides more info about each model in /models, including config.yaml
+5 -5
View File
@@ -21,7 +21,7 @@ from .update import (
AsyncUpdateResourceWithStreamingResponse,
)
from ...types import model_create_params, model_delete_params
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Query, Headers, NotGiven, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -76,7 +76,7 @@ class ModelResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Allows adding new models to the model list in the config.yaml
@@ -117,7 +117,7 @@ class ModelResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Allows deleting models in the model list in the config.yaml
@@ -180,7 +180,7 @@ class AsyncModelResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Allows adding new models to the model list in the config.yaml
@@ -221,7 +221,7 @@ class AsyncModelResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Allows deleting models in the model list in the config.yaml
+17 -17
View File
@@ -6,7 +6,7 @@ from typing import Optional
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -46,15 +46,15 @@ class UpdateResource(SyncAPIResource):
def full(
self,
*,
llm_params: Optional[update_full_params.LlmParams] | NotGiven = NOT_GIVEN,
model_info: Optional[ModelInfoParam] | NotGiven = NOT_GIVEN,
model_name: Optional[str] | NotGiven = NOT_GIVEN,
llm_params: Optional[update_full_params.LlmParams] | Omit = omit,
model_info: Optional[ModelInfoParam] | Omit = omit,
model_name: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Edit existing model params
@@ -88,15 +88,15 @@ class UpdateResource(SyncAPIResource):
self,
model_id: str,
*,
llm_params: Optional[update_partial_params.LlmParams] | NotGiven = NOT_GIVEN,
model_info: Optional[ModelInfoParam] | NotGiven = NOT_GIVEN,
model_name: Optional[str] | NotGiven = NOT_GIVEN,
llm_params: Optional[update_partial_params.LlmParams] | Omit = omit,
model_info: Optional[ModelInfoParam] | Omit = omit,
model_name: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
PATCH Endpoint for partial model updates.
@@ -163,15 +163,15 @@ class AsyncUpdateResource(AsyncAPIResource):
async def full(
self,
*,
llm_params: Optional[update_full_params.LlmParams] | NotGiven = NOT_GIVEN,
model_info: Optional[ModelInfoParam] | NotGiven = NOT_GIVEN,
model_name: Optional[str] | NotGiven = NOT_GIVEN,
llm_params: Optional[update_full_params.LlmParams] | Omit = omit,
model_info: Optional[ModelInfoParam] | Omit = omit,
model_name: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Edit existing model params
@@ -205,15 +205,15 @@ class AsyncUpdateResource(AsyncAPIResource):
self,
model_id: str,
*,
llm_params: Optional[update_partial_params.LlmParams] | NotGiven = NOT_GIVEN,
model_info: Optional[ModelInfoParam] | NotGiven = NOT_GIVEN,
model_name: Optional[str] | NotGiven = NOT_GIVEN,
llm_params: Optional[update_partial_params.LlmParams] | Omit = omit,
model_info: Optional[ModelInfoParam] | Omit = omit,
model_name: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
PATCH Endpoint for partial model updates.
+5 -5
View File
@@ -7,7 +7,7 @@ from typing import Optional
import httpx
from ..types import model_group_retrieve_info_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
@@ -45,13 +45,13 @@ class ModelGroupResource(SyncAPIResource):
def retrieve_info(
self,
*,
model_group: Optional[str] | NotGiven = NOT_GIVEN,
model_group: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Get information about all the deployments on llm proxy, including config.yaml
@@ -244,13 +244,13 @@ class AsyncModelGroupResource(AsyncAPIResource):
async def retrieve_info(
self,
*,
model_group: Optional[str] | NotGiven = NOT_GIVEN,
model_group: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Get information about all the deployments on llm proxy, including config.yaml
+7 -7
View File
@@ -7,7 +7,7 @@ from typing import Optional
import httpx
from ..types import model_list_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
@@ -45,14 +45,14 @@ class ModelsResource(SyncAPIResource):
def list(
self,
*,
return_wildcard_routes: Optional[bool] | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
return_wildcard_routes: Optional[bool] | Omit = omit,
team_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Use `/model/info` - to get detailed model information, example - pricing, mode,
@@ -111,14 +111,14 @@ class AsyncModelsResource(AsyncAPIResource):
async def list(
self,
*,
return_wildcard_routes: Optional[bool] | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
return_wildcard_routes: Optional[bool] | Omit = omit,
team_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Use `/model/info` - to get detailed model information, example - pricing, mode,
+3 -3
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Query, Headers, NotGiven, not_given
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -46,7 +46,7 @@ class ModerationsResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
The moderations endpoint is a tool you can use to check whether content complies
@@ -95,7 +95,7 @@ class AsyncModerationsResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
The moderations endpoint is a tool you can use to check whether content complies
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ...._types import Body, Query, Headers, NotGiven, not_given
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -47,7 +47,7 @@ class ChatResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Follows the exact same API spec as
@@ -117,7 +117,7 @@ class AsyncChatResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Follows the exact same API spec as
@@ -12,7 +12,7 @@ from .chat import (
ChatResourceWithStreamingResponse,
AsyncChatResourceWithStreamingResponse,
)
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ...._types import Body, Query, Headers, NotGiven, not_given
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -59,7 +59,7 @@ class DeploymentsResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Follows the exact same API spec as
@@ -105,7 +105,7 @@ class DeploymentsResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Follows the exact same API spec as
@@ -174,7 +174,7 @@ class AsyncDeploymentsResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Follows the exact same API spec as
@@ -220,7 +220,7 @@ class AsyncDeploymentsResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Follows the exact same API spec as
+11 -11
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Query, Headers, NotGiven, not_given
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -59,7 +59,7 @@ class OpenAIResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Simple pass-through for OpenAI.
@@ -94,7 +94,7 @@ class OpenAIResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Simple pass-through for OpenAI.
@@ -129,7 +129,7 @@ class OpenAIResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Simple pass-through for OpenAI.
@@ -164,7 +164,7 @@ class OpenAIResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Simple pass-through for OpenAI.
@@ -199,7 +199,7 @@ class OpenAIResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Simple pass-through for OpenAI.
@@ -259,7 +259,7 @@ class AsyncOpenAIResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Simple pass-through for OpenAI.
@@ -294,7 +294,7 @@ class AsyncOpenAIResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Simple pass-through for OpenAI.
@@ -329,7 +329,7 @@ class AsyncOpenAIResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Simple pass-through for OpenAI.
@@ -364,7 +364,7 @@ class AsyncOpenAIResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Simple pass-through for OpenAI.
@@ -399,7 +399,7 @@ class AsyncOpenAIResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Simple pass-through for OpenAI.
+5 -5
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
from ..._types import Body, Query, Headers, NotGiven, SequenceNotStr, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -50,7 +50,7 @@ class InfoResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InfoRetrieveResponse:
"""
Get the org specific information
@@ -85,7 +85,7 @@ class InfoResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
DEPRECATED: Use GET /organization/info instead
@@ -138,7 +138,7 @@ class AsyncInfoResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InfoRetrieveResponse:
"""
Get the org specific information
@@ -175,7 +175,7 @@ class AsyncInfoResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
DEPRECATED: Use GET /organization/info instead
@@ -23,7 +23,7 @@ from ...types import (
organization_delete_member_params,
organization_update_member_params,
)
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -72,23 +72,23 @@ class OrganizationResource(SyncAPIResource):
self,
*,
organization_alias: str,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
budget_id: Optional[str] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
max_parallel_requests: Optional[int] | NotGiven = NOT_GIVEN,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
model_max_budget: Optional[object] | NotGiven = NOT_GIVEN,
models: Iterable[object] | NotGiven = NOT_GIVEN,
organization_id: Optional[str] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
soft_budget: Optional[float] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | Omit = omit,
budget_id: Optional[str] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
max_parallel_requests: Optional[int] | Omit = omit,
metadata: Optional[object] | Omit = omit,
model_max_budget: Optional[object] | Omit = omit,
models: Iterable[object] | Omit = omit,
organization_id: Optional[str] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
soft_budget: Optional[float] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OrganizationCreateResponse:
"""
Allow orgs to own teams
@@ -193,19 +193,19 @@ class OrganizationResource(SyncAPIResource):
def update(
self,
*,
budget_id: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
models: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
organization_alias: Optional[str] | NotGiven = NOT_GIVEN,
organization_id: Optional[str] | NotGiven = NOT_GIVEN,
spend: Optional[float] | NotGiven = NOT_GIVEN,
updated_by: Optional[str] | NotGiven = NOT_GIVEN,
budget_id: Optional[str] | Omit = omit,
metadata: Optional[object] | Omit = omit,
models: Optional[SequenceNotStr[str]] | Omit = omit,
organization_alias: Optional[str] | Omit = omit,
organization_id: Optional[str] | Omit = omit,
spend: Optional[float] | Omit = omit,
updated_by: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OrganizationUpdateResponse:
"""
Update an organization
@@ -247,7 +247,7 @@ class OrganizationResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OrganizationListResponse:
"""
```
@@ -271,7 +271,7 @@ class OrganizationResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OrganizationDeleteResponse:
"""
Delete an organization
@@ -305,13 +305,13 @@ class OrganizationResource(SyncAPIResource):
*,
member: organization_add_member_params.Member,
organization_id: str,
max_budget_in_organization: Optional[float] | NotGiven = NOT_GIVEN,
max_budget_in_organization: Optional[float] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OrganizationAddMemberResponse:
"""
[BETA]
@@ -381,14 +381,14 @@ class OrganizationResource(SyncAPIResource):
self,
*,
organization_id: str,
user_email: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
user_email: Optional[str] | Omit = omit,
user_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Delete a member from an organization
@@ -422,7 +422,7 @@ class OrganizationResource(SyncAPIResource):
self,
*,
organization_id: str,
max_budget_in_organization: Optional[float] | NotGiven = NOT_GIVEN,
max_budget_in_organization: Optional[float] | Omit = omit,
role: Optional[
Literal[
"proxy_admin",
@@ -434,15 +434,15 @@ class OrganizationResource(SyncAPIResource):
"customer",
]
]
| NotGiven = NOT_GIVEN,
user_email: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
| Omit = omit,
user_email: Optional[str] | Omit = omit,
user_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OrganizationUpdateMemberResponse:
"""
Update a member's role in an organization
@@ -515,23 +515,23 @@ class AsyncOrganizationResource(AsyncAPIResource):
self,
*,
organization_alias: str,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
budget_id: Optional[str] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
max_parallel_requests: Optional[int] | NotGiven = NOT_GIVEN,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
model_max_budget: Optional[object] | NotGiven = NOT_GIVEN,
models: Iterable[object] | NotGiven = NOT_GIVEN,
organization_id: Optional[str] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
soft_budget: Optional[float] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | Omit = omit,
budget_id: Optional[str] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
max_parallel_requests: Optional[int] | Omit = omit,
metadata: Optional[object] | Omit = omit,
model_max_budget: Optional[object] | Omit = omit,
models: Iterable[object] | Omit = omit,
organization_id: Optional[str] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
soft_budget: Optional[float] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OrganizationCreateResponse:
"""
Allow orgs to own teams
@@ -636,19 +636,19 @@ class AsyncOrganizationResource(AsyncAPIResource):
async def update(
self,
*,
budget_id: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
models: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
organization_alias: Optional[str] | NotGiven = NOT_GIVEN,
organization_id: Optional[str] | NotGiven = NOT_GIVEN,
spend: Optional[float] | NotGiven = NOT_GIVEN,
updated_by: Optional[str] | NotGiven = NOT_GIVEN,
budget_id: Optional[str] | Omit = omit,
metadata: Optional[object] | Omit = omit,
models: Optional[SequenceNotStr[str]] | Omit = omit,
organization_alias: Optional[str] | Omit = omit,
organization_id: Optional[str] | Omit = omit,
spend: Optional[float] | Omit = omit,
updated_by: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OrganizationUpdateResponse:
"""
Update an organization
@@ -690,7 +690,7 @@ class AsyncOrganizationResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OrganizationListResponse:
"""
```
@@ -714,7 +714,7 @@ class AsyncOrganizationResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OrganizationDeleteResponse:
"""
Delete an organization
@@ -748,13 +748,13 @@ class AsyncOrganizationResource(AsyncAPIResource):
*,
member: organization_add_member_params.Member,
organization_id: str,
max_budget_in_organization: Optional[float] | NotGiven = NOT_GIVEN,
max_budget_in_organization: Optional[float] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OrganizationAddMemberResponse:
"""
[BETA]
@@ -824,14 +824,14 @@ class AsyncOrganizationResource(AsyncAPIResource):
self,
*,
organization_id: str,
user_email: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
user_email: Optional[str] | Omit = omit,
user_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Delete a member from an organization
@@ -865,7 +865,7 @@ class AsyncOrganizationResource(AsyncAPIResource):
self,
*,
organization_id: str,
max_budget_in_organization: Optional[float] | NotGiven = NOT_GIVEN,
max_budget_in_organization: Optional[float] | Omit = omit,
role: Optional[
Literal[
"proxy_admin",
@@ -877,15 +877,15 @@ class AsyncOrganizationResource(AsyncAPIResource):
"customer",
]
]
| NotGiven = NOT_GIVEN,
user_email: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
| Omit = omit,
user_email: Optional[str] | Omit = omit,
user_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> OrganizationUpdateMemberResponse:
"""
Update a member's role in an organization
+3 -3
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Query, Headers, NotGiven, not_given
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -47,7 +47,7 @@ class ProviderResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ProviderListBudgetsResponse:
"""
Provider Budget Routing - Get Budget, Spend Details
@@ -132,7 +132,7 @@ class AsyncProviderResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ProviderListBudgetsResponse:
"""
Provider Budget Routing - Get Budget, Spend Details
+7 -7
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Query, Headers, NotGiven, not_given
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -46,7 +46,7 @@ class RerankResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Rerank"""
return self._post(
@@ -65,7 +65,7 @@ class RerankResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Rerank"""
return self._post(
@@ -84,7 +84,7 @@ class RerankResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Rerank"""
return self._post(
@@ -124,7 +124,7 @@ class AsyncRerankResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Rerank"""
return await self._post(
@@ -143,7 +143,7 @@ class AsyncRerankResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Rerank"""
return await self._post(
@@ -162,7 +162,7 @@ class AsyncRerankResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Rerank"""
return await self._post(
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Query, Headers, NotGiven, not_given
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -47,7 +47,7 @@ class InputItemsResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Get input items for a response.
@@ -108,7 +108,7 @@ class AsyncInputItemsResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Get input items for a response.
+7 -7
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Query, Headers, NotGiven, not_given
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -58,7 +58,7 @@ class ResponsesResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Follows the OpenAI Responses API spec:
@@ -88,7 +88,7 @@ class ResponsesResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Get a response by ID.
@@ -128,7 +128,7 @@ class ResponsesResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Delete a response by ID.
@@ -192,7 +192,7 @@ class AsyncResponsesResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Follows the OpenAI Responses API spec:
@@ -222,7 +222,7 @@ class AsyncResponsesResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Get a response by ID.
@@ -262,7 +262,7 @@ class AsyncResponsesResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Delete a response by ID.
+3 -3
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Query, Headers, NotGiven, not_given
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -46,7 +46,7 @@ class RoutesResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Get a list of available routes in the FastAPI application."""
return self._get(
@@ -86,7 +86,7 @@ class AsyncRoutesResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Get a list of available routes in the FastAPI application."""
return await self._get(
+3 -3
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Query, Headers, NotGiven, not_given
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -46,7 +46,7 @@ class SettingsResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Returns a list of llm level settings
@@ -110,7 +110,7 @@ class AsyncSettingsResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Returns a list of llm level settings
+27 -27
View File
@@ -7,7 +7,7 @@ from typing import Iterable, Optional
import httpx
from ..types import spend_list_logs_params, spend_list_tags_params, spend_calculate_spend_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
@@ -47,15 +47,15 @@ class SpendResource(SyncAPIResource):
def calculate_spend(
self,
*,
completion_response: Optional[object] | NotGiven = NOT_GIVEN,
messages: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
model: Optional[str] | NotGiven = NOT_GIVEN,
completion_response: Optional[object] | Omit = omit,
messages: Optional[Iterable[object]] | Omit = omit,
model: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Accepts all the params of completion_cost.
@@ -134,17 +134,17 @@ class SpendResource(SyncAPIResource):
def list_logs(
self,
*,
api_key: Optional[str] | NotGiven = NOT_GIVEN,
end_date: Optional[str] | NotGiven = NOT_GIVEN,
request_id: Optional[str] | NotGiven = NOT_GIVEN,
start_date: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
api_key: Optional[str] | Omit = omit,
end_date: Optional[str] | Omit = omit,
request_id: Optional[str] | Omit = omit,
start_date: Optional[str] | Omit = omit,
user_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SpendListLogsResponse:
"""
View all spend logs, if request_id is provided, only logs for that request_id
@@ -218,14 +218,14 @@ class SpendResource(SyncAPIResource):
def list_tags(
self,
*,
end_date: Optional[str] | NotGiven = NOT_GIVEN,
start_date: Optional[str] | NotGiven = NOT_GIVEN,
end_date: Optional[str] | Omit = omit,
start_date: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SpendListTagsResponse:
"""
LLM Enterprise - View Spend Per Request Tag
@@ -297,15 +297,15 @@ class AsyncSpendResource(AsyncAPIResource):
async def calculate_spend(
self,
*,
completion_response: Optional[object] | NotGiven = NOT_GIVEN,
messages: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
model: Optional[str] | NotGiven = NOT_GIVEN,
completion_response: Optional[object] | Omit = omit,
messages: Optional[Iterable[object]] | Omit = omit,
model: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Accepts all the params of completion_cost.
@@ -384,17 +384,17 @@ class AsyncSpendResource(AsyncAPIResource):
async def list_logs(
self,
*,
api_key: Optional[str] | NotGiven = NOT_GIVEN,
end_date: Optional[str] | NotGiven = NOT_GIVEN,
request_id: Optional[str] | NotGiven = NOT_GIVEN,
start_date: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
api_key: Optional[str] | Omit = omit,
end_date: Optional[str] | Omit = omit,
request_id: Optional[str] | Omit = omit,
start_date: Optional[str] | Omit = omit,
user_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SpendListLogsResponse:
"""
View all spend logs, if request_id is provided, only logs for that request_id
@@ -468,14 +468,14 @@ class AsyncSpendResource(AsyncAPIResource):
async def list_tags(
self,
*,
end_date: Optional[str] | NotGiven = NOT_GIVEN,
start_date: Optional[str] | NotGiven = NOT_GIVEN,
end_date: Optional[str] | Omit = omit,
start_date: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SpendListTagsResponse:
"""
LLM Enterprise - View Spend Per Request Tag
+9 -9
View File
@@ -7,7 +7,7 @@ from typing_extensions import Literal
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from ..._utils import maybe_transform, strip_not_given, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -52,7 +52,7 @@ class CallbackResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Get the success/failure callbacks and variables for a team
@@ -100,14 +100,14 @@ class CallbackResource(SyncAPIResource):
*,
callback_name: str,
callback_vars: Dict[str, str],
callback_type: Optional[Literal["success", "failure", "success_and_failure"]] | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
callback_type: Optional[Literal["success", "failure", "success_and_failure"]] | Omit = omit,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Add a success/failure callback to a team
@@ -212,7 +212,7 @@ class AsyncCallbackResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Get the success/failure callbacks and variables for a team
@@ -260,14 +260,14 @@ class AsyncCallbackResource(AsyncAPIResource):
*,
callback_name: str,
callback_vars: Dict[str, str],
callback_type: Optional[Literal["success", "failure", "success_and_failure"]] | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
callback_type: Optional[Literal["success", "failure", "success_and_failure"]] | Omit = omit,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Add a success/failure callback to a team
+5 -5
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
from ..._types import Body, Query, Headers, NotGiven, SequenceNotStr, not_given
from ..._utils import maybe_transform, async_maybe_transform
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -50,7 +50,7 @@ class ModelResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Add models to a team's allowed model list.
@@ -105,7 +105,7 @@ class ModelResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Remove models from a team's allowed model list.
@@ -181,7 +181,7 @@ class AsyncModelResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Add models to a team's allowed model list.
@@ -236,7 +236,7 @@ class AsyncModelResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Remove models from a team's allowed model list.
+109 -109
View File
@@ -28,7 +28,7 @@ from ...types import (
team_update_member_params,
team_list_available_params,
)
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
from ..._utils import maybe_transform, strip_not_given, async_maybe_transform
from .callback import (
CallbackResource,
@@ -86,29 +86,29 @@ class TeamResource(SyncAPIResource):
def create(
self,
*,
admins: Iterable[object] | NotGiven = NOT_GIVEN,
blocked: bool | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
guardrails: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
members: Iterable[object] | NotGiven = NOT_GIVEN,
members_with_roles: Iterable[MemberParam] | NotGiven = NOT_GIVEN,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
model_aliases: Optional[object] | NotGiven = NOT_GIVEN,
models: Iterable[object] | NotGiven = NOT_GIVEN,
organization_id: Optional[str] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
tags: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
team_alias: Optional[str] | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
admins: Iterable[object] | Omit = omit,
blocked: bool | Omit = omit,
budget_duration: Optional[str] | Omit = omit,
guardrails: Optional[SequenceNotStr[str]] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
members: Iterable[object] | Omit = omit,
members_with_roles: Iterable[MemberParam] | Omit = omit,
metadata: Optional[object] | Omit = omit,
model_aliases: Optional[object] | Omit = omit,
models: Iterable[object] | Omit = omit,
organization_id: Optional[str] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
tags: Optional[Iterable[object]] | Omit = omit,
team_alias: Optional[str] | Omit = omit,
team_id: Optional[str] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> TeamCreateResponse:
"""Allow users to create a new team.
@@ -225,25 +225,25 @@ class TeamResource(SyncAPIResource):
self,
*,
team_id: str,
blocked: Optional[bool] | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
guardrails: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
model_aliases: Optional[object] | NotGiven = NOT_GIVEN,
models: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
organization_id: Optional[str] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
tags: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
team_alias: Optional[str] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
blocked: Optional[bool] | Omit = omit,
budget_duration: Optional[str] | Omit = omit,
guardrails: Optional[SequenceNotStr[str]] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
metadata: Optional[object] | Omit = omit,
model_aliases: Optional[object] | Omit = omit,
models: Optional[Iterable[object]] | Omit = omit,
organization_id: Optional[str] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
tags: Optional[Iterable[object]] | Omit = omit,
team_alias: Optional[str] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Use `/team/member_add` AND `/team/member/delete` to add/remove new team members
@@ -340,14 +340,14 @@ class TeamResource(SyncAPIResource):
def list(
self,
*,
organization_id: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
organization_id: Optional[str] | Omit = omit,
user_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
```
@@ -395,13 +395,13 @@ class TeamResource(SyncAPIResource):
self,
*,
team_ids: SequenceNotStr[str],
llm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
delete team and associated team keys
@@ -444,13 +444,13 @@ class TeamResource(SyncAPIResource):
*,
member: team_add_member_params.Member,
team_id: str,
max_budget_in_team: Optional[float] | NotGiven = NOT_GIVEN,
max_budget_in_team: Optional[float] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> TeamAddMemberResponse:
"""
[BETA]
@@ -501,7 +501,7 @@ class TeamResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Blocks all calls from keys with this team id.
@@ -549,7 +549,7 @@ class TeamResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Disable all logging callbacks for a team
@@ -586,13 +586,13 @@ class TeamResource(SyncAPIResource):
def list_available(
self,
*,
response_model: object | NotGiven = NOT_GIVEN,
response_model: object | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
List Available Teams
@@ -624,14 +624,14 @@ class TeamResource(SyncAPIResource):
self,
*,
team_id: str,
user_email: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
user_email: Optional[str] | Omit = omit,
user_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[BETA]
@@ -678,13 +678,13 @@ class TeamResource(SyncAPIResource):
def retrieve_info(
self,
*,
team_id: str | NotGiven = NOT_GIVEN,
team_id: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""get info on team + related keys
@@ -730,7 +730,7 @@ class TeamResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Blocks all calls from keys with this team id.
@@ -769,16 +769,16 @@ class TeamResource(SyncAPIResource):
self,
*,
team_id: str,
max_budget_in_team: Optional[float] | NotGiven = NOT_GIVEN,
role: Optional[Literal["admin", "user"]] | NotGiven = NOT_GIVEN,
user_email: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
max_budget_in_team: Optional[float] | Omit = omit,
role: Optional[Literal["admin", "user"]] | Omit = omit,
user_email: Optional[str] | Omit = omit,
user_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> TeamUpdateMemberResponse:
"""
[BETA]
@@ -844,29 +844,29 @@ class AsyncTeamResource(AsyncAPIResource):
async def create(
self,
*,
admins: Iterable[object] | NotGiven = NOT_GIVEN,
blocked: bool | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
guardrails: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
members: Iterable[object] | NotGiven = NOT_GIVEN,
members_with_roles: Iterable[MemberParam] | NotGiven = NOT_GIVEN,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
model_aliases: Optional[object] | NotGiven = NOT_GIVEN,
models: Iterable[object] | NotGiven = NOT_GIVEN,
organization_id: Optional[str] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
tags: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
team_alias: Optional[str] | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
admins: Iterable[object] | Omit = omit,
blocked: bool | Omit = omit,
budget_duration: Optional[str] | Omit = omit,
guardrails: Optional[SequenceNotStr[str]] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
members: Iterable[object] | Omit = omit,
members_with_roles: Iterable[MemberParam] | Omit = omit,
metadata: Optional[object] | Omit = omit,
model_aliases: Optional[object] | Omit = omit,
models: Iterable[object] | Omit = omit,
organization_id: Optional[str] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
tags: Optional[Iterable[object]] | Omit = omit,
team_alias: Optional[str] | Omit = omit,
team_id: Optional[str] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> TeamCreateResponse:
"""Allow users to create a new team.
@@ -983,25 +983,25 @@ class AsyncTeamResource(AsyncAPIResource):
self,
*,
team_id: str,
blocked: Optional[bool] | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
guardrails: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
model_aliases: Optional[object] | NotGiven = NOT_GIVEN,
models: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
organization_id: Optional[str] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
tags: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
team_alias: Optional[str] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
blocked: Optional[bool] | Omit = omit,
budget_duration: Optional[str] | Omit = omit,
guardrails: Optional[SequenceNotStr[str]] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
metadata: Optional[object] | Omit = omit,
model_aliases: Optional[object] | Omit = omit,
models: Optional[Iterable[object]] | Omit = omit,
organization_id: Optional[str] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
tags: Optional[Iterable[object]] | Omit = omit,
team_alias: Optional[str] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Use `/team/member_add` AND `/team/member/delete` to add/remove new team members
@@ -1098,14 +1098,14 @@ class AsyncTeamResource(AsyncAPIResource):
async def list(
self,
*,
organization_id: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
organization_id: Optional[str] | Omit = omit,
user_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
```
@@ -1153,13 +1153,13 @@ class AsyncTeamResource(AsyncAPIResource):
self,
*,
team_ids: SequenceNotStr[str],
llm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
delete team and associated team keys
@@ -1202,13 +1202,13 @@ class AsyncTeamResource(AsyncAPIResource):
*,
member: team_add_member_params.Member,
team_id: str,
max_budget_in_team: Optional[float] | NotGiven = NOT_GIVEN,
max_budget_in_team: Optional[float] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> TeamAddMemberResponse:
"""
[BETA]
@@ -1259,7 +1259,7 @@ class AsyncTeamResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Blocks all calls from keys with this team id.
@@ -1307,7 +1307,7 @@ class AsyncTeamResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Disable all logging callbacks for a team
@@ -1344,13 +1344,13 @@ class AsyncTeamResource(AsyncAPIResource):
async def list_available(
self,
*,
response_model: object | NotGiven = NOT_GIVEN,
response_model: object | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
List Available Teams
@@ -1382,14 +1382,14 @@ class AsyncTeamResource(AsyncAPIResource):
self,
*,
team_id: str,
user_email: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
user_email: Optional[str] | Omit = omit,
user_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[BETA]
@@ -1436,13 +1436,13 @@ class AsyncTeamResource(AsyncAPIResource):
async def retrieve_info(
self,
*,
team_id: str | NotGiven = NOT_GIVEN,
team_id: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""get info on team + related keys
@@ -1490,7 +1490,7 @@ class AsyncTeamResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Blocks all calls from keys with this team id.
@@ -1529,16 +1529,16 @@ class AsyncTeamResource(AsyncAPIResource):
self,
*,
team_id: str,
max_budget_in_team: Optional[float] | NotGiven = NOT_GIVEN,
role: Optional[Literal["admin", "user"]] | NotGiven = NOT_GIVEN,
user_email: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
max_budget_in_team: Optional[float] | Omit = omit,
role: Optional[Literal["admin", "user"]] | Omit = omit,
user_email: Optional[str] | Omit = omit,
user_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> TeamUpdateMemberResponse:
"""
[BETA]
+3 -3
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Query, Headers, NotGiven, not_given
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -48,7 +48,7 @@ class TestResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[DEPRECATED] use `/health/liveliness` instead.
@@ -96,7 +96,7 @@ class AsyncTestResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[DEPRECATED] use `/health/liveliness` instead.
+5 -5
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Query, Headers, NotGiven, not_given
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -47,7 +47,7 @@ class MessagesResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Create a message.
@@ -83,7 +83,7 @@ class MessagesResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Returns a list of messages for a given thread.
@@ -140,7 +140,7 @@ class AsyncMessagesResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Create a message.
@@ -176,7 +176,7 @@ class AsyncMessagesResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Returns a list of messages for a given thread.
+3 -3
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Query, Headers, NotGiven, not_given
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -47,7 +47,7 @@ class RunsResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Create a run.
@@ -103,7 +103,7 @@ class AsyncRunsResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Create a run.
+5 -5
View File
@@ -12,7 +12,7 @@ from .runs import (
RunsResourceWithStreamingResponse,
AsyncRunsResourceWithStreamingResponse,
)
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._types import Body, Query, Headers, NotGiven, not_given
from .messages import (
MessagesResource,
AsyncMessagesResource,
@@ -70,7 +70,7 @@ class ThreadsResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Create a thread.
@@ -95,7 +95,7 @@ class ThreadsResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Retrieves a thread.
@@ -158,7 +158,7 @@ class AsyncThreadsResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Create a thread.
@@ -183,7 +183,7 @@ class AsyncThreadsResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Retrieves a thread.
+125 -125
View File
@@ -14,7 +14,7 @@ from ..types import (
user_update_params,
user_retrieve_info_params,
)
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr
from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
from .._utils import maybe_transform, strip_not_given, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
@@ -53,40 +53,40 @@ class UserResource(SyncAPIResource):
def create(
self,
*,
aliases: Optional[object] | NotGiven = NOT_GIVEN,
allowed_cache_controls: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
auto_create_key: bool | NotGiven = NOT_GIVEN,
blocked: Optional[bool] | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
config: Optional[object] | NotGiven = NOT_GIVEN,
duration: Optional[str] | NotGiven = NOT_GIVEN,
guardrails: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
key_alias: Optional[str] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
max_parallel_requests: Optional[int] | NotGiven = NOT_GIVEN,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
model_max_budget: Optional[object] | NotGiven = NOT_GIVEN,
model_rpm_limit: Optional[object] | NotGiven = NOT_GIVEN,
model_tpm_limit: Optional[object] | NotGiven = NOT_GIVEN,
models: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
permissions: Optional[object] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
send_invite_email: Optional[bool] | NotGiven = NOT_GIVEN,
spend: Optional[float] | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
teams: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
user_alias: Optional[str] | NotGiven = NOT_GIVEN,
user_email: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
aliases: Optional[object] | Omit = omit,
allowed_cache_controls: Optional[Iterable[object]] | Omit = omit,
auto_create_key: bool | Omit = omit,
blocked: Optional[bool] | Omit = omit,
budget_duration: Optional[str] | Omit = omit,
config: Optional[object] | Omit = omit,
duration: Optional[str] | Omit = omit,
guardrails: Optional[SequenceNotStr[str]] | Omit = omit,
key_alias: Optional[str] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
max_parallel_requests: Optional[int] | Omit = omit,
metadata: Optional[object] | Omit = omit,
model_max_budget: Optional[object] | Omit = omit,
model_rpm_limit: Optional[object] | Omit = omit,
model_tpm_limit: Optional[object] | Omit = omit,
models: Optional[Iterable[object]] | Omit = omit,
permissions: Optional[object] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
send_invite_email: Optional[bool] | Omit = omit,
spend: Optional[float] | Omit = omit,
team_id: Optional[str] | Omit = omit,
teams: Optional[Iterable[object]] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
user_alias: Optional[str] | Omit = omit,
user_email: Optional[str] | Omit = omit,
user_id: Optional[str] | Omit = omit,
user_role: Optional[Literal["proxy_admin", "proxy_admin_viewer", "internal_user", "internal_user_viewer"]]
| NotGiven = NOT_GIVEN,
| Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> UserCreateResponse:
"""Use this to create a new INTERNAL user with a budget.
@@ -225,37 +225,37 @@ class UserResource(SyncAPIResource):
def update(
self,
*,
aliases: Optional[object] | NotGiven = NOT_GIVEN,
allowed_cache_controls: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
blocked: Optional[bool] | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
config: Optional[object] | NotGiven = NOT_GIVEN,
duration: Optional[str] | NotGiven = NOT_GIVEN,
guardrails: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
key_alias: Optional[str] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
max_parallel_requests: Optional[int] | NotGiven = NOT_GIVEN,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
model_max_budget: Optional[object] | NotGiven = NOT_GIVEN,
model_rpm_limit: Optional[object] | NotGiven = NOT_GIVEN,
model_tpm_limit: Optional[object] | NotGiven = NOT_GIVEN,
models: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
password: Optional[str] | NotGiven = NOT_GIVEN,
permissions: Optional[object] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
spend: Optional[float] | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
user_email: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
aliases: Optional[object] | Omit = omit,
allowed_cache_controls: Optional[Iterable[object]] | Omit = omit,
blocked: Optional[bool] | Omit = omit,
budget_duration: Optional[str] | Omit = omit,
config: Optional[object] | Omit = omit,
duration: Optional[str] | Omit = omit,
guardrails: Optional[SequenceNotStr[str]] | Omit = omit,
key_alias: Optional[str] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
max_parallel_requests: Optional[int] | Omit = omit,
metadata: Optional[object] | Omit = omit,
model_max_budget: Optional[object] | Omit = omit,
model_rpm_limit: Optional[object] | Omit = omit,
model_tpm_limit: Optional[object] | Omit = omit,
models: Optional[Iterable[object]] | Omit = omit,
password: Optional[str] | Omit = omit,
permissions: Optional[object] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
spend: Optional[float] | Omit = omit,
team_id: Optional[str] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
user_email: Optional[str] | Omit = omit,
user_id: Optional[str] | Omit = omit,
user_role: Optional[Literal["proxy_admin", "proxy_admin_viewer", "internal_user", "internal_user_viewer"]]
| NotGiven = NOT_GIVEN,
| Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Example curl
@@ -364,16 +364,16 @@ class UserResource(SyncAPIResource):
def list(
self,
*,
page: int | NotGiven = NOT_GIVEN,
page_size: int | NotGiven = NOT_GIVEN,
role: Optional[str] | NotGiven = NOT_GIVEN,
user_ids: Optional[str] | NotGiven = NOT_GIVEN,
page: int | Omit = omit,
page_size: int | Omit = omit,
role: Optional[str] | Omit = omit,
user_ids: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Get a paginated list of users, optionally filtered by role.
@@ -435,13 +435,13 @@ class UserResource(SyncAPIResource):
self,
*,
user_ids: SequenceNotStr[str],
llm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
delete user and associated user keys
@@ -484,13 +484,13 @@ class UserResource(SyncAPIResource):
def retrieve_info(
self,
*,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[10/07/2024] Note: To get all users (+pagination), use `/user/list` endpoint.
@@ -550,40 +550,40 @@ class AsyncUserResource(AsyncAPIResource):
async def create(
self,
*,
aliases: Optional[object] | NotGiven = NOT_GIVEN,
allowed_cache_controls: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
auto_create_key: bool | NotGiven = NOT_GIVEN,
blocked: Optional[bool] | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
config: Optional[object] | NotGiven = NOT_GIVEN,
duration: Optional[str] | NotGiven = NOT_GIVEN,
guardrails: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
key_alias: Optional[str] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
max_parallel_requests: Optional[int] | NotGiven = NOT_GIVEN,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
model_max_budget: Optional[object] | NotGiven = NOT_GIVEN,
model_rpm_limit: Optional[object] | NotGiven = NOT_GIVEN,
model_tpm_limit: Optional[object] | NotGiven = NOT_GIVEN,
models: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
permissions: Optional[object] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
send_invite_email: Optional[bool] | NotGiven = NOT_GIVEN,
spend: Optional[float] | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
teams: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
user_alias: Optional[str] | NotGiven = NOT_GIVEN,
user_email: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
aliases: Optional[object] | Omit = omit,
allowed_cache_controls: Optional[Iterable[object]] | Omit = omit,
auto_create_key: bool | Omit = omit,
blocked: Optional[bool] | Omit = omit,
budget_duration: Optional[str] | Omit = omit,
config: Optional[object] | Omit = omit,
duration: Optional[str] | Omit = omit,
guardrails: Optional[SequenceNotStr[str]] | Omit = omit,
key_alias: Optional[str] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
max_parallel_requests: Optional[int] | Omit = omit,
metadata: Optional[object] | Omit = omit,
model_max_budget: Optional[object] | Omit = omit,
model_rpm_limit: Optional[object] | Omit = omit,
model_tpm_limit: Optional[object] | Omit = omit,
models: Optional[Iterable[object]] | Omit = omit,
permissions: Optional[object] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
send_invite_email: Optional[bool] | Omit = omit,
spend: Optional[float] | Omit = omit,
team_id: Optional[str] | Omit = omit,
teams: Optional[Iterable[object]] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
user_alias: Optional[str] | Omit = omit,
user_email: Optional[str] | Omit = omit,
user_id: Optional[str] | Omit = omit,
user_role: Optional[Literal["proxy_admin", "proxy_admin_viewer", "internal_user", "internal_user_viewer"]]
| NotGiven = NOT_GIVEN,
| Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> UserCreateResponse:
"""Use this to create a new INTERNAL user with a budget.
@@ -722,37 +722,37 @@ class AsyncUserResource(AsyncAPIResource):
async def update(
self,
*,
aliases: Optional[object] | NotGiven = NOT_GIVEN,
allowed_cache_controls: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
blocked: Optional[bool] | NotGiven = NOT_GIVEN,
budget_duration: Optional[str] | NotGiven = NOT_GIVEN,
config: Optional[object] | NotGiven = NOT_GIVEN,
duration: Optional[str] | NotGiven = NOT_GIVEN,
guardrails: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN,
key_alias: Optional[str] | NotGiven = NOT_GIVEN,
max_budget: Optional[float] | NotGiven = NOT_GIVEN,
max_parallel_requests: Optional[int] | NotGiven = NOT_GIVEN,
metadata: Optional[object] | NotGiven = NOT_GIVEN,
model_max_budget: Optional[object] | NotGiven = NOT_GIVEN,
model_rpm_limit: Optional[object] | NotGiven = NOT_GIVEN,
model_tpm_limit: Optional[object] | NotGiven = NOT_GIVEN,
models: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
password: Optional[str] | NotGiven = NOT_GIVEN,
permissions: Optional[object] | NotGiven = NOT_GIVEN,
rpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
spend: Optional[float] | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
user_email: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
aliases: Optional[object] | Omit = omit,
allowed_cache_controls: Optional[Iterable[object]] | Omit = omit,
blocked: Optional[bool] | Omit = omit,
budget_duration: Optional[str] | Omit = omit,
config: Optional[object] | Omit = omit,
duration: Optional[str] | Omit = omit,
guardrails: Optional[SequenceNotStr[str]] | Omit = omit,
key_alias: Optional[str] | Omit = omit,
max_budget: Optional[float] | Omit = omit,
max_parallel_requests: Optional[int] | Omit = omit,
metadata: Optional[object] | Omit = omit,
model_max_budget: Optional[object] | Omit = omit,
model_rpm_limit: Optional[object] | Omit = omit,
model_tpm_limit: Optional[object] | Omit = omit,
models: Optional[Iterable[object]] | Omit = omit,
password: Optional[str] | Omit = omit,
permissions: Optional[object] | Omit = omit,
rpm_limit: Optional[int] | Omit = omit,
spend: Optional[float] | Omit = omit,
team_id: Optional[str] | Omit = omit,
tpm_limit: Optional[int] | Omit = omit,
user_email: Optional[str] | Omit = omit,
user_id: Optional[str] | Omit = omit,
user_role: Optional[Literal["proxy_admin", "proxy_admin_viewer", "internal_user", "internal_user_viewer"]]
| NotGiven = NOT_GIVEN,
| Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Example curl
@@ -861,16 +861,16 @@ class AsyncUserResource(AsyncAPIResource):
async def list(
self,
*,
page: int | NotGiven = NOT_GIVEN,
page_size: int | NotGiven = NOT_GIVEN,
role: Optional[str] | NotGiven = NOT_GIVEN,
user_ids: Optional[str] | NotGiven = NOT_GIVEN,
page: int | Omit = omit,
page_size: int | Omit = omit,
role: Optional[str] | Omit = omit,
user_ids: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Get a paginated list of users, optionally filtered by role.
@@ -932,13 +932,13 @@ class AsyncUserResource(AsyncAPIResource):
self,
*,
user_ids: SequenceNotStr[str],
llm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
delete user and associated user keys
@@ -981,13 +981,13 @@ class AsyncUserResource(AsyncAPIResource):
async def retrieve_info(
self,
*,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
[10/07/2024] Note: To get all users (+pagination), use `/user/list` endpoint.
+11 -11
View File
@@ -8,7 +8,7 @@ from typing_extensions import Literal
import httpx
from ..types import util_token_counter_params, util_transform_request_params, util_get_supported_openai_params_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
from .._utils import maybe_transform, async_maybe_transform
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
@@ -54,7 +54,7 @@ class UtilsResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Returns supported openai params for a given llm model name
@@ -95,14 +95,14 @@ class UtilsResource(SyncAPIResource):
self,
*,
model: str,
messages: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
prompt: Optional[str] | NotGiven = NOT_GIVEN,
messages: Optional[Iterable[object]] | Omit = omit,
prompt: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> UtilTokenCounterResponse:
"""
Token Counter
@@ -204,7 +204,7 @@ class UtilsResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> UtilTransformRequestResponse:
"""
Transform Request
@@ -263,7 +263,7 @@ class AsyncUtilsResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""Returns supported openai params for a given llm model name
@@ -304,14 +304,14 @@ class AsyncUtilsResource(AsyncAPIResource):
self,
*,
model: str,
messages: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
prompt: Optional[str] | NotGiven = NOT_GIVEN,
messages: Optional[Iterable[object]] | Omit = omit,
prompt: Optional[str] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> UtilTokenCounterResponse:
"""
Token Counter
@@ -413,7 +413,7 @@ class AsyncUtilsResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> UtilTransformRequestResponse:
"""
Transform Request
+11 -11
View File
@@ -4,7 +4,7 @@ from __future__ import annotations
import httpx
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._types import Body, Query, Headers, NotGiven, not_given
from .._compat import cached_property
from .._resource import SyncAPIResource, AsyncAPIResource
from .._response import (
@@ -47,7 +47,7 @@ class VertexAIResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Call LLM proxy via Vertex AI SDK.
@@ -82,7 +82,7 @@ class VertexAIResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Call LLM proxy via Vertex AI SDK.
@@ -117,7 +117,7 @@ class VertexAIResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Call LLM proxy via Vertex AI SDK.
@@ -152,7 +152,7 @@ class VertexAIResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Call LLM proxy via Vertex AI SDK.
@@ -187,7 +187,7 @@ class VertexAIResource(SyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Call LLM proxy via Vertex AI SDK.
@@ -243,7 +243,7 @@ class AsyncVertexAIResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Call LLM proxy via Vertex AI SDK.
@@ -278,7 +278,7 @@ class AsyncVertexAIResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Call LLM proxy via Vertex AI SDK.
@@ -313,7 +313,7 @@ class AsyncVertexAIResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Call LLM proxy via Vertex AI SDK.
@@ -348,7 +348,7 @@ class AsyncVertexAIResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Call LLM proxy via Vertex AI SDK.
@@ -383,7 +383,7 @@ class AsyncVertexAIResource(AsyncAPIResource):
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Call LLM proxy via Vertex AI SDK.
+9 -2
View File
@@ -8,7 +8,7 @@ from typing_extensions import Required, Annotated, TypedDict
import pytest
from hanzoai._types import NOT_GIVEN, Base64FileInput
from hanzoai._types import Base64FileInput, omit, not_given
from hanzoai._utils import (
PropertyInfo,
transform as _transform,
@@ -450,4 +450,11 @@ async def test_transform_skipping(use_async: bool) -> None:
@pytest.mark.asyncio
async def test_strips_notgiven(use_async: bool) -> None:
assert await transform({"foo_bar": "bar"}, Foo1, use_async) == {"fooBar": "bar"}
assert await transform({"foo_bar": NOT_GIVEN}, Foo1, use_async) == {}
assert await transform({"foo_bar": not_given}, Foo1, use_async) == {}
@parametrize
@pytest.mark.asyncio
async def test_strips_omit(use_async: bool) -> None:
assert await transform({"foo_bar": "bar"}, Foo1, use_async) == {"fooBar": "bar"}
assert await transform({"foo_bar": omit}, Foo1, use_async) == {}