From f35d86ddeba896b99c00874cbd3bfba0086741cd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 03:28:02 +0000 Subject: [PATCH 01/41] chore(internal): slight transform perf improvement (#24) --- src/hanzoai/_utils/_transform.py | 22 ++++++++++++++++++++++ tests/test_transform.py | 12 ++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/hanzoai/_utils/_transform.py b/src/hanzoai/_utils/_transform.py index 7ac2e17f..3ec62081 100644 --- a/src/hanzoai/_utils/_transform.py +++ b/src/hanzoai/_utils/_transform.py @@ -142,6 +142,10 @@ def _maybe_transform_key(key: str, type_: type) -> str: return key +def _no_transform_needed(annotation: type) -> bool: + return annotation == float or annotation == int + + def _transform_recursive( data: object, *, @@ -184,6 +188,15 @@ def _transform_recursive( return cast(object, data) inner_type = extract_type_arg(stripped_type, 0) + if _no_transform_needed(inner_type): + # for some types there is no need to transform anything, so we can get a small + # perf boost from skipping that work. + # + # but we still need to convert to a list to ensure the data is json-serializable + if is_list(data): + return data + return list(data) + return [_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data] if is_union_type(stripped_type): @@ -332,6 +345,15 @@ async def _async_transform_recursive( return cast(object, data) inner_type = extract_type_arg(stripped_type, 0) + if _no_transform_needed(inner_type): + # for some types there is no need to transform anything, so we can get a small + # perf boost from skipping that work. + # + # but we still need to convert to a list to ensure the data is json-serializable + if is_list(data): + return data + return list(data) + return [await _async_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data] if is_union_type(stripped_type): diff --git a/tests/test_transform.py b/tests/test_transform.py index 47a668e6..fe02d65e 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -432,3 +432,15 @@ async def test_base64_file_input(use_async: bool) -> None: assert await transform({"foo": io.BytesIO(b"Hello, world!")}, TypedDictBase64Input, use_async) == { "foo": "SGVsbG8sIHdvcmxkIQ==" } # type: ignore[comparison-overlap] + + +@parametrize +@pytest.mark.asyncio +async def test_transform_skipping(use_async: bool) -> None: + # lists of ints are left as-is + data = [1, 2, 3] + assert await transform(data, List[int], use_async) is data + + # iterables of ints are converted to a list + data = iter([1, 2, 3]) + assert await transform(data, Iterable[int], use_async) == [1, 2, 3] From b42f098ec1005979a4ee2cb1bd2bb394c16ae2a3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 03:34:19 +0000 Subject: [PATCH 02/41] chore: slight wording improvement in README (#25) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6de1f60b..596dc8f2 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ print(model.llm_params) ## File uploads -Request parameters that correspond to file uploads can be passed as `bytes`, a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`. +Request parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`. ```python from pathlib import Path From b89fea40099d3201256f9e38ac052d2533a0fa16 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 03:24:55 +0000 Subject: [PATCH 03/41] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 53107a1b..bb9fef09 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 188 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hanzo-industries-inc%2FHanzo-AI-ec4be99f95dc46e9442eb60f233b2bff271d6f5bf57d7c61a52bc4804f55bbd1.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hanzo-industries-inc%2Fhanzo-ai-ec4be99f95dc46e9442eb60f233b2bff271d6f5bf57d7c61a52bc4804f55bbd1.yml openapi_spec_hash: 87bc62c36bb6028ffd1f3e54a2809099 config_hash: 830747463ff4d018b5633ce511e88558 From fd3cd268f6d853b66702f5e05934b0b7deb29abf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 03:45:25 +0000 Subject: [PATCH 04/41] chore(internal): expand CI branch coverage --- .github/workflows/ci.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b286e5a..53a3a09c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,18 +1,18 @@ name: CI on: push: - branches: - - main - pull_request: - branches: - - main - - next + branches-ignore: + - 'generated' + - 'codegen/**' + - 'integrated/**' + - 'preview-head/**' + - 'preview-base/**' + - 'preview/**' jobs: lint: name: lint runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 @@ -33,7 +33,6 @@ jobs: test: name: test runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 From 56b4e459a37ed1510622d2ff2127d789ddaa9893 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 03:50:52 +0000 Subject: [PATCH 05/41] chore(internal): reduce CI branch coverage --- .github/workflows/ci.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53a3a09c..81f6dc20 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,12 @@ name: CI on: push: - branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'preview-head/**' - - 'preview-base/**' - - 'preview/**' + branches: + - main + pull_request: + branches: + - main + - next jobs: lint: From 5eade63f698e112a8c2a07fb7f3466bff33fdc39 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 12 Apr 2025 03:25:00 +0000 Subject: [PATCH 06/41] fix(perf): skip traversing types for NotGiven values --- src/hanzoai/_utils/_transform.py | 11 +++++++++++ tests/test_transform.py | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/hanzoai/_utils/_transform.py b/src/hanzoai/_utils/_transform.py index 3ec62081..3b2b8e00 100644 --- a/src/hanzoai/_utils/_transform.py +++ b/src/hanzoai/_utils/_transform.py @@ -12,6 +12,7 @@ from ._utils import ( is_list, + is_given, is_mapping, is_iterable, ) @@ -258,6 +259,11 @@ def _transform_typeddict( result: dict[str, object] = {} 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 + # be stripped out before the request is sent anyway + continue + type_ = annotations.get(key) if type_ is None: # we do not have a type annotation for this field, leave it as is @@ -415,6 +421,11 @@ async def _async_transform_typeddict( result: dict[str, object] = {} 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 + # be stripped out before the request is sent anyway + continue + type_ = annotations.get(key) if type_ is None: # we do not have a type annotation for this field, leave it as is diff --git a/tests/test_transform.py b/tests/test_transform.py index fe02d65e..a1ca361b 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -8,7 +8,7 @@ import pytest -from hanzoai._types import Base64FileInput +from hanzoai._types import NOT_GIVEN, Base64FileInput from hanzoai._utils import ( PropertyInfo, transform as _transform, @@ -444,3 +444,10 @@ async def test_transform_skipping(use_async: bool) -> None: # iterables of ints are converted to a list data = iter([1, 2, 3]) assert await transform(data, Iterable[int], use_async) == [1, 2, 3] + + +@parametrize +@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) == {} From 6da686a68775c8d364e16790752773392ed21329 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 12 Apr 2025 03:26:12 +0000 Subject: [PATCH 07/41] fix(perf): optimize some hot paths --- src/hanzoai/_utils/_transform.py | 14 +++++++++++++- src/hanzoai/_utils/_typing.py | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/hanzoai/_utils/_transform.py b/src/hanzoai/_utils/_transform.py index 3b2b8e00..b0cc20a7 100644 --- a/src/hanzoai/_utils/_transform.py +++ b/src/hanzoai/_utils/_transform.py @@ -5,7 +5,7 @@ import pathlib from typing import Any, Mapping, TypeVar, cast from datetime import date, datetime -from typing_extensions import Literal, get_args, override, get_type_hints +from typing_extensions import Literal, get_args, override, get_type_hints as _get_type_hints import anyio import pydantic @@ -13,6 +13,7 @@ from ._utils import ( is_list, is_given, + lru_cache, is_mapping, is_iterable, ) @@ -109,6 +110,7 @@ class Params(TypedDict, total=False): return cast(_T, transformed) +@lru_cache(maxsize=8096) def _get_annotated_type(type_: type) -> type | None: """If the given type is an `Annotated` type then it is returned, if not `None` is returned. @@ -433,3 +435,13 @@ async def _async_transform_typeddict( else: result[_maybe_transform_key(key, type_)] = await _async_transform_recursive(value, annotation=type_) return result + + +@lru_cache(maxsize=8096) +def get_type_hints( + obj: Any, + globalns: dict[str, Any] | None = None, + localns: Mapping[str, Any] | None = None, + include_extras: bool = False, +) -> dict[str, Any]: + return _get_type_hints(obj, globalns=globalns, localns=localns, include_extras=include_extras) diff --git a/src/hanzoai/_utils/_typing.py b/src/hanzoai/_utils/_typing.py index 278749b1..1958820f 100644 --- a/src/hanzoai/_utils/_typing.py +++ b/src/hanzoai/_utils/_typing.py @@ -13,6 +13,7 @@ get_origin, ) +from ._utils import lru_cache from .._types import InheritsGeneric from .._compat import is_union as _is_union @@ -66,6 +67,7 @@ def is_type_alias_type(tp: Any, /) -> TypeIs[typing_extensions.TypeAliasType]: # Extracts T from Annotated[T, ...] or from Required[Annotated[T, ...]] +@lru_cache(maxsize=8096) def strip_annotated_type(typ: type) -> type: if is_required_type(typ) or is_annotated_type(typ): return strip_annotated_type(cast(type, get_args(typ)[0])) From bbb302d80ca7a6cf3b5bf2a58fdaac4f3a6e7e2e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 15 Apr 2025 03:43:28 +0000 Subject: [PATCH 08/41] chore(internal): update pyright settings --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 4d43ebb6..bb61a2bb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -147,6 +147,7 @@ exclude = [ ] reportImplicitOverride = true +reportOverlappingOverload = false reportImportCycles = false reportPrivateUsage = false From 8b19fe5acf34e3f9d7da0b6b8739cc893fe784ed Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 15 Apr 2025 03:45:12 +0000 Subject: [PATCH 09/41] chore(client): minor internal fixes --- src/hanzoai/_base_client.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/hanzoai/_base_client.py b/src/hanzoai/_base_client.py index ea463b8f..ee76393d 100644 --- a/src/hanzoai/_base_client.py +++ b/src/hanzoai/_base_client.py @@ -409,7 +409,8 @@ def _build_headers(self, options: FinalRequestOptions, *, retries_taken: int = 0 idempotency_header = self._idempotency_header if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers: - headers[idempotency_header] = options.idempotency_key or self._idempotency_key() + options.idempotency_key = options.idempotency_key or self._idempotency_key() + headers[idempotency_header] = options.idempotency_key # Don't set these headers if they were already set or removed by the caller. We check # `custom_headers`, which can contain `Omit()`, instead of `headers` to account for the removal case. @@ -943,6 +944,10 @@ def _request( request = self._build_request(options, retries_taken=retries_taken) self._prepare_request(request) + if options.idempotency_key: + # ensure the idempotency key is reused between requests + input_options.idempotency_key = options.idempotency_key + kwargs: HttpxSendArgs = {} if self.custom_auth is not None: kwargs["auth"] = self.custom_auth @@ -1475,6 +1480,10 @@ async def _request( request = self._build_request(options, retries_taken=retries_taken) await self._prepare_request(request) + if options.idempotency_key: + # ensure the idempotency key is reused between requests + input_options.idempotency_key = options.idempotency_key + kwargs: HttpxSendArgs = {} if self.custom_auth is not None: kwargs["auth"] = self.custom_auth From c7706f0871c28d186e5f249d24eb3a2a93b23cb2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 17 Apr 2025 03:21:38 +0000 Subject: [PATCH 10/41] chore(internal): bump pyright version --- pyproject.toml | 2 +- requirements-dev.lock | 2 +- src/hanzoai/_base_client.py | 6 +++++- src/hanzoai/_models.py | 1 - src/hanzoai/_utils/_typing.py | 2 +- tests/conftest.py | 2 +- tests/test_models.py | 2 +- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index bb61a2bb..2f608860 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ Repository = "https://github.com/hanzoai/python-sdk" managed = true # version pins are in requirements-dev.lock dev-dependencies = [ - "pyright>=1.1.359", + "pyright==1.1.399", "mypy", "respx", "pytest", diff --git a/requirements-dev.lock b/requirements-dev.lock index c47f71a5..628747d3 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -69,7 +69,7 @@ pydantic-core==2.27.1 # via pydantic pygments==2.18.0 # via rich -pyright==1.1.392.post0 +pyright==1.1.399 pytest==8.3.3 # via pytest-asyncio pytest-asyncio==0.24.0 diff --git a/src/hanzoai/_base_client.py b/src/hanzoai/_base_client.py index ee76393d..575fcb7a 100644 --- a/src/hanzoai/_base_client.py +++ b/src/hanzoai/_base_client.py @@ -98,7 +98,11 @@ _AsyncStreamT = TypeVar("_AsyncStreamT", bound=AsyncStream[Any]) if TYPE_CHECKING: - from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT + from httpx._config import ( + DEFAULT_TIMEOUT_CONFIG, # pyright: ignore[reportPrivateImportUsage] + ) + + HTTPX_DEFAULT_TIMEOUT = DEFAULT_TIMEOUT_CONFIG else: try: from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT diff --git a/src/hanzoai/_models.py b/src/hanzoai/_models.py index 34935716..58b9263e 100644 --- a/src/hanzoai/_models.py +++ b/src/hanzoai/_models.py @@ -19,7 +19,6 @@ ) import pydantic -import pydantic.generics from pydantic.fields import FieldInfo from ._types import ( diff --git a/src/hanzoai/_utils/_typing.py b/src/hanzoai/_utils/_typing.py index 1958820f..1bac9542 100644 --- a/src/hanzoai/_utils/_typing.py +++ b/src/hanzoai/_utils/_typing.py @@ -110,7 +110,7 @@ class MyResponse(Foo[_T]): ``` """ cls = cast(object, get_origin(typ) or typ) - if cls in generic_bases: + if cls in generic_bases: # pyright: ignore[reportUnnecessaryContains] # we're given the class directly return extract_type_arg(typ, index) diff --git a/tests/conftest.py b/tests/conftest.py index 3a90e862..b7a1ac7d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,7 +10,7 @@ from hanzoai import Hanzo, AsyncHanzo if TYPE_CHECKING: - from _pytest.fixtures import FixtureRequest + from _pytest.fixtures import FixtureRequest # pyright: ignore[reportPrivateImportUsage] pytest.register_assert_rewrite("tests.utils") diff --git a/tests/test_models.py b/tests/test_models.py index 93f6821c..947ece2f 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -832,7 +832,7 @@ class B(BaseModel): @pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1") def test_type_alias_type() -> None: - Alias = TypeAliasType("Alias", str) + Alias = TypeAliasType("Alias", str) # pyright: ignore class Model(BaseModel): alias: Alias From d417414c3430003fed22f62c10de07c0088588a2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 17 Apr 2025 03:22:17 +0000 Subject: [PATCH 11/41] chore(internal): base client updates --- src/hanzoai/_base_client.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/hanzoai/_base_client.py b/src/hanzoai/_base_client.py index 575fcb7a..e98c07e3 100644 --- a/src/hanzoai/_base_client.py +++ b/src/hanzoai/_base_client.py @@ -119,6 +119,7 @@ class PageInfo: url: URL | NotGiven params: Query | NotGiven + json: Body | NotGiven @overload def __init__( @@ -134,19 +135,30 @@ def __init__( params: Query, ) -> None: ... + @overload + def __init__( + self, + *, + json: Body, + ) -> None: ... + def __init__( self, *, url: URL | NotGiven = NOT_GIVEN, + json: Body | NotGiven = NOT_GIVEN, params: Query | NotGiven = NOT_GIVEN, ) -> None: self.url = url + self.json = json self.params = params @override def __repr__(self) -> str: if self.url: return f"{self.__class__.__name__}(url={self.url})" + if self.json: + return f"{self.__class__.__name__}(json={self.json})" return f"{self.__class__.__name__}(params={self.params})" @@ -195,6 +207,19 @@ def _info_to_options(self, info: PageInfo) -> FinalRequestOptions: options.url = str(url) return options + if not isinstance(info.json, NotGiven): + if not is_mapping(info.json): + raise TypeError("Pagination is only supported with mappings") + + if not options.json_data: + options.json_data = {**info.json} + else: + if not is_mapping(options.json_data): + raise TypeError("Pagination is only supported with mappings") + + options.json_data = {**options.json_data, **info.json} + return options + raise ValueError("Unexpected PageInfo state") From 77dbb5e3520be7aabad5a8e1259ab060d8d3dfca Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 19 Apr 2025 03:24:13 +0000 Subject: [PATCH 12/41] chore(internal): update models test --- tests/test_models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_models.py b/tests/test_models.py index 947ece2f..de88ed5b 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -492,12 +492,15 @@ class Model(BaseModel): resource_id: Optional[str] = None m = Model.construct() + assert m.resource_id is None assert "resource_id" not in m.model_fields_set m = Model.construct(resource_id=None) + assert m.resource_id is None assert "resource_id" in m.model_fields_set m = Model.construct(resource_id="foo") + assert m.resource_id == "foo" assert "resource_id" in m.model_fields_set From a283e8611476e227244e75d30c0340aa6afd67a1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 04:17:12 +0000 Subject: [PATCH 13/41] chore(ci): add timeout thresholds for CI jobs --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81f6dc20..04b083ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,7 @@ on: jobs: lint: + timeout-minutes: 10 name: lint runs-on: ubuntu-latest steps: @@ -30,6 +31,7 @@ jobs: run: ./scripts/lint test: + timeout-minutes: 10 name: test runs-on: ubuntu-latest steps: From 3a69aa9c55cc2bd2289335ce353c9da067a1b4f6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 04:17:47 +0000 Subject: [PATCH 14/41] chore(internal): import reformatting --- src/hanzoai/_client.py | 5 +---- src/hanzoai/resources/add.py | 5 +---- src/hanzoai/resources/audio/transcriptions.py | 7 +------ src/hanzoai/resources/batches/batches.py | 12 ++---------- src/hanzoai/resources/batches/cancel.py | 5 +---- src/hanzoai/resources/budget.py | 5 +---- src/hanzoai/resources/chat/completions.py | 5 +---- src/hanzoai/resources/completions.py | 5 +---- .../resources/config/pass_through_endpoint.py | 5 +---- src/hanzoai/resources/credentials.py | 5 +---- src/hanzoai/resources/customer.py | 5 +---- src/hanzoai/resources/delete.py | 5 +---- src/hanzoai/resources/embeddings.py | 5 +---- src/hanzoai/resources/files/files.py | 7 +------ src/hanzoai/resources/fine_tuning/jobs/jobs.py | 5 +---- src/hanzoai/resources/global_/spend.py | 5 +---- src/hanzoai/resources/health.py | 5 +---- src/hanzoai/resources/key/key.py | 6 +----- src/hanzoai/resources/model/info.py | 5 +---- src/hanzoai/resources/model/model.py | 5 +---- src/hanzoai/resources/model/update.py | 5 +---- src/hanzoai/resources/model_group.py | 5 +---- src/hanzoai/resources/models.py | 5 +---- src/hanzoai/resources/organization/info.py | 5 +---- src/hanzoai/resources/organization/organization.py | 5 +---- src/hanzoai/resources/spend.py | 5 +---- src/hanzoai/resources/team/callback.py | 6 +----- src/hanzoai/resources/team/model.py | 5 +---- src/hanzoai/resources/team/team.py | 6 +----- src/hanzoai/resources/user.py | 6 +----- src/hanzoai/resources/utils.py | 11 ++--------- 31 files changed, 33 insertions(+), 143 deletions(-) diff --git a/src/hanzoai/_client.py b/src/hanzoai/_client.py index 757b5063..4c6c1a2b 100644 --- a/src/hanzoai/_client.py +++ b/src/hanzoai/_client.py @@ -22,10 +22,7 @@ ProxiesTypes, RequestOptions, ) -from ._utils import ( - is_given, - get_async_library, -) +from ._utils import is_given, get_async_library from ._version import __version__ from ._response import ( to_raw_response_wrapper, diff --git a/src/hanzoai/resources/add.py b/src/hanzoai/resources/add.py index fec9799b..eb775af7 100644 --- a/src/hanzoai/resources/add.py +++ b/src/hanzoai/resources/add.py @@ -6,10 +6,7 @@ from ..types import add_add_allowed_ip_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) +from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( diff --git a/src/hanzoai/resources/audio/transcriptions.py b/src/hanzoai/resources/audio/transcriptions.py index 427aef74..6286a73f 100644 --- a/src/hanzoai/resources/audio/transcriptions.py +++ b/src/hanzoai/resources/audio/transcriptions.py @@ -7,12 +7,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes -from ..._utils import ( - extract_files, - maybe_transform, - deepcopy_minimal, - async_maybe_transform, -) +from ..._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/hanzoai/resources/batches/batches.py b/src/hanzoai/resources/batches/batches.py index 66e0b348..619220e4 100644 --- a/src/hanzoai/resources/batches/batches.py +++ b/src/hanzoai/resources/batches/batches.py @@ -14,17 +14,9 @@ CancelResourceWithStreamingResponse, AsyncCancelResourceWithStreamingResponse, ) -from ...types import ( - batch_list_params, - batch_create_params, - batch_retrieve_params, - batch_list_with_provider_params, -) +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 ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/hanzoai/resources/batches/cancel.py b/src/hanzoai/resources/batches/cancel.py index e99fc8b2..877e9351 100644 --- a/src/hanzoai/resources/batches/cancel.py +++ b/src/hanzoai/resources/batches/cancel.py @@ -7,10 +7,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/hanzoai/resources/budget.py b/src/hanzoai/resources/budget.py index 911adf22..99fa1f3a 100644 --- a/src/hanzoai/resources/budget.py +++ b/src/hanzoai/resources/budget.py @@ -14,10 +14,7 @@ budget_settings_params, ) from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) +from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( diff --git a/src/hanzoai/resources/chat/completions.py b/src/hanzoai/resources/chat/completions.py index 406240ee..2b2edfce 100644 --- a/src/hanzoai/resources/chat/completions.py +++ b/src/hanzoai/resources/chat/completions.py @@ -7,10 +7,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/hanzoai/resources/completions.py b/src/hanzoai/resources/completions.py index 72d8bf3d..f33d13fa 100644 --- a/src/hanzoai/resources/completions.py +++ b/src/hanzoai/resources/completions.py @@ -8,10 +8,7 @@ from ..types import completion_create_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) +from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( diff --git a/src/hanzoai/resources/config/pass_through_endpoint.py b/src/hanzoai/resources/config/pass_through_endpoint.py index a70ddea4..10128a88 100644 --- a/src/hanzoai/resources/config/pass_through_endpoint.py +++ b/src/hanzoai/resources/config/pass_through_endpoint.py @@ -7,10 +7,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/hanzoai/resources/credentials.py b/src/hanzoai/resources/credentials.py index 5f5a12c1..21b119d2 100644 --- a/src/hanzoai/resources/credentials.py +++ b/src/hanzoai/resources/credentials.py @@ -8,10 +8,7 @@ from ..types import credential_create_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) +from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( diff --git a/src/hanzoai/resources/customer.py b/src/hanzoai/resources/customer.py index 668041ad..8dc0f5f6 100644 --- a/src/hanzoai/resources/customer.py +++ b/src/hanzoai/resources/customer.py @@ -16,10 +16,7 @@ customer_retrieve_info_params, ) from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) +from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( diff --git a/src/hanzoai/resources/delete.py b/src/hanzoai/resources/delete.py index a7672f1c..2c87abec 100644 --- a/src/hanzoai/resources/delete.py +++ b/src/hanzoai/resources/delete.py @@ -6,10 +6,7 @@ from ..types import delete_create_allowed_ip_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) +from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( diff --git a/src/hanzoai/resources/embeddings.py b/src/hanzoai/resources/embeddings.py index fac3ca55..4214bed7 100644 --- a/src/hanzoai/resources/embeddings.py +++ b/src/hanzoai/resources/embeddings.py @@ -8,10 +8,7 @@ from ..types import embedding_create_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) +from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( diff --git a/src/hanzoai/resources/files/files.py b/src/hanzoai/resources/files/files.py index c83468b9..acb93ec9 100644 --- a/src/hanzoai/resources/files/files.py +++ b/src/hanzoai/resources/files/files.py @@ -16,12 +16,7 @@ AsyncContentResourceWithStreamingResponse, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes -from ..._utils import ( - extract_files, - maybe_transform, - deepcopy_minimal, - async_maybe_transform, -) +from ..._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/hanzoai/resources/fine_tuning/jobs/jobs.py b/src/hanzoai/resources/fine_tuning/jobs/jobs.py index 18781882..3671dd62 100644 --- a/src/hanzoai/resources/fine_tuning/jobs/jobs.py +++ b/src/hanzoai/resources/fine_tuning/jobs/jobs.py @@ -16,10 +16,7 @@ AsyncCancelResourceWithStreamingResponse, ) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( - maybe_transform, - async_maybe_transform, -) +from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( diff --git a/src/hanzoai/resources/global_/spend.py b/src/hanzoai/resources/global_/spend.py index 01a577fd..c211fef0 100644 --- a/src/hanzoai/resources/global_/spend.py +++ b/src/hanzoai/resources/global_/spend.py @@ -8,10 +8,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/hanzoai/resources/health.py b/src/hanzoai/resources/health.py index eebe3d1e..8350c3c5 100644 --- a/src/hanzoai/resources/health.py +++ b/src/hanzoai/resources/health.py @@ -9,10 +9,7 @@ from ..types import health_check_all_params, health_check_services_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) +from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( diff --git a/src/hanzoai/resources/key/key.py b/src/hanzoai/resources/key/key.py index 1a41972d..54508753 100644 --- a/src/hanzoai/resources/key/key.py +++ b/src/hanzoai/resources/key/key.py @@ -18,11 +18,7 @@ key_regenerate_by_key_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - strip_not_given, - async_maybe_transform, -) +from ..._utils import maybe_transform, strip_not_given, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/hanzoai/resources/model/info.py b/src/hanzoai/resources/model/info.py index 4ce1eb10..bb538e85 100644 --- a/src/hanzoai/resources/model/info.py +++ b/src/hanzoai/resources/model/info.py @@ -7,10 +7,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/hanzoai/resources/model/model.py b/src/hanzoai/resources/model/model.py index ccbe51ad..b6b6dd41 100644 --- a/src/hanzoai/resources/model/model.py +++ b/src/hanzoai/resources/model/model.py @@ -22,10 +22,7 @@ ) from ...types import model_create_params, model_delete_params from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/hanzoai/resources/model/update.py b/src/hanzoai/resources/model/update.py index fdb8a688..59cb6bdc 100644 --- a/src/hanzoai/resources/model/update.py +++ b/src/hanzoai/resources/model/update.py @@ -7,10 +7,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/hanzoai/resources/model_group.py b/src/hanzoai/resources/model_group.py index 9011ebc2..5c37397c 100644 --- a/src/hanzoai/resources/model_group.py +++ b/src/hanzoai/resources/model_group.py @@ -8,10 +8,7 @@ from ..types import model_group_retrieve_info_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) +from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( diff --git a/src/hanzoai/resources/models.py b/src/hanzoai/resources/models.py index 0b395d42..962b3cf1 100644 --- a/src/hanzoai/resources/models.py +++ b/src/hanzoai/resources/models.py @@ -8,10 +8,7 @@ from ..types import model_list_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) +from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( diff --git a/src/hanzoai/resources/organization/info.py b/src/hanzoai/resources/organization/info.py index 9d8d4c1d..1131dc3d 100644 --- a/src/hanzoai/resources/organization/info.py +++ b/src/hanzoai/resources/organization/info.py @@ -7,10 +7,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/hanzoai/resources/organization/organization.py b/src/hanzoai/resources/organization/organization.py index 62a59f45..4a5ce535 100644 --- a/src/hanzoai/resources/organization/organization.py +++ b/src/hanzoai/resources/organization/organization.py @@ -24,10 +24,7 @@ organization_update_member_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/hanzoai/resources/spend.py b/src/hanzoai/resources/spend.py index d4d01236..9b6610c6 100644 --- a/src/hanzoai/resources/spend.py +++ b/src/hanzoai/resources/spend.py @@ -8,10 +8,7 @@ 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 .._utils import ( - maybe_transform, - async_maybe_transform, -) +from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( diff --git a/src/hanzoai/resources/team/callback.py b/src/hanzoai/resources/team/callback.py index 89d2d67b..5233497d 100644 --- a/src/hanzoai/resources/team/callback.py +++ b/src/hanzoai/resources/team/callback.py @@ -8,11 +8,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - strip_not_given, - async_maybe_transform, -) +from ..._utils import maybe_transform, strip_not_given, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/hanzoai/resources/team/model.py b/src/hanzoai/resources/team/model.py index 46ddaa15..ae64a4b6 100644 --- a/src/hanzoai/resources/team/model.py +++ b/src/hanzoai/resources/team/model.py @@ -7,10 +7,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/hanzoai/resources/team/team.py b/src/hanzoai/resources/team/team.py index 69096d09..cbacd2d1 100644 --- a/src/hanzoai/resources/team/team.py +++ b/src/hanzoai/resources/team/team.py @@ -29,11 +29,7 @@ team_list_available_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - strip_not_given, - async_maybe_transform, -) +from ..._utils import maybe_transform, strip_not_given, async_maybe_transform from .callback import ( CallbackResource, AsyncCallbackResource, diff --git a/src/hanzoai/resources/user.py b/src/hanzoai/resources/user.py index 7757d36e..c9e6a1fd 100644 --- a/src/hanzoai/resources/user.py +++ b/src/hanzoai/resources/user.py @@ -15,11 +15,7 @@ user_retrieve_info_params, ) from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - strip_not_given, - async_maybe_transform, -) +from .._utils import maybe_transform, strip_not_given, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( diff --git a/src/hanzoai/resources/utils.py b/src/hanzoai/resources/utils.py index a8eb5a8f..ea5a3573 100644 --- a/src/hanzoai/resources/utils.py +++ b/src/hanzoai/resources/utils.py @@ -7,16 +7,9 @@ import httpx -from ..types import ( - util_token_counter_params, - util_transform_request_params, - util_get_supported_openai_params_params, -) +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 .._utils import ( - maybe_transform, - async_maybe_transform, -) +from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( From e2d64282e2feaa9e239f434e2644d1a5e5271ede Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 04:19:26 +0000 Subject: [PATCH 15/41] chore(internal): fix list file params --- src/hanzoai/_utils/_utils.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/hanzoai/_utils/_utils.py b/src/hanzoai/_utils/_utils.py index e5811bba..ea3cf3f2 100644 --- a/src/hanzoai/_utils/_utils.py +++ b/src/hanzoai/_utils/_utils.py @@ -72,8 +72,16 @@ def _extract_items( from .._files import assert_is_file_content # We have exhausted the path, return the entry we found. - assert_is_file_content(obj, key=flattened_key) assert flattened_key is not None + + if is_list(obj): + files: list[tuple[str, FileTypes]] = [] + for entry in obj: + assert_is_file_content(entry, key=flattened_key + "[]" if flattened_key else "") + files.append((flattened_key + "[]", cast(FileTypes, entry))) + return files + + assert_is_file_content(obj, key=flattened_key) return [(flattened_key, cast(FileTypes, obj))] index += 1 From 25ce0973aaa11be64968f6236ec101ce524dc855 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 04:20:04 +0000 Subject: [PATCH 16/41] chore(internal): refactor retries to not use recursion --- src/hanzoai/_base_client.py | 414 +++++++++++++++--------------------- 1 file changed, 175 insertions(+), 239 deletions(-) diff --git a/src/hanzoai/_base_client.py b/src/hanzoai/_base_client.py index e98c07e3..07bb5d6c 100644 --- a/src/hanzoai/_base_client.py +++ b/src/hanzoai/_base_client.py @@ -437,8 +437,7 @@ def _build_headers(self, options: FinalRequestOptions, *, retries_taken: int = 0 headers = httpx.Headers(headers_dict) idempotency_header = self._idempotency_header - if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers: - options.idempotency_key = options.idempotency_key or self._idempotency_key() + if idempotency_header and options.idempotency_key and idempotency_header not in headers: headers[idempotency_header] = options.idempotency_key # Don't set these headers if they were already set or removed by the caller. We check @@ -903,7 +902,6 @@ def request( self, cast_to: Type[ResponseT], options: FinalRequestOptions, - remaining_retries: Optional[int] = None, *, stream: Literal[True], stream_cls: Type[_StreamT], @@ -914,7 +912,6 @@ def request( self, cast_to: Type[ResponseT], options: FinalRequestOptions, - remaining_retries: Optional[int] = None, *, stream: Literal[False] = False, ) -> ResponseT: ... @@ -924,7 +921,6 @@ def request( self, cast_to: Type[ResponseT], options: FinalRequestOptions, - remaining_retries: Optional[int] = None, *, stream: bool = False, stream_cls: Type[_StreamT] | None = None, @@ -934,125 +930,109 @@ def request( self, cast_to: Type[ResponseT], options: FinalRequestOptions, - remaining_retries: Optional[int] = None, *, stream: bool = False, stream_cls: type[_StreamT] | None = None, ) -> ResponseT | _StreamT: - if remaining_retries is not None: - retries_taken = options.get_max_retries(self.max_retries) - remaining_retries - else: - retries_taken = 0 - - return self._request( - cast_to=cast_to, - options=options, - stream=stream, - stream_cls=stream_cls, - retries_taken=retries_taken, - ) + cast_to = self._maybe_override_cast_to(cast_to, options) - def _request( - self, - *, - cast_to: Type[ResponseT], - options: FinalRequestOptions, - retries_taken: int, - stream: bool, - stream_cls: type[_StreamT] | None, - ) -> ResponseT | _StreamT: # create a copy of the options we were given so that if the # options are mutated later & we then retry, the retries are # given the original options input_options = model_copy(options) - - cast_to = self._maybe_override_cast_to(cast_to, options) - options = self._prepare_options(options) - - remaining_retries = options.get_max_retries(self.max_retries) - retries_taken - request = self._build_request(options, retries_taken=retries_taken) - self._prepare_request(request) - - if options.idempotency_key: + if input_options.idempotency_key is None and input_options.method.lower() != "get": # ensure the idempotency key is reused between requests - input_options.idempotency_key = options.idempotency_key + input_options.idempotency_key = self._idempotency_key() - kwargs: HttpxSendArgs = {} - if self.custom_auth is not None: - kwargs["auth"] = self.custom_auth + response: httpx.Response | None = None + max_retries = input_options.get_max_retries(self.max_retries) - log.debug("Sending HTTP Request: %s %s", request.method, request.url) + retries_taken = 0 + for retries_taken in range(max_retries + 1): + options = model_copy(input_options) + options = self._prepare_options(options) - try: - response = self._client.send( - request, - stream=stream or self._should_stream_response_body(request=request), - **kwargs, - ) - except httpx.TimeoutException as err: - log.debug("Encountered httpx.TimeoutException", exc_info=True) + remaining_retries = max_retries - retries_taken + request = self._build_request(options, retries_taken=retries_taken) + self._prepare_request(request) - if remaining_retries > 0: - return self._retry_request( - input_options, - cast_to, - retries_taken=retries_taken, - stream=stream, - stream_cls=stream_cls, - response_headers=None, - ) + kwargs: HttpxSendArgs = {} + if self.custom_auth is not None: + kwargs["auth"] = self.custom_auth - log.debug("Raising timeout error") - raise APITimeoutError(request=request) from err - except Exception as err: - log.debug("Encountered Exception", exc_info=True) + log.debug("Sending HTTP Request: %s %s", request.method, request.url) - if remaining_retries > 0: - return self._retry_request( - input_options, - cast_to, - retries_taken=retries_taken, - stream=stream, - stream_cls=stream_cls, - response_headers=None, + response = None + try: + response = self._client.send( + request, + stream=stream or self._should_stream_response_body(request=request), + **kwargs, ) + except httpx.TimeoutException as err: + log.debug("Encountered httpx.TimeoutException", exc_info=True) + + if remaining_retries > 0: + self._sleep_for_retry( + retries_taken=retries_taken, + max_retries=max_retries, + options=input_options, + response=None, + ) + continue + + log.debug("Raising timeout error") + raise APITimeoutError(request=request) from err + except Exception as err: + log.debug("Encountered Exception", exc_info=True) + + if remaining_retries > 0: + self._sleep_for_retry( + retries_taken=retries_taken, + max_retries=max_retries, + options=input_options, + response=None, + ) + continue + + log.debug("Raising connection error") + raise APIConnectionError(request=request) from err + + log.debug( + 'HTTP Response: %s %s "%i %s" %s', + request.method, + request.url, + response.status_code, + response.reason_phrase, + response.headers, + ) - log.debug("Raising connection error") - raise APIConnectionError(request=request) from err - - log.debug( - 'HTTP Response: %s %s "%i %s" %s', - request.method, - request.url, - response.status_code, - response.reason_phrase, - response.headers, - ) + try: + response.raise_for_status() + except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code + log.debug("Encountered httpx.HTTPStatusError", exc_info=True) + + if remaining_retries > 0 and self._should_retry(err.response): + err.response.close() + self._sleep_for_retry( + retries_taken=retries_taken, + max_retries=max_retries, + options=input_options, + response=response, + ) + continue - try: - response.raise_for_status() - except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code - log.debug("Encountered httpx.HTTPStatusError", exc_info=True) - - if remaining_retries > 0 and self._should_retry(err.response): - err.response.close() - return self._retry_request( - input_options, - cast_to, - retries_taken=retries_taken, - response_headers=err.response.headers, - stream=stream, - stream_cls=stream_cls, - ) + # If the response is streamed then we need to explicitly read the response + # to completion before attempting to access the response text. + if not err.response.is_closed: + err.response.read() - # If the response is streamed then we need to explicitly read the response - # to completion before attempting to access the response text. - if not err.response.is_closed: - err.response.read() + log.debug("Re-raising status error") + raise self._make_status_error_from_response(err.response) from None - log.debug("Re-raising status error") - raise self._make_status_error_from_response(err.response) from None + break + assert response is not None, "could not resolve response (should never happen)" return self._process_response( cast_to=cast_to, options=options, @@ -1062,37 +1042,20 @@ def _request( retries_taken=retries_taken, ) - def _retry_request( - self, - options: FinalRequestOptions, - cast_to: Type[ResponseT], - *, - retries_taken: int, - response_headers: httpx.Headers | None, - stream: bool, - stream_cls: type[_StreamT] | None, - ) -> ResponseT | _StreamT: - remaining_retries = options.get_max_retries(self.max_retries) - retries_taken + def _sleep_for_retry( + self, *, retries_taken: int, max_retries: int, options: FinalRequestOptions, response: httpx.Response | None + ) -> None: + remaining_retries = max_retries - retries_taken if remaining_retries == 1: log.debug("1 retry left") else: log.debug("%i retries left", remaining_retries) - timeout = self._calculate_retry_timeout(remaining_retries, options, response_headers) + timeout = self._calculate_retry_timeout(remaining_retries, options, response.headers if response else None) log.info("Retrying request to %s in %f seconds", options.url, timeout) - # In a synchronous context we are blocking the entire thread. Up to the library user to run the client in a - # different thread if necessary. time.sleep(timeout) - return self._request( - options=options, - cast_to=cast_to, - retries_taken=retries_taken + 1, - stream=stream, - stream_cls=stream_cls, - ) - def _process_response( self, *, @@ -1436,7 +1399,6 @@ async def request( options: FinalRequestOptions, *, stream: Literal[False] = False, - remaining_retries: Optional[int] = None, ) -> ResponseT: ... @overload @@ -1447,7 +1409,6 @@ async def request( *, stream: Literal[True], stream_cls: type[_AsyncStreamT], - remaining_retries: Optional[int] = None, ) -> _AsyncStreamT: ... @overload @@ -1458,7 +1419,6 @@ async def request( *, stream: bool, stream_cls: type[_AsyncStreamT] | None = None, - remaining_retries: Optional[int] = None, ) -> ResponseT | _AsyncStreamT: ... async def request( @@ -1468,120 +1428,111 @@ async def request( *, stream: bool = False, stream_cls: type[_AsyncStreamT] | None = None, - remaining_retries: Optional[int] = None, - ) -> ResponseT | _AsyncStreamT: - if remaining_retries is not None: - retries_taken = options.get_max_retries(self.max_retries) - remaining_retries - else: - retries_taken = 0 - - return await self._request( - cast_to=cast_to, - options=options, - stream=stream, - stream_cls=stream_cls, - retries_taken=retries_taken, - ) - - async def _request( - self, - cast_to: Type[ResponseT], - options: FinalRequestOptions, - *, - stream: bool, - stream_cls: type[_AsyncStreamT] | None, - retries_taken: int, ) -> ResponseT | _AsyncStreamT: if self._platform is None: # `get_platform` can make blocking IO calls so we # execute it earlier while we are in an async context self._platform = await asyncify(get_platform)() + cast_to = self._maybe_override_cast_to(cast_to, options) + # create a copy of the options we were given so that if the # options are mutated later & we then retry, the retries are # given the original options input_options = model_copy(options) - - cast_to = self._maybe_override_cast_to(cast_to, options) - options = await self._prepare_options(options) - - remaining_retries = options.get_max_retries(self.max_retries) - retries_taken - request = self._build_request(options, retries_taken=retries_taken) - await self._prepare_request(request) - - if options.idempotency_key: + if input_options.idempotency_key is None and input_options.method.lower() != "get": # ensure the idempotency key is reused between requests - input_options.idempotency_key = options.idempotency_key + input_options.idempotency_key = self._idempotency_key() - kwargs: HttpxSendArgs = {} - if self.custom_auth is not None: - kwargs["auth"] = self.custom_auth + response: httpx.Response | None = None + max_retries = input_options.get_max_retries(self.max_retries) - try: - response = await self._client.send( - request, - stream=stream or self._should_stream_response_body(request=request), - **kwargs, - ) - except httpx.TimeoutException as err: - log.debug("Encountered httpx.TimeoutException", exc_info=True) + retries_taken = 0 + for retries_taken in range(max_retries + 1): + options = model_copy(input_options) + options = await self._prepare_options(options) - if remaining_retries > 0: - return await self._retry_request( - input_options, - cast_to, - retries_taken=retries_taken, - stream=stream, - stream_cls=stream_cls, - response_headers=None, - ) + remaining_retries = max_retries - retries_taken + request = self._build_request(options, retries_taken=retries_taken) + await self._prepare_request(request) - log.debug("Raising timeout error") - raise APITimeoutError(request=request) from err - except Exception as err: - log.debug("Encountered Exception", exc_info=True) + kwargs: HttpxSendArgs = {} + if self.custom_auth is not None: + kwargs["auth"] = self.custom_auth - if remaining_retries > 0: - return await self._retry_request( - input_options, - cast_to, - retries_taken=retries_taken, - stream=stream, - stream_cls=stream_cls, - response_headers=None, - ) + log.debug("Sending HTTP Request: %s %s", request.method, request.url) - log.debug("Raising connection error") - raise APIConnectionError(request=request) from err + response = None + try: + response = await self._client.send( + request, + stream=stream or self._should_stream_response_body(request=request), + **kwargs, + ) + except httpx.TimeoutException as err: + log.debug("Encountered httpx.TimeoutException", exc_info=True) + + if remaining_retries > 0: + await self._sleep_for_retry( + retries_taken=retries_taken, + max_retries=max_retries, + options=input_options, + response=None, + ) + continue + + log.debug("Raising timeout error") + raise APITimeoutError(request=request) from err + except Exception as err: + log.debug("Encountered Exception", exc_info=True) + + if remaining_retries > 0: + await self._sleep_for_retry( + retries_taken=retries_taken, + max_retries=max_retries, + options=input_options, + response=None, + ) + continue + + log.debug("Raising connection error") + raise APIConnectionError(request=request) from err + + log.debug( + 'HTTP Response: %s %s "%i %s" %s', + request.method, + request.url, + response.status_code, + response.reason_phrase, + response.headers, + ) - log.debug( - 'HTTP Request: %s %s "%i %s"', request.method, request.url, response.status_code, response.reason_phrase - ) + try: + response.raise_for_status() + except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code + log.debug("Encountered httpx.HTTPStatusError", exc_info=True) + + if remaining_retries > 0 and self._should_retry(err.response): + await err.response.aclose() + await self._sleep_for_retry( + retries_taken=retries_taken, + max_retries=max_retries, + options=input_options, + response=response, + ) + continue - try: - response.raise_for_status() - except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code - log.debug("Encountered httpx.HTTPStatusError", exc_info=True) - - if remaining_retries > 0 and self._should_retry(err.response): - await err.response.aclose() - return await self._retry_request( - input_options, - cast_to, - retries_taken=retries_taken, - response_headers=err.response.headers, - stream=stream, - stream_cls=stream_cls, - ) + # If the response is streamed then we need to explicitly read the response + # to completion before attempting to access the response text. + if not err.response.is_closed: + await err.response.aread() - # If the response is streamed then we need to explicitly read the response - # to completion before attempting to access the response text. - if not err.response.is_closed: - await err.response.aread() + log.debug("Re-raising status error") + raise self._make_status_error_from_response(err.response) from None - log.debug("Re-raising status error") - raise self._make_status_error_from_response(err.response) from None + break + assert response is not None, "could not resolve response (should never happen)" return await self._process_response( cast_to=cast_to, options=options, @@ -1591,35 +1542,20 @@ async def _request( retries_taken=retries_taken, ) - async def _retry_request( - self, - options: FinalRequestOptions, - cast_to: Type[ResponseT], - *, - retries_taken: int, - response_headers: httpx.Headers | None, - stream: bool, - stream_cls: type[_AsyncStreamT] | None, - ) -> ResponseT | _AsyncStreamT: - remaining_retries = options.get_max_retries(self.max_retries) - retries_taken + async def _sleep_for_retry( + self, *, retries_taken: int, max_retries: int, options: FinalRequestOptions, response: httpx.Response | None + ) -> None: + remaining_retries = max_retries - retries_taken if remaining_retries == 1: log.debug("1 retry left") else: log.debug("%i retries left", remaining_retries) - timeout = self._calculate_retry_timeout(remaining_retries, options, response_headers) + timeout = self._calculate_retry_timeout(remaining_retries, options, response.headers if response else None) log.info("Retrying request to %s in %f seconds", options.url, timeout) await anyio.sleep(timeout) - return await self._request( - options=options, - cast_to=cast_to, - retries_taken=retries_taken + 1, - stream=stream, - stream_cls=stream_cls, - ) - async def _process_response( self, *, From c0604303395ca27f73f16ea4bc4d05841acba51d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 04:20:48 +0000 Subject: [PATCH 17/41] fix(pydantic v1): more robust ModelField.annotation check --- src/hanzoai/_models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hanzoai/_models.py b/src/hanzoai/_models.py index 58b9263e..798956f1 100644 --- a/src/hanzoai/_models.py +++ b/src/hanzoai/_models.py @@ -626,8 +626,8 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, # Note: if one variant defines an alias then they all should discriminator_alias = field_info.alias - if field_info.annotation and is_literal_type(field_info.annotation): - for entry in get_args(field_info.annotation): + if (annotation := getattr(field_info, "annotation", None)) and is_literal_type(annotation): + for entry in get_args(annotation): if isinstance(entry, str): mapping[entry] = variant From c4357ac7f204b602cb29c4d4beb9bd1ca99773fc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:50:15 +0000 Subject: [PATCH 18/41] chore(internal): minor formatting changes --- src/hanzoai/types/config/pass_through_generic_endpoint.py | 1 - src/hanzoai/types/util_token_counter_response.py | 1 - 2 files changed, 2 deletions(-) diff --git a/src/hanzoai/types/config/pass_through_generic_endpoint.py b/src/hanzoai/types/config/pass_through_generic_endpoint.py index 5bfabb25..c4d7d8f6 100644 --- a/src/hanzoai/types/config/pass_through_generic_endpoint.py +++ b/src/hanzoai/types/config/pass_through_generic_endpoint.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ..._models import BaseModel __all__ = ["PassThroughGenericEndpoint"] diff --git a/src/hanzoai/types/util_token_counter_response.py b/src/hanzoai/types/util_token_counter_response.py index 866ec4b5..4676deec 100644 --- a/src/hanzoai/types/util_token_counter_response.py +++ b/src/hanzoai/types/util_token_counter_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from pydantic import Field as FieldInfo from .._models import BaseModel From 697ab40b8cd1bedf4cf7398a35408ca364e33d52 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:50:59 +0000 Subject: [PATCH 19/41] chore(internal): codegen related update --- .github/workflows/ci.yml | 16 ++++++++-------- .github/workflows/publish-pypi.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04b083ca..33820422 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,18 +1,18 @@ name: CI on: push: - branches: - - main - pull_request: - branches: - - main - - next + branches-ignore: + - 'generated' + - 'codegen/**' + - 'integrated/**' + - 'stl-preview-head/**' + - 'stl-preview-base/**' jobs: lint: timeout-minutes: 10 name: lint - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 steps: - uses: actions/checkout@v4 @@ -33,7 +33,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index df4f4835..dca371dd 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -11,7 +11,7 @@ on: jobs: publish: name: publish - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index f368afdc..df62d382 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -8,7 +8,7 @@ on: jobs: release_doctor: name: release doctor - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 if: github.repository == 'hanzoai/python-sdk' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: From 15b3705165b138b4827f9fa18fa9b7b8966ab5bb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:51:41 +0000 Subject: [PATCH 20/41] chore(ci): only use depot for staging repos --- .github/workflows/ci.yml | 4 ++-- .github/workflows/publish-pypi.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33820422..34dab13f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: lint: timeout-minutes: 10 name: lint - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/hanzo-ai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 @@ -33,7 +33,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/hanzo-ai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index dca371dd..df4f4835 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -11,7 +11,7 @@ on: jobs: publish: name: publish - runs-on: depot-ubuntu-24.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index df62d382..f368afdc 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -8,7 +8,7 @@ on: jobs: release_doctor: name: release doctor - runs-on: depot-ubuntu-24.04 + runs-on: ubuntu-latest if: github.repository == 'hanzoai/python-sdk' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: From 11bc5fd48e6536cbec838b676c64ce7a175f6b09 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:53:37 +0000 Subject: [PATCH 21/41] chore: broadly detect json family of content-type headers --- src/hanzoai/_response.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hanzoai/_response.py b/src/hanzoai/_response.py index cf6525b3..a99ced03 100644 --- a/src/hanzoai/_response.py +++ b/src/hanzoai/_response.py @@ -233,7 +233,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: # split is required to handle cases where additional information is included # in the response, e.g. application/json; charset=utf-8 content_type, *_ = response.headers.get("content-type", "*").split(";") - if content_type != "application/json": + if not content_type.endswith("json"): if is_basemodel(cast_to): try: data = response.json() From ef6b7d319cee29263bac020390d6b3ec513648a4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 9 May 2025 04:36:39 +0000 Subject: [PATCH 22/41] chore(internal): avoid errors for isinstance checks on proxies --- src/hanzoai/_utils/_proxy.py | 5 ++++- tests/test_utils/test_proxy.py | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/hanzoai/_utils/_proxy.py b/src/hanzoai/_utils/_proxy.py index ffd883e9..0f239a33 100644 --- a/src/hanzoai/_utils/_proxy.py +++ b/src/hanzoai/_utils/_proxy.py @@ -46,7 +46,10 @@ def __dir__(self) -> Iterable[str]: @property # type: ignore @override def __class__(self) -> type: # pyright: ignore - proxied = self.__get_proxied__() + try: + proxied = self.__get_proxied__() + except Exception: + return type(self) if issubclass(type(proxied), LazyProxy): return type(proxied) return proxied.__class__ diff --git a/tests/test_utils/test_proxy.py b/tests/test_utils/test_proxy.py index f09915b1..b55f8b0b 100644 --- a/tests/test_utils/test_proxy.py +++ b/tests/test_utils/test_proxy.py @@ -21,3 +21,14 @@ def test_recursive_proxy() -> None: assert dir(proxy) == [] assert type(proxy).__name__ == "RecursiveLazyProxy" assert type(operator.attrgetter("name.foo.bar.baz")(proxy)).__name__ == "RecursiveLazyProxy" + + +def test_isinstance_does_not_error() -> None: + class AlwaysErrorProxy(LazyProxy[Any]): + @override + def __load__(self) -> Any: + raise RuntimeError("Mocking missing dependency") + + proxy = AlwaysErrorProxy() + assert not isinstance(proxy, dict) + assert isinstance(proxy, LazyProxy) From dd95dadc573369de39916f8bf4bd0e36fbe3feaf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 10 May 2025 03:52:43 +0000 Subject: [PATCH 23/41] fix(package): support direct resource imports --- src/hanzoai/__init__.py | 5 +++++ src/hanzoai/_utils/_resources_proxy.py | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 src/hanzoai/_utils/_resources_proxy.py diff --git a/src/hanzoai/__init__.py b/src/hanzoai/__init__.py index e5ed193a..438e5799 100644 --- a/src/hanzoai/__init__.py +++ b/src/hanzoai/__init__.py @@ -1,5 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +import typing as _t + from . import types from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes from ._utils import file_from_path @@ -80,6 +82,9 @@ "DefaultAsyncHttpxClient", ] +if not _t.TYPE_CHECKING: + from ._utils._resources_proxy import resources as resources + _setup_logging() # Update the __module__ attribute for exported symbols so that diff --git a/src/hanzoai/_utils/_resources_proxy.py b/src/hanzoai/_utils/_resources_proxy.py new file mode 100644 index 00000000..f877db10 --- /dev/null +++ b/src/hanzoai/_utils/_resources_proxy.py @@ -0,0 +1,24 @@ +from __future__ import annotations + +from typing import Any +from typing_extensions import override + +from ._proxy import LazyProxy + + +class ResourcesProxy(LazyProxy[Any]): + """A proxy for the `hanzoai.resources` module. + + This is used so that we can lazily import `hanzoai.resources` only when + needed *and* so that users can just import `hanzoai` and reference `hanzoai.resources` + """ + + @override + def __load__(self) -> Any: + import importlib + + mod = importlib.import_module("hanzoai.resources") + return mod + + +resources = ResourcesProxy().__as_proxied__() From 51807ff9c91fbf15152c4d8850eec0e9a300e685 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 05:18:58 +0000 Subject: [PATCH 24/41] chore(ci): upload sdks to package manager --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ scripts/utils/upload-artifact.sh | 25 +++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100755 scripts/utils/upload-artifact.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34dab13f..94874a05 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,30 @@ jobs: - name: Run lints run: ./scripts/lint + upload: + if: github.repository == 'stainless-sdks/hanzo-ai-python' + timeout-minutes: 10 + name: upload + permissions: + contents: read + id-token: write + runs-on: depot-ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + + - name: Get GitHub OIDC Token + id: github-oidc + uses: actions/github-script@v6 + with: + script: core.setOutput('github_token', await core.getIDToken()); + + - name: Upload tarball + env: + URL: https://pkg.stainless.com/s + AUTH: ${{ steps.github-oidc.outputs.github_token }} + SHA: ${{ github.sha }} + run: ./scripts/utils/upload-artifact.sh + test: timeout-minutes: 10 name: test diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh new file mode 100755 index 00000000..1565be87 --- /dev/null +++ b/scripts/utils/upload-artifact.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -exuo pipefail + +RESPONSE=$(curl -X POST "$URL" \ + -H "Authorization: Bearer $AUTH" \ + -H "Content-Type: application/json") + +SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url') + +if [[ "$SIGNED_URL" == "null" ]]; then + echo -e "\033[31mFailed to get signed URL.\033[0m" + exit 1 +fi + +UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \ + -H "Content-Type: application/gzip" \ + --data-binary @- "$SIGNED_URL" 2>&1) + +if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then + echo -e "\033[32mUploaded build to Stainless storage.\033[0m" + echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/hanzo-ai-python/$SHA'\033[0m" +else + echo -e "\033[31mFailed to upload artifact.\033[0m" + exit 1 +fi From d92f1116f14aaaa9bb2c8a5b186b37dc5781a7d7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 May 2025 04:01:31 +0000 Subject: [PATCH 25/41] chore(ci): fix installation instructions --- scripts/utils/upload-artifact.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh index 1565be87..939759ad 100755 --- a/scripts/utils/upload-artifact.sh +++ b/scripts/utils/upload-artifact.sh @@ -18,7 +18,7 @@ UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \ if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then echo -e "\033[32mUploaded build to Stainless storage.\033[0m" - echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/hanzo-ai-python/$SHA'\033[0m" + echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/hanzo-ai-python/$SHA'\033[0m" else echo -e "\033[31mFailed to upload artifact.\033[0m" exit 1 From f95243ce876224facdb415f49a893c9c4b891b48 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 22 May 2025 02:37:29 +0000 Subject: [PATCH 26/41] chore(docs): grammar improvements --- SECURITY.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index bada7faa..0b579e02 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -16,11 +16,11 @@ before making any information public. ## Reporting Non-SDK Related Security Issues If you encounter security issues that are not directly related to SDKs but pertain to the services -or products provided by Hanzo please follow the respective company's security reporting guidelines. +or products provided by Hanzo, please follow the respective company's security reporting guidelines. ### Hanzo Terms and Policies -Please contact dev@hanzo.ai for any questions or concerns regarding security of our services. +Please contact dev@hanzo.ai for any questions or concerns regarding the security of our services. --- From e28c7f6386b5c42a111a85f1cd4a588747fa8d83 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 03:35:07 +0000 Subject: [PATCH 27/41] fix(docs/api): remove references to nonexistent types --- api.md | 765 +++++++++++++-------------------------------------------- 1 file changed, 172 insertions(+), 593 deletions(-) diff --git a/api.md b/api.md index e5bbbff8..661cdccc 100644 --- a/api.md +++ b/api.md @@ -1,256 +1,138 @@ # Hanzo -Types: - -```python -from hanzoai.types import GetHomeResponse -``` - Methods: -- client.get_home() -> object +- client.get_home() -> object # Models -Types: - -```python -from hanzoai.types import ModelListResponse -``` - Methods: -- client.models.list(\*\*params) -> object +- client.models.list(\*\*params) -> object # OpenAI -Types: - -```python -from hanzoai.types import ( - OpenAICreateResponse, - OpenAIRetrieveResponse, - OpenAIUpdateResponse, - OpenAIDeleteResponse, - OpenAIPatchResponse, -) -``` - Methods: -- client.openai.create(endpoint) -> object -- client.openai.retrieve(endpoint) -> object -- client.openai.update(endpoint) -> object -- client.openai.delete(endpoint) -> object -- client.openai.patch(endpoint) -> object +- client.openai.create(endpoint) -> object +- client.openai.retrieve(endpoint) -> object +- client.openai.update(endpoint) -> object +- client.openai.delete(endpoint) -> object +- client.openai.patch(endpoint) -> object ## Deployments -Types: - -```python -from hanzoai.types.openai import DeploymentCompleteResponse, DeploymentEmbedResponse -``` - Methods: -- client.openai.deployments.complete(model) -> object -- client.openai.deployments.embed(model) -> object +- client.openai.deployments.complete(model) -> object +- client.openai.deployments.embed(model) -> object ### Chat -Types: - -```python -from hanzoai.types.openai.deployments import ChatCompleteResponse -``` - Methods: -- client.openai.deployments.chat.complete(model) -> object +- client.openai.deployments.chat.complete(model) -> object # Engines -Types: - -```python -from hanzoai.types import EngineCompleteResponse, EngineEmbedResponse -``` - Methods: -- client.engines.complete(model) -> object -- client.engines.embed(model) -> object +- client.engines.complete(model) -> object +- client.engines.embed(model) -> object ## Chat -Types: - -```python -from hanzoai.types.engines import ChatCompleteResponse -``` - Methods: -- client.engines.chat.complete(model) -> object +- client.engines.chat.complete(model) -> object # Chat ## Completions -Types: - -```python -from hanzoai.types.chat import CompletionCreateResponse -``` - Methods: -- client.chat.completions.create(\*\*params) -> object +- client.chat.completions.create(\*\*params) -> object # Completions -Types: - -```python -from hanzoai.types import CompletionCreateResponse -``` - Methods: -- client.completions.create(\*\*params) -> object +- client.completions.create(\*\*params) -> object # Embeddings -Types: - -```python -from hanzoai.types import EmbeddingCreateResponse -``` - Methods: -- client.embeddings.create(\*\*params) -> object +- client.embeddings.create(\*\*params) -> object # Images ## Generations -Types: - -```python -from hanzoai.types.images import GenerationCreateResponse -``` - Methods: -- client.images.generations.create() -> object +- client.images.generations.create() -> object # Audio ## Speech -Types: - -```python -from hanzoai.types.audio import SpeechCreateResponse -``` - Methods: -- client.audio.speech.create() -> object +- client.audio.speech.create() -> object ## Transcriptions -Types: - -```python -from hanzoai.types.audio import TranscriptionCreateResponse -``` - Methods: -- client.audio.transcriptions.create(\*\*params) -> object +- client.audio.transcriptions.create(\*\*params) -> object # Assistants -Types: - -```python -from hanzoai.types import AssistantCreateResponse, AssistantListResponse, AssistantDeleteResponse -``` - Methods: -- client.assistants.create() -> object -- client.assistants.list() -> object -- client.assistants.delete(assistant_id) -> object +- client.assistants.create() -> object +- client.assistants.list() -> object +- client.assistants.delete(assistant_id) -> object # Threads -Types: - -```python -from hanzoai.types import ThreadCreateResponse, ThreadRetrieveResponse -``` - Methods: -- client.threads.create() -> object -- client.threads.retrieve(thread_id) -> object +- client.threads.create() -> object +- client.threads.retrieve(thread_id) -> object ## Messages -Types: - -```python -from hanzoai.types.threads import MessageCreateResponse, MessageListResponse -``` - Methods: -- client.threads.messages.create(thread_id) -> object -- client.threads.messages.list(thread_id) -> object +- client.threads.messages.create(thread_id) -> object +- client.threads.messages.list(thread_id) -> object ## Runs -Types: - -```python -from hanzoai.types.threads import RunCreateResponse -``` - Methods: -- client.threads.runs.create(thread_id) -> object +- client.threads.runs.create(thread_id) -> object # Moderations -Types: - -```python -from hanzoai.types import ModerationCreateResponse -``` - Methods: -- client.moderations.create() -> object +- client.moderations.create() -> object # Utils Types: ```python -from hanzoai.types import ( - UtilGetSupportedOpenAIParamsResponse, - UtilTokenCounterResponse, - UtilTransformRequestResponse, -) +from hanzoai.types import UtilTokenCounterResponse, UtilTransformRequestResponse ``` Methods: -- client.utils.get_supported_openai_params(\*\*params) -> object +- client.utils.get_supported_openai_params(\*\*params) -> object - client.utils.token_counter(\*\*params) -> UtilTokenCounterResponse - client.utils.transform_request(\*\*params) -> UtilTransformRequestResponse @@ -259,390 +141,204 @@ Methods: Types: ```python -from hanzoai.types import ( - ConfigurableClientsideParamsCustomAuth, - ModelInfo, - ModelCreateResponse, - ModelDeleteResponse, -) +from hanzoai.types import ConfigurableClientsideParamsCustomAuth, ModelInfo ``` Methods: -- client.model.create(\*\*params) -> object -- client.model.delete(\*\*params) -> object +- client.model.create(\*\*params) -> object +- client.model.delete(\*\*params) -> object ## Info -Types: - -```python -from hanzoai.types.model import InfoListResponse -``` - Methods: -- client.model.info.list(\*\*params) -> object +- client.model.info.list(\*\*params) -> object ## Update Types: ```python -from hanzoai.types.model import UpdateDeployment, UpdateFullResponse, UpdatePartialResponse +from hanzoai.types.model import UpdateDeployment ``` Methods: -- client.model.update.full(\*\*params) -> object -- client.model.update.partial(model_id, \*\*params) -> object +- client.model.update.full(\*\*params) -> object +- client.model.update.partial(model_id, \*\*params) -> object # ModelGroup -Types: - -```python -from hanzoai.types import ModelGroupRetrieveInfoResponse -``` - Methods: -- client.model_group.retrieve_info(\*\*params) -> object +- client.model_group.retrieve_info(\*\*params) -> object # Routes -Types: - -```python -from hanzoai.types import RouteListResponse -``` - Methods: -- client.routes.list() -> object +- client.routes.list() -> object # Responses -Types: - -```python -from hanzoai.types import ResponseCreateResponse, ResponseRetrieveResponse, ResponseDeleteResponse -``` - Methods: -- client.responses.create() -> object -- client.responses.retrieve(response_id) -> object -- client.responses.delete(response_id) -> object +- client.responses.create() -> object +- client.responses.retrieve(response_id) -> object +- client.responses.delete(response_id) -> object ## InputItems -Types: - -```python -from hanzoai.types.responses import InputItemListResponse -``` - Methods: -- client.responses.input_items.list(response_id) -> object +- client.responses.input_items.list(response_id) -> object # Batches -Types: - -```python -from hanzoai.types import ( - BatchCreateResponse, - BatchRetrieveResponse, - BatchListResponse, - BatchCancelWithProviderResponse, - BatchCreateWithProviderResponse, - BatchListWithProviderResponse, - BatchRetrieveWithProviderResponse, -) -``` - Methods: -- client.batches.create(\*\*params) -> object -- client.batches.retrieve(batch_id, \*\*params) -> object -- client.batches.list(\*\*params) -> object -- client.batches.cancel_with_provider(batch_id, \*, provider) -> object -- client.batches.create_with_provider(provider) -> object -- client.batches.list_with_provider(provider, \*\*params) -> object -- client.batches.retrieve_with_provider(batch_id, \*, provider) -> object +- client.batches.create(\*\*params) -> object +- client.batches.retrieve(batch_id, \*\*params) -> object +- client.batches.list(\*\*params) -> object +- client.batches.cancel_with_provider(batch_id, \*, provider) -> object +- client.batches.create_with_provider(provider) -> object +- client.batches.list_with_provider(provider, \*\*params) -> object +- client.batches.retrieve_with_provider(batch_id, \*, provider) -> object ## Cancel -Types: - -```python -from hanzoai.types.batches import CancelCancelResponse -``` - Methods: -- client.batches.cancel.cancel(batch_id, \*\*params) -> object +- client.batches.cancel.cancel(batch_id, \*\*params) -> object # Rerank -Types: - -```python -from hanzoai.types import RerankCreateResponse, RerankCreateV1Response, RerankCreateV2Response -``` - Methods: -- client.rerank.create() -> object -- client.rerank.create_v1() -> object -- client.rerank.create_v2() -> object +- client.rerank.create() -> object +- client.rerank.create_v1() -> object +- client.rerank.create_v2() -> object # FineTuning ## Jobs -Types: - -```python -from hanzoai.types.fine_tuning import JobCreateResponse, JobRetrieveResponse, JobListResponse -``` - Methods: -- client.fine_tuning.jobs.create(\*\*params) -> object -- client.fine_tuning.jobs.retrieve(fine_tuning_job_id, \*\*params) -> object -- client.fine_tuning.jobs.list(\*\*params) -> object +- client.fine_tuning.jobs.create(\*\*params) -> object +- client.fine_tuning.jobs.retrieve(fine_tuning_job_id, \*\*params) -> object +- client.fine_tuning.jobs.list(\*\*params) -> object ### Cancel -Types: - -```python -from hanzoai.types.fine_tuning.jobs import CancelCreateResponse -``` - Methods: -- client.fine_tuning.jobs.cancel.create(fine_tuning_job_id) -> object +- client.fine_tuning.jobs.cancel.create(fine_tuning_job_id) -> object # Credentials Types: ```python -from hanzoai.types import ( - CredentialItem, - CredentialCreateResponse, - CredentialListResponse, - CredentialDeleteResponse, -) +from hanzoai.types import CredentialItem ``` Methods: -- client.credentials.create(\*\*params) -> object -- client.credentials.list() -> object -- client.credentials.delete(credential_name) -> object +- client.credentials.create(\*\*params) -> object +- client.credentials.list() -> object +- client.credentials.delete(credential_name) -> object # VertexAI -Types: - -```python -from hanzoai.types import ( - VertexAICreateResponse, - VertexAIRetrieveResponse, - VertexAIUpdateResponse, - VertexAIDeleteResponse, - VertexAIPatchResponse, -) -``` - Methods: -- client.vertex_ai.create(endpoint) -> object -- client.vertex_ai.retrieve(endpoint) -> object -- client.vertex_ai.update(endpoint) -> object -- client.vertex_ai.delete(endpoint) -> object -- client.vertex_ai.patch(endpoint) -> object +- client.vertex_ai.create(endpoint) -> object +- client.vertex_ai.retrieve(endpoint) -> object +- client.vertex_ai.update(endpoint) -> object +- client.vertex_ai.delete(endpoint) -> object +- client.vertex_ai.patch(endpoint) -> object # Gemini -Types: - -```python -from hanzoai.types import ( - GeminiCreateResponse, - GeminiRetrieveResponse, - GeminiUpdateResponse, - GeminiDeleteResponse, - GeminiPatchResponse, -) -``` - Methods: -- client.gemini.create(endpoint) -> object -- client.gemini.retrieve(endpoint) -> object -- client.gemini.update(endpoint) -> object -- client.gemini.delete(endpoint) -> object -- client.gemini.patch(endpoint) -> object +- client.gemini.create(endpoint) -> object +- client.gemini.retrieve(endpoint) -> object +- client.gemini.update(endpoint) -> object +- client.gemini.delete(endpoint) -> object +- client.gemini.patch(endpoint) -> object # Cohere -Types: - -```python -from hanzoai.types import ( - CohereCreateResponse, - CohereRetrieveResponse, - CohereUpdateResponse, - CohereDeleteResponse, - CohereModifyResponse, -) -``` - Methods: -- client.cohere.create(endpoint) -> object -- client.cohere.retrieve(endpoint) -> object -- client.cohere.update(endpoint) -> object -- client.cohere.delete(endpoint) -> object -- client.cohere.modify(endpoint) -> object +- client.cohere.create(endpoint) -> object +- client.cohere.retrieve(endpoint) -> object +- client.cohere.update(endpoint) -> object +- client.cohere.delete(endpoint) -> object +- client.cohere.modify(endpoint) -> object # Anthropic -Types: - -```python -from hanzoai.types import ( - AnthropicCreateResponse, - AnthropicRetrieveResponse, - AnthropicUpdateResponse, - AnthropicDeleteResponse, - AnthropicModifyResponse, -) -``` - Methods: -- client.anthropic.create(endpoint) -> object -- client.anthropic.retrieve(endpoint) -> object -- client.anthropic.update(endpoint) -> object -- client.anthropic.delete(endpoint) -> object -- client.anthropic.modify(endpoint) -> object +- client.anthropic.create(endpoint) -> object +- client.anthropic.retrieve(endpoint) -> object +- client.anthropic.update(endpoint) -> object +- client.anthropic.delete(endpoint) -> object +- client.anthropic.modify(endpoint) -> object # Bedrock -Types: - -```python -from hanzoai.types import ( - BedrockCreateResponse, - BedrockRetrieveResponse, - BedrockUpdateResponse, - BedrockDeleteResponse, - BedrockPatchResponse, -) -``` - Methods: -- client.bedrock.create(endpoint) -> object -- client.bedrock.retrieve(endpoint) -> object -- client.bedrock.update(endpoint) -> object -- client.bedrock.delete(endpoint) -> object -- client.bedrock.patch(endpoint) -> object +- client.bedrock.create(endpoint) -> object +- client.bedrock.retrieve(endpoint) -> object +- client.bedrock.update(endpoint) -> object +- client.bedrock.delete(endpoint) -> object +- client.bedrock.patch(endpoint) -> object # EuAssemblyai -Types: - -```python -from hanzoai.types import ( - EuAssemblyaiCreateResponse, - EuAssemblyaiRetrieveResponse, - EuAssemblyaiUpdateResponse, - EuAssemblyaiDeleteResponse, - EuAssemblyaiPatchResponse, -) -``` - Methods: -- client.eu_assemblyai.create(endpoint) -> object -- client.eu_assemblyai.retrieve(endpoint) -> object -- client.eu_assemblyai.update(endpoint) -> object -- client.eu_assemblyai.delete(endpoint) -> object -- client.eu_assemblyai.patch(endpoint) -> object +- client.eu_assemblyai.create(endpoint) -> object +- client.eu_assemblyai.retrieve(endpoint) -> object +- client.eu_assemblyai.update(endpoint) -> object +- client.eu_assemblyai.delete(endpoint) -> object +- client.eu_assemblyai.patch(endpoint) -> object # Assemblyai -Types: - -```python -from hanzoai.types import ( - AssemblyaiCreateResponse, - AssemblyaiRetrieveResponse, - AssemblyaiUpdateResponse, - AssemblyaiDeleteResponse, - AssemblyaiPatchResponse, -) -``` - Methods: -- client.assemblyai.create(endpoint) -> object -- client.assemblyai.retrieve(endpoint) -> object -- client.assemblyai.update(endpoint) -> object -- client.assemblyai.delete(endpoint) -> object -- client.assemblyai.patch(endpoint) -> object +- client.assemblyai.create(endpoint) -> object +- client.assemblyai.retrieve(endpoint) -> object +- client.assemblyai.update(endpoint) -> object +- client.assemblyai.delete(endpoint) -> object +- client.assemblyai.patch(endpoint) -> object # Azure -Types: - -```python -from hanzoai.types import ( - AzureCreateResponse, - AzureUpdateResponse, - AzureDeleteResponse, - AzureCallResponse, - AzurePatchResponse, -) -``` - Methods: -- client.azure.create(endpoint) -> object -- client.azure.update(endpoint) -> object -- client.azure.delete(endpoint) -> object -- client.azure.call(endpoint) -> object -- client.azure.patch(endpoint) -> object +- client.azure.create(endpoint) -> object +- client.azure.update(endpoint) -> object +- client.azure.delete(endpoint) -> object +- client.azure.call(endpoint) -> object +- client.azure.patch(endpoint) -> object # Langfuse -Types: - -```python -from hanzoai.types import ( - LangfuseCreateResponse, - LangfuseRetrieveResponse, - LangfuseUpdateResponse, - LangfuseDeleteResponse, - LangfusePatchResponse, -) -``` - Methods: -- client.langfuse.create(endpoint) -> object -- client.langfuse.retrieve(endpoint) -> object -- client.langfuse.update(endpoint) -> object -- client.langfuse.delete(endpoint) -> object -- client.langfuse.patch(endpoint) -> object +- client.langfuse.create(endpoint) -> object +- client.langfuse.retrieve(endpoint) -> object +- client.langfuse.update(endpoint) -> object +- client.langfuse.delete(endpoint) -> object +- client.langfuse.patch(endpoint) -> object # Config @@ -651,78 +347,43 @@ Methods: Types: ```python -from hanzoai.types.config import ( - PassThroughEndpointResponse, - PassThroughGenericEndpoint, - PassThroughEndpointCreateResponse, - PassThroughEndpointUpdateResponse, -) +from hanzoai.types.config import PassThroughEndpointResponse, PassThroughGenericEndpoint ``` Methods: -- client.config.pass_through_endpoint.create(\*\*params) -> object -- client.config.pass_through_endpoint.update(endpoint_id) -> object +- client.config.pass_through_endpoint.create(\*\*params) -> object +- client.config.pass_through_endpoint.update(endpoint_id) -> object - client.config.pass_through_endpoint.list(\*\*params) -> PassThroughEndpointResponse - client.config.pass_through_endpoint.delete(\*\*params) -> PassThroughEndpointResponse # Test -Types: - -```python -from hanzoai.types import TestPingResponse -``` - Methods: -- client.test.ping() -> object +- client.test.ping() -> object # Health -Types: - -```python -from hanzoai.types import ( - HealthCheckAllResponse, - HealthCheckLivelinessResponse, - HealthCheckLivenessResponse, - HealthCheckReadinessResponse, - HealthCheckServicesResponse, -) -``` - Methods: -- client.health.check_all(\*\*params) -> object -- client.health.check_liveliness() -> object -- client.health.check_liveness() -> object -- client.health.check_readiness() -> object -- client.health.check_services(\*\*params) -> object +- client.health.check_all(\*\*params) -> object +- client.health.check_liveliness() -> object +- client.health.check_liveness() -> object +- client.health.check_readiness() -> object +- client.health.check_services(\*\*params) -> object # Active -Types: - -```python -from hanzoai.types import ActiveListCallbacksResponse -``` - Methods: -- client.active.list_callbacks() -> object +- client.active.list_callbacks() -> object # Settings -Types: - -```python -from hanzoai.types import SettingRetrieveResponse -``` - Methods: -- client.settings.retrieve() -> object +- client.settings.retrieve() -> object # Key @@ -732,27 +393,23 @@ Types: from hanzoai.types import ( BlockKeyRequest, GenerateKeyResponse, - KeyUpdateResponse, KeyListResponse, - KeyDeleteResponse, KeyBlockResponse, KeyCheckHealthResponse, - KeyRetrieveInfoResponse, - KeyUnblockResponse, ) ``` Methods: -- client.key.update(\*\*params) -> object +- client.key.update(\*\*params) -> object - client.key.list(\*\*params) -> KeyListResponse -- client.key.delete(\*\*params) -> object +- client.key.delete(\*\*params) -> object - client.key.block(\*\*params) -> Optional[KeyBlockResponse] - client.key.check_health() -> KeyCheckHealthResponse - client.key.generate(\*\*params) -> GenerateKeyResponse - client.key.regenerate_by_key(path_key, \*\*params) -> Optional[GenerateKeyResponse] -- client.key.retrieve_info(\*\*params) -> object -- client.key.unblock(\*\*params) -> object +- client.key.retrieve_info(\*\*params) -> object +- client.key.unblock(\*\*params) -> object ## Regenerate @@ -767,22 +424,16 @@ from hanzoai.types.key import RegenerateKeyRequest Types: ```python -from hanzoai.types import ( - UserCreateResponse, - UserUpdateResponse, - UserListResponse, - UserDeleteResponse, - UserRetrieveInfoResponse, -) +from hanzoai.types import UserCreateResponse ``` Methods: - client.user.create(\*\*params) -> UserCreateResponse -- client.user.update(\*\*params) -> object -- client.user.list(\*\*params) -> object -- client.user.delete(\*\*params) -> object -- client.user.retrieve_info(\*\*params) -> object +- client.user.update(\*\*params) -> object +- client.user.list(\*\*params) -> object +- client.user.delete(\*\*params) -> object +- client.user.retrieve_info(\*\*params) -> object # Team @@ -793,16 +444,7 @@ from hanzoai.types import ( BlockTeamRequest, Member, TeamCreateResponse, - TeamUpdateResponse, - TeamListResponse, - TeamDeleteResponse, TeamAddMemberResponse, - TeamBlockResponse, - TeamDisableLoggingResponse, - TeamListAvailableResponse, - TeamRemoveMemberResponse, - TeamRetrieveInfoResponse, - TeamUnblockResponse, TeamUpdateMemberResponse, ) ``` @@ -810,43 +452,31 @@ from hanzoai.types import ( Methods: - client.team.create(\*\*params) -> TeamCreateResponse -- client.team.update(\*\*params) -> object -- client.team.list(\*\*params) -> object -- client.team.delete(\*\*params) -> object +- client.team.update(\*\*params) -> object +- client.team.list(\*\*params) -> object +- client.team.delete(\*\*params) -> object - client.team.add_member(\*\*params) -> TeamAddMemberResponse -- client.team.block(\*\*params) -> object -- client.team.disable_logging(team_id) -> object -- client.team.list_available(\*\*params) -> object -- client.team.remove_member(\*\*params) -> object -- client.team.retrieve_info(\*\*params) -> object -- client.team.unblock(\*\*params) -> object +- client.team.block(\*\*params) -> object +- client.team.disable_logging(team_id) -> object +- client.team.list_available(\*\*params) -> object +- client.team.remove_member(\*\*params) -> object +- client.team.retrieve_info(\*\*params) -> object +- client.team.unblock(\*\*params) -> object - client.team.update_member(\*\*params) -> TeamUpdateMemberResponse ## Model -Types: - -```python -from hanzoai.types.team import ModelAddResponse, ModelRemoveResponse -``` - Methods: -- client.team.model.add(\*\*params) -> object -- client.team.model.remove(\*\*params) -> object +- client.team.model.add(\*\*params) -> object +- client.team.model.remove(\*\*params) -> object ## Callback -Types: - -```python -from hanzoai.types.team import CallbackRetrieveResponse, CallbackAddResponse -``` - Methods: -- client.team.callback.retrieve(team_id) -> object -- client.team.callback.add(team_id, \*\*params) -> object +- client.team.callback.retrieve(team_id) -> object +- client.team.callback.add(team_id, \*\*params) -> object # Organization @@ -860,7 +490,6 @@ from hanzoai.types import ( OrganizationListResponse, OrganizationDeleteResponse, OrganizationAddMemberResponse, - OrganizationDeleteMemberResponse, OrganizationUpdateMemberResponse, ) ``` @@ -872,7 +501,7 @@ Methods: - client.organization.list() -> OrganizationListResponse - client.organization.delete(\*\*params) -> OrganizationDeleteResponse - client.organization.add_member(\*\*params) -> OrganizationAddMemberResponse -- client.organization.delete_member(\*\*params) -> object +- client.organization.delete_member(\*\*params) -> object - client.organization.update_member(\*\*params) -> OrganizationUpdateMemberResponse ## Info @@ -880,52 +509,43 @@ Methods: Types: ```python -from hanzoai.types.organization import InfoRetrieveResponse, InfoDeprecatedResponse +from hanzoai.types.organization import InfoRetrieveResponse ``` Methods: - client.organization.info.retrieve(\*\*params) -> InfoRetrieveResponse -- client.organization.info.deprecated(\*\*params) -> object +- client.organization.info.deprecated(\*\*params) -> object # Customer Types: ```python -from hanzoai.types import ( - BlockUsers, - CustomerCreateResponse, - CustomerUpdateResponse, - CustomerListResponse, - CustomerDeleteResponse, - CustomerBlockResponse, - CustomerRetrieveInfoResponse, - CustomerUnblockResponse, -) +from hanzoai.types import BlockUsers, CustomerListResponse, CustomerRetrieveInfoResponse ``` Methods: -- client.customer.create(\*\*params) -> object -- client.customer.update(\*\*params) -> object +- client.customer.create(\*\*params) -> object +- client.customer.update(\*\*params) -> object - client.customer.list() -> CustomerListResponse -- client.customer.delete(\*\*params) -> object -- client.customer.block(\*\*params) -> object +- client.customer.delete(\*\*params) -> object +- client.customer.block(\*\*params) -> object - client.customer.retrieve_info(\*\*params) -> CustomerRetrieveInfoResponse -- client.customer.unblock(\*\*params) -> object +- client.customer.unblock(\*\*params) -> object # Spend Types: ```python -from hanzoai.types import SpendCalculateSpendResponse, SpendListLogsResponse, SpendListTagsResponse +from hanzoai.types import SpendListLogsResponse, SpendListTagsResponse ``` Methods: -- client.spend.calculate_spend(\*\*params) -> object +- client.spend.calculate_spend(\*\*params) -> object - client.spend.list_logs(\*\*params) -> SpendListLogsResponse - client.spend.list_tags(\*\*params) -> SpendListTagsResponse @@ -936,17 +556,13 @@ Methods: Types: ```python -from hanzoai.types.global_ import ( - SpendListTagsResponse, - SpendResetResponse, - SpendRetrieveReportResponse, -) +from hanzoai.types.global_ import SpendListTagsResponse, SpendRetrieveReportResponse ``` Methods: - client.global*.spend.list*tags(\*\*params) -> SpendListTagsResponse -- client.global*.spend.reset() -> object +- client.global*.spend.reset() -> object - client.global*.spend.retrieve*report(\*\*params) -> SpendRetrieveReportResponse # Provider @@ -966,26 +582,20 @@ Methods: Types: ```python -from hanzoai.types import CacheDeleteResponse, CacheFlushAllResponse, CachePingResponse +from hanzoai.types import CachePingResponse ``` Methods: -- client.cache.delete() -> object -- client.cache.flush_all() -> object +- client.cache.delete() -> object +- client.cache.flush_all() -> object - client.cache.ping() -> CachePingResponse ## Redis -Types: - -```python -from hanzoai.types.cache import RediRetrieveInfoResponse -``` - Methods: -- client.cache.redis.retrieve_info() -> object +- client.cache.redis.retrieve_info() -> object # Guardrails @@ -1004,78 +614,47 @@ Methods: Types: ```python -from hanzoai.types import IPAddress, AddAddAllowedIPResponse +from hanzoai.types import IPAddress ``` Methods: -- client.add.add_allowed_ip(\*\*params) -> object +- client.add.add_allowed_ip(\*\*params) -> object # Delete -Types: - -```python -from hanzoai.types import DeleteCreateAllowedIPResponse -``` - Methods: -- client.delete.create_allowed_ip(\*\*params) -> object +- client.delete.create_allowed_ip(\*\*params) -> object # Files -Types: - -```python -from hanzoai.types import ( - FileCreateResponse, - FileRetrieveResponse, - FileListResponse, - FileDeleteResponse, -) -``` - Methods: -- client.files.create(provider, \*\*params) -> object -- client.files.retrieve(file_id, \*, provider) -> object -- client.files.list(provider, \*\*params) -> object -- client.files.delete(file_id, \*, provider) -> object +- client.files.create(provider, \*\*params) -> object +- client.files.retrieve(file_id, \*, provider) -> object +- client.files.list(provider, \*\*params) -> object +- client.files.delete(file_id, \*, provider) -> object ## Content -Types: - -```python -from hanzoai.types.files import ContentRetrieveResponse -``` - Methods: -- client.files.content.retrieve(file_id, \*, provider) -> object +- client.files.content.retrieve(file_id, \*, provider) -> object # Budget Types: ```python -from hanzoai.types import ( - BudgetNew, - BudgetCreateResponse, - BudgetUpdateResponse, - BudgetListResponse, - BudgetDeleteResponse, - BudgetInfoResponse, - BudgetSettingsResponse, -) +from hanzoai.types import BudgetNew ``` Methods: -- client.budget.create(\*\*params) -> object -- client.budget.update(\*\*params) -> object -- client.budget.list() -> object -- client.budget.delete(\*\*params) -> object -- client.budget.info(\*\*params) -> object -- client.budget.settings(\*\*params) -> object +- client.budget.create(\*\*params) -> object +- client.budget.update(\*\*params) -> object +- client.budget.list() -> object +- client.budget.delete(\*\*params) -> object +- client.budget.info(\*\*params) -> object +- client.budget.settings(\*\*params) -> object From 00fb01e3fec2b8c4e70158ed6bdb796acc0d33bb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 02:31:42 +0000 Subject: [PATCH 28/41] chore(docs): remove reference to rye shell --- CONTRIBUTING.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index adb9170b..cd6e86ca 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,8 +17,7 @@ $ rye sync --all-features You can then run scripts using `rye run python script.py` or by activating the virtual environment: ```sh -$ rye shell -# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work +# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work $ source .venv/bin/activate # now you can omit the `rye run` prefix From 389eb26846c6920186f1751e6dba087d9b09ab0f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 02:44:10 +0000 Subject: [PATCH 29/41] chore(docs): remove unnecessary param examples --- README.md | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/README.md b/README.md index 596dc8f2..c3cf8729 100644 --- a/README.md +++ b/README.md @@ -83,39 +83,7 @@ from hanzoai import Hanzo client = Hanzo() model = client.model.create( - llm_params={ - "model": "model", - "api_base": "api_base", - "api_key": "api_key", - "api_version": "api_version", - "aws_access_key_id": "aws_access_key_id", - "aws_region_name": "aws_region_name", - "aws_secret_access_key": "aws_secret_access_key", - "budget_duration": "budget_duration", - "configurable_clientside_auth_params": ["string"], - "custom_llm_provider": "custom_llm_provider", - "input_cost_per_second": 0, - "input_cost_per_token": 0, - "llm_trace_id": "llm_trace_id", - "max_budget": 0, - "max_file_size_mb": 0, - "max_retries": 0, - "merge_reasoning_content_in_choices": True, - "model_info": {}, - "organization": "organization", - "output_cost_per_second": 0, - "output_cost_per_token": 0, - "region_name": "region_name", - "rpm": 0, - "stream_timeout": 0, - "timeout": 0, - "tpm": 0, - "use_in_pass_through": True, - "vertex_credentials": "string", - "vertex_location": "vertex_location", - "vertex_project": "vertex_project", - "watsonx_region_name": "watsonx_region_name", - }, + llm_params={"model": "model"}, model_info={"id": "id"}, model_name="model_name", ) From 043f9013103047d31680d29ada3dff35e3bf3f64 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 03:47:14 +0000 Subject: [PATCH 30/41] feat(client): add follow_redirects request option --- src/hanzoai/_base_client.py | 6 +++++ src/hanzoai/_models.py | 2 ++ src/hanzoai/_types.py | 2 ++ tests/test_client.py | 54 +++++++++++++++++++++++++++++++++++++ 4 files changed, 64 insertions(+) diff --git a/src/hanzoai/_base_client.py b/src/hanzoai/_base_client.py index 07bb5d6c..fd245bfb 100644 --- a/src/hanzoai/_base_client.py +++ b/src/hanzoai/_base_client.py @@ -960,6 +960,9 @@ def request( if self.custom_auth is not None: kwargs["auth"] = self.custom_auth + if options.follow_redirects is not None: + kwargs["follow_redirects"] = options.follow_redirects + log.debug("Sending HTTP Request: %s %s", request.method, request.url) response = None @@ -1460,6 +1463,9 @@ async def request( if self.custom_auth is not None: kwargs["auth"] = self.custom_auth + if options.follow_redirects is not None: + kwargs["follow_redirects"] = options.follow_redirects + log.debug("Sending HTTP Request: %s %s", request.method, request.url) response = None diff --git a/src/hanzoai/_models.py b/src/hanzoai/_models.py index 798956f1..4f214980 100644 --- a/src/hanzoai/_models.py +++ b/src/hanzoai/_models.py @@ -737,6 +737,7 @@ class FinalRequestOptionsInput(TypedDict, total=False): idempotency_key: str json_data: Body extra_json: AnyMapping + follow_redirects: bool @final @@ -750,6 +751,7 @@ class FinalRequestOptions(pydantic.BaseModel): files: Union[HttpxRequestFiles, None] = None idempotency_key: Union[str, None] = None post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven() + follow_redirects: Union[bool, None] = None # It should be noted that we cannot use `json` here as that would override # a BaseModel method in an incompatible fashion. diff --git a/src/hanzoai/_types.py b/src/hanzoai/_types.py index 69535385..198ceb18 100644 --- a/src/hanzoai/_types.py +++ b/src/hanzoai/_types.py @@ -100,6 +100,7 @@ class RequestOptions(TypedDict, total=False): params: Query extra_json: AnyMapping idempotency_key: str + follow_redirects: bool # Sentinel class used until PEP 0661 is accepted @@ -215,3 +216,4 @@ class _GenericAlias(Protocol): class HttpxSendArgs(TypedDict, total=False): auth: httpx.Auth + follow_redirects: bool diff --git a/tests/test_client.py b/tests/test_client.py index 799a8d52..845279a8 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -810,6 +810,33 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: assert response.http_request.headers.get("x-stainless-retry-count") == "42" + @pytest.mark.respx(base_url=base_url) + def test_follow_redirects(self, respx_mock: MockRouter) -> None: + # Test that the default follow_redirects=True allows following redirects + respx_mock.post("/redirect").mock( + return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) + ) + respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"})) + + response = self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) + assert response.status_code == 200 + assert response.json() == {"status": "ok"} + + @pytest.mark.respx(base_url=base_url) + def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None: + # Test that follow_redirects=False prevents following redirects + respx_mock.post("/redirect").mock( + return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) + ) + + with pytest.raises(APIStatusError) as exc_info: + self.client.post( + "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response + ) + + assert exc_info.value.response.status_code == 302 + assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected" + class TestAsyncHanzo: client = AsyncHanzo(base_url=base_url, api_key=api_key, _strict_response_validation=True) @@ -1631,3 +1658,30 @@ async def test_main() -> None: raise AssertionError("calling get_platform using asyncify resulted in a hung process") time.sleep(0.1) + + @pytest.mark.respx(base_url=base_url) + async def test_follow_redirects(self, respx_mock: MockRouter) -> None: + # Test that the default follow_redirects=True allows following redirects + respx_mock.post("/redirect").mock( + return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) + ) + respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"})) + + response = await self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) + assert response.status_code == 200 + assert response.json() == {"status": "ok"} + + @pytest.mark.respx(base_url=base_url) + async def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None: + # Test that follow_redirects=False prevents following redirects + respx_mock.post("/redirect").mock( + return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) + ) + + with pytest.raises(APIStatusError) as exc_info: + await self.client.post( + "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response + ) + + assert exc_info.value.response.status_code == 302 + assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected" From 63610f15db91dbad94e87e51ebbea6ac8c85b278 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 17 Jul 2025 11:30:20 +0000 Subject: [PATCH 31/41] feat(api): api update --- .github/workflows/ci.yml | 26 ++++++- .stats.yml | 4 +- README.md | 35 ++++++++- bin/check-release-environment | 2 +- pyproject.toml | 6 +- requirements-dev.lock | 35 ++++++++- requirements.lock | 31 +++++++- scripts/utils/upload-artifact.sh | 12 ++-- src/hanzoai/__init__.py | 3 +- src/hanzoai/_base_client.py | 51 +++++++++++-- src/hanzoai/_models.py | 13 ++-- tests/api_resources/audio/test_speech.py | 4 +- .../audio/test_transcriptions.py | 4 +- tests/api_resources/batches/test_cancel.py | 4 +- tests/api_resources/cache/test_redis.py | 4 +- tests/api_resources/chat/test_completions.py | 4 +- .../config/test_pass_through_endpoint.py | 4 +- tests/api_resources/engines/test_chat.py | 4 +- tests/api_resources/files/test_content.py | 4 +- .../fine_tuning/jobs/test_cancel.py | 4 +- tests/api_resources/fine_tuning/test_jobs.py | 4 +- tests/api_resources/global_/test_spend.py | 4 +- .../api_resources/images/test_generations.py | 4 +- tests/api_resources/model/test_info.py | 4 +- tests/api_resources/model/test_update.py | 4 +- .../openai/deployments/test_chat.py | 4 +- .../api_resources/openai/test_deployments.py | 4 +- tests/api_resources/organization/test_info.py | 4 +- .../responses/test_input_items.py | 4 +- tests/api_resources/team/test_callback.py | 4 +- tests/api_resources/team/test_model.py | 4 +- tests/api_resources/test_active.py | 4 +- tests/api_resources/test_add.py | 4 +- tests/api_resources/test_anthropic.py | 4 +- tests/api_resources/test_assemblyai.py | 4 +- tests/api_resources/test_assistants.py | 4 +- tests/api_resources/test_azure.py | 4 +- tests/api_resources/test_batches.py | 4 +- tests/api_resources/test_bedrock.py | 4 +- tests/api_resources/test_budget.py | 4 +- tests/api_resources/test_cache.py | 4 +- tests/api_resources/test_client.py | 4 +- tests/api_resources/test_cohere.py | 4 +- tests/api_resources/test_completions.py | 4 +- tests/api_resources/test_credentials.py | 4 +- tests/api_resources/test_customer.py | 4 +- tests/api_resources/test_delete.py | 4 +- tests/api_resources/test_embeddings.py | 4 +- tests/api_resources/test_engines.py | 4 +- tests/api_resources/test_eu_assemblyai.py | 4 +- tests/api_resources/test_files.py | 4 +- tests/api_resources/test_gemini.py | 4 +- tests/api_resources/test_guardrails.py | 4 +- tests/api_resources/test_health.py | 4 +- tests/api_resources/test_key.py | 4 +- tests/api_resources/test_langfuse.py | 4 +- tests/api_resources/test_model.py | 4 +- tests/api_resources/test_model_group.py | 4 +- tests/api_resources/test_models.py | 4 +- tests/api_resources/test_moderations.py | 4 +- tests/api_resources/test_openai.py | 4 +- tests/api_resources/test_organization.py | 4 +- tests/api_resources/test_provider.py | 4 +- tests/api_resources/test_rerank.py | 4 +- tests/api_resources/test_responses.py | 4 +- tests/api_resources/test_routes.py | 4 +- tests/api_resources/test_settings.py | 4 +- tests/api_resources/test_spend.py | 4 +- tests/api_resources/test_team.py | 4 +- tests/api_resources/test_test.py | 4 +- tests/api_resources/test_threads.py | 4 +- tests/api_resources/test_user.py | 4 +- tests/api_resources/test_utils.py | 4 +- tests/api_resources/test_vertex_ai.py | 4 +- tests/api_resources/threads/test_messages.py | 4 +- tests/api_resources/threads/test_runs.py | 4 +- tests/conftest.py | 45 ++++++++++-- tests/test_client.py | 71 +++++++++++++++---- tests/test_models.py | 45 ++++++++++++ 79 files changed, 527 insertions(+), 112 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94874a05..0bee5857 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,12 +7,17 @@ on: - 'integrated/**' - 'stl-preview-head/**' - 'stl-preview-base/**' + pull_request: + branches-ignore: + - 'stl-preview-head/**' + - 'stl-preview-base/**' jobs: lint: timeout-minutes: 10 name: lint runs-on: ${{ github.repository == 'stainless-sdks/hanzo-ai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 @@ -30,10 +35,10 @@ jobs: - name: Run lints run: ./scripts/lint - upload: - if: github.repository == 'stainless-sdks/hanzo-ai-python' + build: + if: github.repository == 'stainless-sdks/hanzo-ai-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) timeout-minutes: 10 - name: upload + name: build permissions: contents: read id-token: write @@ -41,6 +46,20 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Install Rye + run: | + curl -sSf https://rye.astral.sh/get | bash + echo "$HOME/.rye/shims" >> $GITHUB_PATH + env: + RYE_VERSION: '0.44.0' + RYE_INSTALL_OPTION: '--yes' + + - name: Install dependencies + run: rye sync --all-features + + - name: Run build + run: rye build + - name: Get GitHub OIDC Token id: github-oidc uses: actions/github-script@v6 @@ -58,6 +77,7 @@ jobs: timeout-minutes: 10 name: test runs-on: ${{ github.repository == 'stainless-sdks/hanzo-ai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 diff --git a/.stats.yml b/.stats.yml index bb9fef09..affe3eef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 188 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hanzo-industries-inc%2Fhanzo-ai-ec4be99f95dc46e9442eb60f233b2bff271d6f5bf57d7c61a52bc4804f55bbd1.yml -openapi_spec_hash: 87bc62c36bb6028ffd1f3e54a2809099 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hanzo-industries-inc%2Fhanzo-ai-2d6e1036fb1eea7e95cafc281141ead9ef77796e43711b17edccaab67c5e791a.yml +openapi_spec_hash: 12501774d0127be4ec1812d613a58e97 config_hash: 830747463ff4d018b5633ce511e88558 diff --git a/README.md b/README.md index c3cf8729..2fc8c957 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Hanzo Python API library -[![PyPI version](https://img.shields.io/pypi/v/hanzoai.svg)](https://pypi.org/project/hanzoai/) + +[![PyPI version](https://img.shields.io/pypi/v/hanzoai.svg?label=pypi%20(stable))](https://pypi.org/project/hanzoai/) The Hanzo Python library provides convenient access to the Hanzo REST API from any Python 3.8+ application. The library includes type definitions for all request params and response fields, @@ -64,6 +65,36 @@ asyncio.run(main()) Functionality between the synchronous and asynchronous clients is otherwise identical. +### With aiohttp + +By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend. + +You can enable this by installing `aiohttp`: + +```sh +# install from PyPI +pip install hanzoai[aiohttp] +``` + +Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: + +```python +import asyncio +from hanzoai import DefaultAioHttpClient +from hanzoai import AsyncHanzo + + +async def main() -> None: + async with AsyncHanzo( + api_key="My API Key", + http_client=DefaultAioHttpClient(), + ) as client: + response = await client.get_home() + + +asyncio.run(main()) +``` + ## Using types Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like: @@ -172,7 +203,7 @@ client.with_options(max_retries=5).get_home() ### Timeouts By default requests time out after 1 minute. You can configure this with a `timeout` option, -which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object: +which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object: ```python from hanzoai import Hanzo diff --git a/bin/check-release-environment b/bin/check-release-environment index d6f7bbb1..b845b0f4 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -3,7 +3,7 @@ errors=() if [ -z "${PYPI_TOKEN}" ]; then - errors+=("The HANZO_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") + errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") fi lenErrors=${#errors[@]} diff --git a/pyproject.toml b/pyproject.toml index 2f608860..5dca4324 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Operating System :: OS Independent", "Operating System :: POSIX", "Operating System :: MacOS", @@ -37,6 +38,8 @@ classifiers = [ Homepage = "https://github.com/hanzoai/python-sdk" Repository = "https://github.com/hanzoai/python-sdk" +[project.optional-dependencies] +aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"] [tool.rye] managed = true @@ -54,6 +57,7 @@ dev-dependencies = [ "importlib-metadata>=6.7.0", "rich>=13.7.1", "nest_asyncio==1.6.0", + "pytest-xdist>=3.6.1", ] [tool.rye.scripts] @@ -125,7 +129,7 @@ replacement = '[\1](https://github.com/hanzoai/python-sdk/tree/main/\g<2>)' [tool.pytest.ini_options] testpaths = ["tests"] -addopts = "--tb=short" +addopts = "--tb=short -n auto" xfail_strict = true asyncio_mode = "auto" asyncio_default_fixture_loop_scope = "session" diff --git a/requirements-dev.lock b/requirements-dev.lock index 628747d3..1c3bc30d 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -10,6 +10,13 @@ # universal: false -e file:. +aiohappyeyeballs==2.6.1 + # via aiohttp +aiohttp==3.12.8 + # via hanzoai + # via httpx-aiohttp +aiosignal==1.3.2 + # via aiohttp annotated-types==0.6.0 # via pydantic anyio==4.4.0 @@ -17,6 +24,10 @@ anyio==4.4.0 # via httpx argcomplete==3.1.2 # via nox +async-timeout==5.0.1 + # via aiohttp +attrs==25.3.0 + # via aiohttp certifi==2023.7.22 # via httpcore # via httpx @@ -30,18 +41,27 @@ distro==1.8.0 exceptiongroup==1.2.2 # via anyio # via pytest +execnet==2.1.1 + # via pytest-xdist filelock==3.12.4 # via virtualenv -h11==0.14.0 +frozenlist==1.6.2 + # via aiohttp + # via aiosignal +h11==0.16.0 # via httpcore -httpcore==1.0.2 +httpcore==1.0.9 # via httpx httpx==0.28.1 # via hanzoai + # via httpx-aiohttp # via respx +httpx-aiohttp==0.1.8 + # via hanzoai idna==3.4 # via anyio # via httpx + # via yarl importlib-metadata==7.0.0 iniconfig==2.0.0 # via pytest @@ -49,6 +69,9 @@ markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py +multidict==6.4.4 + # via aiohttp + # via yarl mypy==1.14.1 mypy-extensions==1.0.0 # via mypy @@ -63,6 +86,9 @@ platformdirs==3.11.0 # via virtualenv pluggy==1.5.0 # via pytest +propcache==0.3.1 + # via aiohttp + # via yarl pydantic==2.10.3 # via hanzoai pydantic-core==2.27.1 @@ -72,7 +98,9 @@ pygments==2.18.0 pyright==1.1.399 pytest==8.3.3 # via pytest-asyncio + # via pytest-xdist pytest-asyncio==0.24.0 +pytest-xdist==3.7.0 python-dateutil==2.8.2 # via time-machine pytz==2023.3.post1 @@ -94,11 +122,14 @@ tomli==2.0.2 typing-extensions==4.12.2 # via anyio # via hanzoai + # via multidict # via mypy # via pydantic # via pydantic-core # via pyright virtualenv==20.24.5 # via nox +yarl==1.20.0 + # via aiohttp zipp==3.17.0 # via importlib-metadata diff --git a/requirements.lock b/requirements.lock index f594f9bc..17b05d07 100644 --- a/requirements.lock +++ b/requirements.lock @@ -10,11 +10,22 @@ # universal: false -e file:. +aiohappyeyeballs==2.6.1 + # via aiohttp +aiohttp==3.12.8 + # via hanzoai + # via httpx-aiohttp +aiosignal==1.3.2 + # via aiohttp annotated-types==0.6.0 # via pydantic anyio==4.4.0 # via hanzoai # via httpx +async-timeout==5.0.1 + # via aiohttp +attrs==25.3.0 + # via aiohttp certifi==2023.7.22 # via httpcore # via httpx @@ -22,15 +33,28 @@ distro==1.8.0 # via hanzoai exceptiongroup==1.2.2 # via anyio -h11==0.14.0 +frozenlist==1.6.2 + # via aiohttp + # via aiosignal +h11==0.16.0 # via httpcore -httpcore==1.0.2 +httpcore==1.0.9 # via httpx httpx==0.28.1 # via hanzoai + # via httpx-aiohttp +httpx-aiohttp==0.1.8 + # via hanzoai idna==3.4 # via anyio # via httpx + # via yarl +multidict==6.4.4 + # via aiohttp + # via yarl +propcache==0.3.1 + # via aiohttp + # via yarl pydantic==2.10.3 # via hanzoai pydantic-core==2.27.1 @@ -41,5 +65,8 @@ sniffio==1.3.0 typing-extensions==4.12.2 # via anyio # via hanzoai + # via multidict # via pydantic # via pydantic-core +yarl==1.20.0 + # via aiohttp diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh index 939759ad..cb7ad79c 100755 --- a/scripts/utils/upload-artifact.sh +++ b/scripts/utils/upload-artifact.sh @@ -1,7 +1,9 @@ #!/usr/bin/env bash set -exuo pipefail -RESPONSE=$(curl -X POST "$URL" \ +FILENAME=$(basename dist/*.whl) + +RESPONSE=$(curl -X POST "$URL?filename=$FILENAME" \ -H "Authorization: Bearer $AUTH" \ -H "Content-Type: application/json") @@ -12,13 +14,13 @@ if [[ "$SIGNED_URL" == "null" ]]; then exit 1 fi -UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \ - -H "Content-Type: application/gzip" \ - --data-binary @- "$SIGNED_URL" 2>&1) +UPLOAD_RESPONSE=$(curl -v -X PUT \ + -H "Content-Type: binary/octet-stream" \ + --data-binary "@dist/$FILENAME" "$SIGNED_URL" 2>&1) if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then echo -e "\033[32mUploaded build to Stainless storage.\033[0m" - echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/hanzo-ai-python/$SHA'\033[0m" + echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/hanzo-ai-python/$SHA/$FILENAME'\033[0m" else echo -e "\033[31mFailed to upload artifact.\033[0m" exit 1 diff --git a/src/hanzoai/__init__.py b/src/hanzoai/__init__.py index 438e5799..bed50af4 100644 --- a/src/hanzoai/__init__.py +++ b/src/hanzoai/__init__.py @@ -37,7 +37,7 @@ UnprocessableEntityError, APIResponseValidationError, ) -from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient +from ._base_client import DefaultHttpxClient, DefaultAioHttpClient, DefaultAsyncHttpxClient from ._utils._logs import setup_logging as _setup_logging __all__ = [ @@ -80,6 +80,7 @@ "DEFAULT_CONNECTION_LIMITS", "DefaultHttpxClient", "DefaultAsyncHttpxClient", + "DefaultAioHttpClient", ] if not _t.TYPE_CHECKING: diff --git a/src/hanzoai/_base_client.py b/src/hanzoai/_base_client.py index fd245bfb..5c54f69c 100644 --- a/src/hanzoai/_base_client.py +++ b/src/hanzoai/_base_client.py @@ -529,6 +529,15 @@ def _build_request( # work around https://github.com/encode/httpx/discussions/2880 kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")} + is_body_allowed = options.method.lower() != "get" + + if is_body_allowed: + kwargs["json"] = json_data if is_given(json_data) else None + kwargs["files"] = files + else: + headers.pop("Content-Type", None) + kwargs.pop("data", None) + # TODO: report this error to httpx return self._client.build_request( # pyright: ignore[reportUnknownMemberType] headers=headers, @@ -540,8 +549,6 @@ def _build_request( # so that passing a `TypedDict` doesn't cause an error. # https://github.com/microsoft/pyright/issues/3526#event-6715453066 params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None, - json=json_data if is_given(json_data) else None, - files=files, **kwargs, ) @@ -1071,7 +1078,14 @@ def _process_response( ) -> ResponseT: origin = get_origin(cast_to) or cast_to - if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse): + if ( + inspect.isclass(origin) + and issubclass(origin, BaseAPIResponse) + # we only want to actually return the custom BaseAPIResponse class if we're + # returning the raw response, or if we're not streaming SSE, as if we're streaming + # SSE then `cast_to` doesn't actively reflect the type we need to parse into + and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER))) + ): if not issubclass(origin, APIResponse): raise TypeError(f"API Response types must subclass {APIResponse}; Received {origin}") @@ -1282,6 +1296,24 @@ def __init__(self, **kwargs: Any) -> None: super().__init__(**kwargs) +try: + import httpx_aiohttp +except ImportError: + + class _DefaultAioHttpClient(httpx.AsyncClient): + def __init__(self, **_kwargs: Any) -> None: + raise RuntimeError("To use the aiohttp client you must have installed the package with the `aiohttp` extra") +else: + + class _DefaultAioHttpClient(httpx_aiohttp.HttpxAiohttpClient): # type: ignore + def __init__(self, **kwargs: Any) -> None: + kwargs.setdefault("timeout", DEFAULT_TIMEOUT) + kwargs.setdefault("limits", DEFAULT_CONNECTION_LIMITS) + kwargs.setdefault("follow_redirects", True) + + super().__init__(**kwargs) + + if TYPE_CHECKING: DefaultAsyncHttpxClient = httpx.AsyncClient """An alias to `httpx.AsyncClient` that provides the same defaults that this SDK @@ -1290,8 +1322,12 @@ def __init__(self, **kwargs: Any) -> None: This is useful because overriding the `http_client` with your own instance of `httpx.AsyncClient` will result in httpx's defaults being used, not ours. """ + + DefaultAioHttpClient = httpx.AsyncClient + """An alias to `httpx.AsyncClient` that changes the default HTTP transport to `aiohttp`.""" else: DefaultAsyncHttpxClient = _DefaultAsyncHttpxClient + DefaultAioHttpClient = _DefaultAioHttpClient class AsyncHttpxClientWrapper(DefaultAsyncHttpxClient): @@ -1574,7 +1610,14 @@ async def _process_response( ) -> ResponseT: origin = get_origin(cast_to) or cast_to - if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse): + if ( + inspect.isclass(origin) + and issubclass(origin, BaseAPIResponse) + # we only want to actually return the custom BaseAPIResponse class if we're + # returning the raw response, or if we're not streaming SSE, as if we're streaming + # SSE then `cast_to` doesn't actively reflect the type we need to parse into + and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER))) + ): if not issubclass(origin, AsyncAPIResponse): raise TypeError(f"API Response types must subclass {AsyncAPIResponse}; Received {origin}") diff --git a/src/hanzoai/_models.py b/src/hanzoai/_models.py index 4f214980..528d5680 100644 --- a/src/hanzoai/_models.py +++ b/src/hanzoai/_models.py @@ -2,9 +2,10 @@ import os import inspect -from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, cast +from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast from datetime import date, datetime from typing_extensions import ( + List, Unpack, Literal, ClassVar, @@ -366,7 +367,7 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object: if type_ is None: raise RuntimeError(f"Unexpected field type is None for {key}") - return construct_type(value=value, type_=type_) + return construct_type(value=value, type_=type_, metadata=getattr(field, "metadata", None)) def is_basemodel(type_: type) -> bool: @@ -420,7 +421,7 @@ def construct_type_unchecked(*, value: object, type_: type[_T]) -> _T: return cast(_T, construct_type(value=value, type_=type_)) -def construct_type(*, value: object, type_: object) -> object: +def construct_type(*, value: object, type_: object, metadata: Optional[List[Any]] = None) -> object: """Loose coercion to the expected type with construction of nested values. If the given value does not match the expected type then it is returned as-is. @@ -438,8 +439,10 @@ def construct_type(*, value: object, type_: object) -> object: type_ = type_.__value__ # type: ignore[unreachable] # unwrap `Annotated[T, ...]` -> `T` - if is_annotated_type(type_): - meta: tuple[Any, ...] = get_args(type_)[1:] + if metadata is not None: + meta: tuple[Any, ...] = tuple(metadata) + elif is_annotated_type(type_): + meta = get_args(type_)[1:] type_ = extract_type_arg(type_, 0) else: meta = tuple() diff --git a/tests/api_resources/audio/test_speech.py b/tests/api_resources/audio/test_speech.py index 08a2a104..f9e29adb 100644 --- a/tests/api_resources/audio/test_speech.py +++ b/tests/api_resources/audio/test_speech.py @@ -46,7 +46,9 @@ def test_streaming_response_create(self, client: Hanzo) -> None: class TestAsyncSpeech: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/audio/test_transcriptions.py b/tests/api_resources/audio/test_transcriptions.py index 8dcf0041..f7ad9434 100644 --- a/tests/api_resources/audio/test_transcriptions.py +++ b/tests/api_resources/audio/test_transcriptions.py @@ -52,7 +52,9 @@ def test_streaming_response_create(self, client: Hanzo) -> None: class TestAsyncTranscriptions: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/batches/test_cancel.py b/tests/api_resources/batches/test_cancel.py index 03646852..875c43a5 100644 --- a/tests/api_resources/batches/test_cancel.py +++ b/tests/api_resources/batches/test_cancel.py @@ -69,7 +69,9 @@ def test_path_params_cancel(self, client: Hanzo) -> None: class TestAsyncCancel: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/cache/test_redis.py b/tests/api_resources/cache/test_redis.py index 8f570c71..b7c10ebd 100644 --- a/tests/api_resources/cache/test_redis.py +++ b/tests/api_resources/cache/test_redis.py @@ -46,7 +46,9 @@ def test_streaming_response_retrieve_info(self, client: Hanzo) -> None: class TestAsyncRedis: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/chat/test_completions.py b/tests/api_resources/chat/test_completions.py index c4d73194..b5999500 100644 --- a/tests/api_resources/chat/test_completions.py +++ b/tests/api_resources/chat/test_completions.py @@ -54,7 +54,9 @@ def test_streaming_response_create(self, client: Hanzo) -> None: class TestAsyncCompletions: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/config/test_pass_through_endpoint.py b/tests/api_resources/config/test_pass_through_endpoint.py index 28a5d12b..3aed89f3 100644 --- a/tests/api_resources/config/test_pass_through_endpoint.py +++ b/tests/api_resources/config/test_pass_through_endpoint.py @@ -173,7 +173,9 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: class TestAsyncPassThroughEndpoint: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/engines/test_chat.py b/tests/api_resources/engines/test_chat.py index 883fa68c..47e9ebd5 100644 --- a/tests/api_resources/engines/test_chat.py +++ b/tests/api_resources/engines/test_chat.py @@ -60,7 +60,9 @@ def test_path_params_complete(self, client: Hanzo) -> None: class TestAsyncChat: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/files/test_content.py b/tests/api_resources/files/test_content.py index e762112f..9e32ae79 100644 --- a/tests/api_resources/files/test_content.py +++ b/tests/api_resources/files/test_content.py @@ -70,7 +70,9 @@ def test_path_params_retrieve(self, client: Hanzo) -> None: class TestAsyncContent: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/fine_tuning/jobs/test_cancel.py b/tests/api_resources/fine_tuning/jobs/test_cancel.py index c5c9a156..0c61a8da 100644 --- a/tests/api_resources/fine_tuning/jobs/test_cancel.py +++ b/tests/api_resources/fine_tuning/jobs/test_cancel.py @@ -60,7 +60,9 @@ def test_path_params_create(self, client: Hanzo) -> None: class TestAsyncCancel: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/fine_tuning/test_jobs.py b/tests/api_resources/fine_tuning/test_jobs.py index 35b453f9..85eba109 100644 --- a/tests/api_resources/fine_tuning/test_jobs.py +++ b/tests/api_resources/fine_tuning/test_jobs.py @@ -167,7 +167,9 @@ def test_streaming_response_list(self, client: Hanzo) -> None: class TestAsyncJobs: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/global_/test_spend.py b/tests/api_resources/global_/test_spend.py index 9cc159b1..7776601a 100644 --- a/tests/api_resources/global_/test_spend.py +++ b/tests/api_resources/global_/test_spend.py @@ -130,7 +130,9 @@ def test_streaming_response_retrieve_report(self, client: Hanzo) -> None: class TestAsyncSpend: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/images/test_generations.py b/tests/api_resources/images/test_generations.py index 0c2f8e83..fa6a2c18 100644 --- a/tests/api_resources/images/test_generations.py +++ b/tests/api_resources/images/test_generations.py @@ -46,7 +46,9 @@ def test_streaming_response_create(self, client: Hanzo) -> None: class TestAsyncGenerations: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/model/test_info.py b/tests/api_resources/model/test_info.py index d53b168e..8ddb02cf 100644 --- a/tests/api_resources/model/test_info.py +++ b/tests/api_resources/model/test_info.py @@ -54,7 +54,9 @@ def test_streaming_response_list(self, client: Hanzo) -> None: class TestAsyncInfo: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/model/test_update.py b/tests/api_resources/model/test_update.py index cb2b6462..fc31bcc0 100644 --- a/tests/api_resources/model/test_update.py +++ b/tests/api_resources/model/test_update.py @@ -196,7 +196,9 @@ def test_path_params_partial(self, client: Hanzo) -> None: class TestAsyncUpdate: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/openai/deployments/test_chat.py b/tests/api_resources/openai/deployments/test_chat.py index eb2bae81..1a81cc7f 100644 --- a/tests/api_resources/openai/deployments/test_chat.py +++ b/tests/api_resources/openai/deployments/test_chat.py @@ -60,7 +60,9 @@ def test_path_params_complete(self, client: Hanzo) -> None: class TestAsyncChat: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/openai/test_deployments.py b/tests/api_resources/openai/test_deployments.py index d0e481ea..3e28d91a 100644 --- a/tests/api_resources/openai/test_deployments.py +++ b/tests/api_resources/openai/test_deployments.py @@ -102,7 +102,9 @@ def test_path_params_embed(self, client: Hanzo) -> None: class TestAsyncDeployments: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/organization/test_info.py b/tests/api_resources/organization/test_info.py index 8dc5aae0..ecac913d 100644 --- a/tests/api_resources/organization/test_info.py +++ b/tests/api_resources/organization/test_info.py @@ -87,7 +87,9 @@ def test_streaming_response_deprecated(self, client: Hanzo) -> None: class TestAsyncInfo: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/responses/test_input_items.py b/tests/api_resources/responses/test_input_items.py index c1f2e801..fca2a4cc 100644 --- a/tests/api_resources/responses/test_input_items.py +++ b/tests/api_resources/responses/test_input_items.py @@ -60,7 +60,9 @@ def test_path_params_list(self, client: Hanzo) -> None: class TestAsyncInputItems: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/team/test_callback.py b/tests/api_resources/team/test_callback.py index 7b617970..e3779a61 100644 --- a/tests/api_resources/team/test_callback.py +++ b/tests/api_resources/team/test_callback.py @@ -122,7 +122,9 @@ def test_path_params_add(self, client: Hanzo) -> None: class TestAsyncCallback: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/team/test_model.py b/tests/api_resources/team/test_model.py index 0f99b143..021be6a5 100644 --- a/tests/api_resources/team/test_model.py +++ b/tests/api_resources/team/test_model.py @@ -92,7 +92,9 @@ def test_streaming_response_remove(self, client: Hanzo) -> None: class TestAsyncModel: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_active.py b/tests/api_resources/test_active.py index b285973d..c2b929ee 100644 --- a/tests/api_resources/test_active.py +++ b/tests/api_resources/test_active.py @@ -46,7 +46,9 @@ def test_streaming_response_list_callbacks(self, client: Hanzo) -> None: class TestAsyncActive: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_add.py b/tests/api_resources/test_add.py index 8bb8ef6c..89ec0132 100644 --- a/tests/api_resources/test_add.py +++ b/tests/api_resources/test_add.py @@ -52,7 +52,9 @@ def test_streaming_response_add_allowed_ip(self, client: Hanzo) -> None: class TestAsyncAdd: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_anthropic.py b/tests/api_resources/test_anthropic.py index 5bcb40e7..21b38237 100644 --- a/tests/api_resources/test_anthropic.py +++ b/tests/api_resources/test_anthropic.py @@ -228,7 +228,9 @@ def test_path_params_modify(self, client: Hanzo) -> None: class TestAsyncAnthropic: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_assemblyai.py b/tests/api_resources/test_assemblyai.py index a7204826..90c95b6c 100644 --- a/tests/api_resources/test_assemblyai.py +++ b/tests/api_resources/test_assemblyai.py @@ -228,7 +228,9 @@ def test_path_params_patch(self, client: Hanzo) -> None: class TestAsyncAssemblyai: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_assistants.py b/tests/api_resources/test_assistants.py index d0b32127..d4586158 100644 --- a/tests/api_resources/test_assistants.py +++ b/tests/api_resources/test_assistants.py @@ -116,7 +116,9 @@ def test_path_params_delete(self, client: Hanzo) -> None: class TestAsyncAssistants: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_azure.py b/tests/api_resources/test_azure.py index 51bbfc77..145a4b3f 100644 --- a/tests/api_resources/test_azure.py +++ b/tests/api_resources/test_azure.py @@ -228,7 +228,9 @@ def test_path_params_patch(self, client: Hanzo) -> None: class TestAsyncAzure: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_batches.py b/tests/api_resources/test_batches.py index 0d39e073..c62174cf 100644 --- a/tests/api_resources/test_batches.py +++ b/tests/api_resources/test_batches.py @@ -341,7 +341,9 @@ def test_path_params_retrieve_with_provider(self, client: Hanzo) -> None: class TestAsyncBatches: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_bedrock.py b/tests/api_resources/test_bedrock.py index d871d6d9..69b65148 100644 --- a/tests/api_resources/test_bedrock.py +++ b/tests/api_resources/test_bedrock.py @@ -228,7 +228,9 @@ def test_path_params_patch(self, client: Hanzo) -> None: class TestAsyncBedrock: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_budget.py b/tests/api_resources/test_budget.py index b87bf81f..64d82477 100644 --- a/tests/api_resources/test_budget.py +++ b/tests/api_resources/test_budget.py @@ -248,7 +248,9 @@ def test_streaming_response_settings(self, client: Hanzo) -> None: class TestAsyncBudget: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_cache.py b/tests/api_resources/test_cache.py index a7478351..b43fdd0a 100644 --- a/tests/api_resources/test_cache.py +++ b/tests/api_resources/test_cache.py @@ -103,7 +103,9 @@ def test_streaming_response_ping(self, client: Hanzo) -> None: class TestAsyncCache: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_client.py b/tests/api_resources/test_client.py index 98c34e8d..7593d352 100644 --- a/tests/api_resources/test_client.py +++ b/tests/api_resources/test_client.py @@ -46,7 +46,9 @@ def test_streaming_response_get_home(self, client: Hanzo) -> None: class TestAsyncClient: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_cohere.py b/tests/api_resources/test_cohere.py index 24f3634b..d0601947 100644 --- a/tests/api_resources/test_cohere.py +++ b/tests/api_resources/test_cohere.py @@ -228,7 +228,9 @@ def test_path_params_modify(self, client: Hanzo) -> None: class TestAsyncCohere: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_completions.py b/tests/api_resources/test_completions.py index f68bae42..20018ca6 100644 --- a/tests/api_resources/test_completions.py +++ b/tests/api_resources/test_completions.py @@ -54,7 +54,9 @@ def test_streaming_response_create(self, client: Hanzo) -> None: class TestAsyncCompletions: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_credentials.py b/tests/api_resources/test_credentials.py index 8e131e6d..bae6095f 100644 --- a/tests/api_resources/test_credentials.py +++ b/tests/api_resources/test_credentials.py @@ -136,7 +136,9 @@ def test_path_params_delete(self, client: Hanzo) -> None: class TestAsyncCredentials: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_customer.py b/tests/api_resources/test_customer.py index bdfc238f..34f8aa32 100644 --- a/tests/api_resources/test_customer.py +++ b/tests/api_resources/test_customer.py @@ -295,7 +295,9 @@ def test_streaming_response_unblock(self, client: Hanzo) -> None: class TestAsyncCustomer: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_delete.py b/tests/api_resources/test_delete.py index 57a72e45..06e54131 100644 --- a/tests/api_resources/test_delete.py +++ b/tests/api_resources/test_delete.py @@ -52,7 +52,9 @@ def test_streaming_response_create_allowed_ip(self, client: Hanzo) -> None: class TestAsyncDelete: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_embeddings.py b/tests/api_resources/test_embeddings.py index c3da982e..665a9cba 100644 --- a/tests/api_resources/test_embeddings.py +++ b/tests/api_resources/test_embeddings.py @@ -54,7 +54,9 @@ def test_streaming_response_create(self, client: Hanzo) -> None: class TestAsyncEmbeddings: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_engines.py b/tests/api_resources/test_engines.py index a9fa11a9..cbbf2e87 100644 --- a/tests/api_resources/test_engines.py +++ b/tests/api_resources/test_engines.py @@ -102,7 +102,9 @@ def test_path_params_embed(self, client: Hanzo) -> None: class TestAsyncEngines: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_eu_assemblyai.py b/tests/api_resources/test_eu_assemblyai.py index b08c9890..8d402941 100644 --- a/tests/api_resources/test_eu_assemblyai.py +++ b/tests/api_resources/test_eu_assemblyai.py @@ -228,7 +228,9 @@ def test_path_params_patch(self, client: Hanzo) -> None: class TestAsyncEuAssemblyai: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_files.py b/tests/api_resources/test_files.py index 5f49edf3..1dc36901 100644 --- a/tests/api_resources/test_files.py +++ b/tests/api_resources/test_files.py @@ -234,7 +234,9 @@ def test_path_params_delete(self, client: Hanzo) -> None: class TestAsyncFiles: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_gemini.py b/tests/api_resources/test_gemini.py index 3f47be86..c970fbab 100644 --- a/tests/api_resources/test_gemini.py +++ b/tests/api_resources/test_gemini.py @@ -228,7 +228,9 @@ def test_path_params_patch(self, client: Hanzo) -> None: class TestAsyncGemini: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_guardrails.py b/tests/api_resources/test_guardrails.py index a3c6e5c5..a7c80770 100644 --- a/tests/api_resources/test_guardrails.py +++ b/tests/api_resources/test_guardrails.py @@ -47,7 +47,9 @@ def test_streaming_response_list(self, client: Hanzo) -> None: class TestAsyncGuardrails: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_health.py b/tests/api_resources/test_health.py index b8db2144..96259c73 100644 --- a/tests/api_resources/test_health.py +++ b/tests/api_resources/test_health.py @@ -172,7 +172,9 @@ def test_streaming_response_check_services(self, client: Hanzo) -> None: class TestAsyncHealth: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_key.py b/tests/api_resources/test_key.py index 28d83c28..71826ea5 100644 --- a/tests/api_resources/test_key.py +++ b/tests/api_resources/test_key.py @@ -467,7 +467,9 @@ def test_streaming_response_unblock(self, client: Hanzo) -> None: class TestAsyncKey: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_langfuse.py b/tests/api_resources/test_langfuse.py index 791502f1..0ad8d423 100644 --- a/tests/api_resources/test_langfuse.py +++ b/tests/api_resources/test_langfuse.py @@ -228,7 +228,9 @@ def test_path_params_patch(self, client: Hanzo) -> None: class TestAsyncLangfuse: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_model.py b/tests/api_resources/test_model.py index 84a97870..126e252a 100644 --- a/tests/api_resources/test_model.py +++ b/tests/api_resources/test_model.py @@ -146,7 +146,9 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: class TestAsyncModel: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_model_group.py b/tests/api_resources/test_model_group.py index e18214ac..dc18c40b 100644 --- a/tests/api_resources/test_model_group.py +++ b/tests/api_resources/test_model_group.py @@ -54,7 +54,9 @@ def test_streaming_response_retrieve_info(self, client: Hanzo) -> None: class TestAsyncModelGroup: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_models.py b/tests/api_resources/test_models.py index c0c1aea4..07199547 100644 --- a/tests/api_resources/test_models.py +++ b/tests/api_resources/test_models.py @@ -55,7 +55,9 @@ def test_streaming_response_list(self, client: Hanzo) -> None: class TestAsyncModels: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_moderations.py b/tests/api_resources/test_moderations.py index 225d81df..45d6cda6 100644 --- a/tests/api_resources/test_moderations.py +++ b/tests/api_resources/test_moderations.py @@ -46,7 +46,9 @@ def test_streaming_response_create(self, client: Hanzo) -> None: class TestAsyncModerations: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_openai.py b/tests/api_resources/test_openai.py index 1b4b641d..ae3cf41a 100644 --- a/tests/api_resources/test_openai.py +++ b/tests/api_resources/test_openai.py @@ -228,7 +228,9 @@ def test_path_params_patch(self, client: Hanzo) -> None: class TestAsyncOpenAI: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_organization.py b/tests/api_resources/test_organization.py index 7c032e18..15c74cb6 100644 --- a/tests/api_resources/test_organization.py +++ b/tests/api_resources/test_organization.py @@ -326,7 +326,9 @@ def test_streaming_response_update_member(self, client: Hanzo) -> None: class TestAsyncOrganization: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_provider.py b/tests/api_resources/test_provider.py index a89e6ceb..1246e80e 100644 --- a/tests/api_resources/test_provider.py +++ b/tests/api_resources/test_provider.py @@ -47,7 +47,9 @@ def test_streaming_response_list_budgets(self, client: Hanzo) -> None: class TestAsyncProvider: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_rerank.py b/tests/api_resources/test_rerank.py index 3c2b88af..2893a4a1 100644 --- a/tests/api_resources/test_rerank.py +++ b/tests/api_resources/test_rerank.py @@ -102,7 +102,9 @@ def test_streaming_response_create_v2(self, client: Hanzo) -> None: class TestAsyncRerank: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_responses.py b/tests/api_resources/test_responses.py index 8b17ba87..f1c2b4ce 100644 --- a/tests/api_resources/test_responses.py +++ b/tests/api_resources/test_responses.py @@ -130,7 +130,9 @@ def test_path_params_delete(self, client: Hanzo) -> None: class TestAsyncResponses: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_routes.py b/tests/api_resources/test_routes.py index 95817942..3febf4f3 100644 --- a/tests/api_resources/test_routes.py +++ b/tests/api_resources/test_routes.py @@ -46,7 +46,9 @@ def test_streaming_response_list(self, client: Hanzo) -> None: class TestAsyncRoutes: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_settings.py b/tests/api_resources/test_settings.py index 7ed493b0..6146d41f 100644 --- a/tests/api_resources/test_settings.py +++ b/tests/api_resources/test_settings.py @@ -46,7 +46,9 @@ def test_streaming_response_retrieve(self, client: Hanzo) -> None: class TestAsyncSettings: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_spend.py b/tests/api_resources/test_spend.py index 81ee876b..c1059c3f 100644 --- a/tests/api_resources/test_spend.py +++ b/tests/api_resources/test_spend.py @@ -137,7 +137,9 @@ def test_streaming_response_list_tags(self, client: Hanzo) -> None: class TestAsyncSpend: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_team.py b/tests/api_resources/test_team.py index 8f8570f8..a14bd1cf 100644 --- a/tests/api_resources/test_team.py +++ b/tests/api_resources/test_team.py @@ -541,7 +541,9 @@ def test_streaming_response_update_member(self, client: Hanzo) -> None: class TestAsyncTeam: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_test.py b/tests/api_resources/test_test.py index 6e7a47c0..3b10a6ed 100644 --- a/tests/api_resources/test_test.py +++ b/tests/api_resources/test_test.py @@ -46,7 +46,9 @@ def test_streaming_response_ping(self, client: Hanzo) -> None: class TestAsyncTest: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_threads.py b/tests/api_resources/test_threads.py index e8a5d571..d1073d05 100644 --- a/tests/api_resources/test_threads.py +++ b/tests/api_resources/test_threads.py @@ -88,7 +88,9 @@ def test_path_params_retrieve(self, client: Hanzo) -> None: class TestAsyncThreads: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_user.py b/tests/api_resources/test_user.py index ef5028e4..b9af2e31 100644 --- a/tests/api_resources/test_user.py +++ b/tests/api_resources/test_user.py @@ -260,7 +260,9 @@ def test_streaming_response_retrieve_info(self, client: Hanzo) -> None: class TestAsyncUser: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_utils.py b/tests/api_resources/test_utils.py index 5dbdb935..df4d1500 100644 --- a/tests/api_resources/test_utils.py +++ b/tests/api_resources/test_utils.py @@ -137,7 +137,9 @@ def test_streaming_response_transform_request(self, client: Hanzo) -> None: class TestAsyncUtils: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/test_vertex_ai.py b/tests/api_resources/test_vertex_ai.py index cd213525..eaaed0f4 100644 --- a/tests/api_resources/test_vertex_ai.py +++ b/tests/api_resources/test_vertex_ai.py @@ -228,7 +228,9 @@ def test_path_params_patch(self, client: Hanzo) -> None: class TestAsyncVertexAI: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/threads/test_messages.py b/tests/api_resources/threads/test_messages.py index 4a9809f4..080c51d4 100644 --- a/tests/api_resources/threads/test_messages.py +++ b/tests/api_resources/threads/test_messages.py @@ -102,7 +102,9 @@ def test_path_params_list(self, client: Hanzo) -> None: class TestAsyncMessages: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/api_resources/threads/test_runs.py b/tests/api_resources/threads/test_runs.py index 9271694b..e3a3b181 100644 --- a/tests/api_resources/threads/test_runs.py +++ b/tests/api_resources/threads/test_runs.py @@ -60,7 +60,9 @@ def test_path_params_create(self, client: Hanzo) -> None: class TestAsyncRuns: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @pytest.mark.skip() @parametrize diff --git a/tests/conftest.py b/tests/conftest.py index b7a1ac7d..ddb3ba82 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,13 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + from __future__ import annotations import os import logging from typing import TYPE_CHECKING, Iterator, AsyncIterator +import httpx import pytest from pytest_asyncio import is_async_test -from hanzoai import Hanzo, AsyncHanzo +from hanzoai import Hanzo, AsyncHanzo, DefaultAioHttpClient +from hanzoai._utils import is_dict if TYPE_CHECKING: from _pytest.fixtures import FixtureRequest # pyright: ignore[reportPrivateImportUsage] @@ -25,6 +29,19 @@ def pytest_collection_modifyitems(items: list[pytest.Function]) -> None: for async_test in pytest_asyncio_tests: async_test.add_marker(session_scope_marker, append=False) + # We skip tests that use both the aiohttp client and respx_mock as respx_mock + # doesn't support custom transports. + for item in items: + if "async_client" not in item.fixturenames or "respx_mock" not in item.fixturenames: + continue + + if not hasattr(item, "callspec"): + continue + + async_client_param = item.callspec.params.get("async_client") + if is_dict(async_client_param) and async_client_param.get("http_client") == "aiohttp": + item.add_marker(pytest.mark.skip(reason="aiohttp client is not compatible with respx_mock")) + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -43,9 +60,25 @@ def client(request: FixtureRequest) -> Iterator[Hanzo]: @pytest.fixture(scope="session") async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncHanzo]: - strict = getattr(request, "param", True) - if not isinstance(strict, bool): - raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") - - async with AsyncHanzo(base_url=base_url, api_key=api_key, _strict_response_validation=strict) as client: + param = getattr(request, "param", True) + + # defaults + strict = True + http_client: None | httpx.AsyncClient = None + + if isinstance(param, bool): + strict = param + elif is_dict(param): + strict = param.get("strict", True) + assert isinstance(strict, bool) + + http_client_type = param.get("http_client", "httpx") + if http_client_type == "aiohttp": + http_client = DefaultAioHttpClient() + else: + raise TypeError(f"Unexpected fixture parameter type {type(param)}, expected bool or dict") + + async with AsyncHanzo( + base_url=base_url, api_key=api_key, _strict_response_validation=strict, http_client=http_client + ) as client: yield client diff --git a/tests/test_client.py b/tests/test_client.py index 845279a8..ccb0dbc4 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -24,12 +24,13 @@ from hanzoai import Hanzo, AsyncHanzo, APIResponseValidationError from hanzoai._types import Omit from hanzoai._models import BaseModel, FinalRequestOptions -from hanzoai._constants import RAW_RESPONSE_HEADER from hanzoai._exceptions import HanzoError, APIStatusError, APITimeoutError, APIResponseValidationError from hanzoai._base_client import ( DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, + DefaultHttpxClient, + DefaultAsyncHttpxClient, make_request_options, ) @@ -190,6 +191,7 @@ def test_copy_signature(self) -> None: copy_param = copy_signature.parameters.get(name) assert copy_param is not None, f"copy() signature is missing the {name} param" + @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12") def test_copy_build_request(self) -> None: options = FinalRequestOptions(method="get", url="/foo") @@ -460,7 +462,7 @@ def test_request_extra_query(self) -> None: def test_multipart_repeating_array(self, client: Hanzo) -> None: request = client._build_request( FinalRequestOptions.construct( - method="get", + method="post", url="/foo", headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, json_data={"array": ["foo", "bar"]}, @@ -717,22 +719,21 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str @mock.patch("hanzoai._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, client: Hanzo) -> None: respx_mock.get("/").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): - self.client.get("/", cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}) + client.with_streaming_response.get_home().__enter__() assert _get_open_connections(self.client) == 0 @mock.patch("hanzoai._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client: Hanzo) -> None: respx_mock.get("/").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): - self.client.get("/", cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}) - + client.with_streaming_response.get_home().__enter__() assert _get_open_connections(self.client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @@ -810,6 +811,28 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: assert response.http_request.headers.get("x-stainless-retry-count") == "42" + def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: + # Test that the proxy environment variables are set correctly + monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + + client = DefaultHttpxClient() + + mounts = tuple(client._mounts.items()) + assert len(mounts) == 1 + assert mounts[0][0].pattern == "https://" + + @pytest.mark.filterwarnings("ignore:.*deprecated.*:DeprecationWarning") + def test_default_client_creation(self) -> None: + # Ensure that the client can be initialized without any exceptions + DefaultHttpxClient( + verify=True, + cert=None, + trust_env=True, + http1=True, + http2=False, + limits=httpx.Limits(max_connections=100, max_keepalive_connections=20), + ) + @pytest.mark.respx(base_url=base_url) def test_follow_redirects(self, respx_mock: MockRouter) -> None: # Test that the default follow_redirects=True allows following redirects @@ -973,6 +996,7 @@ def test_copy_signature(self) -> None: copy_param = copy_signature.parameters.get(name) assert copy_param is not None, f"copy() signature is missing the {name} param" + @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12") def test_copy_build_request(self) -> None: options = FinalRequestOptions(method="get", url="/foo") @@ -1245,7 +1269,7 @@ def test_request_extra_query(self) -> None: def test_multipart_repeating_array(self, async_client: AsyncHanzo) -> None: request = async_client._build_request( FinalRequestOptions.construct( - method="get", + method="post", url="/foo", headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, json_data={"array": ["foo", "bar"]}, @@ -1516,22 +1540,21 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte @mock.patch("hanzoai._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, async_client: AsyncHanzo) -> None: respx_mock.get("/").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): - await self.client.get("/", cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}) + await async_client.with_streaming_response.get_home().__aenter__() assert _get_open_connections(self.client) == 0 @mock.patch("hanzoai._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, async_client: AsyncHanzo) -> None: respx_mock.get("/").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): - await self.client.get("/", cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}) - + await async_client.with_streaming_response.get_home().__aenter__() assert _get_open_connections(self.client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @@ -1659,6 +1682,28 @@ async def test_main() -> None: time.sleep(0.1) + async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: + # Test that the proxy environment variables are set correctly + monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + + client = DefaultAsyncHttpxClient() + + mounts = tuple(client._mounts.items()) + assert len(mounts) == 1 + assert mounts[0][0].pattern == "https://" + + @pytest.mark.filterwarnings("ignore:.*deprecated.*:DeprecationWarning") + async def test_default_client_creation(self) -> None: + # Ensure that the client can be initialized without any exceptions + DefaultAsyncHttpxClient( + verify=True, + cert=None, + trust_env=True, + http1=True, + http2=False, + limits=httpx.Limits(max_connections=100, max_keepalive_connections=20), + ) + @pytest.mark.respx(base_url=base_url) async def test_follow_redirects(self, respx_mock: MockRouter) -> None: # Test that the default follow_redirects=True allows following redirects diff --git a/tests/test_models.py b/tests/test_models.py index de88ed5b..8c0e33c1 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -889,3 +889,48 @@ class ModelB(BaseModel): ) assert isinstance(m, ModelB) + + +def test_nested_discriminated_union() -> None: + class InnerType1(BaseModel): + type: Literal["type_1"] + + class InnerModel(BaseModel): + inner_value: str + + class InnerType2(BaseModel): + type: Literal["type_2"] + some_inner_model: InnerModel + + class Type1(BaseModel): + base_type: Literal["base_type_1"] + value: Annotated[ + Union[ + InnerType1, + InnerType2, + ], + PropertyInfo(discriminator="type"), + ] + + class Type2(BaseModel): + base_type: Literal["base_type_2"] + + T = Annotated[ + Union[ + Type1, + Type2, + ], + PropertyInfo(discriminator="base_type"), + ] + + model = construct_type( + type_=T, + value={ + "base_type": "base_type_1", + "value": { + "type": "type_2", + }, + }, + ) + assert isinstance(model, Type1) + assert isinstance(model.value, InnerType2) From 2d6ad21c1518cb21658d308357a4017ff3e97973 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 6 Sep 2025 13:31:48 +0000 Subject: [PATCH 32/41] chore: configure new SDK language --- .github/workflows/ci.yml | 6 +- .gitignore | 1 - .stats.yml | 2 +- .vscode/settings.json | 3 + mypy.ini | 50 ----- pyproject.toml | 56 +++++- requirements-dev.lock | 1 - scripts/mock | 4 +- scripts/test | 2 +- src/hanzoai/_base_client.py | 11 +- src/hanzoai/_compat.py | 96 ++++----- src/hanzoai/_files.py | 8 +- src/hanzoai/_models.py | 105 ++++++---- src/hanzoai/_types.py | 36 +++- src/hanzoai/_utils/__init__.py | 11 +- src/hanzoai/_utils/_compat.py | 45 +++++ src/hanzoai/_utils/_datetime_parse.py | 136 +++++++++++++ src/hanzoai/_utils/_transform.py | 12 +- src/hanzoai/_utils/_typing.py | 7 +- src/hanzoai/_utils/_utils.py | 1 - src/hanzoai/resources/budget.py | 8 +- src/hanzoai/resources/customer.py | 16 +- .../resources/fine_tuning/jobs/jobs.py | 8 +- src/hanzoai/resources/key/key.py | 48 ++--- src/hanzoai/resources/organization/info.py | 8 +- .../resources/organization/organization.py | 12 +- src/hanzoai/resources/team/model.py | 12 +- src/hanzoai/resources/team/team.py | 16 +- src/hanzoai/resources/user.py | 16 +- src/hanzoai/types/budget_info_params.py | 5 +- src/hanzoai/types/customer_block_params.py | 5 +- src/hanzoai/types/customer_delete_params.py | 5 +- src/hanzoai/types/customer_unblock_params.py | 5 +- .../types/fine_tuning/job_create_params.py | 6 +- src/hanzoai/types/key_delete_params.py | 7 +- src/hanzoai/types/key_generate_params.py | 9 +- .../types/key_regenerate_by_key_params.py | 9 +- src/hanzoai/types/key_update_params.py | 9 +- src/hanzoai/types/model/update_full_params.py | 5 +- .../types/model/update_partial_params.py | 5 +- src/hanzoai/types/model_create_params.py | 5 +- .../organization/info_deprecated_params.py | 5 +- .../types/organization_delete_params.py | 5 +- .../types/organization_update_params.py | 6 +- src/hanzoai/types/team/model_add_params.py | 5 +- src/hanzoai/types/team/model_remove_params.py | 5 +- src/hanzoai/types/team_create_params.py | 5 +- src/hanzoai/types/team_delete_params.py | 4 +- src/hanzoai/types/team_update_params.py | 5 +- src/hanzoai/types/user_create_params.py | 6 +- src/hanzoai/types/user_delete_params.py | 4 +- src/hanzoai/types/user_update_params.py | 6 +- tests/api_resources/audio/test_speech.py | 12 +- .../audio/test_transcriptions.py | 12 +- tests/api_resources/batches/test_cancel.py | 20 +- tests/api_resources/cache/test_redis.py | 12 +- tests/api_resources/chat/test_completions.py | 16 +- .../config/test_pass_through_endpoint.py | 56 +++--- tests/api_resources/engines/test_chat.py | 16 +- tests/api_resources/files/test_content.py | 16 +- .../fine_tuning/jobs/test_cancel.py | 16 +- tests/api_resources/fine_tuning/test_jobs.py | 48 ++--- tests/api_resources/global_/test_spend.py | 44 ++--- .../api_resources/images/test_generations.py | 12 +- tests/api_resources/model/test_info.py | 16 +- tests/api_resources/model/test_update.py | 36 ++-- .../openai/deployments/test_chat.py | 16 +- .../api_resources/openai/test_deployments.py | 32 +-- tests/api_resources/organization/test_info.py | 24 +-- .../responses/test_input_items.py | 16 +- tests/api_resources/team/test_callback.py | 36 ++-- tests/api_resources/team/test_model.py | 24 +-- tests/api_resources/test_active.py | 12 +- tests/api_resources/test_add.py | 12 +- tests/api_resources/test_anthropic.py | 80 ++++---- tests/api_resources/test_assemblyai.py | 80 ++++---- tests/api_resources/test_assistants.py | 40 ++-- tests/api_resources/test_azure.py | 80 ++++---- tests/api_resources/test_batches.py | 120 ++++++------ tests/api_resources/test_bedrock.py | 80 ++++---- tests/api_resources/test_budget.py | 80 ++++---- tests/api_resources/test_cache.py | 36 ++-- tests/api_resources/test_client.py | 12 +- tests/api_resources/test_cohere.py | 80 ++++---- tests/api_resources/test_completions.py | 16 +- tests/api_resources/test_credentials.py | 44 ++--- tests/api_resources/test_customer.py | 92 ++++----- tests/api_resources/test_delete.py | 12 +- tests/api_resources/test_embeddings.py | 16 +- tests/api_resources/test_engines.py | 32 +-- tests/api_resources/test_eu_assemblyai.py | 80 ++++---- tests/api_resources/test_files.py | 72 +++---- tests/api_resources/test_gemini.py | 80 ++++---- tests/api_resources/test_guardrails.py | 12 +- tests/api_resources/test_health.py | 64 +++--- tests/api_resources/test_key.py | 144 +++++++------- tests/api_resources/test_langfuse.py | 80 ++++---- tests/api_resources/test_model.py | 28 +-- tests/api_resources/test_model_group.py | 16 +- tests/api_resources/test_models.py | 16 +- tests/api_resources/test_moderations.py | 12 +- tests/api_resources/test_openai.py | 80 ++++---- tests/api_resources/test_organization.py | 104 +++++----- tests/api_resources/test_provider.py | 12 +- tests/api_resources/test_rerank.py | 36 ++-- tests/api_resources/test_responses.py | 44 ++--- tests/api_resources/test_routes.py | 12 +- tests/api_resources/test_settings.py | 12 +- tests/api_resources/test_spend.py | 48 ++--- tests/api_resources/test_team.py | 184 +++++++++--------- tests/api_resources/test_test.py | 12 +- tests/api_resources/test_threads.py | 28 +-- tests/api_resources/test_user.py | 80 ++++---- tests/api_resources/test_utils.py | 40 ++-- tests/api_resources/test_vertex_ai.py | 80 ++++---- tests/api_resources/threads/test_messages.py | 32 +-- tests/api_resources/threads/test_runs.py | 16 +- tests/test_client.py | 53 +---- tests/test_models.py | 75 ++++--- tests/test_transform.py | 16 +- tests/test_utils/test_datetime_parse.py | 110 +++++++++++ tests/utils.py | 18 +- 122 files changed, 2179 insertions(+), 1789 deletions(-) create mode 100644 .vscode/settings.json delete mode 100644 mypy.ini create mode 100644 src/hanzoai/_utils/_compat.py create mode 100644 src/hanzoai/_utils/_datetime_parse.py create mode 100644 tests/test_utils/test_datetime_parse.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0bee5857..73f8ca52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,13 +36,13 @@ jobs: run: ./scripts/lint build: - if: github.repository == 'stainless-sdks/hanzo-ai-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork timeout-minutes: 10 name: build permissions: contents: read id-token: write - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/hanzo-ai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 @@ -61,12 +61,14 @@ jobs: run: rye build - name: Get GitHub OIDC Token + if: github.repository == 'stainless-sdks/hanzo-ai-python' id: github-oidc uses: actions/github-script@v6 with: script: core.setOutput('github_token', await core.getIDToken()); - name: Upload tarball + if: github.repository == 'stainless-sdks/hanzo-ai-python' env: URL: https://pkg.stainless.com/s AUTH: ${{ steps.github-oidc.outputs.github_token }} diff --git a/.gitignore b/.gitignore index 87797408..95ceb189 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .prism.log -.vscode _dev __pycache__ diff --git a/.stats.yml b/.stats.yml index affe3eef..7c3c5481 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 188 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hanzo-industries-inc%2Fhanzo-ai-2d6e1036fb1eea7e95cafc281141ead9ef77796e43711b17edccaab67c5e791a.yml openapi_spec_hash: 12501774d0127be4ec1812d613a58e97 -config_hash: 830747463ff4d018b5633ce511e88558 +config_hash: 5b61cc8c6c31c071a08578ad825b421d diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..5b010307 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.analysis.importFormat": "relative", +} diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index 9c0e4822..00000000 --- a/mypy.ini +++ /dev/null @@ -1,50 +0,0 @@ -[mypy] -pretty = True -show_error_codes = True - -# Exclude _files.py because mypy isn't smart enough to apply -# the correct type narrowing and as this is an internal module -# it's fine to just use Pyright. -# -# We also exclude our `tests` as mypy doesn't always infer -# types correctly and Pyright will still catch any type errors. -exclude = ^(src/hanzoai/_files\.py|_dev/.*\.py|tests/.*)$ - -strict_equality = True -implicit_reexport = True -check_untyped_defs = True -no_implicit_optional = True - -warn_return_any = True -warn_unreachable = True -warn_unused_configs = True - -# Turn these options off as it could cause conflicts -# with the Pyright options. -warn_unused_ignores = False -warn_redundant_casts = False - -disallow_any_generics = True -disallow_untyped_defs = True -disallow_untyped_calls = True -disallow_subclassing_any = True -disallow_incomplete_defs = True -disallow_untyped_decorators = True -cache_fine_grained = True - -# By default, mypy reports an error if you assign a value to the result -# of a function call that doesn't return anything. We do this in our test -# cases: -# ``` -# result = ... -# assert result is None -# ``` -# Changing this codegen to make mypy happy would increase complexity -# and would not be worth it. -disable_error_code = func-returns-value,overload-cannot-match - -# https://github.com/python/mypy/issues/12162 -[mypy.overrides] -module = "black.files.*" -ignore_errors = true -ignore_missing_imports = true diff --git a/pyproject.toml b/pyproject.toml index 5dca4324..bb1e059a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,6 @@ dev-dependencies = [ "dirty-equals>=0.6.0", "importlib-metadata>=6.7.0", "rich>=13.7.1", - "nest_asyncio==1.6.0", "pytest-xdist>=3.6.1", ] @@ -148,6 +147,7 @@ exclude = [ "_dev", ".venv", ".nox", + ".git", ] reportImplicitOverride = true @@ -156,10 +156,62 @@ reportOverlappingOverload = false reportImportCycles = false reportPrivateUsage = false +[tool.mypy] +pretty = true +show_error_codes = true + +# Exclude _files.py because mypy isn't smart enough to apply +# the correct type narrowing and as this is an internal module +# it's fine to just use Pyright. +# +# We also exclude our `tests` as mypy doesn't always infer +# types correctly and Pyright will still catch any type errors. +exclude = ['src/hanzoai/_files.py', '_dev/.*.py', 'tests/.*'] + +strict_equality = true +implicit_reexport = true +check_untyped_defs = true +no_implicit_optional = true + +warn_return_any = true +warn_unreachable = true +warn_unused_configs = true + +# Turn these options off as it could cause conflicts +# with the Pyright options. +warn_unused_ignores = false +warn_redundant_casts = false + +disallow_any_generics = true +disallow_untyped_defs = true +disallow_untyped_calls = true +disallow_subclassing_any = true +disallow_incomplete_defs = true +disallow_untyped_decorators = true +cache_fine_grained = true + +# By default, mypy reports an error if you assign a value to the result +# of a function call that doesn't return anything. We do this in our test +# cases: +# ``` +# result = ... +# assert result is None +# ``` +# Changing this codegen to make mypy happy would increase complexity +# and would not be worth it. +disable_error_code = "func-returns-value,overload-cannot-match" + +# https://github.com/python/mypy/issues/12162 +[[tool.mypy.overrides]] +module = "black.files.*" +ignore_errors = true +ignore_missing_imports = true + + [tool.ruff] line-length = 120 output-format = "grouped" -target-version = "py37" +target-version = "py38" [tool.ruff.format] docstring-code-format = true diff --git a/requirements-dev.lock b/requirements-dev.lock index 1c3bc30d..0cd84f5a 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -75,7 +75,6 @@ multidict==6.4.4 mypy==1.14.1 mypy-extensions==1.0.0 # via mypy -nest-asyncio==1.6.0 nodeenv==1.8.0 # via pyright nox==2023.4.22 diff --git a/scripts/mock b/scripts/mock index d2814ae6..0b28f6ea 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & # Wait for server to come online echo -n "Waiting for server" @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" fi diff --git a/scripts/test b/scripts/test index 2b878456..dbeda2d2 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! prism_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the prism command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" echo exit 1 diff --git a/src/hanzoai/_base_client.py b/src/hanzoai/_base_client.py index 5c54f69c..e20c03de 100644 --- a/src/hanzoai/_base_client.py +++ b/src/hanzoai/_base_client.py @@ -59,7 +59,7 @@ ModelBuilderProtocol, ) from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping -from ._compat import PYDANTIC_V2, model_copy, model_dump +from ._compat import PYDANTIC_V1, model_copy, model_dump from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type from ._response import ( APIResponse, @@ -232,7 +232,7 @@ def _set_private_attributes( model: Type[_T], options: FinalRequestOptions, ) -> None: - if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None: + if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None: self.__pydantic_private__ = {} self._model = model @@ -320,7 +320,7 @@ def _set_private_attributes( client: AsyncAPIClient, options: FinalRequestOptions, ) -> None: - if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None: + if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None: self.__pydantic_private__ = {} self._model = model @@ -532,7 +532,10 @@ def _build_request( is_body_allowed = options.method.lower() != "get" if is_body_allowed: - kwargs["json"] = json_data if is_given(json_data) else None + if isinstance(json_data, bytes): + kwargs["content"] = json_data + else: + kwargs["json"] = json_data if is_given(json_data) else None kwargs["files"] = files else: headers.pop("Content-Type", None) diff --git a/src/hanzoai/_compat.py b/src/hanzoai/_compat.py index 92d9ee61..bdef67f0 100644 --- a/src/hanzoai/_compat.py +++ b/src/hanzoai/_compat.py @@ -12,14 +12,13 @@ _T = TypeVar("_T") _ModelT = TypeVar("_ModelT", bound=pydantic.BaseModel) -# --------------- Pydantic v2 compatibility --------------- +# --------------- Pydantic v2, v3 compatibility --------------- # Pyright incorrectly reports some of our functions as overriding a method when they don't # pyright: reportIncompatibleMethodOverride=false -PYDANTIC_V2 = pydantic.VERSION.startswith("2.") +PYDANTIC_V1 = pydantic.VERSION.startswith("1.") -# v1 re-exports if TYPE_CHECKING: def parse_date(value: date | StrBytesIntFloat) -> date: # noqa: ARG001 @@ -44,90 +43,92 @@ def is_typeddict(type_: type[Any]) -> bool: # noqa: ARG001 ... else: - if PYDANTIC_V2: - from pydantic.v1.typing import ( + # v1 re-exports + if PYDANTIC_V1: + from pydantic.typing import ( get_args as get_args, is_union as is_union, get_origin as get_origin, is_typeddict as is_typeddict, is_literal_type as is_literal_type, ) - from pydantic.v1.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime + from pydantic.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime else: - from pydantic.typing import ( + from ._utils import ( get_args as get_args, is_union as is_union, get_origin as get_origin, + parse_date as parse_date, is_typeddict as is_typeddict, + parse_datetime as parse_datetime, is_literal_type as is_literal_type, ) - from pydantic.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime # refactored config if TYPE_CHECKING: from pydantic import ConfigDict as ConfigDict else: - if PYDANTIC_V2: - from pydantic import ConfigDict - else: + if PYDANTIC_V1: # TODO: provide an error message here? ConfigDict = None + else: + from pydantic import ConfigDict as ConfigDict # renamed methods / properties def parse_obj(model: type[_ModelT], value: object) -> _ModelT: - if PYDANTIC_V2: - return model.model_validate(value) - else: + if PYDANTIC_V1: return cast(_ModelT, model.parse_obj(value)) # pyright: ignore[reportDeprecated, reportUnnecessaryCast] + else: + return model.model_validate(value) def field_is_required(field: FieldInfo) -> bool: - if PYDANTIC_V2: - return field.is_required() - return field.required # type: ignore + if PYDANTIC_V1: + return field.required # type: ignore + return field.is_required() def field_get_default(field: FieldInfo) -> Any: value = field.get_default() - if PYDANTIC_V2: - from pydantic_core import PydanticUndefined - - if value == PydanticUndefined: - return None + if PYDANTIC_V1: return value + from pydantic_core import PydanticUndefined + + if value == PydanticUndefined: + return None return value def field_outer_type(field: FieldInfo) -> Any: - if PYDANTIC_V2: - return field.annotation - return field.outer_type_ # type: ignore + if PYDANTIC_V1: + return field.outer_type_ # type: ignore + return field.annotation def get_model_config(model: type[pydantic.BaseModel]) -> Any: - if PYDANTIC_V2: - return model.model_config - return model.__config__ # type: ignore + if PYDANTIC_V1: + return model.__config__ # type: ignore + return model.model_config def get_model_fields(model: type[pydantic.BaseModel]) -> dict[str, FieldInfo]: - if PYDANTIC_V2: - return model.model_fields - return model.__fields__ # type: ignore + if PYDANTIC_V1: + return model.__fields__ # type: ignore + return model.model_fields def model_copy(model: _ModelT, *, deep: bool = False) -> _ModelT: - if PYDANTIC_V2: - return model.model_copy(deep=deep) - return model.copy(deep=deep) # type: ignore + if PYDANTIC_V1: + return model.copy(deep=deep) # type: ignore + return model.model_copy(deep=deep) def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str: - if PYDANTIC_V2: - return model.model_dump_json(indent=indent) - return model.json(indent=indent) # type: ignore + if PYDANTIC_V1: + return model.json(indent=indent) # type: ignore + return model.model_dump_json(indent=indent) def model_dump( @@ -139,14 +140,14 @@ def model_dump( warnings: bool = True, mode: Literal["json", "python"] = "python", ) -> dict[str, Any]: - if PYDANTIC_V2 or hasattr(model, "model_dump"): + if (not PYDANTIC_V1) or hasattr(model, "model_dump"): return model.model_dump( mode=mode, exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, # warnings are not supported in Pydantic v1 - warnings=warnings if PYDANTIC_V2 else True, + warnings=True if PYDANTIC_V1 else warnings, ) return cast( "dict[str, Any]", @@ -159,9 +160,9 @@ def model_dump( def model_parse(model: type[_ModelT], data: Any) -> _ModelT: - if PYDANTIC_V2: - return model.model_validate(data) - return model.parse_obj(data) # pyright: ignore[reportDeprecated] + if PYDANTIC_V1: + return model.parse_obj(data) # pyright: ignore[reportDeprecated] + return model.model_validate(data) # generic models @@ -170,17 +171,16 @@ def model_parse(model: type[_ModelT], data: Any) -> _ModelT: class GenericModel(pydantic.BaseModel): ... else: - if PYDANTIC_V2: + if PYDANTIC_V1: + import pydantic.generics + + class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): ... + else: # there no longer needs to be a distinction in v2 but # we still have to create our own subclass to avoid # inconsistent MRO ordering errors class GenericModel(pydantic.BaseModel): ... - else: - import pydantic.generics - - class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): ... - # cached properties if TYPE_CHECKING: diff --git a/src/hanzoai/_files.py b/src/hanzoai/_files.py index 27524fd5..4fab3241 100644 --- a/src/hanzoai/_files.py +++ b/src/hanzoai/_files.py @@ -69,12 +69,12 @@ def _transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], _read_file_content(file[1]), *file[2:]) + return (file[0], read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -def _read_file_content(file: FileContent) -> HttpxFileContent: +def read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return pathlib.Path(file).read_bytes() return file @@ -111,12 +111,12 @@ async def _async_transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], await _async_read_file_content(file[1]), *file[2:]) + return (file[0], await async_read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -async def _async_read_file_content(file: FileContent) -> HttpxFileContent: +async def async_read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return await anyio.Path(file).read_bytes() diff --git a/src/hanzoai/_models.py b/src/hanzoai/_models.py index 528d5680..3a6017ef 100644 --- a/src/hanzoai/_models.py +++ b/src/hanzoai/_models.py @@ -50,7 +50,7 @@ strip_annotated_type, ) from ._compat import ( - PYDANTIC_V2, + PYDANTIC_V1, ConfigDict, GenericModel as BaseGenericModel, get_args, @@ -81,11 +81,7 @@ class _ConfigProtocol(Protocol): class BaseModel(pydantic.BaseModel): - if PYDANTIC_V2: - model_config: ClassVar[ConfigDict] = ConfigDict( - extra="allow", defer_build=coerce_boolean(os.environ.get("DEFER_PYDANTIC_BUILD", "true")) - ) - else: + if PYDANTIC_V1: @property @override @@ -95,6 +91,10 @@ def model_fields_set(self) -> set[str]: class Config(pydantic.BaseConfig): # pyright: ignore[reportDeprecated] extra: Any = pydantic.Extra.allow # type: ignore + else: + model_config: ClassVar[ConfigDict] = ConfigDict( + extra="allow", defer_build=coerce_boolean(os.environ.get("DEFER_PYDANTIC_BUILD", "true")) + ) def to_dict( self, @@ -208,28 +208,32 @@ def construct( # pyright: ignore[reportIncompatibleMethodOverride] else: fields_values[name] = field_get_default(field) + extra_field_type = _get_extra_fields_type(__cls) + _extra = {} for key, value in values.items(): if key not in model_fields: - if PYDANTIC_V2: - _extra[key] = value - else: + parsed = construct_type(value=value, type_=extra_field_type) if extra_field_type is not None else value + + if PYDANTIC_V1: _fields_set.add(key) - fields_values[key] = value + fields_values[key] = parsed + else: + _extra[key] = parsed object.__setattr__(m, "__dict__", fields_values) - if PYDANTIC_V2: - # these properties are copied from Pydantic's `model_construct()` method - object.__setattr__(m, "__pydantic_private__", None) - object.__setattr__(m, "__pydantic_extra__", _extra) - object.__setattr__(m, "__pydantic_fields_set__", _fields_set) - else: + if PYDANTIC_V1: # init_private_attributes() does not exist in v2 m._init_private_attributes() # type: ignore # copied from Pydantic v1's `construct()` method object.__setattr__(m, "__fields_set__", _fields_set) + else: + # these properties are copied from Pydantic's `model_construct()` method + object.__setattr__(m, "__pydantic_private__", None) + object.__setattr__(m, "__pydantic_extra__", _extra) + object.__setattr__(m, "__pydantic_fields_set__", _fields_set) return m @@ -239,7 +243,7 @@ def construct( # pyright: ignore[reportIncompatibleMethodOverride] # although not in practice model_construct = construct - if not PYDANTIC_V2: + if PYDANTIC_V1: # we define aliases for some of the new pydantic v2 methods so # that we can just document these methods without having to specify # a specific pydantic version as some users may not know which @@ -300,7 +304,7 @@ def model_dump( exclude_none=exclude_none, ) - return cast(dict[str, Any], json_safe(dumped)) if mode == "json" else dumped + return cast("dict[str, Any]", json_safe(dumped)) if mode == "json" else dumped @override def model_dump_json( @@ -359,10 +363,10 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object: if value is None: return field_get_default(field) - if PYDANTIC_V2: - type_ = field.annotation - else: + if PYDANTIC_V1: type_ = cast(type, field.outer_type_) # type: ignore + else: + type_ = field.annotation # type: ignore if type_ is None: raise RuntimeError(f"Unexpected field type is None for {key}") @@ -370,6 +374,23 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object: return construct_type(value=value, type_=type_, metadata=getattr(field, "metadata", None)) +def _get_extra_fields_type(cls: type[pydantic.BaseModel]) -> type | None: + if PYDANTIC_V1: + # TODO + return None + + schema = cls.__pydantic_core_schema__ + if schema["type"] == "model": + fields = schema["schema"] + if fields["type"] == "model-fields": + extras = fields.get("extras_schema") + if extras and "cls" in extras: + # mypy can't narrow the type + return extras["cls"] # type: ignore[no-any-return] + + return None + + def is_basemodel(type_: type) -> bool: """Returns whether or not the given type is either a `BaseModel` or a union of `BaseModel`""" if is_union(type_): @@ -439,7 +460,7 @@ def construct_type(*, value: object, type_: object, metadata: Optional[List[Any] type_ = type_.__value__ # type: ignore[unreachable] # unwrap `Annotated[T, ...]` -> `T` - if metadata is not None: + if metadata is not None and len(metadata) > 0: meta: tuple[Any, ...] = tuple(metadata) elif is_annotated_type(type_): meta = get_args(type_)[1:] @@ -607,30 +628,30 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, for variant in get_args(union): variant = strip_annotated_type(variant) if is_basemodel_type(variant): - if PYDANTIC_V2: - field = _extract_field_schema_pv2(variant, discriminator_field_name) - if not field: + if PYDANTIC_V1: + field_info = cast("dict[str, FieldInfo]", variant.__fields__).get(discriminator_field_name) # pyright: ignore[reportDeprecated, reportUnnecessaryCast] + if not field_info: continue # Note: if one variant defines an alias then they all should - discriminator_alias = field.get("serialization_alias") - - field_schema = field["schema"] + discriminator_alias = field_info.alias - if field_schema["type"] == "literal": - for entry in cast("LiteralSchema", field_schema)["expected"]: + if (annotation := getattr(field_info, "annotation", None)) and is_literal_type(annotation): + for entry in get_args(annotation): if isinstance(entry, str): mapping[entry] = variant else: - field_info = cast("dict[str, FieldInfo]", variant.__fields__).get(discriminator_field_name) # pyright: ignore[reportDeprecated, reportUnnecessaryCast] - if not field_info: + field = _extract_field_schema_pv2(variant, discriminator_field_name) + if not field: continue # Note: if one variant defines an alias then they all should - discriminator_alias = field_info.alias + discriminator_alias = field.get("serialization_alias") - if (annotation := getattr(field_info, "annotation", None)) and is_literal_type(annotation): - for entry in get_args(annotation): + field_schema = field["schema"] + + if field_schema["type"] == "literal": + for entry in cast("LiteralSchema", field_schema)["expected"]: if isinstance(entry, str): mapping[entry] = variant @@ -693,7 +714,7 @@ class GenericModel(BaseGenericModel, BaseModel): pass -if PYDANTIC_V2: +if not PYDANTIC_V1: from pydantic import TypeAdapter as _TypeAdapter _CachedTypeAdapter = cast("TypeAdapter[object]", lru_cache(maxsize=None)(_TypeAdapter)) @@ -761,12 +782,12 @@ class FinalRequestOptions(pydantic.BaseModel): json_data: Union[Body, None] = None extra_json: Union[AnyMapping, None] = None - if PYDANTIC_V2: - model_config: ClassVar[ConfigDict] = ConfigDict(arbitrary_types_allowed=True) - else: + if PYDANTIC_V1: class Config(pydantic.BaseConfig): # pyright: ignore[reportDeprecated] arbitrary_types_allowed: bool = True + else: + model_config: ClassVar[ConfigDict] = ConfigDict(arbitrary_types_allowed=True) def get_max_retries(self, max_retries: int) -> int: if isinstance(self.max_retries, NotGiven): @@ -799,9 +820,9 @@ def construct( # type: ignore key: strip_not_given(value) for key, value in values.items() } - if PYDANTIC_V2: - return super().model_construct(_fields_set, **kwargs) - return cast(FinalRequestOptions, super().construct(_fields_set, **kwargs)) # pyright: ignore[reportDeprecated] + if PYDANTIC_V1: + return cast(FinalRequestOptions, super().construct(_fields_set, **kwargs)) # pyright: ignore[reportDeprecated] + return super().model_construct(_fields_set, **kwargs) if not TYPE_CHECKING: # type checkers incorrectly complain about this assignment diff --git a/src/hanzoai/_types.py b/src/hanzoai/_types.py index 198ceb18..7d34e556 100644 --- a/src/hanzoai/_types.py +++ b/src/hanzoai/_types.py @@ -13,10 +13,21 @@ Mapping, TypeVar, Callable, + Iterator, Optional, Sequence, ) -from typing_extensions import Set, Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable +from typing_extensions import ( + Set, + Literal, + Protocol, + TypeAlias, + TypedDict, + SupportsIndex, + overload, + override, + runtime_checkable, +) import httpx import pydantic @@ -217,3 +228,26 @@ class _GenericAlias(Protocol): class HttpxSendArgs(TypedDict, total=False): auth: httpx.Auth follow_redirects: bool + + +_T_co = TypeVar("_T_co", covariant=True) + + +if TYPE_CHECKING: + # This works because str.__contains__ does not accept object (either in typeshed or at runtime) + # https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285 + class SequenceNotStr(Protocol[_T_co]): + @overload + def __getitem__(self, index: SupportsIndex, /) -> _T_co: ... + @overload + def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ... + def __contains__(self, value: object, /) -> bool: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T_co]: ... + def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ... + def count(self, value: Any, /) -> int: ... + def __reversed__(self) -> Iterator[_T_co]: ... +else: + # just point this to a normal `Sequence` at runtime to avoid having to special case + # deserializing our custom sequence type + SequenceNotStr = Sequence diff --git a/src/hanzoai/_utils/__init__.py b/src/hanzoai/_utils/__init__.py index d4fda26f..dc64e29a 100644 --- a/src/hanzoai/_utils/__init__.py +++ b/src/hanzoai/_utils/__init__.py @@ -10,7 +10,6 @@ lru_cache as lru_cache, is_mapping as is_mapping, is_tuple_t as is_tuple_t, - parse_date as parse_date, is_iterable as is_iterable, is_sequence as is_sequence, coerce_float as coerce_float, @@ -23,7 +22,6 @@ coerce_boolean as coerce_boolean, coerce_integer as coerce_integer, file_from_path as file_from_path, - parse_datetime as parse_datetime, strip_not_given as strip_not_given, deepcopy_minimal as deepcopy_minimal, get_async_library as get_async_library, @@ -32,12 +30,20 @@ maybe_coerce_boolean as maybe_coerce_boolean, maybe_coerce_integer as maybe_coerce_integer, ) +from ._compat import ( + get_args as get_args, + is_union as is_union, + get_origin as get_origin, + is_typeddict as is_typeddict, + is_literal_type as is_literal_type, +) from ._typing import ( is_list_type as is_list_type, is_union_type as is_union_type, extract_type_arg as extract_type_arg, is_iterable_type as is_iterable_type, is_required_type as is_required_type, + is_sequence_type as is_sequence_type, is_annotated_type as is_annotated_type, is_type_alias_type as is_type_alias_type, strip_annotated_type as strip_annotated_type, @@ -55,3 +61,4 @@ function_has_argument as function_has_argument, assert_signatures_in_sync as assert_signatures_in_sync, ) +from ._datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime diff --git a/src/hanzoai/_utils/_compat.py b/src/hanzoai/_utils/_compat.py new file mode 100644 index 00000000..dd703233 --- /dev/null +++ b/src/hanzoai/_utils/_compat.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +import sys +import typing_extensions +from typing import Any, Type, Union, Literal, Optional +from datetime import date, datetime +from typing_extensions import get_args as _get_args, get_origin as _get_origin + +from .._types import StrBytesIntFloat +from ._datetime_parse import parse_date as _parse_date, parse_datetime as _parse_datetime + +_LITERAL_TYPES = {Literal, typing_extensions.Literal} + + +def get_args(tp: type[Any]) -> tuple[Any, ...]: + return _get_args(tp) + + +def get_origin(tp: type[Any]) -> type[Any] | None: + return _get_origin(tp) + + +def is_union(tp: Optional[Type[Any]]) -> bool: + if sys.version_info < (3, 10): + return tp is Union # type: ignore[comparison-overlap] + else: + import types + + return tp is Union or tp is types.UnionType + + +def is_typeddict(tp: Type[Any]) -> bool: + return typing_extensions.is_typeddict(tp) + + +def is_literal_type(tp: Type[Any]) -> bool: + return get_origin(tp) in _LITERAL_TYPES + + +def parse_date(value: Union[date, StrBytesIntFloat]) -> date: + return _parse_date(value) + + +def parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime: + return _parse_datetime(value) diff --git a/src/hanzoai/_utils/_datetime_parse.py b/src/hanzoai/_utils/_datetime_parse.py new file mode 100644 index 00000000..7cb9d9e6 --- /dev/null +++ b/src/hanzoai/_utils/_datetime_parse.py @@ -0,0 +1,136 @@ +""" +This file contains code from https://github.com/pydantic/pydantic/blob/main/pydantic/v1/datetime_parse.py +without the Pydantic v1 specific errors. +""" + +from __future__ import annotations + +import re +from typing import Dict, Union, Optional +from datetime import date, datetime, timezone, timedelta + +from .._types import StrBytesIntFloat + +date_expr = r"(?P\d{4})-(?P\d{1,2})-(?P\d{1,2})" +time_expr = ( + r"(?P\d{1,2}):(?P\d{1,2})" + r"(?::(?P\d{1,2})(?:\.(?P\d{1,6})\d{0,6})?)?" + r"(?PZ|[+-]\d{2}(?::?\d{2})?)?$" +) + +date_re = re.compile(f"{date_expr}$") +datetime_re = re.compile(f"{date_expr}[T ]{time_expr}") + + +EPOCH = datetime(1970, 1, 1) +# if greater than this, the number is in ms, if less than or equal it's in seconds +# (in seconds this is 11th October 2603, in ms it's 20th August 1970) +MS_WATERSHED = int(2e10) +# slightly more than datetime.max in ns - (datetime.max - EPOCH).total_seconds() * 1e9 +MAX_NUMBER = int(3e20) + + +def _get_numeric(value: StrBytesIntFloat, native_expected_type: str) -> Union[None, int, float]: + if isinstance(value, (int, float)): + return value + try: + return float(value) + except ValueError: + return None + except TypeError: + raise TypeError(f"invalid type; expected {native_expected_type}, string, bytes, int or float") from None + + +def _from_unix_seconds(seconds: Union[int, float]) -> datetime: + if seconds > MAX_NUMBER: + return datetime.max + elif seconds < -MAX_NUMBER: + return datetime.min + + while abs(seconds) > MS_WATERSHED: + seconds /= 1000 + dt = EPOCH + timedelta(seconds=seconds) + return dt.replace(tzinfo=timezone.utc) + + +def _parse_timezone(value: Optional[str]) -> Union[None, int, timezone]: + if value == "Z": + return timezone.utc + elif value is not None: + offset_mins = int(value[-2:]) if len(value) > 3 else 0 + offset = 60 * int(value[1:3]) + offset_mins + if value[0] == "-": + offset = -offset + return timezone(timedelta(minutes=offset)) + else: + return None + + +def parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime: + """ + Parse a datetime/int/float/string and return a datetime.datetime. + + This function supports time zone offsets. When the input contains one, + the output uses a timezone with a fixed offset from UTC. + + Raise ValueError if the input is well formatted but not a valid datetime. + Raise ValueError if the input isn't well formatted. + """ + if isinstance(value, datetime): + return value + + number = _get_numeric(value, "datetime") + if number is not None: + return _from_unix_seconds(number) + + if isinstance(value, bytes): + value = value.decode() + + assert not isinstance(value, (float, int)) + + match = datetime_re.match(value) + if match is None: + raise ValueError("invalid datetime format") + + kw = match.groupdict() + if kw["microsecond"]: + kw["microsecond"] = kw["microsecond"].ljust(6, "0") + + tzinfo = _parse_timezone(kw.pop("tzinfo")) + kw_: Dict[str, Union[None, int, timezone]] = {k: int(v) for k, v in kw.items() if v is not None} + kw_["tzinfo"] = tzinfo + + return datetime(**kw_) # type: ignore + + +def parse_date(value: Union[date, StrBytesIntFloat]) -> date: + """ + Parse a date/int/float/string and return a datetime.date. + + Raise ValueError if the input is well formatted but not a valid date. + Raise ValueError if the input isn't well formatted. + """ + if isinstance(value, date): + if isinstance(value, datetime): + return value.date() + else: + return value + + number = _get_numeric(value, "date") + if number is not None: + return _from_unix_seconds(number).date() + + if isinstance(value, bytes): + value = value.decode() + + assert not isinstance(value, (float, int)) + match = date_re.match(value) + if match is None: + raise ValueError("invalid date format") + + kw = {k: int(v) for k, v in match.groupdict().items()} + + try: + return date(**kw) + except ValueError: + raise ValueError("invalid date format") from None diff --git a/src/hanzoai/_utils/_transform.py b/src/hanzoai/_utils/_transform.py index b0cc20a7..c19124f0 100644 --- a/src/hanzoai/_utils/_transform.py +++ b/src/hanzoai/_utils/_transform.py @@ -16,18 +16,20 @@ lru_cache, is_mapping, is_iterable, + is_sequence, ) from .._files import is_base64_file_input +from ._compat import get_origin, is_typeddict from ._typing import ( is_list_type, is_union_type, extract_type_arg, is_iterable_type, is_required_type, + is_sequence_type, is_annotated_type, strip_annotated_type, ) -from .._compat import get_origin, model_dump, is_typeddict _T = TypeVar("_T") @@ -167,6 +169,8 @@ def _transform_recursive( Defaults to the same value as the `annotation` argument. """ + from .._compat import model_dump + if inner_type is None: inner_type = annotation @@ -184,6 +188,8 @@ def _transform_recursive( (is_list_type(stripped_type) and is_list(data)) # Iterable[T] or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str)) + # Sequence[T] + or (is_sequence_type(stripped_type) and is_sequence(data) and not isinstance(data, str)) ): # dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually # intended as an iterable, so we don't transform it. @@ -329,6 +335,8 @@ async def _async_transform_recursive( Defaults to the same value as the `annotation` argument. """ + from .._compat import model_dump + if inner_type is None: inner_type = annotation @@ -346,6 +354,8 @@ async def _async_transform_recursive( (is_list_type(stripped_type) and is_list(data)) # Iterable[T] or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str)) + # Sequence[T] + or (is_sequence_type(stripped_type) and is_sequence(data) and not isinstance(data, str)) ): # dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually # intended as an iterable, so we don't transform it. diff --git a/src/hanzoai/_utils/_typing.py b/src/hanzoai/_utils/_typing.py index 1bac9542..193109f3 100644 --- a/src/hanzoai/_utils/_typing.py +++ b/src/hanzoai/_utils/_typing.py @@ -15,7 +15,7 @@ from ._utils import lru_cache from .._types import InheritsGeneric -from .._compat import is_union as _is_union +from ._compat import is_union as _is_union def is_annotated_type(typ: type) -> bool: @@ -26,6 +26,11 @@ def is_list_type(typ: type) -> bool: return (get_origin(typ) or typ) == list +def is_sequence_type(typ: type) -> bool: + origin = get_origin(typ) or typ + return origin == typing_extensions.Sequence or origin == typing.Sequence or origin == _c_abc.Sequence + + def is_iterable_type(typ: type) -> bool: """If the given type is `typing.Iterable[T]`""" origin = get_origin(typ) or typ diff --git a/src/hanzoai/_utils/_utils.py b/src/hanzoai/_utils/_utils.py index ea3cf3f2..f0818595 100644 --- a/src/hanzoai/_utils/_utils.py +++ b/src/hanzoai/_utils/_utils.py @@ -22,7 +22,6 @@ import sniffio from .._types import NotGiven, FileTypes, NotGivenOr, HeadersLike -from .._compat import parse_date as parse_date, parse_datetime as parse_datetime _T = TypeVar("_T") _TupleT = TypeVar("_TupleT", bound=Tuple[object, ...]) diff --git a/src/hanzoai/resources/budget.py b/src/hanzoai/resources/budget.py index 99fa1f3a..3750f713 100644 --- a/src/hanzoai/resources/budget.py +++ b/src/hanzoai/resources/budget.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Optional +from typing import Dict, Optional import httpx @@ -13,7 +13,7 @@ budget_update_params, budget_settings_params, ) -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -273,7 +273,7 @@ def delete( def info( self, *, - budgets: List[str], + budgets: SequenceNotStr[str], # 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, @@ -594,7 +594,7 @@ async def delete( async def info( self, *, - budgets: List[str], + budgets: SequenceNotStr[str], # 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, diff --git a/src/hanzoai/resources/customer.py b/src/hanzoai/resources/customer.py index 8dc0f5f6..da50e589 100644 --- a/src/hanzoai/resources/customer.py +++ b/src/hanzoai/resources/customer.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Optional +from typing import Dict, Optional from typing_extensions import Literal import httpx @@ -15,7 +15,7 @@ customer_unblock_params, customer_retrieve_info_params, ) -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -280,7 +280,7 @@ def list( def delete( self, *, - user_ids: List[str], + user_ids: SequenceNotStr[str], # 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, @@ -326,7 +326,7 @@ def delete( def block( self, *, - user_ids: List[str], + user_ids: SequenceNotStr[str], # 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, @@ -424,7 +424,7 @@ def retrieve_info( def unblock( self, *, - user_ids: List[str], + user_ids: SequenceNotStr[str], # 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, @@ -712,7 +712,7 @@ async def list( async def delete( self, *, - user_ids: List[str], + user_ids: SequenceNotStr[str], # 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, @@ -758,7 +758,7 @@ async def delete( async def block( self, *, - user_ids: List[str], + user_ids: SequenceNotStr[str], # 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, @@ -856,7 +856,7 @@ async def retrieve_info( async def unblock( self, *, - user_ids: List[str], + user_ids: SequenceNotStr[str], # 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, diff --git a/src/hanzoai/resources/fine_tuning/jobs/jobs.py b/src/hanzoai/resources/fine_tuning/jobs/jobs.py index 3671dd62..b1600483 100644 --- a/src/hanzoai/resources/fine_tuning/jobs/jobs.py +++ b/src/hanzoai/resources/fine_tuning/jobs/jobs.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Optional +from typing import Optional from typing_extensions import Literal import httpx @@ -15,7 +15,7 @@ CancelResourceWithStreamingResponse, AsyncCancelResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -62,7 +62,7 @@ def create( model: str, training_file: str, hyperparameters: Optional[job_create_params.Hyperparameters] | NotGiven = NOT_GIVEN, - integrations: Optional[List[str]] | 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, @@ -254,7 +254,7 @@ async def create( model: str, training_file: str, hyperparameters: Optional[job_create_params.Hyperparameters] | NotGiven = NOT_GIVEN, - integrations: Optional[List[str]] | 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, diff --git a/src/hanzoai/resources/key/key.py b/src/hanzoai/resources/key/key.py index 54508753..7c79dd4a 100644 --- a/src/hanzoai/resources/key/key.py +++ b/src/hanzoai/resources/key/key.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Union, Iterable, Optional +from typing import Union, Iterable, Optional from datetime import datetime import httpx @@ -17,7 +17,7 @@ key_retrieve_info_params, key_regenerate_by_key_params, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from ..._utils import maybe_transform, strip_not_given, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -67,8 +67,8 @@ def update( budget_id: Optional[str] | NotGiven = NOT_GIVEN, config: Optional[object] | NotGiven = NOT_GIVEN, duration: Optional[str] | NotGiven = NOT_GIVEN, - enforced_params: Optional[List[str]] | NotGiven = NOT_GIVEN, - guardrails: Optional[List[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, @@ -80,7 +80,7 @@ def update( permissions: Optional[object] | NotGiven = NOT_GIVEN, rpm_limit: Optional[int] | NotGiven = NOT_GIVEN, spend: Optional[float] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | 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, @@ -282,8 +282,8 @@ def list( def delete( self, *, - key_aliases: Optional[List[str]] | NotGiven = NOT_GIVEN, - keys: Optional[List[str]] | NotGiven = NOT_GIVEN, + key_aliases: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + keys: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, llm_changed_by: str | NotGiven = NOT_GIVEN, # 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. @@ -468,8 +468,8 @@ def generate( budget_id: Optional[str] | NotGiven = NOT_GIVEN, config: Optional[object] | NotGiven = NOT_GIVEN, duration: Optional[str] | NotGiven = NOT_GIVEN, - enforced_params: Optional[List[str]] | NotGiven = NOT_GIVEN, - guardrails: Optional[List[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, @@ -484,7 +484,7 @@ def generate( send_invite_email: Optional[bool] | NotGiven = NOT_GIVEN, soft_budget: Optional[float] | NotGiven = NOT_GIVEN, spend: Optional[float] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | 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, @@ -645,8 +645,8 @@ def regenerate_by_key( budget_id: Optional[str] | NotGiven = NOT_GIVEN, config: Optional[object] | NotGiven = NOT_GIVEN, duration: Optional[str] | NotGiven = NOT_GIVEN, - enforced_params: Optional[List[str]] | NotGiven = NOT_GIVEN, - guardrails: Optional[List[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, @@ -662,7 +662,7 @@ def regenerate_by_key( send_invite_email: Optional[bool] | NotGiven = NOT_GIVEN, soft_budget: Optional[float] | NotGiven = NOT_GIVEN, spend: Optional[float] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | 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, @@ -920,8 +920,8 @@ async def update( budget_id: Optional[str] | NotGiven = NOT_GIVEN, config: Optional[object] | NotGiven = NOT_GIVEN, duration: Optional[str] | NotGiven = NOT_GIVEN, - enforced_params: Optional[List[str]] | NotGiven = NOT_GIVEN, - guardrails: Optional[List[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, @@ -933,7 +933,7 @@ async def update( permissions: Optional[object] | NotGiven = NOT_GIVEN, rpm_limit: Optional[int] | NotGiven = NOT_GIVEN, spend: Optional[float] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | 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, @@ -1135,8 +1135,8 @@ async def list( async def delete( self, *, - key_aliases: Optional[List[str]] | NotGiven = NOT_GIVEN, - keys: Optional[List[str]] | NotGiven = NOT_GIVEN, + key_aliases: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + keys: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, llm_changed_by: str | NotGiven = NOT_GIVEN, # 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. @@ -1321,8 +1321,8 @@ async def generate( budget_id: Optional[str] | NotGiven = NOT_GIVEN, config: Optional[object] | NotGiven = NOT_GIVEN, duration: Optional[str] | NotGiven = NOT_GIVEN, - enforced_params: Optional[List[str]] | NotGiven = NOT_GIVEN, - guardrails: Optional[List[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, @@ -1337,7 +1337,7 @@ async def generate( send_invite_email: Optional[bool] | NotGiven = NOT_GIVEN, soft_budget: Optional[float] | NotGiven = NOT_GIVEN, spend: Optional[float] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | 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, @@ -1498,8 +1498,8 @@ async def regenerate_by_key( budget_id: Optional[str] | NotGiven = NOT_GIVEN, config: Optional[object] | NotGiven = NOT_GIVEN, duration: Optional[str] | NotGiven = NOT_GIVEN, - enforced_params: Optional[List[str]] | NotGiven = NOT_GIVEN, - guardrails: Optional[List[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, @@ -1515,7 +1515,7 @@ async def regenerate_by_key( send_invite_email: Optional[bool] | NotGiven = NOT_GIVEN, soft_budget: Optional[float] | NotGiven = NOT_GIVEN, spend: Optional[float] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | 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, diff --git a/src/hanzoai/resources/organization/info.py b/src/hanzoai/resources/organization/info.py index 1131dc3d..d43e6935 100644 --- a/src/hanzoai/resources/organization/info.py +++ b/src/hanzoai/resources/organization/info.py @@ -2,11 +2,9 @@ from __future__ import annotations -from typing import List - import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -81,7 +79,7 @@ def retrieve( def deprecated( self, *, - organizations: List[str], + organizations: SequenceNotStr[str], # 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, @@ -171,7 +169,7 @@ async def retrieve( async def deprecated( self, *, - organizations: List[str], + organizations: SequenceNotStr[str], # 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, diff --git a/src/hanzoai/resources/organization/organization.py b/src/hanzoai/resources/organization/organization.py index 4a5ce535..44912257 100644 --- a/src/hanzoai/resources/organization/organization.py +++ b/src/hanzoai/resources/organization/organization.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Literal import httpx @@ -23,7 +23,7 @@ organization_delete_member_params, organization_update_member_params, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -195,7 +195,7 @@ def update( *, budget_id: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[object] | NotGiven = NOT_GIVEN, - models: Optional[List[str]] | 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, @@ -265,7 +265,7 @@ def list( def delete( self, *, - organization_ids: List[str], + organization_ids: SequenceNotStr[str], # 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, @@ -638,7 +638,7 @@ async def update( *, budget_id: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[object] | NotGiven = NOT_GIVEN, - models: Optional[List[str]] | 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, @@ -708,7 +708,7 @@ async def list( async def delete( self, *, - organization_ids: List[str], + organization_ids: SequenceNotStr[str], # 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, diff --git a/src/hanzoai/resources/team/model.py b/src/hanzoai/resources/team/model.py index ae64a4b6..e6f19293 100644 --- a/src/hanzoai/resources/team/model.py +++ b/src/hanzoai/resources/team/model.py @@ -2,11 +2,9 @@ from __future__ import annotations -from typing import List - import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -45,7 +43,7 @@ def with_streaming_response(self) -> ModelResourceWithStreamingResponse: def add( self, *, - models: List[str], + models: SequenceNotStr[str], team_id: str, # 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. @@ -100,7 +98,7 @@ def add( def remove( self, *, - models: List[str], + models: SequenceNotStr[str], team_id: str, # 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. @@ -176,7 +174,7 @@ def with_streaming_response(self) -> AsyncModelResourceWithStreamingResponse: async def add( self, *, - models: List[str], + models: SequenceNotStr[str], team_id: str, # 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. @@ -231,7 +229,7 @@ async def add( async def remove( self, *, - models: List[str], + models: SequenceNotStr[str], team_id: str, # 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. diff --git a/src/hanzoai/resources/team/team.py b/src/hanzoai/resources/team/team.py index cbacd2d1..ca0791b0 100644 --- a/src/hanzoai/resources/team/team.py +++ b/src/hanzoai/resources/team/team.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Literal import httpx @@ -28,7 +28,7 @@ team_update_member_params, team_list_available_params, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from ..._utils import maybe_transform, strip_not_given, async_maybe_transform from .callback import ( CallbackResource, @@ -89,7 +89,7 @@ def create( admins: Iterable[object] | NotGiven = NOT_GIVEN, blocked: bool | NotGiven = NOT_GIVEN, budget_duration: Optional[str] | NotGiven = NOT_GIVEN, - guardrails: Optional[List[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, @@ -227,7 +227,7 @@ def update( team_id: str, blocked: Optional[bool] | NotGiven = NOT_GIVEN, budget_duration: Optional[str] | NotGiven = NOT_GIVEN, - guardrails: Optional[List[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, @@ -394,7 +394,7 @@ def list( def delete( self, *, - team_ids: List[str], + team_ids: SequenceNotStr[str], llm_changed_by: str | NotGiven = NOT_GIVEN, # 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. @@ -847,7 +847,7 @@ async def create( admins: Iterable[object] | NotGiven = NOT_GIVEN, blocked: bool | NotGiven = NOT_GIVEN, budget_duration: Optional[str] | NotGiven = NOT_GIVEN, - guardrails: Optional[List[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, @@ -985,7 +985,7 @@ async def update( team_id: str, blocked: Optional[bool] | NotGiven = NOT_GIVEN, budget_duration: Optional[str] | NotGiven = NOT_GIVEN, - guardrails: Optional[List[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, @@ -1152,7 +1152,7 @@ async def list( async def delete( self, *, - team_ids: List[str], + team_ids: SequenceNotStr[str], llm_changed_by: str | NotGiven = NOT_GIVEN, # 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. diff --git a/src/hanzoai/resources/user.py b/src/hanzoai/resources/user.py index c9e6a1fd..90501868 100644 --- a/src/hanzoai/resources/user.py +++ b/src/hanzoai/resources/user.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Literal import httpx @@ -14,7 +14,7 @@ user_update_params, user_retrieve_info_params, ) -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from .._utils import maybe_transform, strip_not_given, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -60,7 +60,7 @@ def create( budget_duration: Optional[str] | NotGiven = NOT_GIVEN, config: Optional[object] | NotGiven = NOT_GIVEN, duration: Optional[str] | NotGiven = NOT_GIVEN, - guardrails: Optional[List[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, @@ -231,7 +231,7 @@ def update( budget_duration: Optional[str] | NotGiven = NOT_GIVEN, config: Optional[object] | NotGiven = NOT_GIVEN, duration: Optional[str] | NotGiven = NOT_GIVEN, - guardrails: Optional[List[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, @@ -434,7 +434,7 @@ def list( def delete( self, *, - user_ids: List[str], + user_ids: SequenceNotStr[str], llm_changed_by: str | NotGiven = NOT_GIVEN, # 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. @@ -557,7 +557,7 @@ async def create( budget_duration: Optional[str] | NotGiven = NOT_GIVEN, config: Optional[object] | NotGiven = NOT_GIVEN, duration: Optional[str] | NotGiven = NOT_GIVEN, - guardrails: Optional[List[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, @@ -728,7 +728,7 @@ async def update( budget_duration: Optional[str] | NotGiven = NOT_GIVEN, config: Optional[object] | NotGiven = NOT_GIVEN, duration: Optional[str] | NotGiven = NOT_GIVEN, - guardrails: Optional[List[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, @@ -931,7 +931,7 @@ async def list( async def delete( self, *, - user_ids: List[str], + user_ids: SequenceNotStr[str], llm_changed_by: str | NotGiven = NOT_GIVEN, # 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. diff --git a/src/hanzoai/types/budget_info_params.py b/src/hanzoai/types/budget_info_params.py index aba6da88..5676b674 100644 --- a/src/hanzoai/types/budget_info_params.py +++ b/src/hanzoai/types/budget_info_params.py @@ -2,11 +2,12 @@ from __future__ import annotations -from typing import List from typing_extensions import Required, TypedDict +from .._types import SequenceNotStr + __all__ = ["BudgetInfoParams"] class BudgetInfoParams(TypedDict, total=False): - budgets: Required[List[str]] + budgets: Required[SequenceNotStr[str]] diff --git a/src/hanzoai/types/customer_block_params.py b/src/hanzoai/types/customer_block_params.py index 59f7b0f9..0e9a4eae 100644 --- a/src/hanzoai/types/customer_block_params.py +++ b/src/hanzoai/types/customer_block_params.py @@ -2,11 +2,12 @@ from __future__ import annotations -from typing import List from typing_extensions import Required, TypedDict +from .._types import SequenceNotStr + __all__ = ["CustomerBlockParams"] class CustomerBlockParams(TypedDict, total=False): - user_ids: Required[List[str]] + user_ids: Required[SequenceNotStr[str]] diff --git a/src/hanzoai/types/customer_delete_params.py b/src/hanzoai/types/customer_delete_params.py index 75ca9063..7c1603f5 100644 --- a/src/hanzoai/types/customer_delete_params.py +++ b/src/hanzoai/types/customer_delete_params.py @@ -2,11 +2,12 @@ from __future__ import annotations -from typing import List from typing_extensions import Required, TypedDict +from .._types import SequenceNotStr + __all__ = ["CustomerDeleteParams"] class CustomerDeleteParams(TypedDict, total=False): - user_ids: Required[List[str]] + user_ids: Required[SequenceNotStr[str]] diff --git a/src/hanzoai/types/customer_unblock_params.py b/src/hanzoai/types/customer_unblock_params.py index a8157286..8d4c4b22 100644 --- a/src/hanzoai/types/customer_unblock_params.py +++ b/src/hanzoai/types/customer_unblock_params.py @@ -2,11 +2,12 @@ from __future__ import annotations -from typing import List from typing_extensions import Required, TypedDict +from .._types import SequenceNotStr + __all__ = ["CustomerUnblockParams"] class CustomerUnblockParams(TypedDict, total=False): - user_ids: Required[List[str]] + user_ids: Required[SequenceNotStr[str]] diff --git a/src/hanzoai/types/fine_tuning/job_create_params.py b/src/hanzoai/types/fine_tuning/job_create_params.py index 6fe3533f..cc37b222 100644 --- a/src/hanzoai/types/fine_tuning/job_create_params.py +++ b/src/hanzoai/types/fine_tuning/job_create_params.py @@ -2,9 +2,11 @@ from __future__ import annotations -from typing import List, Union, Optional +from typing import Union, Optional from typing_extensions import Literal, Required, TypedDict +from ..._types import SequenceNotStr + __all__ = ["JobCreateParams", "Hyperparameters"] @@ -17,7 +19,7 @@ class JobCreateParams(TypedDict, total=False): hyperparameters: Optional[Hyperparameters] - integrations: Optional[List[str]] + integrations: Optional[SequenceNotStr[str]] seed: Optional[int] diff --git a/src/hanzoai/types/key_delete_params.py b/src/hanzoai/types/key_delete_params.py index b6a33b66..5872e9d0 100644 --- a/src/hanzoai/types/key_delete_params.py +++ b/src/hanzoai/types/key_delete_params.py @@ -2,18 +2,19 @@ from __future__ import annotations -from typing import List, Optional +from typing import Optional from typing_extensions import Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["KeyDeleteParams"] class KeyDeleteParams(TypedDict, total=False): - key_aliases: Optional[List[str]] + key_aliases: Optional[SequenceNotStr[str]] - keys: Optional[List[str]] + keys: Optional[SequenceNotStr[str]] llm_changed_by: Annotated[str, PropertyInfo(alias="llm-changed-by")] """ diff --git a/src/hanzoai/types/key_generate_params.py b/src/hanzoai/types/key_generate_params.py index edc1353d..aab469a1 100644 --- a/src/hanzoai/types/key_generate_params.py +++ b/src/hanzoai/types/key_generate_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["KeyGenerateParams"] @@ -25,9 +26,9 @@ class KeyGenerateParams(TypedDict, total=False): duration: Optional[str] - enforced_params: Optional[List[str]] + enforced_params: Optional[SequenceNotStr[str]] - guardrails: Optional[List[str]] + guardrails: Optional[SequenceNotStr[str]] key: Optional[str] @@ -57,7 +58,7 @@ class KeyGenerateParams(TypedDict, total=False): spend: Optional[float] - tags: Optional[List[str]] + tags: Optional[SequenceNotStr[str]] team_id: Optional[str] diff --git a/src/hanzoai/types/key_regenerate_by_key_params.py b/src/hanzoai/types/key_regenerate_by_key_params.py index e6758be1..2ed9f961 100644 --- a/src/hanzoai/types/key_regenerate_by_key_params.py +++ b/src/hanzoai/types/key_regenerate_by_key_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["KeyRegenerateByKeyParams"] @@ -25,9 +26,9 @@ class KeyRegenerateByKeyParams(TypedDict, total=False): duration: Optional[str] - enforced_params: Optional[List[str]] + enforced_params: Optional[SequenceNotStr[str]] - guardrails: Optional[List[str]] + guardrails: Optional[SequenceNotStr[str]] body_key: Annotated[Optional[str], PropertyInfo(alias="key")] @@ -59,7 +60,7 @@ class KeyRegenerateByKeyParams(TypedDict, total=False): spend: Optional[float] - tags: Optional[List[str]] + tags: Optional[SequenceNotStr[str]] team_id: Optional[str] diff --git a/src/hanzoai/types/key_update_params.py b/src/hanzoai/types/key_update_params.py index 77ac2045..ebc7bca6 100644 --- a/src/hanzoai/types/key_update_params.py +++ b/src/hanzoai/types/key_update_params.py @@ -2,10 +2,11 @@ from __future__ import annotations -from typing import List, Union, Iterable, Optional +from typing import Union, Iterable, Optional from datetime import datetime from typing_extensions import Required, Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["KeyUpdateParams"] @@ -28,9 +29,9 @@ class KeyUpdateParams(TypedDict, total=False): duration: Optional[str] - enforced_params: Optional[List[str]] + enforced_params: Optional[SequenceNotStr[str]] - guardrails: Optional[List[str]] + guardrails: Optional[SequenceNotStr[str]] key_alias: Optional[str] @@ -54,7 +55,7 @@ class KeyUpdateParams(TypedDict, total=False): spend: Optional[float] - tags: Optional[List[str]] + tags: Optional[SequenceNotStr[str]] team_id: Optional[str] diff --git a/src/hanzoai/types/model/update_full_params.py b/src/hanzoai/types/model/update_full_params.py index fe0a6141..0bad3219 100644 --- a/src/hanzoai/types/model/update_full_params.py +++ b/src/hanzoai/types/model/update_full_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import Dict, List, Union, Optional +from typing import Dict, Union, Optional from typing_extensions import TypeAlias, TypedDict +from ..._types import SequenceNotStr from ..model_info_param import ModelInfoParam from ..configurable_clientside_params_custom_auth_param import ConfigurableClientsideParamsCustomAuthParam @@ -37,7 +38,7 @@ class LlmParamsTyped(TypedDict, total=False): budget_duration: Optional[str] - configurable_clientside_auth_params: Optional[List[LlmParamsConfigurableClientsideAuthParam]] + configurable_clientside_auth_params: Optional[SequenceNotStr[LlmParamsConfigurableClientsideAuthParam]] custom_llm_provider: Optional[str] diff --git a/src/hanzoai/types/model/update_partial_params.py b/src/hanzoai/types/model/update_partial_params.py index e018e6f1..d31d31a6 100644 --- a/src/hanzoai/types/model/update_partial_params.py +++ b/src/hanzoai/types/model/update_partial_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import Dict, List, Union, Optional +from typing import Dict, Union, Optional from typing_extensions import TypeAlias, TypedDict +from ..._types import SequenceNotStr from ..model_info_param import ModelInfoParam from ..configurable_clientside_params_custom_auth_param import ConfigurableClientsideParamsCustomAuthParam @@ -37,7 +38,7 @@ class LlmParamsTyped(TypedDict, total=False): budget_duration: Optional[str] - configurable_clientside_auth_params: Optional[List[LlmParamsConfigurableClientsideAuthParam]] + configurable_clientside_auth_params: Optional[SequenceNotStr[LlmParamsConfigurableClientsideAuthParam]] custom_llm_provider: Optional[str] diff --git a/src/hanzoai/types/model_create_params.py b/src/hanzoai/types/model_create_params.py index dbec510c..62fac2eb 100644 --- a/src/hanzoai/types/model_create_params.py +++ b/src/hanzoai/types/model_create_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import Dict, List, Union, Optional +from typing import Dict, Union, Optional from typing_extensions import Required, TypeAlias, TypedDict +from .._types import SequenceNotStr from .model_info_param import ModelInfoParam from .configurable_clientside_params_custom_auth_param import ConfigurableClientsideParamsCustomAuthParam @@ -40,7 +41,7 @@ class LlmParamsTyped(TypedDict, total=False): budget_duration: Optional[str] - configurable_clientside_auth_params: Optional[List[LlmParamsConfigurableClientsideAuthParam]] + configurable_clientside_auth_params: Optional[SequenceNotStr[LlmParamsConfigurableClientsideAuthParam]] custom_llm_provider: Optional[str] diff --git a/src/hanzoai/types/organization/info_deprecated_params.py b/src/hanzoai/types/organization/info_deprecated_params.py index 63504cf3..e26d61f4 100644 --- a/src/hanzoai/types/organization/info_deprecated_params.py +++ b/src/hanzoai/types/organization/info_deprecated_params.py @@ -2,11 +2,12 @@ from __future__ import annotations -from typing import List from typing_extensions import Required, TypedDict +from ..._types import SequenceNotStr + __all__ = ["InfoDeprecatedParams"] class InfoDeprecatedParams(TypedDict, total=False): - organizations: Required[List[str]] + organizations: Required[SequenceNotStr[str]] diff --git a/src/hanzoai/types/organization_delete_params.py b/src/hanzoai/types/organization_delete_params.py index ef720f39..99901d81 100644 --- a/src/hanzoai/types/organization_delete_params.py +++ b/src/hanzoai/types/organization_delete_params.py @@ -2,11 +2,12 @@ from __future__ import annotations -from typing import List from typing_extensions import Required, TypedDict +from .._types import SequenceNotStr + __all__ = ["OrganizationDeleteParams"] class OrganizationDeleteParams(TypedDict, total=False): - organization_ids: Required[List[str]] + organization_ids: Required[SequenceNotStr[str]] diff --git a/src/hanzoai/types/organization_update_params.py b/src/hanzoai/types/organization_update_params.py index 1432738b..d0e2e065 100644 --- a/src/hanzoai/types/organization_update_params.py +++ b/src/hanzoai/types/organization_update_params.py @@ -2,9 +2,11 @@ from __future__ import annotations -from typing import List, Optional +from typing import Optional from typing_extensions import TypedDict +from .._types import SequenceNotStr + __all__ = ["OrganizationUpdateParams"] @@ -13,7 +15,7 @@ class OrganizationUpdateParams(TypedDict, total=False): metadata: Optional[object] - models: Optional[List[str]] + models: Optional[SequenceNotStr[str]] organization_alias: Optional[str] diff --git a/src/hanzoai/types/team/model_add_params.py b/src/hanzoai/types/team/model_add_params.py index 8df4798f..bd3521a6 100644 --- a/src/hanzoai/types/team/model_add_params.py +++ b/src/hanzoai/types/team/model_add_params.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing import List from typing_extensions import Required, TypedDict +from ..._types import SequenceNotStr + __all__ = ["ModelAddParams"] class ModelAddParams(TypedDict, total=False): - models: Required[List[str]] + models: Required[SequenceNotStr[str]] team_id: Required[str] diff --git a/src/hanzoai/types/team/model_remove_params.py b/src/hanzoai/types/team/model_remove_params.py index f3fa3818..4205c523 100644 --- a/src/hanzoai/types/team/model_remove_params.py +++ b/src/hanzoai/types/team/model_remove_params.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing import List from typing_extensions import Required, TypedDict +from ..._types import SequenceNotStr + __all__ = ["ModelRemoveParams"] class ModelRemoveParams(TypedDict, total=False): - models: Required[List[str]] + models: Required[SequenceNotStr[str]] team_id: Required[str] diff --git a/src/hanzoai/types/team_create_params.py b/src/hanzoai/types/team_create_params.py index e7e04406..f7a370bb 100644 --- a/src/hanzoai/types/team_create_params.py +++ b/src/hanzoai/types/team_create_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo from .member_param import MemberParam @@ -18,7 +19,7 @@ class TeamCreateParams(TypedDict, total=False): budget_duration: Optional[str] - guardrails: Optional[List[str]] + guardrails: Optional[SequenceNotStr[str]] max_budget: Optional[float] diff --git a/src/hanzoai/types/team_delete_params.py b/src/hanzoai/types/team_delete_params.py index 2b026f7b..7e3a49f9 100644 --- a/src/hanzoai/types/team_delete_params.py +++ b/src/hanzoai/types/team_delete_params.py @@ -2,16 +2,16 @@ from __future__ import annotations -from typing import List from typing_extensions import Required, Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["TeamDeleteParams"] class TeamDeleteParams(TypedDict, total=False): - team_ids: Required[List[str]] + team_ids: Required[SequenceNotStr[str]] llm_changed_by: Annotated[str, PropertyInfo(alias="llm-changed-by")] """ diff --git a/src/hanzoai/types/team_update_params.py b/src/hanzoai/types/team_update_params.py index d674c0dc..432c7ecd 100644 --- a/src/hanzoai/types/team_update_params.py +++ b/src/hanzoai/types/team_update_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Required, Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["TeamUpdateParams"] @@ -17,7 +18,7 @@ class TeamUpdateParams(TypedDict, total=False): budget_duration: Optional[str] - guardrails: Optional[List[str]] + guardrails: Optional[SequenceNotStr[str]] max_budget: Optional[float] diff --git a/src/hanzoai/types/user_create_params.py b/src/hanzoai/types/user_create_params.py index df5571c0..e0b69e95 100644 --- a/src/hanzoai/types/user_create_params.py +++ b/src/hanzoai/types/user_create_params.py @@ -2,9 +2,11 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Literal, TypedDict +from .._types import SequenceNotStr + __all__ = ["UserCreateParams"] @@ -23,7 +25,7 @@ class UserCreateParams(TypedDict, total=False): duration: Optional[str] - guardrails: Optional[List[str]] + guardrails: Optional[SequenceNotStr[str]] key_alias: Optional[str] diff --git a/src/hanzoai/types/user_delete_params.py b/src/hanzoai/types/user_delete_params.py index 8810770f..eac116b3 100644 --- a/src/hanzoai/types/user_delete_params.py +++ b/src/hanzoai/types/user_delete_params.py @@ -2,16 +2,16 @@ from __future__ import annotations -from typing import List from typing_extensions import Required, Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["UserDeleteParams"] class UserDeleteParams(TypedDict, total=False): - user_ids: Required[List[str]] + user_ids: Required[SequenceNotStr[str]] llm_changed_by: Annotated[str, PropertyInfo(alias="llm-changed-by")] """ diff --git a/src/hanzoai/types/user_update_params.py b/src/hanzoai/types/user_update_params.py index c94fccad..0f0a9ddd 100644 --- a/src/hanzoai/types/user_update_params.py +++ b/src/hanzoai/types/user_update_params.py @@ -2,9 +2,11 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Literal, TypedDict +from .._types import SequenceNotStr + __all__ = ["UserUpdateParams"] @@ -21,7 +23,7 @@ class UserUpdateParams(TypedDict, total=False): duration: Optional[str] - guardrails: Optional[List[str]] + guardrails: Optional[SequenceNotStr[str]] key_alias: Optional[str] diff --git a/tests/api_resources/audio/test_speech.py b/tests/api_resources/audio/test_speech.py index f9e29adb..351c4837 100644 --- a/tests/api_resources/audio/test_speech.py +++ b/tests/api_resources/audio/test_speech.py @@ -16,13 +16,13 @@ class TestSpeech: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: speech = client.audio.speech.create() assert_matches_type(object, speech, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.audio.speech.with_raw_response.create() @@ -32,7 +32,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: speech = response.parse() assert_matches_type(object, speech, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.audio.speech.with_streaming_response.create() as response: @@ -50,13 +50,13 @@ class TestAsyncSpeech: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: speech = await async_client.audio.speech.create() assert_matches_type(object, speech, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.audio.speech.with_raw_response.create() @@ -66,7 +66,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: speech = await response.parse() assert_matches_type(object, speech, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.audio.speech.with_streaming_response.create() as response: diff --git a/tests/api_resources/audio/test_transcriptions.py b/tests/api_resources/audio/test_transcriptions.py index f7ad9434..d9ffbf8f 100644 --- a/tests/api_resources/audio/test_transcriptions.py +++ b/tests/api_resources/audio/test_transcriptions.py @@ -16,7 +16,7 @@ class TestTranscriptions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: transcription = client.audio.transcriptions.create( @@ -24,7 +24,7 @@ def test_method_create(self, client: Hanzo) -> None: ) assert_matches_type(object, transcription, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.audio.transcriptions.with_raw_response.create( @@ -36,7 +36,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: transcription = response.parse() assert_matches_type(object, transcription, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.audio.transcriptions.with_streaming_response.create( @@ -56,7 +56,7 @@ class TestAsyncTranscriptions: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: transcription = await async_client.audio.transcriptions.create( @@ -64,7 +64,7 @@ async def test_method_create(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, transcription, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.audio.transcriptions.with_raw_response.create( @@ -76,7 +76,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: transcription = await response.parse() assert_matches_type(object, transcription, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.audio.transcriptions.with_streaming_response.create( diff --git a/tests/api_resources/batches/test_cancel.py b/tests/api_resources/batches/test_cancel.py index 875c43a5..740f777d 100644 --- a/tests/api_resources/batches/test_cancel.py +++ b/tests/api_resources/batches/test_cancel.py @@ -16,7 +16,7 @@ class TestCancel: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_cancel(self, client: Hanzo) -> None: cancel = client.batches.cancel.cancel( @@ -24,7 +24,7 @@ def test_method_cancel(self, client: Hanzo) -> None: ) assert_matches_type(object, cancel, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_cancel_with_all_params(self, client: Hanzo) -> None: cancel = client.batches.cancel.cancel( @@ -33,7 +33,7 @@ def test_method_cancel_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, cancel, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_cancel(self, client: Hanzo) -> None: response = client.batches.cancel.with_raw_response.cancel( @@ -45,7 +45,7 @@ def test_raw_response_cancel(self, client: Hanzo) -> None: cancel = response.parse() assert_matches_type(object, cancel, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_cancel(self, client: Hanzo) -> None: with client.batches.cancel.with_streaming_response.cancel( @@ -59,7 +59,7 @@ def test_streaming_response_cancel(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_cancel(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `batch_id` but received ''"): @@ -73,7 +73,7 @@ class TestAsyncCancel: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_cancel(self, async_client: AsyncHanzo) -> None: cancel = await async_client.batches.cancel.cancel( @@ -81,7 +81,7 @@ async def test_method_cancel(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, cancel, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_cancel_with_all_params(self, async_client: AsyncHanzo) -> None: cancel = await async_client.batches.cancel.cancel( @@ -90,7 +90,7 @@ async def test_method_cancel_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, cancel, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_cancel(self, async_client: AsyncHanzo) -> None: response = await async_client.batches.cancel.with_raw_response.cancel( @@ -102,7 +102,7 @@ async def test_raw_response_cancel(self, async_client: AsyncHanzo) -> None: cancel = await response.parse() assert_matches_type(object, cancel, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_cancel(self, async_client: AsyncHanzo) -> None: async with async_client.batches.cancel.with_streaming_response.cancel( @@ -116,7 +116,7 @@ async def test_streaming_response_cancel(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_cancel(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `batch_id` but received ''"): diff --git a/tests/api_resources/cache/test_redis.py b/tests/api_resources/cache/test_redis.py index b7c10ebd..0c9a7a29 100644 --- a/tests/api_resources/cache/test_redis.py +++ b/tests/api_resources/cache/test_redis.py @@ -16,13 +16,13 @@ class TestRedis: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_info(self, client: Hanzo) -> None: redi = client.cache.redis.retrieve_info() assert_matches_type(object, redi, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve_info(self, client: Hanzo) -> None: response = client.cache.redis.with_raw_response.retrieve_info() @@ -32,7 +32,7 @@ def test_raw_response_retrieve_info(self, client: Hanzo) -> None: redi = response.parse() assert_matches_type(object, redi, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve_info(self, client: Hanzo) -> None: with client.cache.redis.with_streaming_response.retrieve_info() as response: @@ -50,13 +50,13 @@ class TestAsyncRedis: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_info(self, async_client: AsyncHanzo) -> None: redi = await async_client.cache.redis.retrieve_info() assert_matches_type(object, redi, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve_info(self, async_client: AsyncHanzo) -> None: response = await async_client.cache.redis.with_raw_response.retrieve_info() @@ -66,7 +66,7 @@ async def test_raw_response_retrieve_info(self, async_client: AsyncHanzo) -> Non redi = await response.parse() assert_matches_type(object, redi, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve_info(self, async_client: AsyncHanzo) -> None: async with async_client.cache.redis.with_streaming_response.retrieve_info() as response: diff --git a/tests/api_resources/chat/test_completions.py b/tests/api_resources/chat/test_completions.py index b5999500..c52205e0 100644 --- a/tests/api_resources/chat/test_completions.py +++ b/tests/api_resources/chat/test_completions.py @@ -16,13 +16,13 @@ class TestCompletions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: completion = client.chat.completions.create() assert_matches_type(object, completion, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Hanzo) -> None: completion = client.chat.completions.create( @@ -30,7 +30,7 @@ def test_method_create_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, completion, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.chat.completions.with_raw_response.create() @@ -40,7 +40,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: completion = response.parse() assert_matches_type(object, completion, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.chat.completions.with_streaming_response.create() as response: @@ -58,13 +58,13 @@ class TestAsyncCompletions: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: completion = await async_client.chat.completions.create() assert_matches_type(object, completion, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> None: completion = await async_client.chat.completions.create( @@ -72,7 +72,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, completion, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.chat.completions.with_raw_response.create() @@ -82,7 +82,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: completion = await response.parse() assert_matches_type(object, completion, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.chat.completions.with_streaming_response.create() as response: diff --git a/tests/api_resources/config/test_pass_through_endpoint.py b/tests/api_resources/config/test_pass_through_endpoint.py index 3aed89f3..e8c422a3 100644 --- a/tests/api_resources/config/test_pass_through_endpoint.py +++ b/tests/api_resources/config/test_pass_through_endpoint.py @@ -19,7 +19,7 @@ class TestPassThroughEndpoint: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: pass_through_endpoint = client.config.pass_through_endpoint.create( @@ -29,7 +29,7 @@ def test_method_create(self, client: Hanzo) -> None: ) assert_matches_type(object, pass_through_endpoint, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.config.pass_through_endpoint.with_raw_response.create( @@ -43,7 +43,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: pass_through_endpoint = response.parse() assert_matches_type(object, pass_through_endpoint, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.config.pass_through_endpoint.with_streaming_response.create( @@ -59,7 +59,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Hanzo) -> None: pass_through_endpoint = client.config.pass_through_endpoint.update( @@ -67,7 +67,7 @@ def test_method_update(self, client: Hanzo) -> None: ) assert_matches_type(object, pass_through_endpoint, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Hanzo) -> None: response = client.config.pass_through_endpoint.with_raw_response.update( @@ -79,7 +79,7 @@ def test_raw_response_update(self, client: Hanzo) -> None: pass_through_endpoint = response.parse() assert_matches_type(object, pass_through_endpoint, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Hanzo) -> None: with client.config.pass_through_endpoint.with_streaming_response.update( @@ -93,7 +93,7 @@ def test_streaming_response_update(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_update(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint_id` but received ''"): @@ -101,13 +101,13 @@ def test_path_params_update(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Hanzo) -> None: pass_through_endpoint = client.config.pass_through_endpoint.list() assert_matches_type(PassThroughEndpointResponse, pass_through_endpoint, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Hanzo) -> None: pass_through_endpoint = client.config.pass_through_endpoint.list( @@ -115,7 +115,7 @@ def test_method_list_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(PassThroughEndpointResponse, pass_through_endpoint, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Hanzo) -> None: response = client.config.pass_through_endpoint.with_raw_response.list() @@ -125,7 +125,7 @@ def test_raw_response_list(self, client: Hanzo) -> None: pass_through_endpoint = response.parse() assert_matches_type(PassThroughEndpointResponse, pass_through_endpoint, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Hanzo) -> None: with client.config.pass_through_endpoint.with_streaming_response.list() as response: @@ -137,7 +137,7 @@ def test_streaming_response_list(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: pass_through_endpoint = client.config.pass_through_endpoint.delete( @@ -145,7 +145,7 @@ def test_method_delete(self, client: Hanzo) -> None: ) assert_matches_type(PassThroughEndpointResponse, pass_through_endpoint, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.config.pass_through_endpoint.with_raw_response.delete( @@ -157,7 +157,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: pass_through_endpoint = response.parse() assert_matches_type(PassThroughEndpointResponse, pass_through_endpoint, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.config.pass_through_endpoint.with_streaming_response.delete( @@ -177,7 +177,7 @@ class TestAsyncPassThroughEndpoint: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: pass_through_endpoint = await async_client.config.pass_through_endpoint.create( @@ -187,7 +187,7 @@ async def test_method_create(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, pass_through_endpoint, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.config.pass_through_endpoint.with_raw_response.create( @@ -201,7 +201,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: pass_through_endpoint = await response.parse() assert_matches_type(object, pass_through_endpoint, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.config.pass_through_endpoint.with_streaming_response.create( @@ -217,7 +217,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncHanzo) -> None: pass_through_endpoint = await async_client.config.pass_through_endpoint.update( @@ -225,7 +225,7 @@ async def test_method_update(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, pass_through_endpoint, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: response = await async_client.config.pass_through_endpoint.with_raw_response.update( @@ -237,7 +237,7 @@ async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: pass_through_endpoint = await response.parse() assert_matches_type(object, pass_through_endpoint, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None: async with async_client.config.pass_through_endpoint.with_streaming_response.update( @@ -251,7 +251,7 @@ async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint_id` but received ''"): @@ -259,13 +259,13 @@ async def test_path_params_update(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncHanzo) -> None: pass_through_endpoint = await async_client.config.pass_through_endpoint.list() assert_matches_type(PassThroughEndpointResponse, pass_through_endpoint, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncHanzo) -> None: pass_through_endpoint = await async_client.config.pass_through_endpoint.list( @@ -273,7 +273,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncHanzo) -> No ) assert_matches_type(PassThroughEndpointResponse, pass_through_endpoint, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: response = await async_client.config.pass_through_endpoint.with_raw_response.list() @@ -283,7 +283,7 @@ async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: pass_through_endpoint = await response.parse() assert_matches_type(PassThroughEndpointResponse, pass_through_endpoint, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: async with async_client.config.pass_through_endpoint.with_streaming_response.list() as response: @@ -295,7 +295,7 @@ async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: pass_through_endpoint = await async_client.config.pass_through_endpoint.delete( @@ -303,7 +303,7 @@ async def test_method_delete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(PassThroughEndpointResponse, pass_through_endpoint, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.config.pass_through_endpoint.with_raw_response.delete( @@ -315,7 +315,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: pass_through_endpoint = await response.parse() assert_matches_type(PassThroughEndpointResponse, pass_through_endpoint, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.config.pass_through_endpoint.with_streaming_response.delete( diff --git a/tests/api_resources/engines/test_chat.py b/tests/api_resources/engines/test_chat.py index 47e9ebd5..28100c12 100644 --- a/tests/api_resources/engines/test_chat.py +++ b/tests/api_resources/engines/test_chat.py @@ -16,7 +16,7 @@ class TestChat: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_complete(self, client: Hanzo) -> None: chat = client.engines.chat.complete( @@ -24,7 +24,7 @@ def test_method_complete(self, client: Hanzo) -> None: ) assert_matches_type(object, chat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_complete(self, client: Hanzo) -> None: response = client.engines.chat.with_raw_response.complete( @@ -36,7 +36,7 @@ def test_raw_response_complete(self, client: Hanzo) -> None: chat = response.parse() assert_matches_type(object, chat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_complete(self, client: Hanzo) -> None: with client.engines.chat.with_streaming_response.complete( @@ -50,7 +50,7 @@ def test_streaming_response_complete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_complete(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model` but received ''"): @@ -64,7 +64,7 @@ class TestAsyncChat: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_complete(self, async_client: AsyncHanzo) -> None: chat = await async_client.engines.chat.complete( @@ -72,7 +72,7 @@ async def test_method_complete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, chat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_complete(self, async_client: AsyncHanzo) -> None: response = await async_client.engines.chat.with_raw_response.complete( @@ -84,7 +84,7 @@ async def test_raw_response_complete(self, async_client: AsyncHanzo) -> None: chat = await response.parse() assert_matches_type(object, chat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_complete(self, async_client: AsyncHanzo) -> None: async with async_client.engines.chat.with_streaming_response.complete( @@ -98,7 +98,7 @@ async def test_streaming_response_complete(self, async_client: AsyncHanzo) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_complete(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model` but received ''"): diff --git a/tests/api_resources/files/test_content.py b/tests/api_resources/files/test_content.py index 9e32ae79..8f414b52 100644 --- a/tests/api_resources/files/test_content.py +++ b/tests/api_resources/files/test_content.py @@ -16,7 +16,7 @@ class TestContent: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Hanzo) -> None: content = client.files.content.retrieve( @@ -25,7 +25,7 @@ def test_method_retrieve(self, client: Hanzo) -> None: ) assert_matches_type(object, content, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Hanzo) -> None: response = client.files.content.with_raw_response.retrieve( @@ -38,7 +38,7 @@ def test_raw_response_retrieve(self, client: Hanzo) -> None: content = response.parse() assert_matches_type(object, content, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Hanzo) -> None: with client.files.content.with_streaming_response.retrieve( @@ -53,7 +53,7 @@ def test_streaming_response_retrieve(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_retrieve(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `provider` but received ''"): @@ -74,7 +74,7 @@ class TestAsyncContent: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: content = await async_client.files.content.retrieve( @@ -83,7 +83,7 @@ async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, content, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: response = await async_client.files.content.with_raw_response.retrieve( @@ -96,7 +96,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: content = await response.parse() assert_matches_type(object, content, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> None: async with async_client.files.content.with_streaming_response.retrieve( @@ -111,7 +111,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `provider` but received ''"): diff --git a/tests/api_resources/fine_tuning/jobs/test_cancel.py b/tests/api_resources/fine_tuning/jobs/test_cancel.py index 0c61a8da..5fa22e8f 100644 --- a/tests/api_resources/fine_tuning/jobs/test_cancel.py +++ b/tests/api_resources/fine_tuning/jobs/test_cancel.py @@ -16,7 +16,7 @@ class TestCancel: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: cancel = client.fine_tuning.jobs.cancel.create( @@ -24,7 +24,7 @@ def test_method_create(self, client: Hanzo) -> None: ) assert_matches_type(object, cancel, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.fine_tuning.jobs.cancel.with_raw_response.create( @@ -36,7 +36,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: cancel = response.parse() assert_matches_type(object, cancel, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.fine_tuning.jobs.cancel.with_streaming_response.create( @@ -50,7 +50,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_create(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `fine_tuning_job_id` but received ''"): @@ -64,7 +64,7 @@ class TestAsyncCancel: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: cancel = await async_client.fine_tuning.jobs.cancel.create( @@ -72,7 +72,7 @@ async def test_method_create(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, cancel, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.fine_tuning.jobs.cancel.with_raw_response.create( @@ -84,7 +84,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: cancel = await response.parse() assert_matches_type(object, cancel, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.fine_tuning.jobs.cancel.with_streaming_response.create( @@ -98,7 +98,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_create(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `fine_tuning_job_id` but received ''"): diff --git a/tests/api_resources/fine_tuning/test_jobs.py b/tests/api_resources/fine_tuning/test_jobs.py index 85eba109..c226ef26 100644 --- a/tests/api_resources/fine_tuning/test_jobs.py +++ b/tests/api_resources/fine_tuning/test_jobs.py @@ -16,7 +16,7 @@ class TestJobs: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: job = client.fine_tuning.jobs.create( @@ -26,7 +26,7 @@ def test_method_create(self, client: Hanzo) -> None: ) assert_matches_type(object, job, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Hanzo) -> None: job = client.fine_tuning.jobs.create( @@ -45,7 +45,7 @@ def test_method_create_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, job, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.fine_tuning.jobs.with_raw_response.create( @@ -59,7 +59,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: job = response.parse() assert_matches_type(object, job, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.fine_tuning.jobs.with_streaming_response.create( @@ -75,7 +75,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Hanzo) -> None: job = client.fine_tuning.jobs.retrieve( @@ -84,7 +84,7 @@ def test_method_retrieve(self, client: Hanzo) -> None: ) assert_matches_type(object, job, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Hanzo) -> None: response = client.fine_tuning.jobs.with_raw_response.retrieve( @@ -97,7 +97,7 @@ def test_raw_response_retrieve(self, client: Hanzo) -> None: job = response.parse() assert_matches_type(object, job, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Hanzo) -> None: with client.fine_tuning.jobs.with_streaming_response.retrieve( @@ -112,7 +112,7 @@ def test_streaming_response_retrieve(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_retrieve(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `fine_tuning_job_id` but received ''"): @@ -121,7 +121,7 @@ def test_path_params_retrieve(self, client: Hanzo) -> None: custom_llm_provider="openai", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Hanzo) -> None: job = client.fine_tuning.jobs.list( @@ -129,7 +129,7 @@ def test_method_list(self, client: Hanzo) -> None: ) assert_matches_type(object, job, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Hanzo) -> None: job = client.fine_tuning.jobs.list( @@ -139,7 +139,7 @@ def test_method_list_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, job, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Hanzo) -> None: response = client.fine_tuning.jobs.with_raw_response.list( @@ -151,7 +151,7 @@ def test_raw_response_list(self, client: Hanzo) -> None: job = response.parse() assert_matches_type(object, job, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Hanzo) -> None: with client.fine_tuning.jobs.with_streaming_response.list( @@ -171,7 +171,7 @@ class TestAsyncJobs: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: job = await async_client.fine_tuning.jobs.create( @@ -181,7 +181,7 @@ async def test_method_create(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, job, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> None: job = await async_client.fine_tuning.jobs.create( @@ -200,7 +200,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, job, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.fine_tuning.jobs.with_raw_response.create( @@ -214,7 +214,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: job = await response.parse() assert_matches_type(object, job, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.fine_tuning.jobs.with_streaming_response.create( @@ -230,7 +230,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: job = await async_client.fine_tuning.jobs.retrieve( @@ -239,7 +239,7 @@ async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, job, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: response = await async_client.fine_tuning.jobs.with_raw_response.retrieve( @@ -252,7 +252,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: job = await response.parse() assert_matches_type(object, job, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> None: async with async_client.fine_tuning.jobs.with_streaming_response.retrieve( @@ -267,7 +267,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `fine_tuning_job_id` but received ''"): @@ -276,7 +276,7 @@ async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: custom_llm_provider="openai", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncHanzo) -> None: job = await async_client.fine_tuning.jobs.list( @@ -284,7 +284,7 @@ async def test_method_list(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, job, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncHanzo) -> None: job = await async_client.fine_tuning.jobs.list( @@ -294,7 +294,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncHanzo) -> No ) assert_matches_type(object, job, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: response = await async_client.fine_tuning.jobs.with_raw_response.list( @@ -306,7 +306,7 @@ async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: job = await response.parse() assert_matches_type(object, job, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: async with async_client.fine_tuning.jobs.with_streaming_response.list( diff --git a/tests/api_resources/global_/test_spend.py b/tests/api_resources/global_/test_spend.py index 7776601a..cde16d4e 100644 --- a/tests/api_resources/global_/test_spend.py +++ b/tests/api_resources/global_/test_spend.py @@ -20,13 +20,13 @@ class TestSpend: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_tags(self, client: Hanzo) -> None: spend = client.global_.spend.list_tags() assert_matches_type(SpendListTagsResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_tags_with_all_params(self, client: Hanzo) -> None: spend = client.global_.spend.list_tags( @@ -36,7 +36,7 @@ def test_method_list_tags_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(SpendListTagsResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list_tags(self, client: Hanzo) -> None: response = client.global_.spend.with_raw_response.list_tags() @@ -46,7 +46,7 @@ def test_raw_response_list_tags(self, client: Hanzo) -> None: spend = response.parse() assert_matches_type(SpendListTagsResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list_tags(self, client: Hanzo) -> None: with client.global_.spend.with_streaming_response.list_tags() as response: @@ -58,13 +58,13 @@ def test_streaming_response_list_tags(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_reset(self, client: Hanzo) -> None: spend = client.global_.spend.reset() assert_matches_type(object, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_reset(self, client: Hanzo) -> None: response = client.global_.spend.with_raw_response.reset() @@ -74,7 +74,7 @@ def test_raw_response_reset(self, client: Hanzo) -> None: spend = response.parse() assert_matches_type(object, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_reset(self, client: Hanzo) -> None: with client.global_.spend.with_streaming_response.reset() as response: @@ -86,13 +86,13 @@ def test_streaming_response_reset(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_report(self, client: Hanzo) -> None: spend = client.global_.spend.retrieve_report() assert_matches_type(SpendRetrieveReportResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_report_with_all_params(self, client: Hanzo) -> None: spend = client.global_.spend.retrieve_report( @@ -106,7 +106,7 @@ def test_method_retrieve_report_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(SpendRetrieveReportResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve_report(self, client: Hanzo) -> None: response = client.global_.spend.with_raw_response.retrieve_report() @@ -116,7 +116,7 @@ def test_raw_response_retrieve_report(self, client: Hanzo) -> None: spend = response.parse() assert_matches_type(SpendRetrieveReportResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve_report(self, client: Hanzo) -> None: with client.global_.spend.with_streaming_response.retrieve_report() as response: @@ -134,13 +134,13 @@ class TestAsyncSpend: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_tags(self, async_client: AsyncHanzo) -> None: spend = await async_client.global_.spend.list_tags() assert_matches_type(SpendListTagsResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_tags_with_all_params(self, async_client: AsyncHanzo) -> None: spend = await async_client.global_.spend.list_tags( @@ -150,7 +150,7 @@ async def test_method_list_tags_with_all_params(self, async_client: AsyncHanzo) ) assert_matches_type(SpendListTagsResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list_tags(self, async_client: AsyncHanzo) -> None: response = await async_client.global_.spend.with_raw_response.list_tags() @@ -160,7 +160,7 @@ async def test_raw_response_list_tags(self, async_client: AsyncHanzo) -> None: spend = await response.parse() assert_matches_type(SpendListTagsResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list_tags(self, async_client: AsyncHanzo) -> None: async with async_client.global_.spend.with_streaming_response.list_tags() as response: @@ -172,13 +172,13 @@ async def test_streaming_response_list_tags(self, async_client: AsyncHanzo) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_reset(self, async_client: AsyncHanzo) -> None: spend = await async_client.global_.spend.reset() assert_matches_type(object, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_reset(self, async_client: AsyncHanzo) -> None: response = await async_client.global_.spend.with_raw_response.reset() @@ -188,7 +188,7 @@ async def test_raw_response_reset(self, async_client: AsyncHanzo) -> None: spend = await response.parse() assert_matches_type(object, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_reset(self, async_client: AsyncHanzo) -> None: async with async_client.global_.spend.with_streaming_response.reset() as response: @@ -200,13 +200,13 @@ async def test_streaming_response_reset(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_report(self, async_client: AsyncHanzo) -> None: spend = await async_client.global_.spend.retrieve_report() assert_matches_type(SpendRetrieveReportResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_report_with_all_params(self, async_client: AsyncHanzo) -> None: spend = await async_client.global_.spend.retrieve_report( @@ -220,7 +220,7 @@ async def test_method_retrieve_report_with_all_params(self, async_client: AsyncH ) assert_matches_type(SpendRetrieveReportResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve_report(self, async_client: AsyncHanzo) -> None: response = await async_client.global_.spend.with_raw_response.retrieve_report() @@ -230,7 +230,7 @@ async def test_raw_response_retrieve_report(self, async_client: AsyncHanzo) -> N spend = await response.parse() assert_matches_type(SpendRetrieveReportResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve_report(self, async_client: AsyncHanzo) -> None: async with async_client.global_.spend.with_streaming_response.retrieve_report() as response: diff --git a/tests/api_resources/images/test_generations.py b/tests/api_resources/images/test_generations.py index fa6a2c18..bc1620b1 100644 --- a/tests/api_resources/images/test_generations.py +++ b/tests/api_resources/images/test_generations.py @@ -16,13 +16,13 @@ class TestGenerations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: generation = client.images.generations.create() assert_matches_type(object, generation, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.images.generations.with_raw_response.create() @@ -32,7 +32,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: generation = response.parse() assert_matches_type(object, generation, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.images.generations.with_streaming_response.create() as response: @@ -50,13 +50,13 @@ class TestAsyncGenerations: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: generation = await async_client.images.generations.create() assert_matches_type(object, generation, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.images.generations.with_raw_response.create() @@ -66,7 +66,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: generation = await response.parse() assert_matches_type(object, generation, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.images.generations.with_streaming_response.create() as response: diff --git a/tests/api_resources/model/test_info.py b/tests/api_resources/model/test_info.py index 8ddb02cf..98ddccaf 100644 --- a/tests/api_resources/model/test_info.py +++ b/tests/api_resources/model/test_info.py @@ -16,13 +16,13 @@ class TestInfo: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Hanzo) -> None: info = client.model.info.list() assert_matches_type(object, info, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Hanzo) -> None: info = client.model.info.list( @@ -30,7 +30,7 @@ def test_method_list_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, info, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Hanzo) -> None: response = client.model.info.with_raw_response.list() @@ -40,7 +40,7 @@ def test_raw_response_list(self, client: Hanzo) -> None: info = response.parse() assert_matches_type(object, info, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Hanzo) -> None: with client.model.info.with_streaming_response.list() as response: @@ -58,13 +58,13 @@ class TestAsyncInfo: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncHanzo) -> None: info = await async_client.model.info.list() assert_matches_type(object, info, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncHanzo) -> None: info = await async_client.model.info.list( @@ -72,7 +72,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncHanzo) -> No ) assert_matches_type(object, info, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: response = await async_client.model.info.with_raw_response.list() @@ -82,7 +82,7 @@ async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: info = await response.parse() assert_matches_type(object, info, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: async with async_client.model.info.with_streaming_response.list() as response: diff --git a/tests/api_resources/model/test_update.py b/tests/api_resources/model/test_update.py index fc31bcc0..a228260e 100644 --- a/tests/api_resources/model/test_update.py +++ b/tests/api_resources/model/test_update.py @@ -17,13 +17,13 @@ class TestUpdate: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_full(self, client: Hanzo) -> None: update = client.model.update.full() assert_matches_type(object, update, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_full_with_all_params(self, client: Hanzo) -> None: update = client.model.update.full( @@ -76,7 +76,7 @@ def test_method_full_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, update, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_full(self, client: Hanzo) -> None: response = client.model.update.with_raw_response.full() @@ -86,7 +86,7 @@ def test_raw_response_full(self, client: Hanzo) -> None: update = response.parse() assert_matches_type(object, update, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_full(self, client: Hanzo) -> None: with client.model.update.with_streaming_response.full() as response: @@ -98,7 +98,7 @@ def test_streaming_response_full(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_partial(self, client: Hanzo) -> None: update = client.model.update.partial( @@ -106,7 +106,7 @@ def test_method_partial(self, client: Hanzo) -> None: ) assert_matches_type(object, update, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_partial_with_all_params(self, client: Hanzo) -> None: update = client.model.update.partial( @@ -160,7 +160,7 @@ def test_method_partial_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, update, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_partial(self, client: Hanzo) -> None: response = client.model.update.with_raw_response.partial( @@ -172,7 +172,7 @@ def test_raw_response_partial(self, client: Hanzo) -> None: update = response.parse() assert_matches_type(object, update, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_partial(self, client: Hanzo) -> None: with client.model.update.with_streaming_response.partial( @@ -186,7 +186,7 @@ def test_streaming_response_partial(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_partial(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_id` but received ''"): @@ -200,13 +200,13 @@ class TestAsyncUpdate: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_full(self, async_client: AsyncHanzo) -> None: update = await async_client.model.update.full() assert_matches_type(object, update, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_full_with_all_params(self, async_client: AsyncHanzo) -> None: update = await async_client.model.update.full( @@ -259,7 +259,7 @@ async def test_method_full_with_all_params(self, async_client: AsyncHanzo) -> No ) assert_matches_type(object, update, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_full(self, async_client: AsyncHanzo) -> None: response = await async_client.model.update.with_raw_response.full() @@ -269,7 +269,7 @@ async def test_raw_response_full(self, async_client: AsyncHanzo) -> None: update = await response.parse() assert_matches_type(object, update, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_full(self, async_client: AsyncHanzo) -> None: async with async_client.model.update.with_streaming_response.full() as response: @@ -281,7 +281,7 @@ async def test_streaming_response_full(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_partial(self, async_client: AsyncHanzo) -> None: update = await async_client.model.update.partial( @@ -289,7 +289,7 @@ async def test_method_partial(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, update, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_partial_with_all_params(self, async_client: AsyncHanzo) -> None: update = await async_client.model.update.partial( @@ -343,7 +343,7 @@ async def test_method_partial_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, update, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_partial(self, async_client: AsyncHanzo) -> None: response = await async_client.model.update.with_raw_response.partial( @@ -355,7 +355,7 @@ async def test_raw_response_partial(self, async_client: AsyncHanzo) -> None: update = await response.parse() assert_matches_type(object, update, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_partial(self, async_client: AsyncHanzo) -> None: async with async_client.model.update.with_streaming_response.partial( @@ -369,7 +369,7 @@ async def test_streaming_response_partial(self, async_client: AsyncHanzo) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_partial(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model_id` but received ''"): diff --git a/tests/api_resources/openai/deployments/test_chat.py b/tests/api_resources/openai/deployments/test_chat.py index 1a81cc7f..0aed99dc 100644 --- a/tests/api_resources/openai/deployments/test_chat.py +++ b/tests/api_resources/openai/deployments/test_chat.py @@ -16,7 +16,7 @@ class TestChat: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_complete(self, client: Hanzo) -> None: chat = client.openai.deployments.chat.complete( @@ -24,7 +24,7 @@ def test_method_complete(self, client: Hanzo) -> None: ) assert_matches_type(object, chat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_complete(self, client: Hanzo) -> None: response = client.openai.deployments.chat.with_raw_response.complete( @@ -36,7 +36,7 @@ def test_raw_response_complete(self, client: Hanzo) -> None: chat = response.parse() assert_matches_type(object, chat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_complete(self, client: Hanzo) -> None: with client.openai.deployments.chat.with_streaming_response.complete( @@ -50,7 +50,7 @@ def test_streaming_response_complete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_complete(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model` but received ''"): @@ -64,7 +64,7 @@ class TestAsyncChat: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_complete(self, async_client: AsyncHanzo) -> None: chat = await async_client.openai.deployments.chat.complete( @@ -72,7 +72,7 @@ async def test_method_complete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, chat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_complete(self, async_client: AsyncHanzo) -> None: response = await async_client.openai.deployments.chat.with_raw_response.complete( @@ -84,7 +84,7 @@ async def test_raw_response_complete(self, async_client: AsyncHanzo) -> None: chat = await response.parse() assert_matches_type(object, chat, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_complete(self, async_client: AsyncHanzo) -> None: async with async_client.openai.deployments.chat.with_streaming_response.complete( @@ -98,7 +98,7 @@ async def test_streaming_response_complete(self, async_client: AsyncHanzo) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_complete(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model` but received ''"): diff --git a/tests/api_resources/openai/test_deployments.py b/tests/api_resources/openai/test_deployments.py index 3e28d91a..7fa7e1d7 100644 --- a/tests/api_resources/openai/test_deployments.py +++ b/tests/api_resources/openai/test_deployments.py @@ -16,7 +16,7 @@ class TestDeployments: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_complete(self, client: Hanzo) -> None: deployment = client.openai.deployments.complete( @@ -24,7 +24,7 @@ def test_method_complete(self, client: Hanzo) -> None: ) assert_matches_type(object, deployment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_complete(self, client: Hanzo) -> None: response = client.openai.deployments.with_raw_response.complete( @@ -36,7 +36,7 @@ def test_raw_response_complete(self, client: Hanzo) -> None: deployment = response.parse() assert_matches_type(object, deployment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_complete(self, client: Hanzo) -> None: with client.openai.deployments.with_streaming_response.complete( @@ -50,7 +50,7 @@ def test_streaming_response_complete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_complete(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model` but received ''"): @@ -58,7 +58,7 @@ def test_path_params_complete(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_embed(self, client: Hanzo) -> None: deployment = client.openai.deployments.embed( @@ -66,7 +66,7 @@ def test_method_embed(self, client: Hanzo) -> None: ) assert_matches_type(object, deployment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_embed(self, client: Hanzo) -> None: response = client.openai.deployments.with_raw_response.embed( @@ -78,7 +78,7 @@ def test_raw_response_embed(self, client: Hanzo) -> None: deployment = response.parse() assert_matches_type(object, deployment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_embed(self, client: Hanzo) -> None: with client.openai.deployments.with_streaming_response.embed( @@ -92,7 +92,7 @@ def test_streaming_response_embed(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_embed(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model` but received ''"): @@ -106,7 +106,7 @@ class TestAsyncDeployments: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_complete(self, async_client: AsyncHanzo) -> None: deployment = await async_client.openai.deployments.complete( @@ -114,7 +114,7 @@ async def test_method_complete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, deployment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_complete(self, async_client: AsyncHanzo) -> None: response = await async_client.openai.deployments.with_raw_response.complete( @@ -126,7 +126,7 @@ async def test_raw_response_complete(self, async_client: AsyncHanzo) -> None: deployment = await response.parse() assert_matches_type(object, deployment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_complete(self, async_client: AsyncHanzo) -> None: async with async_client.openai.deployments.with_streaming_response.complete( @@ -140,7 +140,7 @@ async def test_streaming_response_complete(self, async_client: AsyncHanzo) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_complete(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model` but received ''"): @@ -148,7 +148,7 @@ async def test_path_params_complete(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_embed(self, async_client: AsyncHanzo) -> None: deployment = await async_client.openai.deployments.embed( @@ -156,7 +156,7 @@ async def test_method_embed(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, deployment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_embed(self, async_client: AsyncHanzo) -> None: response = await async_client.openai.deployments.with_raw_response.embed( @@ -168,7 +168,7 @@ async def test_raw_response_embed(self, async_client: AsyncHanzo) -> None: deployment = await response.parse() assert_matches_type(object, deployment, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_embed(self, async_client: AsyncHanzo) -> None: async with async_client.openai.deployments.with_streaming_response.embed( @@ -182,7 +182,7 @@ async def test_streaming_response_embed(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_embed(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model` but received ''"): diff --git a/tests/api_resources/organization/test_info.py b/tests/api_resources/organization/test_info.py index ecac913d..4ca3b710 100644 --- a/tests/api_resources/organization/test_info.py +++ b/tests/api_resources/organization/test_info.py @@ -17,7 +17,7 @@ class TestInfo: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Hanzo) -> None: info = client.organization.info.retrieve( @@ -25,7 +25,7 @@ def test_method_retrieve(self, client: Hanzo) -> None: ) assert_matches_type(InfoRetrieveResponse, info, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Hanzo) -> None: response = client.organization.info.with_raw_response.retrieve( @@ -37,7 +37,7 @@ def test_raw_response_retrieve(self, client: Hanzo) -> None: info = response.parse() assert_matches_type(InfoRetrieveResponse, info, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Hanzo) -> None: with client.organization.info.with_streaming_response.retrieve( @@ -51,7 +51,7 @@ def test_streaming_response_retrieve(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_deprecated(self, client: Hanzo) -> None: info = client.organization.info.deprecated( @@ -59,7 +59,7 @@ def test_method_deprecated(self, client: Hanzo) -> None: ) assert_matches_type(object, info, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_deprecated(self, client: Hanzo) -> None: response = client.organization.info.with_raw_response.deprecated( @@ -71,7 +71,7 @@ def test_raw_response_deprecated(self, client: Hanzo) -> None: info = response.parse() assert_matches_type(object, info, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_deprecated(self, client: Hanzo) -> None: with client.organization.info.with_streaming_response.deprecated( @@ -91,7 +91,7 @@ class TestAsyncInfo: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: info = await async_client.organization.info.retrieve( @@ -99,7 +99,7 @@ async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(InfoRetrieveResponse, info, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: response = await async_client.organization.info.with_raw_response.retrieve( @@ -111,7 +111,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: info = await response.parse() assert_matches_type(InfoRetrieveResponse, info, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> None: async with async_client.organization.info.with_streaming_response.retrieve( @@ -125,7 +125,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_deprecated(self, async_client: AsyncHanzo) -> None: info = await async_client.organization.info.deprecated( @@ -133,7 +133,7 @@ async def test_method_deprecated(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, info, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_deprecated(self, async_client: AsyncHanzo) -> None: response = await async_client.organization.info.with_raw_response.deprecated( @@ -145,7 +145,7 @@ async def test_raw_response_deprecated(self, async_client: AsyncHanzo) -> None: info = await response.parse() assert_matches_type(object, info, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_deprecated(self, async_client: AsyncHanzo) -> None: async with async_client.organization.info.with_streaming_response.deprecated( diff --git a/tests/api_resources/responses/test_input_items.py b/tests/api_resources/responses/test_input_items.py index fca2a4cc..c25ff052 100644 --- a/tests/api_resources/responses/test_input_items.py +++ b/tests/api_resources/responses/test_input_items.py @@ -16,7 +16,7 @@ class TestInputItems: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Hanzo) -> None: input_item = client.responses.input_items.list( @@ -24,7 +24,7 @@ def test_method_list(self, client: Hanzo) -> None: ) assert_matches_type(object, input_item, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Hanzo) -> None: response = client.responses.input_items.with_raw_response.list( @@ -36,7 +36,7 @@ def test_raw_response_list(self, client: Hanzo) -> None: input_item = response.parse() assert_matches_type(object, input_item, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Hanzo) -> None: with client.responses.input_items.with_streaming_response.list( @@ -50,7 +50,7 @@ def test_streaming_response_list(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_list(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `response_id` but received ''"): @@ -64,7 +64,7 @@ class TestAsyncInputItems: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncHanzo) -> None: input_item = await async_client.responses.input_items.list( @@ -72,7 +72,7 @@ async def test_method_list(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, input_item, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: response = await async_client.responses.input_items.with_raw_response.list( @@ -84,7 +84,7 @@ async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: input_item = await response.parse() assert_matches_type(object, input_item, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: async with async_client.responses.input_items.with_streaming_response.list( @@ -98,7 +98,7 @@ async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_list(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `response_id` but received ''"): diff --git a/tests/api_resources/team/test_callback.py b/tests/api_resources/team/test_callback.py index e3779a61..845dd640 100644 --- a/tests/api_resources/team/test_callback.py +++ b/tests/api_resources/team/test_callback.py @@ -16,7 +16,7 @@ class TestCallback: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Hanzo) -> None: callback = client.team.callback.retrieve( @@ -24,7 +24,7 @@ def test_method_retrieve(self, client: Hanzo) -> None: ) assert_matches_type(object, callback, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Hanzo) -> None: response = client.team.callback.with_raw_response.retrieve( @@ -36,7 +36,7 @@ def test_raw_response_retrieve(self, client: Hanzo) -> None: callback = response.parse() assert_matches_type(object, callback, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Hanzo) -> None: with client.team.callback.with_streaming_response.retrieve( @@ -50,7 +50,7 @@ def test_streaming_response_retrieve(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_retrieve(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `team_id` but received ''"): @@ -58,7 +58,7 @@ def test_path_params_retrieve(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_add(self, client: Hanzo) -> None: callback = client.team.callback.add( @@ -68,7 +68,7 @@ def test_method_add(self, client: Hanzo) -> None: ) assert_matches_type(object, callback, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_add_with_all_params(self, client: Hanzo) -> None: callback = client.team.callback.add( @@ -80,7 +80,7 @@ def test_method_add_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, callback, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_add(self, client: Hanzo) -> None: response = client.team.callback.with_raw_response.add( @@ -94,7 +94,7 @@ def test_raw_response_add(self, client: Hanzo) -> None: callback = response.parse() assert_matches_type(object, callback, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_add(self, client: Hanzo) -> None: with client.team.callback.with_streaming_response.add( @@ -110,7 +110,7 @@ def test_streaming_response_add(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_add(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `team_id` but received ''"): @@ -126,7 +126,7 @@ class TestAsyncCallback: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: callback = await async_client.team.callback.retrieve( @@ -134,7 +134,7 @@ async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, callback, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: response = await async_client.team.callback.with_raw_response.retrieve( @@ -146,7 +146,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: callback = await response.parse() assert_matches_type(object, callback, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> None: async with async_client.team.callback.with_streaming_response.retrieve( @@ -160,7 +160,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `team_id` but received ''"): @@ -168,7 +168,7 @@ async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_add(self, async_client: AsyncHanzo) -> None: callback = await async_client.team.callback.add( @@ -178,7 +178,7 @@ async def test_method_add(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, callback, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_add_with_all_params(self, async_client: AsyncHanzo) -> None: callback = await async_client.team.callback.add( @@ -190,7 +190,7 @@ async def test_method_add_with_all_params(self, async_client: AsyncHanzo) -> Non ) assert_matches_type(object, callback, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_add(self, async_client: AsyncHanzo) -> None: response = await async_client.team.callback.with_raw_response.add( @@ -204,7 +204,7 @@ async def test_raw_response_add(self, async_client: AsyncHanzo) -> None: callback = await response.parse() assert_matches_type(object, callback, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_add(self, async_client: AsyncHanzo) -> None: async with async_client.team.callback.with_streaming_response.add( @@ -220,7 +220,7 @@ async def test_streaming_response_add(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_add(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `team_id` but received ''"): diff --git a/tests/api_resources/team/test_model.py b/tests/api_resources/team/test_model.py index 021be6a5..8f037cf2 100644 --- a/tests/api_resources/team/test_model.py +++ b/tests/api_resources/team/test_model.py @@ -16,7 +16,7 @@ class TestModel: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_add(self, client: Hanzo) -> None: model = client.team.model.add( @@ -25,7 +25,7 @@ def test_method_add(self, client: Hanzo) -> None: ) assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_add(self, client: Hanzo) -> None: response = client.team.model.with_raw_response.add( @@ -38,7 +38,7 @@ def test_raw_response_add(self, client: Hanzo) -> None: model = response.parse() assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_add(self, client: Hanzo) -> None: with client.team.model.with_streaming_response.add( @@ -53,7 +53,7 @@ def test_streaming_response_add(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_remove(self, client: Hanzo) -> None: model = client.team.model.remove( @@ -62,7 +62,7 @@ def test_method_remove(self, client: Hanzo) -> None: ) assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_remove(self, client: Hanzo) -> None: response = client.team.model.with_raw_response.remove( @@ -75,7 +75,7 @@ def test_raw_response_remove(self, client: Hanzo) -> None: model = response.parse() assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_remove(self, client: Hanzo) -> None: with client.team.model.with_streaming_response.remove( @@ -96,7 +96,7 @@ class TestAsyncModel: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_add(self, async_client: AsyncHanzo) -> None: model = await async_client.team.model.add( @@ -105,7 +105,7 @@ async def test_method_add(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_add(self, async_client: AsyncHanzo) -> None: response = await async_client.team.model.with_raw_response.add( @@ -118,7 +118,7 @@ async def test_raw_response_add(self, async_client: AsyncHanzo) -> None: model = await response.parse() assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_add(self, async_client: AsyncHanzo) -> None: async with async_client.team.model.with_streaming_response.add( @@ -133,7 +133,7 @@ async def test_streaming_response_add(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_remove(self, async_client: AsyncHanzo) -> None: model = await async_client.team.model.remove( @@ -142,7 +142,7 @@ async def test_method_remove(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_remove(self, async_client: AsyncHanzo) -> None: response = await async_client.team.model.with_raw_response.remove( @@ -155,7 +155,7 @@ async def test_raw_response_remove(self, async_client: AsyncHanzo) -> None: model = await response.parse() assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_remove(self, async_client: AsyncHanzo) -> None: async with async_client.team.model.with_streaming_response.remove( diff --git a/tests/api_resources/test_active.py b/tests/api_resources/test_active.py index c2b929ee..0881e229 100644 --- a/tests/api_resources/test_active.py +++ b/tests/api_resources/test_active.py @@ -16,13 +16,13 @@ class TestActive: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_callbacks(self, client: Hanzo) -> None: active = client.active.list_callbacks() assert_matches_type(object, active, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list_callbacks(self, client: Hanzo) -> None: response = client.active.with_raw_response.list_callbacks() @@ -32,7 +32,7 @@ def test_raw_response_list_callbacks(self, client: Hanzo) -> None: active = response.parse() assert_matches_type(object, active, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list_callbacks(self, client: Hanzo) -> None: with client.active.with_streaming_response.list_callbacks() as response: @@ -50,13 +50,13 @@ class TestAsyncActive: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_callbacks(self, async_client: AsyncHanzo) -> None: active = await async_client.active.list_callbacks() assert_matches_type(object, active, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list_callbacks(self, async_client: AsyncHanzo) -> None: response = await async_client.active.with_raw_response.list_callbacks() @@ -66,7 +66,7 @@ async def test_raw_response_list_callbacks(self, async_client: AsyncHanzo) -> No active = await response.parse() assert_matches_type(object, active, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list_callbacks(self, async_client: AsyncHanzo) -> None: async with async_client.active.with_streaming_response.list_callbacks() as response: diff --git a/tests/api_resources/test_add.py b/tests/api_resources/test_add.py index 89ec0132..68c42896 100644 --- a/tests/api_resources/test_add.py +++ b/tests/api_resources/test_add.py @@ -16,7 +16,7 @@ class TestAdd: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_add_allowed_ip(self, client: Hanzo) -> None: add = client.add.add_allowed_ip( @@ -24,7 +24,7 @@ def test_method_add_allowed_ip(self, client: Hanzo) -> None: ) assert_matches_type(object, add, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_add_allowed_ip(self, client: Hanzo) -> None: response = client.add.with_raw_response.add_allowed_ip( @@ -36,7 +36,7 @@ def test_raw_response_add_allowed_ip(self, client: Hanzo) -> None: add = response.parse() assert_matches_type(object, add, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_add_allowed_ip(self, client: Hanzo) -> None: with client.add.with_streaming_response.add_allowed_ip( @@ -56,7 +56,7 @@ class TestAsyncAdd: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_add_allowed_ip(self, async_client: AsyncHanzo) -> None: add = await async_client.add.add_allowed_ip( @@ -64,7 +64,7 @@ async def test_method_add_allowed_ip(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, add, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_add_allowed_ip(self, async_client: AsyncHanzo) -> None: response = await async_client.add.with_raw_response.add_allowed_ip( @@ -76,7 +76,7 @@ async def test_raw_response_add_allowed_ip(self, async_client: AsyncHanzo) -> No add = await response.parse() assert_matches_type(object, add, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_add_allowed_ip(self, async_client: AsyncHanzo) -> None: async with async_client.add.with_streaming_response.add_allowed_ip( diff --git a/tests/api_resources/test_anthropic.py b/tests/api_resources/test_anthropic.py index 21b38237..ba1ddd80 100644 --- a/tests/api_resources/test_anthropic.py +++ b/tests/api_resources/test_anthropic.py @@ -16,7 +16,7 @@ class TestAnthropic: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: anthropic = client.anthropic.create( @@ -24,7 +24,7 @@ def test_method_create(self, client: Hanzo) -> None: ) assert_matches_type(object, anthropic, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.anthropic.with_raw_response.create( @@ -36,7 +36,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: anthropic = response.parse() assert_matches_type(object, anthropic, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.anthropic.with_streaming_response.create( @@ -50,7 +50,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_create(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -58,7 +58,7 @@ def test_path_params_create(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Hanzo) -> None: anthropic = client.anthropic.retrieve( @@ -66,7 +66,7 @@ def test_method_retrieve(self, client: Hanzo) -> None: ) assert_matches_type(object, anthropic, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Hanzo) -> None: response = client.anthropic.with_raw_response.retrieve( @@ -78,7 +78,7 @@ def test_raw_response_retrieve(self, client: Hanzo) -> None: anthropic = response.parse() assert_matches_type(object, anthropic, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Hanzo) -> None: with client.anthropic.with_streaming_response.retrieve( @@ -92,7 +92,7 @@ def test_streaming_response_retrieve(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_retrieve(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -100,7 +100,7 @@ def test_path_params_retrieve(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Hanzo) -> None: anthropic = client.anthropic.update( @@ -108,7 +108,7 @@ def test_method_update(self, client: Hanzo) -> None: ) assert_matches_type(object, anthropic, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Hanzo) -> None: response = client.anthropic.with_raw_response.update( @@ -120,7 +120,7 @@ def test_raw_response_update(self, client: Hanzo) -> None: anthropic = response.parse() assert_matches_type(object, anthropic, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Hanzo) -> None: with client.anthropic.with_streaming_response.update( @@ -134,7 +134,7 @@ def test_streaming_response_update(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_update(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -142,7 +142,7 @@ def test_path_params_update(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: anthropic = client.anthropic.delete( @@ -150,7 +150,7 @@ def test_method_delete(self, client: Hanzo) -> None: ) assert_matches_type(object, anthropic, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.anthropic.with_raw_response.delete( @@ -162,7 +162,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: anthropic = response.parse() assert_matches_type(object, anthropic, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.anthropic.with_streaming_response.delete( @@ -176,7 +176,7 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_delete(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -184,7 +184,7 @@ def test_path_params_delete(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_modify(self, client: Hanzo) -> None: anthropic = client.anthropic.modify( @@ -192,7 +192,7 @@ def test_method_modify(self, client: Hanzo) -> None: ) assert_matches_type(object, anthropic, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_modify(self, client: Hanzo) -> None: response = client.anthropic.with_raw_response.modify( @@ -204,7 +204,7 @@ def test_raw_response_modify(self, client: Hanzo) -> None: anthropic = response.parse() assert_matches_type(object, anthropic, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_modify(self, client: Hanzo) -> None: with client.anthropic.with_streaming_response.modify( @@ -218,7 +218,7 @@ def test_streaming_response_modify(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_modify(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -232,7 +232,7 @@ class TestAsyncAnthropic: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: anthropic = await async_client.anthropic.create( @@ -240,7 +240,7 @@ async def test_method_create(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, anthropic, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.anthropic.with_raw_response.create( @@ -252,7 +252,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: anthropic = await response.parse() assert_matches_type(object, anthropic, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.anthropic.with_streaming_response.create( @@ -266,7 +266,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_create(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -274,7 +274,7 @@ async def test_path_params_create(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: anthropic = await async_client.anthropic.retrieve( @@ -282,7 +282,7 @@ async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, anthropic, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: response = await async_client.anthropic.with_raw_response.retrieve( @@ -294,7 +294,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: anthropic = await response.parse() assert_matches_type(object, anthropic, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> None: async with async_client.anthropic.with_streaming_response.retrieve( @@ -308,7 +308,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -316,7 +316,7 @@ async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncHanzo) -> None: anthropic = await async_client.anthropic.update( @@ -324,7 +324,7 @@ async def test_method_update(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, anthropic, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: response = await async_client.anthropic.with_raw_response.update( @@ -336,7 +336,7 @@ async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: anthropic = await response.parse() assert_matches_type(object, anthropic, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None: async with async_client.anthropic.with_streaming_response.update( @@ -350,7 +350,7 @@ async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -358,7 +358,7 @@ async def test_path_params_update(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: anthropic = await async_client.anthropic.delete( @@ -366,7 +366,7 @@ async def test_method_delete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, anthropic, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.anthropic.with_raw_response.delete( @@ -378,7 +378,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: anthropic = await response.parse() assert_matches_type(object, anthropic, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.anthropic.with_streaming_response.delete( @@ -392,7 +392,7 @@ async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -400,7 +400,7 @@ async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_modify(self, async_client: AsyncHanzo) -> None: anthropic = await async_client.anthropic.modify( @@ -408,7 +408,7 @@ async def test_method_modify(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, anthropic, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_modify(self, async_client: AsyncHanzo) -> None: response = await async_client.anthropic.with_raw_response.modify( @@ -420,7 +420,7 @@ async def test_raw_response_modify(self, async_client: AsyncHanzo) -> None: anthropic = await response.parse() assert_matches_type(object, anthropic, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_modify(self, async_client: AsyncHanzo) -> None: async with async_client.anthropic.with_streaming_response.modify( @@ -434,7 +434,7 @@ async def test_streaming_response_modify(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_modify(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): diff --git a/tests/api_resources/test_assemblyai.py b/tests/api_resources/test_assemblyai.py index 90c95b6c..6a0d50cb 100644 --- a/tests/api_resources/test_assemblyai.py +++ b/tests/api_resources/test_assemblyai.py @@ -16,7 +16,7 @@ class TestAssemblyai: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: assemblyai = client.assemblyai.create( @@ -24,7 +24,7 @@ def test_method_create(self, client: Hanzo) -> None: ) assert_matches_type(object, assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.assemblyai.with_raw_response.create( @@ -36,7 +36,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: assemblyai = response.parse() assert_matches_type(object, assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.assemblyai.with_streaming_response.create( @@ -50,7 +50,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_create(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -58,7 +58,7 @@ def test_path_params_create(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Hanzo) -> None: assemblyai = client.assemblyai.retrieve( @@ -66,7 +66,7 @@ def test_method_retrieve(self, client: Hanzo) -> None: ) assert_matches_type(object, assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Hanzo) -> None: response = client.assemblyai.with_raw_response.retrieve( @@ -78,7 +78,7 @@ def test_raw_response_retrieve(self, client: Hanzo) -> None: assemblyai = response.parse() assert_matches_type(object, assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Hanzo) -> None: with client.assemblyai.with_streaming_response.retrieve( @@ -92,7 +92,7 @@ def test_streaming_response_retrieve(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_retrieve(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -100,7 +100,7 @@ def test_path_params_retrieve(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Hanzo) -> None: assemblyai = client.assemblyai.update( @@ -108,7 +108,7 @@ def test_method_update(self, client: Hanzo) -> None: ) assert_matches_type(object, assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Hanzo) -> None: response = client.assemblyai.with_raw_response.update( @@ -120,7 +120,7 @@ def test_raw_response_update(self, client: Hanzo) -> None: assemblyai = response.parse() assert_matches_type(object, assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Hanzo) -> None: with client.assemblyai.with_streaming_response.update( @@ -134,7 +134,7 @@ def test_streaming_response_update(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_update(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -142,7 +142,7 @@ def test_path_params_update(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: assemblyai = client.assemblyai.delete( @@ -150,7 +150,7 @@ def test_method_delete(self, client: Hanzo) -> None: ) assert_matches_type(object, assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.assemblyai.with_raw_response.delete( @@ -162,7 +162,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: assemblyai = response.parse() assert_matches_type(object, assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.assemblyai.with_streaming_response.delete( @@ -176,7 +176,7 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_delete(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -184,7 +184,7 @@ def test_path_params_delete(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_patch(self, client: Hanzo) -> None: assemblyai = client.assemblyai.patch( @@ -192,7 +192,7 @@ def test_method_patch(self, client: Hanzo) -> None: ) assert_matches_type(object, assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_patch(self, client: Hanzo) -> None: response = client.assemblyai.with_raw_response.patch( @@ -204,7 +204,7 @@ def test_raw_response_patch(self, client: Hanzo) -> None: assemblyai = response.parse() assert_matches_type(object, assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_patch(self, client: Hanzo) -> None: with client.assemblyai.with_streaming_response.patch( @@ -218,7 +218,7 @@ def test_streaming_response_patch(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_patch(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -232,7 +232,7 @@ class TestAsyncAssemblyai: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: assemblyai = await async_client.assemblyai.create( @@ -240,7 +240,7 @@ async def test_method_create(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.assemblyai.with_raw_response.create( @@ -252,7 +252,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: assemblyai = await response.parse() assert_matches_type(object, assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.assemblyai.with_streaming_response.create( @@ -266,7 +266,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_create(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -274,7 +274,7 @@ async def test_path_params_create(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: assemblyai = await async_client.assemblyai.retrieve( @@ -282,7 +282,7 @@ async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: response = await async_client.assemblyai.with_raw_response.retrieve( @@ -294,7 +294,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: assemblyai = await response.parse() assert_matches_type(object, assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> None: async with async_client.assemblyai.with_streaming_response.retrieve( @@ -308,7 +308,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -316,7 +316,7 @@ async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncHanzo) -> None: assemblyai = await async_client.assemblyai.update( @@ -324,7 +324,7 @@ async def test_method_update(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: response = await async_client.assemblyai.with_raw_response.update( @@ -336,7 +336,7 @@ async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: assemblyai = await response.parse() assert_matches_type(object, assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None: async with async_client.assemblyai.with_streaming_response.update( @@ -350,7 +350,7 @@ async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -358,7 +358,7 @@ async def test_path_params_update(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: assemblyai = await async_client.assemblyai.delete( @@ -366,7 +366,7 @@ async def test_method_delete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.assemblyai.with_raw_response.delete( @@ -378,7 +378,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: assemblyai = await response.parse() assert_matches_type(object, assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.assemblyai.with_streaming_response.delete( @@ -392,7 +392,7 @@ async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -400,7 +400,7 @@ async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_patch(self, async_client: AsyncHanzo) -> None: assemblyai = await async_client.assemblyai.patch( @@ -408,7 +408,7 @@ async def test_method_patch(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_patch(self, async_client: AsyncHanzo) -> None: response = await async_client.assemblyai.with_raw_response.patch( @@ -420,7 +420,7 @@ async def test_raw_response_patch(self, async_client: AsyncHanzo) -> None: assemblyai = await response.parse() assert_matches_type(object, assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_patch(self, async_client: AsyncHanzo) -> None: async with async_client.assemblyai.with_streaming_response.patch( @@ -434,7 +434,7 @@ async def test_streaming_response_patch(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_patch(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): diff --git a/tests/api_resources/test_assistants.py b/tests/api_resources/test_assistants.py index d4586158..73be9213 100644 --- a/tests/api_resources/test_assistants.py +++ b/tests/api_resources/test_assistants.py @@ -16,13 +16,13 @@ class TestAssistants: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: assistant = client.assistants.create() assert_matches_type(object, assistant, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.assistants.with_raw_response.create() @@ -32,7 +32,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: assistant = response.parse() assert_matches_type(object, assistant, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.assistants.with_streaming_response.create() as response: @@ -44,13 +44,13 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Hanzo) -> None: assistant = client.assistants.list() assert_matches_type(object, assistant, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Hanzo) -> None: response = client.assistants.with_raw_response.list() @@ -60,7 +60,7 @@ def test_raw_response_list(self, client: Hanzo) -> None: assistant = response.parse() assert_matches_type(object, assistant, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Hanzo) -> None: with client.assistants.with_streaming_response.list() as response: @@ -72,7 +72,7 @@ def test_streaming_response_list(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: assistant = client.assistants.delete( @@ -80,7 +80,7 @@ def test_method_delete(self, client: Hanzo) -> None: ) assert_matches_type(object, assistant, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.assistants.with_raw_response.delete( @@ -92,7 +92,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: assistant = response.parse() assert_matches_type(object, assistant, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.assistants.with_streaming_response.delete( @@ -106,7 +106,7 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_delete(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `assistant_id` but received ''"): @@ -120,13 +120,13 @@ class TestAsyncAssistants: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: assistant = await async_client.assistants.create() assert_matches_type(object, assistant, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.assistants.with_raw_response.create() @@ -136,7 +136,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: assistant = await response.parse() assert_matches_type(object, assistant, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.assistants.with_streaming_response.create() as response: @@ -148,13 +148,13 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncHanzo) -> None: assistant = await async_client.assistants.list() assert_matches_type(object, assistant, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: response = await async_client.assistants.with_raw_response.list() @@ -164,7 +164,7 @@ async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: assistant = await response.parse() assert_matches_type(object, assistant, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: async with async_client.assistants.with_streaming_response.list() as response: @@ -176,7 +176,7 @@ async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: assistant = await async_client.assistants.delete( @@ -184,7 +184,7 @@ async def test_method_delete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, assistant, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.assistants.with_raw_response.delete( @@ -196,7 +196,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: assistant = await response.parse() assert_matches_type(object, assistant, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.assistants.with_streaming_response.delete( @@ -210,7 +210,7 @@ async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `assistant_id` but received ''"): diff --git a/tests/api_resources/test_azure.py b/tests/api_resources/test_azure.py index 145a4b3f..f7b0e1b4 100644 --- a/tests/api_resources/test_azure.py +++ b/tests/api_resources/test_azure.py @@ -16,7 +16,7 @@ class TestAzure: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: azure = client.azure.create( @@ -24,7 +24,7 @@ def test_method_create(self, client: Hanzo) -> None: ) assert_matches_type(object, azure, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.azure.with_raw_response.create( @@ -36,7 +36,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: azure = response.parse() assert_matches_type(object, azure, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.azure.with_streaming_response.create( @@ -50,7 +50,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_create(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -58,7 +58,7 @@ def test_path_params_create(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Hanzo) -> None: azure = client.azure.update( @@ -66,7 +66,7 @@ def test_method_update(self, client: Hanzo) -> None: ) assert_matches_type(object, azure, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Hanzo) -> None: response = client.azure.with_raw_response.update( @@ -78,7 +78,7 @@ def test_raw_response_update(self, client: Hanzo) -> None: azure = response.parse() assert_matches_type(object, azure, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Hanzo) -> None: with client.azure.with_streaming_response.update( @@ -92,7 +92,7 @@ def test_streaming_response_update(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_update(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -100,7 +100,7 @@ def test_path_params_update(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: azure = client.azure.delete( @@ -108,7 +108,7 @@ def test_method_delete(self, client: Hanzo) -> None: ) assert_matches_type(object, azure, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.azure.with_raw_response.delete( @@ -120,7 +120,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: azure = response.parse() assert_matches_type(object, azure, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.azure.with_streaming_response.delete( @@ -134,7 +134,7 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_delete(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -142,7 +142,7 @@ def test_path_params_delete(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_call(self, client: Hanzo) -> None: azure = client.azure.call( @@ -150,7 +150,7 @@ def test_method_call(self, client: Hanzo) -> None: ) assert_matches_type(object, azure, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_call(self, client: Hanzo) -> None: response = client.azure.with_raw_response.call( @@ -162,7 +162,7 @@ def test_raw_response_call(self, client: Hanzo) -> None: azure = response.parse() assert_matches_type(object, azure, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_call(self, client: Hanzo) -> None: with client.azure.with_streaming_response.call( @@ -176,7 +176,7 @@ def test_streaming_response_call(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_call(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -184,7 +184,7 @@ def test_path_params_call(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_patch(self, client: Hanzo) -> None: azure = client.azure.patch( @@ -192,7 +192,7 @@ def test_method_patch(self, client: Hanzo) -> None: ) assert_matches_type(object, azure, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_patch(self, client: Hanzo) -> None: response = client.azure.with_raw_response.patch( @@ -204,7 +204,7 @@ def test_raw_response_patch(self, client: Hanzo) -> None: azure = response.parse() assert_matches_type(object, azure, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_patch(self, client: Hanzo) -> None: with client.azure.with_streaming_response.patch( @@ -218,7 +218,7 @@ def test_streaming_response_patch(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_patch(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -232,7 +232,7 @@ class TestAsyncAzure: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: azure = await async_client.azure.create( @@ -240,7 +240,7 @@ async def test_method_create(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, azure, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.azure.with_raw_response.create( @@ -252,7 +252,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: azure = await response.parse() assert_matches_type(object, azure, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.azure.with_streaming_response.create( @@ -266,7 +266,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_create(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -274,7 +274,7 @@ async def test_path_params_create(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncHanzo) -> None: azure = await async_client.azure.update( @@ -282,7 +282,7 @@ async def test_method_update(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, azure, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: response = await async_client.azure.with_raw_response.update( @@ -294,7 +294,7 @@ async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: azure = await response.parse() assert_matches_type(object, azure, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None: async with async_client.azure.with_streaming_response.update( @@ -308,7 +308,7 @@ async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -316,7 +316,7 @@ async def test_path_params_update(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: azure = await async_client.azure.delete( @@ -324,7 +324,7 @@ async def test_method_delete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, azure, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.azure.with_raw_response.delete( @@ -336,7 +336,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: azure = await response.parse() assert_matches_type(object, azure, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.azure.with_streaming_response.delete( @@ -350,7 +350,7 @@ async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -358,7 +358,7 @@ async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_call(self, async_client: AsyncHanzo) -> None: azure = await async_client.azure.call( @@ -366,7 +366,7 @@ async def test_method_call(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, azure, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_call(self, async_client: AsyncHanzo) -> None: response = await async_client.azure.with_raw_response.call( @@ -378,7 +378,7 @@ async def test_raw_response_call(self, async_client: AsyncHanzo) -> None: azure = await response.parse() assert_matches_type(object, azure, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_call(self, async_client: AsyncHanzo) -> None: async with async_client.azure.with_streaming_response.call( @@ -392,7 +392,7 @@ async def test_streaming_response_call(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_call(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -400,7 +400,7 @@ async def test_path_params_call(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_patch(self, async_client: AsyncHanzo) -> None: azure = await async_client.azure.patch( @@ -408,7 +408,7 @@ async def test_method_patch(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, azure, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_patch(self, async_client: AsyncHanzo) -> None: response = await async_client.azure.with_raw_response.patch( @@ -420,7 +420,7 @@ async def test_raw_response_patch(self, async_client: AsyncHanzo) -> None: azure = await response.parse() assert_matches_type(object, azure, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_patch(self, async_client: AsyncHanzo) -> None: async with async_client.azure.with_streaming_response.patch( @@ -434,7 +434,7 @@ async def test_streaming_response_patch(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_patch(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): diff --git a/tests/api_resources/test_batches.py b/tests/api_resources/test_batches.py index c62174cf..834ae4e4 100644 --- a/tests/api_resources/test_batches.py +++ b/tests/api_resources/test_batches.py @@ -16,13 +16,13 @@ class TestBatches: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: batch = client.batches.create() assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Hanzo) -> None: batch = client.batches.create( @@ -30,7 +30,7 @@ def test_method_create_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.batches.with_raw_response.create() @@ -40,7 +40,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: batch = response.parse() assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.batches.with_streaming_response.create() as response: @@ -52,7 +52,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Hanzo) -> None: batch = client.batches.retrieve( @@ -60,7 +60,7 @@ def test_method_retrieve(self, client: Hanzo) -> None: ) assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Hanzo) -> None: batch = client.batches.retrieve( @@ -69,7 +69,7 @@ def test_method_retrieve_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Hanzo) -> None: response = client.batches.with_raw_response.retrieve( @@ -81,7 +81,7 @@ def test_raw_response_retrieve(self, client: Hanzo) -> None: batch = response.parse() assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Hanzo) -> None: with client.batches.with_streaming_response.retrieve( @@ -95,7 +95,7 @@ def test_streaming_response_retrieve(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_retrieve(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `batch_id` but received ''"): @@ -103,13 +103,13 @@ def test_path_params_retrieve(self, client: Hanzo) -> None: batch_id="", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Hanzo) -> None: batch = client.batches.list() assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Hanzo) -> None: batch = client.batches.list( @@ -119,7 +119,7 @@ def test_method_list_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Hanzo) -> None: response = client.batches.with_raw_response.list() @@ -129,7 +129,7 @@ def test_raw_response_list(self, client: Hanzo) -> None: batch = response.parse() assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Hanzo) -> None: with client.batches.with_streaming_response.list() as response: @@ -141,7 +141,7 @@ def test_streaming_response_list(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_cancel_with_provider(self, client: Hanzo) -> None: batch = client.batches.cancel_with_provider( @@ -150,7 +150,7 @@ def test_method_cancel_with_provider(self, client: Hanzo) -> None: ) assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_cancel_with_provider(self, client: Hanzo) -> None: response = client.batches.with_raw_response.cancel_with_provider( @@ -163,7 +163,7 @@ def test_raw_response_cancel_with_provider(self, client: Hanzo) -> None: batch = response.parse() assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_cancel_with_provider(self, client: Hanzo) -> None: with client.batches.with_streaming_response.cancel_with_provider( @@ -178,7 +178,7 @@ def test_streaming_response_cancel_with_provider(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_cancel_with_provider(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `provider` but received ''"): @@ -193,7 +193,7 @@ def test_path_params_cancel_with_provider(self, client: Hanzo) -> None: provider="provider", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_provider(self, client: Hanzo) -> None: batch = client.batches.create_with_provider( @@ -201,7 +201,7 @@ def test_method_create_with_provider(self, client: Hanzo) -> None: ) assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create_with_provider(self, client: Hanzo) -> None: response = client.batches.with_raw_response.create_with_provider( @@ -213,7 +213,7 @@ def test_raw_response_create_with_provider(self, client: Hanzo) -> None: batch = response.parse() assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create_with_provider(self, client: Hanzo) -> None: with client.batches.with_streaming_response.create_with_provider( @@ -227,7 +227,7 @@ def test_streaming_response_create_with_provider(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_create_with_provider(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `provider` but received ''"): @@ -235,7 +235,7 @@ def test_path_params_create_with_provider(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_provider(self, client: Hanzo) -> None: batch = client.batches.list_with_provider( @@ -243,7 +243,7 @@ def test_method_list_with_provider(self, client: Hanzo) -> None: ) assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_provider_with_all_params(self, client: Hanzo) -> None: batch = client.batches.list_with_provider( @@ -253,7 +253,7 @@ def test_method_list_with_provider_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list_with_provider(self, client: Hanzo) -> None: response = client.batches.with_raw_response.list_with_provider( @@ -265,7 +265,7 @@ def test_raw_response_list_with_provider(self, client: Hanzo) -> None: batch = response.parse() assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list_with_provider(self, client: Hanzo) -> None: with client.batches.with_streaming_response.list_with_provider( @@ -279,7 +279,7 @@ def test_streaming_response_list_with_provider(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_list_with_provider(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `provider` but received ''"): @@ -287,7 +287,7 @@ def test_path_params_list_with_provider(self, client: Hanzo) -> None: provider="", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_with_provider(self, client: Hanzo) -> None: batch = client.batches.retrieve_with_provider( @@ -296,7 +296,7 @@ def test_method_retrieve_with_provider(self, client: Hanzo) -> None: ) assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve_with_provider(self, client: Hanzo) -> None: response = client.batches.with_raw_response.retrieve_with_provider( @@ -309,7 +309,7 @@ def test_raw_response_retrieve_with_provider(self, client: Hanzo) -> None: batch = response.parse() assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve_with_provider(self, client: Hanzo) -> None: with client.batches.with_streaming_response.retrieve_with_provider( @@ -324,7 +324,7 @@ def test_streaming_response_retrieve_with_provider(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_retrieve_with_provider(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `provider` but received ''"): @@ -345,13 +345,13 @@ class TestAsyncBatches: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: batch = await async_client.batches.create() assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> None: batch = await async_client.batches.create( @@ -359,7 +359,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.batches.with_raw_response.create() @@ -369,7 +369,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: batch = await response.parse() assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.batches.with_streaming_response.create() as response: @@ -381,7 +381,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: batch = await async_client.batches.retrieve( @@ -389,7 +389,7 @@ async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncHanzo) -> None: batch = await async_client.batches.retrieve( @@ -398,7 +398,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncHanzo) - ) assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: response = await async_client.batches.with_raw_response.retrieve( @@ -410,7 +410,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: batch = await response.parse() assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> None: async with async_client.batches.with_streaming_response.retrieve( @@ -424,7 +424,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `batch_id` but received ''"): @@ -432,13 +432,13 @@ async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: batch_id="", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncHanzo) -> None: batch = await async_client.batches.list() assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncHanzo) -> None: batch = await async_client.batches.list( @@ -448,7 +448,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncHanzo) -> No ) assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: response = await async_client.batches.with_raw_response.list() @@ -458,7 +458,7 @@ async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: batch = await response.parse() assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: async with async_client.batches.with_streaming_response.list() as response: @@ -470,7 +470,7 @@ async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_cancel_with_provider(self, async_client: AsyncHanzo) -> None: batch = await async_client.batches.cancel_with_provider( @@ -479,7 +479,7 @@ async def test_method_cancel_with_provider(self, async_client: AsyncHanzo) -> No ) assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_cancel_with_provider(self, async_client: AsyncHanzo) -> None: response = await async_client.batches.with_raw_response.cancel_with_provider( @@ -492,7 +492,7 @@ async def test_raw_response_cancel_with_provider(self, async_client: AsyncHanzo) batch = await response.parse() assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_cancel_with_provider(self, async_client: AsyncHanzo) -> None: async with async_client.batches.with_streaming_response.cancel_with_provider( @@ -507,7 +507,7 @@ async def test_streaming_response_cancel_with_provider(self, async_client: Async assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_cancel_with_provider(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `provider` but received ''"): @@ -522,7 +522,7 @@ async def test_path_params_cancel_with_provider(self, async_client: AsyncHanzo) provider="provider", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_provider(self, async_client: AsyncHanzo) -> None: batch = await async_client.batches.create_with_provider( @@ -530,7 +530,7 @@ async def test_method_create_with_provider(self, async_client: AsyncHanzo) -> No ) assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create_with_provider(self, async_client: AsyncHanzo) -> None: response = await async_client.batches.with_raw_response.create_with_provider( @@ -542,7 +542,7 @@ async def test_raw_response_create_with_provider(self, async_client: AsyncHanzo) batch = await response.parse() assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create_with_provider(self, async_client: AsyncHanzo) -> None: async with async_client.batches.with_streaming_response.create_with_provider( @@ -556,7 +556,7 @@ async def test_streaming_response_create_with_provider(self, async_client: Async assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_create_with_provider(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `provider` but received ''"): @@ -564,7 +564,7 @@ async def test_path_params_create_with_provider(self, async_client: AsyncHanzo) "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_provider(self, async_client: AsyncHanzo) -> None: batch = await async_client.batches.list_with_provider( @@ -572,7 +572,7 @@ async def test_method_list_with_provider(self, async_client: AsyncHanzo) -> None ) assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_provider_with_all_params(self, async_client: AsyncHanzo) -> None: batch = await async_client.batches.list_with_provider( @@ -582,7 +582,7 @@ async def test_method_list_with_provider_with_all_params(self, async_client: Asy ) assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list_with_provider(self, async_client: AsyncHanzo) -> None: response = await async_client.batches.with_raw_response.list_with_provider( @@ -594,7 +594,7 @@ async def test_raw_response_list_with_provider(self, async_client: AsyncHanzo) - batch = await response.parse() assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list_with_provider(self, async_client: AsyncHanzo) -> None: async with async_client.batches.with_streaming_response.list_with_provider( @@ -608,7 +608,7 @@ async def test_streaming_response_list_with_provider(self, async_client: AsyncHa assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_list_with_provider(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `provider` but received ''"): @@ -616,7 +616,7 @@ async def test_path_params_list_with_provider(self, async_client: AsyncHanzo) -> provider="", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_with_provider(self, async_client: AsyncHanzo) -> None: batch = await async_client.batches.retrieve_with_provider( @@ -625,7 +625,7 @@ async def test_method_retrieve_with_provider(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve_with_provider(self, async_client: AsyncHanzo) -> None: response = await async_client.batches.with_raw_response.retrieve_with_provider( @@ -638,7 +638,7 @@ async def test_raw_response_retrieve_with_provider(self, async_client: AsyncHanz batch = await response.parse() assert_matches_type(object, batch, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve_with_provider(self, async_client: AsyncHanzo) -> None: async with async_client.batches.with_streaming_response.retrieve_with_provider( @@ -653,7 +653,7 @@ async def test_streaming_response_retrieve_with_provider(self, async_client: Asy assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_retrieve_with_provider(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `provider` but received ''"): diff --git a/tests/api_resources/test_bedrock.py b/tests/api_resources/test_bedrock.py index 69b65148..80044255 100644 --- a/tests/api_resources/test_bedrock.py +++ b/tests/api_resources/test_bedrock.py @@ -16,7 +16,7 @@ class TestBedrock: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: bedrock = client.bedrock.create( @@ -24,7 +24,7 @@ def test_method_create(self, client: Hanzo) -> None: ) assert_matches_type(object, bedrock, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.bedrock.with_raw_response.create( @@ -36,7 +36,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: bedrock = response.parse() assert_matches_type(object, bedrock, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.bedrock.with_streaming_response.create( @@ -50,7 +50,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_create(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -58,7 +58,7 @@ def test_path_params_create(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Hanzo) -> None: bedrock = client.bedrock.retrieve( @@ -66,7 +66,7 @@ def test_method_retrieve(self, client: Hanzo) -> None: ) assert_matches_type(object, bedrock, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Hanzo) -> None: response = client.bedrock.with_raw_response.retrieve( @@ -78,7 +78,7 @@ def test_raw_response_retrieve(self, client: Hanzo) -> None: bedrock = response.parse() assert_matches_type(object, bedrock, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Hanzo) -> None: with client.bedrock.with_streaming_response.retrieve( @@ -92,7 +92,7 @@ def test_streaming_response_retrieve(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_retrieve(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -100,7 +100,7 @@ def test_path_params_retrieve(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Hanzo) -> None: bedrock = client.bedrock.update( @@ -108,7 +108,7 @@ def test_method_update(self, client: Hanzo) -> None: ) assert_matches_type(object, bedrock, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Hanzo) -> None: response = client.bedrock.with_raw_response.update( @@ -120,7 +120,7 @@ def test_raw_response_update(self, client: Hanzo) -> None: bedrock = response.parse() assert_matches_type(object, bedrock, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Hanzo) -> None: with client.bedrock.with_streaming_response.update( @@ -134,7 +134,7 @@ def test_streaming_response_update(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_update(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -142,7 +142,7 @@ def test_path_params_update(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: bedrock = client.bedrock.delete( @@ -150,7 +150,7 @@ def test_method_delete(self, client: Hanzo) -> None: ) assert_matches_type(object, bedrock, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.bedrock.with_raw_response.delete( @@ -162,7 +162,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: bedrock = response.parse() assert_matches_type(object, bedrock, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.bedrock.with_streaming_response.delete( @@ -176,7 +176,7 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_delete(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -184,7 +184,7 @@ def test_path_params_delete(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_patch(self, client: Hanzo) -> None: bedrock = client.bedrock.patch( @@ -192,7 +192,7 @@ def test_method_patch(self, client: Hanzo) -> None: ) assert_matches_type(object, bedrock, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_patch(self, client: Hanzo) -> None: response = client.bedrock.with_raw_response.patch( @@ -204,7 +204,7 @@ def test_raw_response_patch(self, client: Hanzo) -> None: bedrock = response.parse() assert_matches_type(object, bedrock, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_patch(self, client: Hanzo) -> None: with client.bedrock.with_streaming_response.patch( @@ -218,7 +218,7 @@ def test_streaming_response_patch(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_patch(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -232,7 +232,7 @@ class TestAsyncBedrock: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: bedrock = await async_client.bedrock.create( @@ -240,7 +240,7 @@ async def test_method_create(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, bedrock, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.bedrock.with_raw_response.create( @@ -252,7 +252,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: bedrock = await response.parse() assert_matches_type(object, bedrock, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.bedrock.with_streaming_response.create( @@ -266,7 +266,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_create(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -274,7 +274,7 @@ async def test_path_params_create(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: bedrock = await async_client.bedrock.retrieve( @@ -282,7 +282,7 @@ async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, bedrock, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: response = await async_client.bedrock.with_raw_response.retrieve( @@ -294,7 +294,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: bedrock = await response.parse() assert_matches_type(object, bedrock, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> None: async with async_client.bedrock.with_streaming_response.retrieve( @@ -308,7 +308,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -316,7 +316,7 @@ async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncHanzo) -> None: bedrock = await async_client.bedrock.update( @@ -324,7 +324,7 @@ async def test_method_update(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, bedrock, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: response = await async_client.bedrock.with_raw_response.update( @@ -336,7 +336,7 @@ async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: bedrock = await response.parse() assert_matches_type(object, bedrock, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None: async with async_client.bedrock.with_streaming_response.update( @@ -350,7 +350,7 @@ async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -358,7 +358,7 @@ async def test_path_params_update(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: bedrock = await async_client.bedrock.delete( @@ -366,7 +366,7 @@ async def test_method_delete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, bedrock, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.bedrock.with_raw_response.delete( @@ -378,7 +378,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: bedrock = await response.parse() assert_matches_type(object, bedrock, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.bedrock.with_streaming_response.delete( @@ -392,7 +392,7 @@ async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -400,7 +400,7 @@ async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_patch(self, async_client: AsyncHanzo) -> None: bedrock = await async_client.bedrock.patch( @@ -408,7 +408,7 @@ async def test_method_patch(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, bedrock, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_patch(self, async_client: AsyncHanzo) -> None: response = await async_client.bedrock.with_raw_response.patch( @@ -420,7 +420,7 @@ async def test_raw_response_patch(self, async_client: AsyncHanzo) -> None: bedrock = await response.parse() assert_matches_type(object, bedrock, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_patch(self, async_client: AsyncHanzo) -> None: async with async_client.bedrock.with_streaming_response.patch( @@ -434,7 +434,7 @@ async def test_streaming_response_patch(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_patch(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): diff --git a/tests/api_resources/test_budget.py b/tests/api_resources/test_budget.py index 64d82477..0bbe9fb0 100644 --- a/tests/api_resources/test_budget.py +++ b/tests/api_resources/test_budget.py @@ -16,13 +16,13 @@ class TestBudget: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: budget = client.budget.create() assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Hanzo) -> None: budget = client.budget.create( @@ -44,7 +44,7 @@ def test_method_create_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.budget.with_raw_response.create() @@ -54,7 +54,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: budget = response.parse() assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.budget.with_streaming_response.create() as response: @@ -66,13 +66,13 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Hanzo) -> None: budget = client.budget.update() assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Hanzo) -> None: budget = client.budget.update( @@ -94,7 +94,7 @@ def test_method_update_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Hanzo) -> None: response = client.budget.with_raw_response.update() @@ -104,7 +104,7 @@ def test_raw_response_update(self, client: Hanzo) -> None: budget = response.parse() assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Hanzo) -> None: with client.budget.with_streaming_response.update() as response: @@ -116,13 +116,13 @@ def test_streaming_response_update(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Hanzo) -> None: budget = client.budget.list() assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Hanzo) -> None: response = client.budget.with_raw_response.list() @@ -132,7 +132,7 @@ def test_raw_response_list(self, client: Hanzo) -> None: budget = response.parse() assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Hanzo) -> None: with client.budget.with_streaming_response.list() as response: @@ -144,7 +144,7 @@ def test_streaming_response_list(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: budget = client.budget.delete( @@ -152,7 +152,7 @@ def test_method_delete(self, client: Hanzo) -> None: ) assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.budget.with_raw_response.delete( @@ -164,7 +164,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: budget = response.parse() assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.budget.with_streaming_response.delete( @@ -178,7 +178,7 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_info(self, client: Hanzo) -> None: budget = client.budget.info( @@ -186,7 +186,7 @@ def test_method_info(self, client: Hanzo) -> None: ) assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_info(self, client: Hanzo) -> None: response = client.budget.with_raw_response.info( @@ -198,7 +198,7 @@ def test_raw_response_info(self, client: Hanzo) -> None: budget = response.parse() assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_info(self, client: Hanzo) -> None: with client.budget.with_streaming_response.info( @@ -212,7 +212,7 @@ def test_streaming_response_info(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_settings(self, client: Hanzo) -> None: budget = client.budget.settings( @@ -220,7 +220,7 @@ def test_method_settings(self, client: Hanzo) -> None: ) assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_settings(self, client: Hanzo) -> None: response = client.budget.with_raw_response.settings( @@ -232,7 +232,7 @@ def test_raw_response_settings(self, client: Hanzo) -> None: budget = response.parse() assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_settings(self, client: Hanzo) -> None: with client.budget.with_streaming_response.settings( @@ -252,13 +252,13 @@ class TestAsyncBudget: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: budget = await async_client.budget.create() assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> None: budget = await async_client.budget.create( @@ -280,7 +280,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.budget.with_raw_response.create() @@ -290,7 +290,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: budget = await response.parse() assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.budget.with_streaming_response.create() as response: @@ -302,13 +302,13 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncHanzo) -> None: budget = await async_client.budget.update() assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncHanzo) -> None: budget = await async_client.budget.update( @@ -330,7 +330,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: response = await async_client.budget.with_raw_response.update() @@ -340,7 +340,7 @@ async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: budget = await response.parse() assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None: async with async_client.budget.with_streaming_response.update() as response: @@ -352,13 +352,13 @@ async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncHanzo) -> None: budget = await async_client.budget.list() assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: response = await async_client.budget.with_raw_response.list() @@ -368,7 +368,7 @@ async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: budget = await response.parse() assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: async with async_client.budget.with_streaming_response.list() as response: @@ -380,7 +380,7 @@ async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: budget = await async_client.budget.delete( @@ -388,7 +388,7 @@ async def test_method_delete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.budget.with_raw_response.delete( @@ -400,7 +400,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: budget = await response.parse() assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.budget.with_streaming_response.delete( @@ -414,7 +414,7 @@ async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_info(self, async_client: AsyncHanzo) -> None: budget = await async_client.budget.info( @@ -422,7 +422,7 @@ async def test_method_info(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_info(self, async_client: AsyncHanzo) -> None: response = await async_client.budget.with_raw_response.info( @@ -434,7 +434,7 @@ async def test_raw_response_info(self, async_client: AsyncHanzo) -> None: budget = await response.parse() assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_info(self, async_client: AsyncHanzo) -> None: async with async_client.budget.with_streaming_response.info( @@ -448,7 +448,7 @@ async def test_streaming_response_info(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_settings(self, async_client: AsyncHanzo) -> None: budget = await async_client.budget.settings( @@ -456,7 +456,7 @@ async def test_method_settings(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_settings(self, async_client: AsyncHanzo) -> None: response = await async_client.budget.with_raw_response.settings( @@ -468,7 +468,7 @@ async def test_raw_response_settings(self, async_client: AsyncHanzo) -> None: budget = await response.parse() assert_matches_type(object, budget, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_settings(self, async_client: AsyncHanzo) -> None: async with async_client.budget.with_streaming_response.settings( diff --git a/tests/api_resources/test_cache.py b/tests/api_resources/test_cache.py index b43fdd0a..d645297d 100644 --- a/tests/api_resources/test_cache.py +++ b/tests/api_resources/test_cache.py @@ -17,13 +17,13 @@ class TestCache: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: cache = client.cache.delete() assert_matches_type(object, cache, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.cache.with_raw_response.delete() @@ -33,7 +33,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: cache = response.parse() assert_matches_type(object, cache, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.cache.with_streaming_response.delete() as response: @@ -45,13 +45,13 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_flush_all(self, client: Hanzo) -> None: cache = client.cache.flush_all() assert_matches_type(object, cache, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_flush_all(self, client: Hanzo) -> None: response = client.cache.with_raw_response.flush_all() @@ -61,7 +61,7 @@ def test_raw_response_flush_all(self, client: Hanzo) -> None: cache = response.parse() assert_matches_type(object, cache, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_flush_all(self, client: Hanzo) -> None: with client.cache.with_streaming_response.flush_all() as response: @@ -73,13 +73,13 @@ def test_streaming_response_flush_all(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_ping(self, client: Hanzo) -> None: cache = client.cache.ping() assert_matches_type(CachePingResponse, cache, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_ping(self, client: Hanzo) -> None: response = client.cache.with_raw_response.ping() @@ -89,7 +89,7 @@ def test_raw_response_ping(self, client: Hanzo) -> None: cache = response.parse() assert_matches_type(CachePingResponse, cache, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_ping(self, client: Hanzo) -> None: with client.cache.with_streaming_response.ping() as response: @@ -107,13 +107,13 @@ class TestAsyncCache: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: cache = await async_client.cache.delete() assert_matches_type(object, cache, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.cache.with_raw_response.delete() @@ -123,7 +123,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: cache = await response.parse() assert_matches_type(object, cache, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.cache.with_streaming_response.delete() as response: @@ -135,13 +135,13 @@ async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_flush_all(self, async_client: AsyncHanzo) -> None: cache = await async_client.cache.flush_all() assert_matches_type(object, cache, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_flush_all(self, async_client: AsyncHanzo) -> None: response = await async_client.cache.with_raw_response.flush_all() @@ -151,7 +151,7 @@ async def test_raw_response_flush_all(self, async_client: AsyncHanzo) -> None: cache = await response.parse() assert_matches_type(object, cache, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_flush_all(self, async_client: AsyncHanzo) -> None: async with async_client.cache.with_streaming_response.flush_all() as response: @@ -163,13 +163,13 @@ async def test_streaming_response_flush_all(self, async_client: AsyncHanzo) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_ping(self, async_client: AsyncHanzo) -> None: cache = await async_client.cache.ping() assert_matches_type(CachePingResponse, cache, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_ping(self, async_client: AsyncHanzo) -> None: response = await async_client.cache.with_raw_response.ping() @@ -179,7 +179,7 @@ async def test_raw_response_ping(self, async_client: AsyncHanzo) -> None: cache = await response.parse() assert_matches_type(CachePingResponse, cache, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_ping(self, async_client: AsyncHanzo) -> None: async with async_client.cache.with_streaming_response.ping() as response: diff --git a/tests/api_resources/test_client.py b/tests/api_resources/test_client.py index 7593d352..807bad4c 100644 --- a/tests/api_resources/test_client.py +++ b/tests/api_resources/test_client.py @@ -16,13 +16,13 @@ class TestClient: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_get_home(self, client: Hanzo) -> None: client_ = client.get_home() assert_matches_type(object, client_, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_get_home(self, client: Hanzo) -> None: response = client.with_raw_response.get_home() @@ -32,7 +32,7 @@ def test_raw_response_get_home(self, client: Hanzo) -> None: client_ = response.parse() assert_matches_type(object, client_, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_get_home(self, client: Hanzo) -> None: with client.with_streaming_response.get_home() as response: @@ -50,13 +50,13 @@ class TestAsyncClient: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_get_home(self, async_client: AsyncHanzo) -> None: client = await async_client.get_home() assert_matches_type(object, client, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_get_home(self, async_client: AsyncHanzo) -> None: response = await async_client.with_raw_response.get_home() @@ -66,7 +66,7 @@ async def test_raw_response_get_home(self, async_client: AsyncHanzo) -> None: client = await response.parse() assert_matches_type(object, client, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_get_home(self, async_client: AsyncHanzo) -> None: async with async_client.with_streaming_response.get_home() as response: diff --git a/tests/api_resources/test_cohere.py b/tests/api_resources/test_cohere.py index d0601947..0fe84533 100644 --- a/tests/api_resources/test_cohere.py +++ b/tests/api_resources/test_cohere.py @@ -16,7 +16,7 @@ class TestCohere: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: cohere = client.cohere.create( @@ -24,7 +24,7 @@ def test_method_create(self, client: Hanzo) -> None: ) assert_matches_type(object, cohere, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.cohere.with_raw_response.create( @@ -36,7 +36,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: cohere = response.parse() assert_matches_type(object, cohere, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.cohere.with_streaming_response.create( @@ -50,7 +50,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_create(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -58,7 +58,7 @@ def test_path_params_create(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Hanzo) -> None: cohere = client.cohere.retrieve( @@ -66,7 +66,7 @@ def test_method_retrieve(self, client: Hanzo) -> None: ) assert_matches_type(object, cohere, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Hanzo) -> None: response = client.cohere.with_raw_response.retrieve( @@ -78,7 +78,7 @@ def test_raw_response_retrieve(self, client: Hanzo) -> None: cohere = response.parse() assert_matches_type(object, cohere, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Hanzo) -> None: with client.cohere.with_streaming_response.retrieve( @@ -92,7 +92,7 @@ def test_streaming_response_retrieve(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_retrieve(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -100,7 +100,7 @@ def test_path_params_retrieve(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Hanzo) -> None: cohere = client.cohere.update( @@ -108,7 +108,7 @@ def test_method_update(self, client: Hanzo) -> None: ) assert_matches_type(object, cohere, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Hanzo) -> None: response = client.cohere.with_raw_response.update( @@ -120,7 +120,7 @@ def test_raw_response_update(self, client: Hanzo) -> None: cohere = response.parse() assert_matches_type(object, cohere, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Hanzo) -> None: with client.cohere.with_streaming_response.update( @@ -134,7 +134,7 @@ def test_streaming_response_update(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_update(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -142,7 +142,7 @@ def test_path_params_update(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: cohere = client.cohere.delete( @@ -150,7 +150,7 @@ def test_method_delete(self, client: Hanzo) -> None: ) assert_matches_type(object, cohere, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.cohere.with_raw_response.delete( @@ -162,7 +162,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: cohere = response.parse() assert_matches_type(object, cohere, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.cohere.with_streaming_response.delete( @@ -176,7 +176,7 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_delete(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -184,7 +184,7 @@ def test_path_params_delete(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_modify(self, client: Hanzo) -> None: cohere = client.cohere.modify( @@ -192,7 +192,7 @@ def test_method_modify(self, client: Hanzo) -> None: ) assert_matches_type(object, cohere, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_modify(self, client: Hanzo) -> None: response = client.cohere.with_raw_response.modify( @@ -204,7 +204,7 @@ def test_raw_response_modify(self, client: Hanzo) -> None: cohere = response.parse() assert_matches_type(object, cohere, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_modify(self, client: Hanzo) -> None: with client.cohere.with_streaming_response.modify( @@ -218,7 +218,7 @@ def test_streaming_response_modify(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_modify(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -232,7 +232,7 @@ class TestAsyncCohere: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: cohere = await async_client.cohere.create( @@ -240,7 +240,7 @@ async def test_method_create(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, cohere, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.cohere.with_raw_response.create( @@ -252,7 +252,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: cohere = await response.parse() assert_matches_type(object, cohere, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.cohere.with_streaming_response.create( @@ -266,7 +266,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_create(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -274,7 +274,7 @@ async def test_path_params_create(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: cohere = await async_client.cohere.retrieve( @@ -282,7 +282,7 @@ async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, cohere, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: response = await async_client.cohere.with_raw_response.retrieve( @@ -294,7 +294,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: cohere = await response.parse() assert_matches_type(object, cohere, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> None: async with async_client.cohere.with_streaming_response.retrieve( @@ -308,7 +308,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -316,7 +316,7 @@ async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncHanzo) -> None: cohere = await async_client.cohere.update( @@ -324,7 +324,7 @@ async def test_method_update(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, cohere, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: response = await async_client.cohere.with_raw_response.update( @@ -336,7 +336,7 @@ async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: cohere = await response.parse() assert_matches_type(object, cohere, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None: async with async_client.cohere.with_streaming_response.update( @@ -350,7 +350,7 @@ async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -358,7 +358,7 @@ async def test_path_params_update(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: cohere = await async_client.cohere.delete( @@ -366,7 +366,7 @@ async def test_method_delete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, cohere, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.cohere.with_raw_response.delete( @@ -378,7 +378,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: cohere = await response.parse() assert_matches_type(object, cohere, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.cohere.with_streaming_response.delete( @@ -392,7 +392,7 @@ async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -400,7 +400,7 @@ async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_modify(self, async_client: AsyncHanzo) -> None: cohere = await async_client.cohere.modify( @@ -408,7 +408,7 @@ async def test_method_modify(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, cohere, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_modify(self, async_client: AsyncHanzo) -> None: response = await async_client.cohere.with_raw_response.modify( @@ -420,7 +420,7 @@ async def test_raw_response_modify(self, async_client: AsyncHanzo) -> None: cohere = await response.parse() assert_matches_type(object, cohere, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_modify(self, async_client: AsyncHanzo) -> None: async with async_client.cohere.with_streaming_response.modify( @@ -434,7 +434,7 @@ async def test_streaming_response_modify(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_modify(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): diff --git a/tests/api_resources/test_completions.py b/tests/api_resources/test_completions.py index 20018ca6..09e98f99 100644 --- a/tests/api_resources/test_completions.py +++ b/tests/api_resources/test_completions.py @@ -16,13 +16,13 @@ class TestCompletions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: completion = client.completions.create() assert_matches_type(object, completion, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Hanzo) -> None: completion = client.completions.create( @@ -30,7 +30,7 @@ def test_method_create_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, completion, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.completions.with_raw_response.create() @@ -40,7 +40,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: completion = response.parse() assert_matches_type(object, completion, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.completions.with_streaming_response.create() as response: @@ -58,13 +58,13 @@ class TestAsyncCompletions: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: completion = await async_client.completions.create() assert_matches_type(object, completion, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> None: completion = await async_client.completions.create( @@ -72,7 +72,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, completion, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.completions.with_raw_response.create() @@ -82,7 +82,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: completion = await response.parse() assert_matches_type(object, completion, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.completions.with_streaming_response.create() as response: diff --git a/tests/api_resources/test_credentials.py b/tests/api_resources/test_credentials.py index bae6095f..f95954fa 100644 --- a/tests/api_resources/test_credentials.py +++ b/tests/api_resources/test_credentials.py @@ -16,7 +16,7 @@ class TestCredentials: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: credential = client.credentials.create( @@ -25,7 +25,7 @@ def test_method_create(self, client: Hanzo) -> None: ) assert_matches_type(object, credential, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Hanzo) -> None: credential = client.credentials.create( @@ -36,7 +36,7 @@ def test_method_create_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, credential, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.credentials.with_raw_response.create( @@ -49,7 +49,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: credential = response.parse() assert_matches_type(object, credential, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.credentials.with_streaming_response.create( @@ -64,13 +64,13 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Hanzo) -> None: credential = client.credentials.list() assert_matches_type(object, credential, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Hanzo) -> None: response = client.credentials.with_raw_response.list() @@ -80,7 +80,7 @@ def test_raw_response_list(self, client: Hanzo) -> None: credential = response.parse() assert_matches_type(object, credential, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Hanzo) -> None: with client.credentials.with_streaming_response.list() as response: @@ -92,7 +92,7 @@ def test_streaming_response_list(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: credential = client.credentials.delete( @@ -100,7 +100,7 @@ def test_method_delete(self, client: Hanzo) -> None: ) assert_matches_type(object, credential, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.credentials.with_raw_response.delete( @@ -112,7 +112,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: credential = response.parse() assert_matches_type(object, credential, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.credentials.with_streaming_response.delete( @@ -126,7 +126,7 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_delete(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `credential_name` but received ''"): @@ -140,7 +140,7 @@ class TestAsyncCredentials: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: credential = await async_client.credentials.create( @@ -149,7 +149,7 @@ async def test_method_create(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, credential, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> None: credential = await async_client.credentials.create( @@ -160,7 +160,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, credential, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.credentials.with_raw_response.create( @@ -173,7 +173,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: credential = await response.parse() assert_matches_type(object, credential, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.credentials.with_streaming_response.create( @@ -188,13 +188,13 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncHanzo) -> None: credential = await async_client.credentials.list() assert_matches_type(object, credential, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: response = await async_client.credentials.with_raw_response.list() @@ -204,7 +204,7 @@ async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: credential = await response.parse() assert_matches_type(object, credential, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: async with async_client.credentials.with_streaming_response.list() as response: @@ -216,7 +216,7 @@ async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: credential = await async_client.credentials.delete( @@ -224,7 +224,7 @@ async def test_method_delete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, credential, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.credentials.with_raw_response.delete( @@ -236,7 +236,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: credential = await response.parse() assert_matches_type(object, credential, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.credentials.with_streaming_response.delete( @@ -250,7 +250,7 @@ async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `credential_name` but received ''"): diff --git a/tests/api_resources/test_customer.py b/tests/api_resources/test_customer.py index 34f8aa32..8cc9c37c 100644 --- a/tests/api_resources/test_customer.py +++ b/tests/api_resources/test_customer.py @@ -20,7 +20,7 @@ class TestCustomer: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: customer = client.customer.create( @@ -28,7 +28,7 @@ def test_method_create(self, client: Hanzo) -> None: ) assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Hanzo) -> None: customer = client.customer.create( @@ -55,7 +55,7 @@ def test_method_create_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.customer.with_raw_response.create( @@ -67,7 +67,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: customer = response.parse() assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.customer.with_streaming_response.create( @@ -81,7 +81,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Hanzo) -> None: customer = client.customer.update( @@ -89,7 +89,7 @@ def test_method_update(self, client: Hanzo) -> None: ) assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Hanzo) -> None: customer = client.customer.update( @@ -103,7 +103,7 @@ def test_method_update_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Hanzo) -> None: response = client.customer.with_raw_response.update( @@ -115,7 +115,7 @@ def test_raw_response_update(self, client: Hanzo) -> None: customer = response.parse() assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Hanzo) -> None: with client.customer.with_streaming_response.update( @@ -129,13 +129,13 @@ def test_streaming_response_update(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Hanzo) -> None: customer = client.customer.list() assert_matches_type(CustomerListResponse, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Hanzo) -> None: response = client.customer.with_raw_response.list() @@ -145,7 +145,7 @@ def test_raw_response_list(self, client: Hanzo) -> None: customer = response.parse() assert_matches_type(CustomerListResponse, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Hanzo) -> None: with client.customer.with_streaming_response.list() as response: @@ -157,7 +157,7 @@ def test_streaming_response_list(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: customer = client.customer.delete( @@ -165,7 +165,7 @@ def test_method_delete(self, client: Hanzo) -> None: ) assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.customer.with_raw_response.delete( @@ -177,7 +177,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: customer = response.parse() assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.customer.with_streaming_response.delete( @@ -191,7 +191,7 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_block(self, client: Hanzo) -> None: customer = client.customer.block( @@ -199,7 +199,7 @@ def test_method_block(self, client: Hanzo) -> None: ) assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_block(self, client: Hanzo) -> None: response = client.customer.with_raw_response.block( @@ -211,7 +211,7 @@ def test_raw_response_block(self, client: Hanzo) -> None: customer = response.parse() assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_block(self, client: Hanzo) -> None: with client.customer.with_streaming_response.block( @@ -225,7 +225,7 @@ def test_streaming_response_block(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_info(self, client: Hanzo) -> None: customer = client.customer.retrieve_info( @@ -233,7 +233,7 @@ def test_method_retrieve_info(self, client: Hanzo) -> None: ) assert_matches_type(CustomerRetrieveInfoResponse, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve_info(self, client: Hanzo) -> None: response = client.customer.with_raw_response.retrieve_info( @@ -245,7 +245,7 @@ def test_raw_response_retrieve_info(self, client: Hanzo) -> None: customer = response.parse() assert_matches_type(CustomerRetrieveInfoResponse, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve_info(self, client: Hanzo) -> None: with client.customer.with_streaming_response.retrieve_info( @@ -259,7 +259,7 @@ def test_streaming_response_retrieve_info(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_unblock(self, client: Hanzo) -> None: customer = client.customer.unblock( @@ -267,7 +267,7 @@ def test_method_unblock(self, client: Hanzo) -> None: ) assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_unblock(self, client: Hanzo) -> None: response = client.customer.with_raw_response.unblock( @@ -279,7 +279,7 @@ def test_raw_response_unblock(self, client: Hanzo) -> None: customer = response.parse() assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_unblock(self, client: Hanzo) -> None: with client.customer.with_streaming_response.unblock( @@ -299,7 +299,7 @@ class TestAsyncCustomer: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: customer = await async_client.customer.create( @@ -307,7 +307,7 @@ async def test_method_create(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> None: customer = await async_client.customer.create( @@ -334,7 +334,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.customer.with_raw_response.create( @@ -346,7 +346,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: customer = await response.parse() assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.customer.with_streaming_response.create( @@ -360,7 +360,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncHanzo) -> None: customer = await async_client.customer.update( @@ -368,7 +368,7 @@ async def test_method_update(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncHanzo) -> None: customer = await async_client.customer.update( @@ -382,7 +382,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: response = await async_client.customer.with_raw_response.update( @@ -394,7 +394,7 @@ async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: customer = await response.parse() assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None: async with async_client.customer.with_streaming_response.update( @@ -408,13 +408,13 @@ async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncHanzo) -> None: customer = await async_client.customer.list() assert_matches_type(CustomerListResponse, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: response = await async_client.customer.with_raw_response.list() @@ -424,7 +424,7 @@ async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: customer = await response.parse() assert_matches_type(CustomerListResponse, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: async with async_client.customer.with_streaming_response.list() as response: @@ -436,7 +436,7 @@ async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: customer = await async_client.customer.delete( @@ -444,7 +444,7 @@ async def test_method_delete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.customer.with_raw_response.delete( @@ -456,7 +456,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: customer = await response.parse() assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.customer.with_streaming_response.delete( @@ -470,7 +470,7 @@ async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_block(self, async_client: AsyncHanzo) -> None: customer = await async_client.customer.block( @@ -478,7 +478,7 @@ async def test_method_block(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_block(self, async_client: AsyncHanzo) -> None: response = await async_client.customer.with_raw_response.block( @@ -490,7 +490,7 @@ async def test_raw_response_block(self, async_client: AsyncHanzo) -> None: customer = await response.parse() assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_block(self, async_client: AsyncHanzo) -> None: async with async_client.customer.with_streaming_response.block( @@ -504,7 +504,7 @@ async def test_streaming_response_block(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_info(self, async_client: AsyncHanzo) -> None: customer = await async_client.customer.retrieve_info( @@ -512,7 +512,7 @@ async def test_method_retrieve_info(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(CustomerRetrieveInfoResponse, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve_info(self, async_client: AsyncHanzo) -> None: response = await async_client.customer.with_raw_response.retrieve_info( @@ -524,7 +524,7 @@ async def test_raw_response_retrieve_info(self, async_client: AsyncHanzo) -> Non customer = await response.parse() assert_matches_type(CustomerRetrieveInfoResponse, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve_info(self, async_client: AsyncHanzo) -> None: async with async_client.customer.with_streaming_response.retrieve_info( @@ -538,7 +538,7 @@ async def test_streaming_response_retrieve_info(self, async_client: AsyncHanzo) assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_unblock(self, async_client: AsyncHanzo) -> None: customer = await async_client.customer.unblock( @@ -546,7 +546,7 @@ async def test_method_unblock(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_unblock(self, async_client: AsyncHanzo) -> None: response = await async_client.customer.with_raw_response.unblock( @@ -558,7 +558,7 @@ async def test_raw_response_unblock(self, async_client: AsyncHanzo) -> None: customer = await response.parse() assert_matches_type(object, customer, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_unblock(self, async_client: AsyncHanzo) -> None: async with async_client.customer.with_streaming_response.unblock( diff --git a/tests/api_resources/test_delete.py b/tests/api_resources/test_delete.py index 06e54131..4f0ce744 100644 --- a/tests/api_resources/test_delete.py +++ b/tests/api_resources/test_delete.py @@ -16,7 +16,7 @@ class TestDelete: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_allowed_ip(self, client: Hanzo) -> None: delete = client.delete.create_allowed_ip( @@ -24,7 +24,7 @@ def test_method_create_allowed_ip(self, client: Hanzo) -> None: ) assert_matches_type(object, delete, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create_allowed_ip(self, client: Hanzo) -> None: response = client.delete.with_raw_response.create_allowed_ip( @@ -36,7 +36,7 @@ def test_raw_response_create_allowed_ip(self, client: Hanzo) -> None: delete = response.parse() assert_matches_type(object, delete, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create_allowed_ip(self, client: Hanzo) -> None: with client.delete.with_streaming_response.create_allowed_ip( @@ -56,7 +56,7 @@ class TestAsyncDelete: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_allowed_ip(self, async_client: AsyncHanzo) -> None: delete = await async_client.delete.create_allowed_ip( @@ -64,7 +64,7 @@ async def test_method_create_allowed_ip(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, delete, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create_allowed_ip(self, async_client: AsyncHanzo) -> None: response = await async_client.delete.with_raw_response.create_allowed_ip( @@ -76,7 +76,7 @@ async def test_raw_response_create_allowed_ip(self, async_client: AsyncHanzo) -> delete = await response.parse() assert_matches_type(object, delete, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create_allowed_ip(self, async_client: AsyncHanzo) -> None: async with async_client.delete.with_streaming_response.create_allowed_ip( diff --git a/tests/api_resources/test_embeddings.py b/tests/api_resources/test_embeddings.py index 665a9cba..26880a95 100644 --- a/tests/api_resources/test_embeddings.py +++ b/tests/api_resources/test_embeddings.py @@ -16,13 +16,13 @@ class TestEmbeddings: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: embedding = client.embeddings.create() assert_matches_type(object, embedding, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Hanzo) -> None: embedding = client.embeddings.create( @@ -30,7 +30,7 @@ def test_method_create_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, embedding, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.embeddings.with_raw_response.create() @@ -40,7 +40,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: embedding = response.parse() assert_matches_type(object, embedding, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.embeddings.with_streaming_response.create() as response: @@ -58,13 +58,13 @@ class TestAsyncEmbeddings: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: embedding = await async_client.embeddings.create() assert_matches_type(object, embedding, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> None: embedding = await async_client.embeddings.create( @@ -72,7 +72,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, embedding, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.embeddings.with_raw_response.create() @@ -82,7 +82,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: embedding = await response.parse() assert_matches_type(object, embedding, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.embeddings.with_streaming_response.create() as response: diff --git a/tests/api_resources/test_engines.py b/tests/api_resources/test_engines.py index cbbf2e87..78894a69 100644 --- a/tests/api_resources/test_engines.py +++ b/tests/api_resources/test_engines.py @@ -16,7 +16,7 @@ class TestEngines: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_complete(self, client: Hanzo) -> None: engine = client.engines.complete( @@ -24,7 +24,7 @@ def test_method_complete(self, client: Hanzo) -> None: ) assert_matches_type(object, engine, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_complete(self, client: Hanzo) -> None: response = client.engines.with_raw_response.complete( @@ -36,7 +36,7 @@ def test_raw_response_complete(self, client: Hanzo) -> None: engine = response.parse() assert_matches_type(object, engine, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_complete(self, client: Hanzo) -> None: with client.engines.with_streaming_response.complete( @@ -50,7 +50,7 @@ def test_streaming_response_complete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_complete(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model` but received ''"): @@ -58,7 +58,7 @@ def test_path_params_complete(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_embed(self, client: Hanzo) -> None: engine = client.engines.embed( @@ -66,7 +66,7 @@ def test_method_embed(self, client: Hanzo) -> None: ) assert_matches_type(object, engine, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_embed(self, client: Hanzo) -> None: response = client.engines.with_raw_response.embed( @@ -78,7 +78,7 @@ def test_raw_response_embed(self, client: Hanzo) -> None: engine = response.parse() assert_matches_type(object, engine, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_embed(self, client: Hanzo) -> None: with client.engines.with_streaming_response.embed( @@ -92,7 +92,7 @@ def test_streaming_response_embed(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_embed(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model` but received ''"): @@ -106,7 +106,7 @@ class TestAsyncEngines: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_complete(self, async_client: AsyncHanzo) -> None: engine = await async_client.engines.complete( @@ -114,7 +114,7 @@ async def test_method_complete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, engine, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_complete(self, async_client: AsyncHanzo) -> None: response = await async_client.engines.with_raw_response.complete( @@ -126,7 +126,7 @@ async def test_raw_response_complete(self, async_client: AsyncHanzo) -> None: engine = await response.parse() assert_matches_type(object, engine, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_complete(self, async_client: AsyncHanzo) -> None: async with async_client.engines.with_streaming_response.complete( @@ -140,7 +140,7 @@ async def test_streaming_response_complete(self, async_client: AsyncHanzo) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_complete(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model` but received ''"): @@ -148,7 +148,7 @@ async def test_path_params_complete(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_embed(self, async_client: AsyncHanzo) -> None: engine = await async_client.engines.embed( @@ -156,7 +156,7 @@ async def test_method_embed(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, engine, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_embed(self, async_client: AsyncHanzo) -> None: response = await async_client.engines.with_raw_response.embed( @@ -168,7 +168,7 @@ async def test_raw_response_embed(self, async_client: AsyncHanzo) -> None: engine = await response.parse() assert_matches_type(object, engine, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_embed(self, async_client: AsyncHanzo) -> None: async with async_client.engines.with_streaming_response.embed( @@ -182,7 +182,7 @@ async def test_streaming_response_embed(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_embed(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `model` but received ''"): diff --git a/tests/api_resources/test_eu_assemblyai.py b/tests/api_resources/test_eu_assemblyai.py index 8d402941..3bb9074e 100644 --- a/tests/api_resources/test_eu_assemblyai.py +++ b/tests/api_resources/test_eu_assemblyai.py @@ -16,7 +16,7 @@ class TestEuAssemblyai: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: eu_assemblyai = client.eu_assemblyai.create( @@ -24,7 +24,7 @@ def test_method_create(self, client: Hanzo) -> None: ) assert_matches_type(object, eu_assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.eu_assemblyai.with_raw_response.create( @@ -36,7 +36,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: eu_assemblyai = response.parse() assert_matches_type(object, eu_assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.eu_assemblyai.with_streaming_response.create( @@ -50,7 +50,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_create(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -58,7 +58,7 @@ def test_path_params_create(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Hanzo) -> None: eu_assemblyai = client.eu_assemblyai.retrieve( @@ -66,7 +66,7 @@ def test_method_retrieve(self, client: Hanzo) -> None: ) assert_matches_type(object, eu_assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Hanzo) -> None: response = client.eu_assemblyai.with_raw_response.retrieve( @@ -78,7 +78,7 @@ def test_raw_response_retrieve(self, client: Hanzo) -> None: eu_assemblyai = response.parse() assert_matches_type(object, eu_assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Hanzo) -> None: with client.eu_assemblyai.with_streaming_response.retrieve( @@ -92,7 +92,7 @@ def test_streaming_response_retrieve(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_retrieve(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -100,7 +100,7 @@ def test_path_params_retrieve(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Hanzo) -> None: eu_assemblyai = client.eu_assemblyai.update( @@ -108,7 +108,7 @@ def test_method_update(self, client: Hanzo) -> None: ) assert_matches_type(object, eu_assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Hanzo) -> None: response = client.eu_assemblyai.with_raw_response.update( @@ -120,7 +120,7 @@ def test_raw_response_update(self, client: Hanzo) -> None: eu_assemblyai = response.parse() assert_matches_type(object, eu_assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Hanzo) -> None: with client.eu_assemblyai.with_streaming_response.update( @@ -134,7 +134,7 @@ def test_streaming_response_update(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_update(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -142,7 +142,7 @@ def test_path_params_update(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: eu_assemblyai = client.eu_assemblyai.delete( @@ -150,7 +150,7 @@ def test_method_delete(self, client: Hanzo) -> None: ) assert_matches_type(object, eu_assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.eu_assemblyai.with_raw_response.delete( @@ -162,7 +162,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: eu_assemblyai = response.parse() assert_matches_type(object, eu_assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.eu_assemblyai.with_streaming_response.delete( @@ -176,7 +176,7 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_delete(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -184,7 +184,7 @@ def test_path_params_delete(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_patch(self, client: Hanzo) -> None: eu_assemblyai = client.eu_assemblyai.patch( @@ -192,7 +192,7 @@ def test_method_patch(self, client: Hanzo) -> None: ) assert_matches_type(object, eu_assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_patch(self, client: Hanzo) -> None: response = client.eu_assemblyai.with_raw_response.patch( @@ -204,7 +204,7 @@ def test_raw_response_patch(self, client: Hanzo) -> None: eu_assemblyai = response.parse() assert_matches_type(object, eu_assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_patch(self, client: Hanzo) -> None: with client.eu_assemblyai.with_streaming_response.patch( @@ -218,7 +218,7 @@ def test_streaming_response_patch(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_patch(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -232,7 +232,7 @@ class TestAsyncEuAssemblyai: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: eu_assemblyai = await async_client.eu_assemblyai.create( @@ -240,7 +240,7 @@ async def test_method_create(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, eu_assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.eu_assemblyai.with_raw_response.create( @@ -252,7 +252,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: eu_assemblyai = await response.parse() assert_matches_type(object, eu_assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.eu_assemblyai.with_streaming_response.create( @@ -266,7 +266,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_create(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -274,7 +274,7 @@ async def test_path_params_create(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: eu_assemblyai = await async_client.eu_assemblyai.retrieve( @@ -282,7 +282,7 @@ async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, eu_assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: response = await async_client.eu_assemblyai.with_raw_response.retrieve( @@ -294,7 +294,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: eu_assemblyai = await response.parse() assert_matches_type(object, eu_assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> None: async with async_client.eu_assemblyai.with_streaming_response.retrieve( @@ -308,7 +308,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -316,7 +316,7 @@ async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncHanzo) -> None: eu_assemblyai = await async_client.eu_assemblyai.update( @@ -324,7 +324,7 @@ async def test_method_update(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, eu_assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: response = await async_client.eu_assemblyai.with_raw_response.update( @@ -336,7 +336,7 @@ async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: eu_assemblyai = await response.parse() assert_matches_type(object, eu_assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None: async with async_client.eu_assemblyai.with_streaming_response.update( @@ -350,7 +350,7 @@ async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -358,7 +358,7 @@ async def test_path_params_update(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: eu_assemblyai = await async_client.eu_assemblyai.delete( @@ -366,7 +366,7 @@ async def test_method_delete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, eu_assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.eu_assemblyai.with_raw_response.delete( @@ -378,7 +378,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: eu_assemblyai = await response.parse() assert_matches_type(object, eu_assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.eu_assemblyai.with_streaming_response.delete( @@ -392,7 +392,7 @@ async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -400,7 +400,7 @@ async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_patch(self, async_client: AsyncHanzo) -> None: eu_assemblyai = await async_client.eu_assemblyai.patch( @@ -408,7 +408,7 @@ async def test_method_patch(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, eu_assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_patch(self, async_client: AsyncHanzo) -> None: response = await async_client.eu_assemblyai.with_raw_response.patch( @@ -420,7 +420,7 @@ async def test_raw_response_patch(self, async_client: AsyncHanzo) -> None: eu_assemblyai = await response.parse() assert_matches_type(object, eu_assemblyai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_patch(self, async_client: AsyncHanzo) -> None: async with async_client.eu_assemblyai.with_streaming_response.patch( @@ -434,7 +434,7 @@ async def test_streaming_response_patch(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_patch(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): diff --git a/tests/api_resources/test_files.py b/tests/api_resources/test_files.py index 1dc36901..8653f292 100644 --- a/tests/api_resources/test_files.py +++ b/tests/api_resources/test_files.py @@ -16,7 +16,7 @@ class TestFiles: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: file = client.files.create( @@ -26,7 +26,7 @@ def test_method_create(self, client: Hanzo) -> None: ) assert_matches_type(object, file, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Hanzo) -> None: file = client.files.create( @@ -37,7 +37,7 @@ def test_method_create_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, file, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.files.with_raw_response.create( @@ -51,7 +51,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: file = response.parse() assert_matches_type(object, file, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.files.with_streaming_response.create( @@ -67,7 +67,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_create(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `provider` but received ''"): @@ -77,7 +77,7 @@ def test_path_params_create(self, client: Hanzo) -> None: purpose="purpose", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Hanzo) -> None: file = client.files.retrieve( @@ -86,7 +86,7 @@ def test_method_retrieve(self, client: Hanzo) -> None: ) assert_matches_type(object, file, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Hanzo) -> None: response = client.files.with_raw_response.retrieve( @@ -99,7 +99,7 @@ def test_raw_response_retrieve(self, client: Hanzo) -> None: file = response.parse() assert_matches_type(object, file, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Hanzo) -> None: with client.files.with_streaming_response.retrieve( @@ -114,7 +114,7 @@ def test_streaming_response_retrieve(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_retrieve(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `provider` but received ''"): @@ -129,7 +129,7 @@ def test_path_params_retrieve(self, client: Hanzo) -> None: provider="provider", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Hanzo) -> None: file = client.files.list( @@ -137,7 +137,7 @@ def test_method_list(self, client: Hanzo) -> None: ) assert_matches_type(object, file, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Hanzo) -> None: file = client.files.list( @@ -146,7 +146,7 @@ def test_method_list_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, file, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Hanzo) -> None: response = client.files.with_raw_response.list( @@ -158,7 +158,7 @@ def test_raw_response_list(self, client: Hanzo) -> None: file = response.parse() assert_matches_type(object, file, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Hanzo) -> None: with client.files.with_streaming_response.list( @@ -172,7 +172,7 @@ def test_streaming_response_list(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_list(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `provider` but received ''"): @@ -180,7 +180,7 @@ def test_path_params_list(self, client: Hanzo) -> None: provider="", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: file = client.files.delete( @@ -189,7 +189,7 @@ def test_method_delete(self, client: Hanzo) -> None: ) assert_matches_type(object, file, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.files.with_raw_response.delete( @@ -202,7 +202,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: file = response.parse() assert_matches_type(object, file, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.files.with_streaming_response.delete( @@ -217,7 +217,7 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_delete(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `provider` but received ''"): @@ -238,7 +238,7 @@ class TestAsyncFiles: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: file = await async_client.files.create( @@ -248,7 +248,7 @@ async def test_method_create(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, file, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> None: file = await async_client.files.create( @@ -259,7 +259,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, file, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.files.with_raw_response.create( @@ -273,7 +273,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: file = await response.parse() assert_matches_type(object, file, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.files.with_streaming_response.create( @@ -289,7 +289,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_create(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `provider` but received ''"): @@ -299,7 +299,7 @@ async def test_path_params_create(self, async_client: AsyncHanzo) -> None: purpose="purpose", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: file = await async_client.files.retrieve( @@ -308,7 +308,7 @@ async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, file, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: response = await async_client.files.with_raw_response.retrieve( @@ -321,7 +321,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: file = await response.parse() assert_matches_type(object, file, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> None: async with async_client.files.with_streaming_response.retrieve( @@ -336,7 +336,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `provider` but received ''"): @@ -351,7 +351,7 @@ async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: provider="provider", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncHanzo) -> None: file = await async_client.files.list( @@ -359,7 +359,7 @@ async def test_method_list(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, file, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncHanzo) -> None: file = await async_client.files.list( @@ -368,7 +368,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncHanzo) -> No ) assert_matches_type(object, file, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: response = await async_client.files.with_raw_response.list( @@ -380,7 +380,7 @@ async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: file = await response.parse() assert_matches_type(object, file, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: async with async_client.files.with_streaming_response.list( @@ -394,7 +394,7 @@ async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_list(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `provider` but received ''"): @@ -402,7 +402,7 @@ async def test_path_params_list(self, async_client: AsyncHanzo) -> None: provider="", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: file = await async_client.files.delete( @@ -411,7 +411,7 @@ async def test_method_delete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, file, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.files.with_raw_response.delete( @@ -424,7 +424,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: file = await response.parse() assert_matches_type(object, file, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.files.with_streaming_response.delete( @@ -439,7 +439,7 @@ async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `provider` but received ''"): diff --git a/tests/api_resources/test_gemini.py b/tests/api_resources/test_gemini.py index c970fbab..5cb8bac2 100644 --- a/tests/api_resources/test_gemini.py +++ b/tests/api_resources/test_gemini.py @@ -16,7 +16,7 @@ class TestGemini: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: gemini = client.gemini.create( @@ -24,7 +24,7 @@ def test_method_create(self, client: Hanzo) -> None: ) assert_matches_type(object, gemini, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.gemini.with_raw_response.create( @@ -36,7 +36,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: gemini = response.parse() assert_matches_type(object, gemini, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.gemini.with_streaming_response.create( @@ -50,7 +50,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_create(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -58,7 +58,7 @@ def test_path_params_create(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Hanzo) -> None: gemini = client.gemini.retrieve( @@ -66,7 +66,7 @@ def test_method_retrieve(self, client: Hanzo) -> None: ) assert_matches_type(object, gemini, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Hanzo) -> None: response = client.gemini.with_raw_response.retrieve( @@ -78,7 +78,7 @@ def test_raw_response_retrieve(self, client: Hanzo) -> None: gemini = response.parse() assert_matches_type(object, gemini, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Hanzo) -> None: with client.gemini.with_streaming_response.retrieve( @@ -92,7 +92,7 @@ def test_streaming_response_retrieve(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_retrieve(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -100,7 +100,7 @@ def test_path_params_retrieve(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Hanzo) -> None: gemini = client.gemini.update( @@ -108,7 +108,7 @@ def test_method_update(self, client: Hanzo) -> None: ) assert_matches_type(object, gemini, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Hanzo) -> None: response = client.gemini.with_raw_response.update( @@ -120,7 +120,7 @@ def test_raw_response_update(self, client: Hanzo) -> None: gemini = response.parse() assert_matches_type(object, gemini, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Hanzo) -> None: with client.gemini.with_streaming_response.update( @@ -134,7 +134,7 @@ def test_streaming_response_update(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_update(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -142,7 +142,7 @@ def test_path_params_update(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: gemini = client.gemini.delete( @@ -150,7 +150,7 @@ def test_method_delete(self, client: Hanzo) -> None: ) assert_matches_type(object, gemini, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.gemini.with_raw_response.delete( @@ -162,7 +162,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: gemini = response.parse() assert_matches_type(object, gemini, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.gemini.with_streaming_response.delete( @@ -176,7 +176,7 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_delete(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -184,7 +184,7 @@ def test_path_params_delete(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_patch(self, client: Hanzo) -> None: gemini = client.gemini.patch( @@ -192,7 +192,7 @@ def test_method_patch(self, client: Hanzo) -> None: ) assert_matches_type(object, gemini, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_patch(self, client: Hanzo) -> None: response = client.gemini.with_raw_response.patch( @@ -204,7 +204,7 @@ def test_raw_response_patch(self, client: Hanzo) -> None: gemini = response.parse() assert_matches_type(object, gemini, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_patch(self, client: Hanzo) -> None: with client.gemini.with_streaming_response.patch( @@ -218,7 +218,7 @@ def test_streaming_response_patch(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_patch(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -232,7 +232,7 @@ class TestAsyncGemini: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: gemini = await async_client.gemini.create( @@ -240,7 +240,7 @@ async def test_method_create(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, gemini, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.gemini.with_raw_response.create( @@ -252,7 +252,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: gemini = await response.parse() assert_matches_type(object, gemini, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.gemini.with_streaming_response.create( @@ -266,7 +266,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_create(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -274,7 +274,7 @@ async def test_path_params_create(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: gemini = await async_client.gemini.retrieve( @@ -282,7 +282,7 @@ async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, gemini, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: response = await async_client.gemini.with_raw_response.retrieve( @@ -294,7 +294,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: gemini = await response.parse() assert_matches_type(object, gemini, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> None: async with async_client.gemini.with_streaming_response.retrieve( @@ -308,7 +308,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -316,7 +316,7 @@ async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncHanzo) -> None: gemini = await async_client.gemini.update( @@ -324,7 +324,7 @@ async def test_method_update(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, gemini, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: response = await async_client.gemini.with_raw_response.update( @@ -336,7 +336,7 @@ async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: gemini = await response.parse() assert_matches_type(object, gemini, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None: async with async_client.gemini.with_streaming_response.update( @@ -350,7 +350,7 @@ async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -358,7 +358,7 @@ async def test_path_params_update(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: gemini = await async_client.gemini.delete( @@ -366,7 +366,7 @@ async def test_method_delete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, gemini, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.gemini.with_raw_response.delete( @@ -378,7 +378,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: gemini = await response.parse() assert_matches_type(object, gemini, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.gemini.with_streaming_response.delete( @@ -392,7 +392,7 @@ async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -400,7 +400,7 @@ async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_patch(self, async_client: AsyncHanzo) -> None: gemini = await async_client.gemini.patch( @@ -408,7 +408,7 @@ async def test_method_patch(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, gemini, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_patch(self, async_client: AsyncHanzo) -> None: response = await async_client.gemini.with_raw_response.patch( @@ -420,7 +420,7 @@ async def test_raw_response_patch(self, async_client: AsyncHanzo) -> None: gemini = await response.parse() assert_matches_type(object, gemini, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_patch(self, async_client: AsyncHanzo) -> None: async with async_client.gemini.with_streaming_response.patch( @@ -434,7 +434,7 @@ async def test_streaming_response_patch(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_patch(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): diff --git a/tests/api_resources/test_guardrails.py b/tests/api_resources/test_guardrails.py index a7c80770..bd7a73d8 100644 --- a/tests/api_resources/test_guardrails.py +++ b/tests/api_resources/test_guardrails.py @@ -17,13 +17,13 @@ class TestGuardrails: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Hanzo) -> None: guardrail = client.guardrails.list() assert_matches_type(GuardrailListResponse, guardrail, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Hanzo) -> None: response = client.guardrails.with_raw_response.list() @@ -33,7 +33,7 @@ def test_raw_response_list(self, client: Hanzo) -> None: guardrail = response.parse() assert_matches_type(GuardrailListResponse, guardrail, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Hanzo) -> None: with client.guardrails.with_streaming_response.list() as response: @@ -51,13 +51,13 @@ class TestAsyncGuardrails: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncHanzo) -> None: guardrail = await async_client.guardrails.list() assert_matches_type(GuardrailListResponse, guardrail, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: response = await async_client.guardrails.with_raw_response.list() @@ -67,7 +67,7 @@ async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: guardrail = await response.parse() assert_matches_type(GuardrailListResponse, guardrail, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: async with async_client.guardrails.with_streaming_response.list() as response: diff --git a/tests/api_resources/test_health.py b/tests/api_resources/test_health.py index 96259c73..e23071ac 100644 --- a/tests/api_resources/test_health.py +++ b/tests/api_resources/test_health.py @@ -16,13 +16,13 @@ class TestHealth: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_check_all(self, client: Hanzo) -> None: health = client.health.check_all() assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_check_all_with_all_params(self, client: Hanzo) -> None: health = client.health.check_all( @@ -30,7 +30,7 @@ def test_method_check_all_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_check_all(self, client: Hanzo) -> None: response = client.health.with_raw_response.check_all() @@ -40,7 +40,7 @@ def test_raw_response_check_all(self, client: Hanzo) -> None: health = response.parse() assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_check_all(self, client: Hanzo) -> None: with client.health.with_streaming_response.check_all() as response: @@ -52,13 +52,13 @@ def test_streaming_response_check_all(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_check_liveliness(self, client: Hanzo) -> None: health = client.health.check_liveliness() assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_check_liveliness(self, client: Hanzo) -> None: response = client.health.with_raw_response.check_liveliness() @@ -68,7 +68,7 @@ def test_raw_response_check_liveliness(self, client: Hanzo) -> None: health = response.parse() assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_check_liveliness(self, client: Hanzo) -> None: with client.health.with_streaming_response.check_liveliness() as response: @@ -80,13 +80,13 @@ def test_streaming_response_check_liveliness(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_check_liveness(self, client: Hanzo) -> None: health = client.health.check_liveness() assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_check_liveness(self, client: Hanzo) -> None: response = client.health.with_raw_response.check_liveness() @@ -96,7 +96,7 @@ def test_raw_response_check_liveness(self, client: Hanzo) -> None: health = response.parse() assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_check_liveness(self, client: Hanzo) -> None: with client.health.with_streaming_response.check_liveness() as response: @@ -108,13 +108,13 @@ def test_streaming_response_check_liveness(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_check_readiness(self, client: Hanzo) -> None: health = client.health.check_readiness() assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_check_readiness(self, client: Hanzo) -> None: response = client.health.with_raw_response.check_readiness() @@ -124,7 +124,7 @@ def test_raw_response_check_readiness(self, client: Hanzo) -> None: health = response.parse() assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_check_readiness(self, client: Hanzo) -> None: with client.health.with_streaming_response.check_readiness() as response: @@ -136,7 +136,7 @@ def test_streaming_response_check_readiness(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_check_services(self, client: Hanzo) -> None: health = client.health.check_services( @@ -144,7 +144,7 @@ def test_method_check_services(self, client: Hanzo) -> None: ) assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_check_services(self, client: Hanzo) -> None: response = client.health.with_raw_response.check_services( @@ -156,7 +156,7 @@ def test_raw_response_check_services(self, client: Hanzo) -> None: health = response.parse() assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_check_services(self, client: Hanzo) -> None: with client.health.with_streaming_response.check_services( @@ -176,13 +176,13 @@ class TestAsyncHealth: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_check_all(self, async_client: AsyncHanzo) -> None: health = await async_client.health.check_all() assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_check_all_with_all_params(self, async_client: AsyncHanzo) -> None: health = await async_client.health.check_all( @@ -190,7 +190,7 @@ async def test_method_check_all_with_all_params(self, async_client: AsyncHanzo) ) assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_check_all(self, async_client: AsyncHanzo) -> None: response = await async_client.health.with_raw_response.check_all() @@ -200,7 +200,7 @@ async def test_raw_response_check_all(self, async_client: AsyncHanzo) -> None: health = await response.parse() assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_check_all(self, async_client: AsyncHanzo) -> None: async with async_client.health.with_streaming_response.check_all() as response: @@ -212,13 +212,13 @@ async def test_streaming_response_check_all(self, async_client: AsyncHanzo) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_check_liveliness(self, async_client: AsyncHanzo) -> None: health = await async_client.health.check_liveliness() assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_check_liveliness(self, async_client: AsyncHanzo) -> None: response = await async_client.health.with_raw_response.check_liveliness() @@ -228,7 +228,7 @@ async def test_raw_response_check_liveliness(self, async_client: AsyncHanzo) -> health = await response.parse() assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_check_liveliness(self, async_client: AsyncHanzo) -> None: async with async_client.health.with_streaming_response.check_liveliness() as response: @@ -240,13 +240,13 @@ async def test_streaming_response_check_liveliness(self, async_client: AsyncHanz assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_check_liveness(self, async_client: AsyncHanzo) -> None: health = await async_client.health.check_liveness() assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_check_liveness(self, async_client: AsyncHanzo) -> None: response = await async_client.health.with_raw_response.check_liveness() @@ -256,7 +256,7 @@ async def test_raw_response_check_liveness(self, async_client: AsyncHanzo) -> No health = await response.parse() assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_check_liveness(self, async_client: AsyncHanzo) -> None: async with async_client.health.with_streaming_response.check_liveness() as response: @@ -268,13 +268,13 @@ async def test_streaming_response_check_liveness(self, async_client: AsyncHanzo) assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_check_readiness(self, async_client: AsyncHanzo) -> None: health = await async_client.health.check_readiness() assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_check_readiness(self, async_client: AsyncHanzo) -> None: response = await async_client.health.with_raw_response.check_readiness() @@ -284,7 +284,7 @@ async def test_raw_response_check_readiness(self, async_client: AsyncHanzo) -> N health = await response.parse() assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_check_readiness(self, async_client: AsyncHanzo) -> None: async with async_client.health.with_streaming_response.check_readiness() as response: @@ -296,7 +296,7 @@ async def test_streaming_response_check_readiness(self, async_client: AsyncHanzo assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_check_services(self, async_client: AsyncHanzo) -> None: health = await async_client.health.check_services( @@ -304,7 +304,7 @@ async def test_method_check_services(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_check_services(self, async_client: AsyncHanzo) -> None: response = await async_client.health.with_raw_response.check_services( @@ -316,7 +316,7 @@ async def test_raw_response_check_services(self, async_client: AsyncHanzo) -> No health = await response.parse() assert_matches_type(object, health, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_check_services(self, async_client: AsyncHanzo) -> None: async with async_client.health.with_streaming_response.check_services( diff --git a/tests/api_resources/test_key.py b/tests/api_resources/test_key.py index 71826ea5..9ee42745 100644 --- a/tests/api_resources/test_key.py +++ b/tests/api_resources/test_key.py @@ -23,7 +23,7 @@ class TestKey: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Hanzo) -> None: key = client.key.update( @@ -31,7 +31,7 @@ def test_method_update(self, client: Hanzo) -> None: ) assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Hanzo) -> None: key = client.key.update( @@ -66,7 +66,7 @@ def test_method_update_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Hanzo) -> None: response = client.key.with_raw_response.update( @@ -78,7 +78,7 @@ def test_raw_response_update(self, client: Hanzo) -> None: key = response.parse() assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Hanzo) -> None: with client.key.with_streaming_response.update( @@ -92,13 +92,13 @@ def test_streaming_response_update(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Hanzo) -> None: key = client.key.list() assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Hanzo) -> None: key = client.key.list( @@ -113,7 +113,7 @@ def test_method_list_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Hanzo) -> None: response = client.key.with_raw_response.list() @@ -123,7 +123,7 @@ def test_raw_response_list(self, client: Hanzo) -> None: key = response.parse() assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Hanzo) -> None: with client.key.with_streaming_response.list() as response: @@ -135,13 +135,13 @@ def test_streaming_response_list(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: key = client.key.delete() assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Hanzo) -> None: key = client.key.delete( @@ -151,7 +151,7 @@ def test_method_delete_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.key.with_raw_response.delete() @@ -161,7 +161,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: key = response.parse() assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.key.with_streaming_response.delete() as response: @@ -173,7 +173,7 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_block(self, client: Hanzo) -> None: key = client.key.block( @@ -181,7 +181,7 @@ def test_method_block(self, client: Hanzo) -> None: ) assert_matches_type(Optional[KeyBlockResponse], key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_block_with_all_params(self, client: Hanzo) -> None: key = client.key.block( @@ -190,7 +190,7 @@ def test_method_block_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(Optional[KeyBlockResponse], key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_block(self, client: Hanzo) -> None: response = client.key.with_raw_response.block( @@ -202,7 +202,7 @@ def test_raw_response_block(self, client: Hanzo) -> None: key = response.parse() assert_matches_type(Optional[KeyBlockResponse], key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_block(self, client: Hanzo) -> None: with client.key.with_streaming_response.block( @@ -216,13 +216,13 @@ def test_streaming_response_block(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_check_health(self, client: Hanzo) -> None: key = client.key.check_health() assert_matches_type(KeyCheckHealthResponse, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_check_health(self, client: Hanzo) -> None: response = client.key.with_raw_response.check_health() @@ -232,7 +232,7 @@ def test_raw_response_check_health(self, client: Hanzo) -> None: key = response.parse() assert_matches_type(KeyCheckHealthResponse, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_check_health(self, client: Hanzo) -> None: with client.key.with_streaming_response.check_health() as response: @@ -244,13 +244,13 @@ def test_streaming_response_check_health(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_generate(self, client: Hanzo) -> None: key = client.key.generate() assert_matches_type(GenerateKeyResponse, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_generate_with_all_params(self, client: Hanzo) -> None: key = client.key.generate( @@ -285,7 +285,7 @@ def test_method_generate_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(GenerateKeyResponse, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_generate(self, client: Hanzo) -> None: response = client.key.with_raw_response.generate() @@ -295,7 +295,7 @@ def test_raw_response_generate(self, client: Hanzo) -> None: key = response.parse() assert_matches_type(GenerateKeyResponse, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_generate(self, client: Hanzo) -> None: with client.key.with_streaming_response.generate() as response: @@ -307,7 +307,7 @@ def test_streaming_response_generate(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_regenerate_by_key(self, client: Hanzo) -> None: key = client.key.regenerate_by_key( @@ -315,7 +315,7 @@ def test_method_regenerate_by_key(self, client: Hanzo) -> None: ) assert_matches_type(Optional[GenerateKeyResponse], key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_regenerate_by_key_with_all_params(self, client: Hanzo) -> None: key = client.key.regenerate_by_key( @@ -352,7 +352,7 @@ def test_method_regenerate_by_key_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(Optional[GenerateKeyResponse], key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_regenerate_by_key(self, client: Hanzo) -> None: response = client.key.with_raw_response.regenerate_by_key( @@ -364,7 +364,7 @@ def test_raw_response_regenerate_by_key(self, client: Hanzo) -> None: key = response.parse() assert_matches_type(Optional[GenerateKeyResponse], key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_regenerate_by_key(self, client: Hanzo) -> None: with client.key.with_streaming_response.regenerate_by_key( @@ -378,7 +378,7 @@ def test_streaming_response_regenerate_by_key(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_regenerate_by_key(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_key` but received ''"): @@ -386,13 +386,13 @@ def test_path_params_regenerate_by_key(self, client: Hanzo) -> None: path_key="", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_info(self, client: Hanzo) -> None: key = client.key.retrieve_info() assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_info_with_all_params(self, client: Hanzo) -> None: key = client.key.retrieve_info( @@ -400,7 +400,7 @@ def test_method_retrieve_info_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve_info(self, client: Hanzo) -> None: response = client.key.with_raw_response.retrieve_info() @@ -410,7 +410,7 @@ def test_raw_response_retrieve_info(self, client: Hanzo) -> None: key = response.parse() assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve_info(self, client: Hanzo) -> None: with client.key.with_streaming_response.retrieve_info() as response: @@ -422,7 +422,7 @@ def test_streaming_response_retrieve_info(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_unblock(self, client: Hanzo) -> None: key = client.key.unblock( @@ -430,7 +430,7 @@ def test_method_unblock(self, client: Hanzo) -> None: ) assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_unblock_with_all_params(self, client: Hanzo) -> None: key = client.key.unblock( @@ -439,7 +439,7 @@ def test_method_unblock_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_unblock(self, client: Hanzo) -> None: response = client.key.with_raw_response.unblock( @@ -451,7 +451,7 @@ def test_raw_response_unblock(self, client: Hanzo) -> None: key = response.parse() assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_unblock(self, client: Hanzo) -> None: with client.key.with_streaming_response.unblock( @@ -471,7 +471,7 @@ class TestAsyncKey: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncHanzo) -> None: key = await async_client.key.update( @@ -479,7 +479,7 @@ async def test_method_update(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncHanzo) -> None: key = await async_client.key.update( @@ -514,7 +514,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: response = await async_client.key.with_raw_response.update( @@ -526,7 +526,7 @@ async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: key = await response.parse() assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None: async with async_client.key.with_streaming_response.update( @@ -540,13 +540,13 @@ async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncHanzo) -> None: key = await async_client.key.list() assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncHanzo) -> None: key = await async_client.key.list( @@ -561,7 +561,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncHanzo) -> No ) assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: response = await async_client.key.with_raw_response.list() @@ -571,7 +571,7 @@ async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: key = await response.parse() assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: async with async_client.key.with_streaming_response.list() as response: @@ -583,13 +583,13 @@ async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: key = await async_client.key.delete() assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncHanzo) -> None: key = await async_client.key.delete( @@ -599,7 +599,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.key.with_raw_response.delete() @@ -609,7 +609,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: key = await response.parse() assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.key.with_streaming_response.delete() as response: @@ -621,7 +621,7 @@ async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_block(self, async_client: AsyncHanzo) -> None: key = await async_client.key.block( @@ -629,7 +629,7 @@ async def test_method_block(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(Optional[KeyBlockResponse], key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_block_with_all_params(self, async_client: AsyncHanzo) -> None: key = await async_client.key.block( @@ -638,7 +638,7 @@ async def test_method_block_with_all_params(self, async_client: AsyncHanzo) -> N ) assert_matches_type(Optional[KeyBlockResponse], key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_block(self, async_client: AsyncHanzo) -> None: response = await async_client.key.with_raw_response.block( @@ -650,7 +650,7 @@ async def test_raw_response_block(self, async_client: AsyncHanzo) -> None: key = await response.parse() assert_matches_type(Optional[KeyBlockResponse], key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_block(self, async_client: AsyncHanzo) -> None: async with async_client.key.with_streaming_response.block( @@ -664,13 +664,13 @@ async def test_streaming_response_block(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_check_health(self, async_client: AsyncHanzo) -> None: key = await async_client.key.check_health() assert_matches_type(KeyCheckHealthResponse, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_check_health(self, async_client: AsyncHanzo) -> None: response = await async_client.key.with_raw_response.check_health() @@ -680,7 +680,7 @@ async def test_raw_response_check_health(self, async_client: AsyncHanzo) -> None key = await response.parse() assert_matches_type(KeyCheckHealthResponse, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_check_health(self, async_client: AsyncHanzo) -> None: async with async_client.key.with_streaming_response.check_health() as response: @@ -692,13 +692,13 @@ async def test_streaming_response_check_health(self, async_client: AsyncHanzo) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_generate(self, async_client: AsyncHanzo) -> None: key = await async_client.key.generate() assert_matches_type(GenerateKeyResponse, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_generate_with_all_params(self, async_client: AsyncHanzo) -> None: key = await async_client.key.generate( @@ -733,7 +733,7 @@ async def test_method_generate_with_all_params(self, async_client: AsyncHanzo) - ) assert_matches_type(GenerateKeyResponse, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_generate(self, async_client: AsyncHanzo) -> None: response = await async_client.key.with_raw_response.generate() @@ -743,7 +743,7 @@ async def test_raw_response_generate(self, async_client: AsyncHanzo) -> None: key = await response.parse() assert_matches_type(GenerateKeyResponse, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_generate(self, async_client: AsyncHanzo) -> None: async with async_client.key.with_streaming_response.generate() as response: @@ -755,7 +755,7 @@ async def test_streaming_response_generate(self, async_client: AsyncHanzo) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_regenerate_by_key(self, async_client: AsyncHanzo) -> None: key = await async_client.key.regenerate_by_key( @@ -763,7 +763,7 @@ async def test_method_regenerate_by_key(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(Optional[GenerateKeyResponse], key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_regenerate_by_key_with_all_params(self, async_client: AsyncHanzo) -> None: key = await async_client.key.regenerate_by_key( @@ -800,7 +800,7 @@ async def test_method_regenerate_by_key_with_all_params(self, async_client: Asyn ) assert_matches_type(Optional[GenerateKeyResponse], key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_regenerate_by_key(self, async_client: AsyncHanzo) -> None: response = await async_client.key.with_raw_response.regenerate_by_key( @@ -812,7 +812,7 @@ async def test_raw_response_regenerate_by_key(self, async_client: AsyncHanzo) -> key = await response.parse() assert_matches_type(Optional[GenerateKeyResponse], key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_regenerate_by_key(self, async_client: AsyncHanzo) -> None: async with async_client.key.with_streaming_response.regenerate_by_key( @@ -826,7 +826,7 @@ async def test_streaming_response_regenerate_by_key(self, async_client: AsyncHan assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_regenerate_by_key(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_key` but received ''"): @@ -834,13 +834,13 @@ async def test_path_params_regenerate_by_key(self, async_client: AsyncHanzo) -> path_key="", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_info(self, async_client: AsyncHanzo) -> None: key = await async_client.key.retrieve_info() assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_info_with_all_params(self, async_client: AsyncHanzo) -> None: key = await async_client.key.retrieve_info( @@ -848,7 +848,7 @@ async def test_method_retrieve_info_with_all_params(self, async_client: AsyncHan ) assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve_info(self, async_client: AsyncHanzo) -> None: response = await async_client.key.with_raw_response.retrieve_info() @@ -858,7 +858,7 @@ async def test_raw_response_retrieve_info(self, async_client: AsyncHanzo) -> Non key = await response.parse() assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve_info(self, async_client: AsyncHanzo) -> None: async with async_client.key.with_streaming_response.retrieve_info() as response: @@ -870,7 +870,7 @@ async def test_streaming_response_retrieve_info(self, async_client: AsyncHanzo) assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_unblock(self, async_client: AsyncHanzo) -> None: key = await async_client.key.unblock( @@ -878,7 +878,7 @@ async def test_method_unblock(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_unblock_with_all_params(self, async_client: AsyncHanzo) -> None: key = await async_client.key.unblock( @@ -887,7 +887,7 @@ async def test_method_unblock_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_unblock(self, async_client: AsyncHanzo) -> None: response = await async_client.key.with_raw_response.unblock( @@ -899,7 +899,7 @@ async def test_raw_response_unblock(self, async_client: AsyncHanzo) -> None: key = await response.parse() assert_matches_type(object, key, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_unblock(self, async_client: AsyncHanzo) -> None: async with async_client.key.with_streaming_response.unblock( diff --git a/tests/api_resources/test_langfuse.py b/tests/api_resources/test_langfuse.py index 0ad8d423..de62cf71 100644 --- a/tests/api_resources/test_langfuse.py +++ b/tests/api_resources/test_langfuse.py @@ -16,7 +16,7 @@ class TestLangfuse: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: langfuse = client.langfuse.create( @@ -24,7 +24,7 @@ def test_method_create(self, client: Hanzo) -> None: ) assert_matches_type(object, langfuse, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.langfuse.with_raw_response.create( @@ -36,7 +36,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: langfuse = response.parse() assert_matches_type(object, langfuse, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.langfuse.with_streaming_response.create( @@ -50,7 +50,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_create(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -58,7 +58,7 @@ def test_path_params_create(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Hanzo) -> None: langfuse = client.langfuse.retrieve( @@ -66,7 +66,7 @@ def test_method_retrieve(self, client: Hanzo) -> None: ) assert_matches_type(object, langfuse, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Hanzo) -> None: response = client.langfuse.with_raw_response.retrieve( @@ -78,7 +78,7 @@ def test_raw_response_retrieve(self, client: Hanzo) -> None: langfuse = response.parse() assert_matches_type(object, langfuse, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Hanzo) -> None: with client.langfuse.with_streaming_response.retrieve( @@ -92,7 +92,7 @@ def test_streaming_response_retrieve(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_retrieve(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -100,7 +100,7 @@ def test_path_params_retrieve(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Hanzo) -> None: langfuse = client.langfuse.update( @@ -108,7 +108,7 @@ def test_method_update(self, client: Hanzo) -> None: ) assert_matches_type(object, langfuse, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Hanzo) -> None: response = client.langfuse.with_raw_response.update( @@ -120,7 +120,7 @@ def test_raw_response_update(self, client: Hanzo) -> None: langfuse = response.parse() assert_matches_type(object, langfuse, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Hanzo) -> None: with client.langfuse.with_streaming_response.update( @@ -134,7 +134,7 @@ def test_streaming_response_update(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_update(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -142,7 +142,7 @@ def test_path_params_update(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: langfuse = client.langfuse.delete( @@ -150,7 +150,7 @@ def test_method_delete(self, client: Hanzo) -> None: ) assert_matches_type(object, langfuse, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.langfuse.with_raw_response.delete( @@ -162,7 +162,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: langfuse = response.parse() assert_matches_type(object, langfuse, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.langfuse.with_streaming_response.delete( @@ -176,7 +176,7 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_delete(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -184,7 +184,7 @@ def test_path_params_delete(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_patch(self, client: Hanzo) -> None: langfuse = client.langfuse.patch( @@ -192,7 +192,7 @@ def test_method_patch(self, client: Hanzo) -> None: ) assert_matches_type(object, langfuse, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_patch(self, client: Hanzo) -> None: response = client.langfuse.with_raw_response.patch( @@ -204,7 +204,7 @@ def test_raw_response_patch(self, client: Hanzo) -> None: langfuse = response.parse() assert_matches_type(object, langfuse, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_patch(self, client: Hanzo) -> None: with client.langfuse.with_streaming_response.patch( @@ -218,7 +218,7 @@ def test_streaming_response_patch(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_patch(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -232,7 +232,7 @@ class TestAsyncLangfuse: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: langfuse = await async_client.langfuse.create( @@ -240,7 +240,7 @@ async def test_method_create(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, langfuse, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.langfuse.with_raw_response.create( @@ -252,7 +252,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: langfuse = await response.parse() assert_matches_type(object, langfuse, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.langfuse.with_streaming_response.create( @@ -266,7 +266,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_create(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -274,7 +274,7 @@ async def test_path_params_create(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: langfuse = await async_client.langfuse.retrieve( @@ -282,7 +282,7 @@ async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, langfuse, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: response = await async_client.langfuse.with_raw_response.retrieve( @@ -294,7 +294,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: langfuse = await response.parse() assert_matches_type(object, langfuse, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> None: async with async_client.langfuse.with_streaming_response.retrieve( @@ -308,7 +308,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -316,7 +316,7 @@ async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncHanzo) -> None: langfuse = await async_client.langfuse.update( @@ -324,7 +324,7 @@ async def test_method_update(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, langfuse, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: response = await async_client.langfuse.with_raw_response.update( @@ -336,7 +336,7 @@ async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: langfuse = await response.parse() assert_matches_type(object, langfuse, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None: async with async_client.langfuse.with_streaming_response.update( @@ -350,7 +350,7 @@ async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -358,7 +358,7 @@ async def test_path_params_update(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: langfuse = await async_client.langfuse.delete( @@ -366,7 +366,7 @@ async def test_method_delete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, langfuse, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.langfuse.with_raw_response.delete( @@ -378,7 +378,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: langfuse = await response.parse() assert_matches_type(object, langfuse, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.langfuse.with_streaming_response.delete( @@ -392,7 +392,7 @@ async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -400,7 +400,7 @@ async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_patch(self, async_client: AsyncHanzo) -> None: langfuse = await async_client.langfuse.patch( @@ -408,7 +408,7 @@ async def test_method_patch(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, langfuse, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_patch(self, async_client: AsyncHanzo) -> None: response = await async_client.langfuse.with_raw_response.patch( @@ -420,7 +420,7 @@ async def test_raw_response_patch(self, async_client: AsyncHanzo) -> None: langfuse = await response.parse() assert_matches_type(object, langfuse, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_patch(self, async_client: AsyncHanzo) -> None: async with async_client.langfuse.with_streaming_response.patch( @@ -434,7 +434,7 @@ async def test_streaming_response_patch(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_patch(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): diff --git a/tests/api_resources/test_model.py b/tests/api_resources/test_model.py index 126e252a..01e63a21 100644 --- a/tests/api_resources/test_model.py +++ b/tests/api_resources/test_model.py @@ -17,7 +17,7 @@ class TestModel: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: model = client.model.create( @@ -27,7 +27,7 @@ def test_method_create(self, client: Hanzo) -> None: ) assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Hanzo) -> None: model = client.model.create( @@ -80,7 +80,7 @@ def test_method_create_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.model.with_raw_response.create( @@ -94,7 +94,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: model = response.parse() assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.model.with_streaming_response.create( @@ -110,7 +110,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: model = client.model.delete( @@ -118,7 +118,7 @@ def test_method_delete(self, client: Hanzo) -> None: ) assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.model.with_raw_response.delete( @@ -130,7 +130,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: model = response.parse() assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.model.with_streaming_response.delete( @@ -150,7 +150,7 @@ class TestAsyncModel: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: model = await async_client.model.create( @@ -160,7 +160,7 @@ async def test_method_create(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> None: model = await async_client.model.create( @@ -213,7 +213,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.model.with_raw_response.create( @@ -227,7 +227,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: model = await response.parse() assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.model.with_streaming_response.create( @@ -243,7 +243,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: model = await async_client.model.delete( @@ -251,7 +251,7 @@ async def test_method_delete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.model.with_raw_response.delete( @@ -263,7 +263,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: model = await response.parse() assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.model.with_streaming_response.delete( diff --git a/tests/api_resources/test_model_group.py b/tests/api_resources/test_model_group.py index dc18c40b..caca5e16 100644 --- a/tests/api_resources/test_model_group.py +++ b/tests/api_resources/test_model_group.py @@ -16,13 +16,13 @@ class TestModelGroup: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_info(self, client: Hanzo) -> None: model_group = client.model_group.retrieve_info() assert_matches_type(object, model_group, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_info_with_all_params(self, client: Hanzo) -> None: model_group = client.model_group.retrieve_info( @@ -30,7 +30,7 @@ def test_method_retrieve_info_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, model_group, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve_info(self, client: Hanzo) -> None: response = client.model_group.with_raw_response.retrieve_info() @@ -40,7 +40,7 @@ def test_raw_response_retrieve_info(self, client: Hanzo) -> None: model_group = response.parse() assert_matches_type(object, model_group, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve_info(self, client: Hanzo) -> None: with client.model_group.with_streaming_response.retrieve_info() as response: @@ -58,13 +58,13 @@ class TestAsyncModelGroup: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_info(self, async_client: AsyncHanzo) -> None: model_group = await async_client.model_group.retrieve_info() assert_matches_type(object, model_group, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_info_with_all_params(self, async_client: AsyncHanzo) -> None: model_group = await async_client.model_group.retrieve_info( @@ -72,7 +72,7 @@ async def test_method_retrieve_info_with_all_params(self, async_client: AsyncHan ) assert_matches_type(object, model_group, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve_info(self, async_client: AsyncHanzo) -> None: response = await async_client.model_group.with_raw_response.retrieve_info() @@ -82,7 +82,7 @@ async def test_raw_response_retrieve_info(self, async_client: AsyncHanzo) -> Non model_group = await response.parse() assert_matches_type(object, model_group, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve_info(self, async_client: AsyncHanzo) -> None: async with async_client.model_group.with_streaming_response.retrieve_info() as response: diff --git a/tests/api_resources/test_models.py b/tests/api_resources/test_models.py index 07199547..d1eef473 100644 --- a/tests/api_resources/test_models.py +++ b/tests/api_resources/test_models.py @@ -16,13 +16,13 @@ class TestModels: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Hanzo) -> None: model = client.models.list() assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Hanzo) -> None: model = client.models.list( @@ -31,7 +31,7 @@ def test_method_list_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Hanzo) -> None: response = client.models.with_raw_response.list() @@ -41,7 +41,7 @@ def test_raw_response_list(self, client: Hanzo) -> None: model = response.parse() assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Hanzo) -> None: with client.models.with_streaming_response.list() as response: @@ -59,13 +59,13 @@ class TestAsyncModels: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncHanzo) -> None: model = await async_client.models.list() assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncHanzo) -> None: model = await async_client.models.list( @@ -74,7 +74,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncHanzo) -> No ) assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: response = await async_client.models.with_raw_response.list() @@ -84,7 +84,7 @@ async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: model = await response.parse() assert_matches_type(object, model, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: async with async_client.models.with_streaming_response.list() as response: diff --git a/tests/api_resources/test_moderations.py b/tests/api_resources/test_moderations.py index 45d6cda6..5b9b9205 100644 --- a/tests/api_resources/test_moderations.py +++ b/tests/api_resources/test_moderations.py @@ -16,13 +16,13 @@ class TestModerations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: moderation = client.moderations.create() assert_matches_type(object, moderation, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.moderations.with_raw_response.create() @@ -32,7 +32,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: moderation = response.parse() assert_matches_type(object, moderation, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.moderations.with_streaming_response.create() as response: @@ -50,13 +50,13 @@ class TestAsyncModerations: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: moderation = await async_client.moderations.create() assert_matches_type(object, moderation, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.moderations.with_raw_response.create() @@ -66,7 +66,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: moderation = await response.parse() assert_matches_type(object, moderation, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.moderations.with_streaming_response.create() as response: diff --git a/tests/api_resources/test_openai.py b/tests/api_resources/test_openai.py index ae3cf41a..e2471124 100644 --- a/tests/api_resources/test_openai.py +++ b/tests/api_resources/test_openai.py @@ -16,7 +16,7 @@ class TestOpenAI: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: openai = client.openai.create( @@ -24,7 +24,7 @@ def test_method_create(self, client: Hanzo) -> None: ) assert_matches_type(object, openai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.openai.with_raw_response.create( @@ -36,7 +36,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: openai = response.parse() assert_matches_type(object, openai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.openai.with_streaming_response.create( @@ -50,7 +50,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_create(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -58,7 +58,7 @@ def test_path_params_create(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Hanzo) -> None: openai = client.openai.retrieve( @@ -66,7 +66,7 @@ def test_method_retrieve(self, client: Hanzo) -> None: ) assert_matches_type(object, openai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Hanzo) -> None: response = client.openai.with_raw_response.retrieve( @@ -78,7 +78,7 @@ def test_raw_response_retrieve(self, client: Hanzo) -> None: openai = response.parse() assert_matches_type(object, openai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Hanzo) -> None: with client.openai.with_streaming_response.retrieve( @@ -92,7 +92,7 @@ def test_streaming_response_retrieve(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_retrieve(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -100,7 +100,7 @@ def test_path_params_retrieve(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Hanzo) -> None: openai = client.openai.update( @@ -108,7 +108,7 @@ def test_method_update(self, client: Hanzo) -> None: ) assert_matches_type(object, openai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Hanzo) -> None: response = client.openai.with_raw_response.update( @@ -120,7 +120,7 @@ def test_raw_response_update(self, client: Hanzo) -> None: openai = response.parse() assert_matches_type(object, openai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Hanzo) -> None: with client.openai.with_streaming_response.update( @@ -134,7 +134,7 @@ def test_streaming_response_update(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_update(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -142,7 +142,7 @@ def test_path_params_update(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: openai = client.openai.delete( @@ -150,7 +150,7 @@ def test_method_delete(self, client: Hanzo) -> None: ) assert_matches_type(object, openai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.openai.with_raw_response.delete( @@ -162,7 +162,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: openai = response.parse() assert_matches_type(object, openai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.openai.with_streaming_response.delete( @@ -176,7 +176,7 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_delete(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -184,7 +184,7 @@ def test_path_params_delete(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_patch(self, client: Hanzo) -> None: openai = client.openai.patch( @@ -192,7 +192,7 @@ def test_method_patch(self, client: Hanzo) -> None: ) assert_matches_type(object, openai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_patch(self, client: Hanzo) -> None: response = client.openai.with_raw_response.patch( @@ -204,7 +204,7 @@ def test_raw_response_patch(self, client: Hanzo) -> None: openai = response.parse() assert_matches_type(object, openai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_patch(self, client: Hanzo) -> None: with client.openai.with_streaming_response.patch( @@ -218,7 +218,7 @@ def test_streaming_response_patch(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_patch(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -232,7 +232,7 @@ class TestAsyncOpenAI: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: openai = await async_client.openai.create( @@ -240,7 +240,7 @@ async def test_method_create(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, openai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.openai.with_raw_response.create( @@ -252,7 +252,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: openai = await response.parse() assert_matches_type(object, openai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.openai.with_streaming_response.create( @@ -266,7 +266,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_create(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -274,7 +274,7 @@ async def test_path_params_create(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: openai = await async_client.openai.retrieve( @@ -282,7 +282,7 @@ async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, openai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: response = await async_client.openai.with_raw_response.retrieve( @@ -294,7 +294,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: openai = await response.parse() assert_matches_type(object, openai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> None: async with async_client.openai.with_streaming_response.retrieve( @@ -308,7 +308,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -316,7 +316,7 @@ async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncHanzo) -> None: openai = await async_client.openai.update( @@ -324,7 +324,7 @@ async def test_method_update(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, openai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: response = await async_client.openai.with_raw_response.update( @@ -336,7 +336,7 @@ async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: openai = await response.parse() assert_matches_type(object, openai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None: async with async_client.openai.with_streaming_response.update( @@ -350,7 +350,7 @@ async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -358,7 +358,7 @@ async def test_path_params_update(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: openai = await async_client.openai.delete( @@ -366,7 +366,7 @@ async def test_method_delete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, openai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.openai.with_raw_response.delete( @@ -378,7 +378,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: openai = await response.parse() assert_matches_type(object, openai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.openai.with_streaming_response.delete( @@ -392,7 +392,7 @@ async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -400,7 +400,7 @@ async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_patch(self, async_client: AsyncHanzo) -> None: openai = await async_client.openai.patch( @@ -408,7 +408,7 @@ async def test_method_patch(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, openai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_patch(self, async_client: AsyncHanzo) -> None: response = await async_client.openai.with_raw_response.patch( @@ -420,7 +420,7 @@ async def test_raw_response_patch(self, async_client: AsyncHanzo) -> None: openai = await response.parse() assert_matches_type(object, openai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_patch(self, async_client: AsyncHanzo) -> None: async with async_client.openai.with_streaming_response.patch( @@ -434,7 +434,7 @@ async def test_streaming_response_patch(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_patch(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): diff --git a/tests/api_resources/test_organization.py b/tests/api_resources/test_organization.py index 15c74cb6..8e6929bf 100644 --- a/tests/api_resources/test_organization.py +++ b/tests/api_resources/test_organization.py @@ -24,7 +24,7 @@ class TestOrganization: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: organization = client.organization.create( @@ -32,7 +32,7 @@ def test_method_create(self, client: Hanzo) -> None: ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Hanzo) -> None: organization = client.organization.create( @@ -51,7 +51,7 @@ def test_method_create_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.organization.with_raw_response.create( @@ -63,7 +63,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: organization = response.parse() assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.organization.with_streaming_response.create( @@ -77,13 +77,13 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Hanzo) -> None: organization = client.organization.update() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Hanzo) -> None: organization = client.organization.update( @@ -97,7 +97,7 @@ def test_method_update_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Hanzo) -> None: response = client.organization.with_raw_response.update() @@ -107,7 +107,7 @@ def test_raw_response_update(self, client: Hanzo) -> None: organization = response.parse() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Hanzo) -> None: with client.organization.with_streaming_response.update() as response: @@ -119,13 +119,13 @@ def test_streaming_response_update(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Hanzo) -> None: organization = client.organization.list() assert_matches_type(OrganizationListResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Hanzo) -> None: response = client.organization.with_raw_response.list() @@ -135,7 +135,7 @@ def test_raw_response_list(self, client: Hanzo) -> None: organization = response.parse() assert_matches_type(OrganizationListResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Hanzo) -> None: with client.organization.with_streaming_response.list() as response: @@ -147,7 +147,7 @@ def test_streaming_response_list(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: organization = client.organization.delete( @@ -155,7 +155,7 @@ def test_method_delete(self, client: Hanzo) -> None: ) assert_matches_type(OrganizationDeleteResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.organization.with_raw_response.delete( @@ -167,7 +167,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: organization = response.parse() assert_matches_type(OrganizationDeleteResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.organization.with_streaming_response.delete( @@ -181,7 +181,7 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_add_member(self, client: Hanzo) -> None: organization = client.organization.add_member( @@ -190,7 +190,7 @@ def test_method_add_member(self, client: Hanzo) -> None: ) assert_matches_type(OrganizationAddMemberResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_add_member_with_all_params(self, client: Hanzo) -> None: organization = client.organization.add_member( @@ -206,7 +206,7 @@ def test_method_add_member_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(OrganizationAddMemberResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_add_member(self, client: Hanzo) -> None: response = client.organization.with_raw_response.add_member( @@ -219,7 +219,7 @@ def test_raw_response_add_member(self, client: Hanzo) -> None: organization = response.parse() assert_matches_type(OrganizationAddMemberResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_add_member(self, client: Hanzo) -> None: with client.organization.with_streaming_response.add_member( @@ -234,7 +234,7 @@ def test_streaming_response_add_member(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete_member(self, client: Hanzo) -> None: organization = client.organization.delete_member( @@ -242,7 +242,7 @@ def test_method_delete_member(self, client: Hanzo) -> None: ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete_member_with_all_params(self, client: Hanzo) -> None: organization = client.organization.delete_member( @@ -252,7 +252,7 @@ def test_method_delete_member_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete_member(self, client: Hanzo) -> None: response = client.organization.with_raw_response.delete_member( @@ -264,7 +264,7 @@ def test_raw_response_delete_member(self, client: Hanzo) -> None: organization = response.parse() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete_member(self, client: Hanzo) -> None: with client.organization.with_streaming_response.delete_member( @@ -278,7 +278,7 @@ def test_streaming_response_delete_member(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_member(self, client: Hanzo) -> None: organization = client.organization.update_member( @@ -286,7 +286,7 @@ def test_method_update_member(self, client: Hanzo) -> None: ) assert_matches_type(OrganizationUpdateMemberResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_member_with_all_params(self, client: Hanzo) -> None: organization = client.organization.update_member( @@ -298,7 +298,7 @@ def test_method_update_member_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(OrganizationUpdateMemberResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update_member(self, client: Hanzo) -> None: response = client.organization.with_raw_response.update_member( @@ -310,7 +310,7 @@ def test_raw_response_update_member(self, client: Hanzo) -> None: organization = response.parse() assert_matches_type(OrganizationUpdateMemberResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update_member(self, client: Hanzo) -> None: with client.organization.with_streaming_response.update_member( @@ -330,7 +330,7 @@ class TestAsyncOrganization: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: organization = await async_client.organization.create( @@ -338,7 +338,7 @@ async def test_method_create(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> None: organization = await async_client.organization.create( @@ -357,7 +357,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.organization.with_raw_response.create( @@ -369,7 +369,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: organization = await response.parse() assert_matches_type(OrganizationCreateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.organization.with_streaming_response.create( @@ -383,13 +383,13 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncHanzo) -> None: organization = await async_client.organization.update() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncHanzo) -> None: organization = await async_client.organization.update( @@ -403,7 +403,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: response = await async_client.organization.with_raw_response.update() @@ -413,7 +413,7 @@ async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: organization = await response.parse() assert_matches_type(OrganizationUpdateResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None: async with async_client.organization.with_streaming_response.update() as response: @@ -425,13 +425,13 @@ async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncHanzo) -> None: organization = await async_client.organization.list() assert_matches_type(OrganizationListResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: response = await async_client.organization.with_raw_response.list() @@ -441,7 +441,7 @@ async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: organization = await response.parse() assert_matches_type(OrganizationListResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: async with async_client.organization.with_streaming_response.list() as response: @@ -453,7 +453,7 @@ async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: organization = await async_client.organization.delete( @@ -461,7 +461,7 @@ async def test_method_delete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(OrganizationDeleteResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.organization.with_raw_response.delete( @@ -473,7 +473,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: organization = await response.parse() assert_matches_type(OrganizationDeleteResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.organization.with_streaming_response.delete( @@ -487,7 +487,7 @@ async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_add_member(self, async_client: AsyncHanzo) -> None: organization = await async_client.organization.add_member( @@ -496,7 +496,7 @@ async def test_method_add_member(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(OrganizationAddMemberResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_add_member_with_all_params(self, async_client: AsyncHanzo) -> None: organization = await async_client.organization.add_member( @@ -512,7 +512,7 @@ async def test_method_add_member_with_all_params(self, async_client: AsyncHanzo) ) assert_matches_type(OrganizationAddMemberResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_add_member(self, async_client: AsyncHanzo) -> None: response = await async_client.organization.with_raw_response.add_member( @@ -525,7 +525,7 @@ async def test_raw_response_add_member(self, async_client: AsyncHanzo) -> None: organization = await response.parse() assert_matches_type(OrganizationAddMemberResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_add_member(self, async_client: AsyncHanzo) -> None: async with async_client.organization.with_streaming_response.add_member( @@ -540,7 +540,7 @@ async def test_streaming_response_add_member(self, async_client: AsyncHanzo) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete_member(self, async_client: AsyncHanzo) -> None: organization = await async_client.organization.delete_member( @@ -548,7 +548,7 @@ async def test_method_delete_member(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete_member_with_all_params(self, async_client: AsyncHanzo) -> None: organization = await async_client.organization.delete_member( @@ -558,7 +558,7 @@ async def test_method_delete_member_with_all_params(self, async_client: AsyncHan ) assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete_member(self, async_client: AsyncHanzo) -> None: response = await async_client.organization.with_raw_response.delete_member( @@ -570,7 +570,7 @@ async def test_raw_response_delete_member(self, async_client: AsyncHanzo) -> Non organization = await response.parse() assert_matches_type(object, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete_member(self, async_client: AsyncHanzo) -> None: async with async_client.organization.with_streaming_response.delete_member( @@ -584,7 +584,7 @@ async def test_streaming_response_delete_member(self, async_client: AsyncHanzo) assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_member(self, async_client: AsyncHanzo) -> None: organization = await async_client.organization.update_member( @@ -592,7 +592,7 @@ async def test_method_update_member(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(OrganizationUpdateMemberResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_member_with_all_params(self, async_client: AsyncHanzo) -> None: organization = await async_client.organization.update_member( @@ -604,7 +604,7 @@ async def test_method_update_member_with_all_params(self, async_client: AsyncHan ) assert_matches_type(OrganizationUpdateMemberResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update_member(self, async_client: AsyncHanzo) -> None: response = await async_client.organization.with_raw_response.update_member( @@ -616,7 +616,7 @@ async def test_raw_response_update_member(self, async_client: AsyncHanzo) -> Non organization = await response.parse() assert_matches_type(OrganizationUpdateMemberResponse, organization, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update_member(self, async_client: AsyncHanzo) -> None: async with async_client.organization.with_streaming_response.update_member( diff --git a/tests/api_resources/test_provider.py b/tests/api_resources/test_provider.py index 1246e80e..65a0bf63 100644 --- a/tests/api_resources/test_provider.py +++ b/tests/api_resources/test_provider.py @@ -17,13 +17,13 @@ class TestProvider: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_budgets(self, client: Hanzo) -> None: provider = client.provider.list_budgets() assert_matches_type(ProviderListBudgetsResponse, provider, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list_budgets(self, client: Hanzo) -> None: response = client.provider.with_raw_response.list_budgets() @@ -33,7 +33,7 @@ def test_raw_response_list_budgets(self, client: Hanzo) -> None: provider = response.parse() assert_matches_type(ProviderListBudgetsResponse, provider, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list_budgets(self, client: Hanzo) -> None: with client.provider.with_streaming_response.list_budgets() as response: @@ -51,13 +51,13 @@ class TestAsyncProvider: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_budgets(self, async_client: AsyncHanzo) -> None: provider = await async_client.provider.list_budgets() assert_matches_type(ProviderListBudgetsResponse, provider, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list_budgets(self, async_client: AsyncHanzo) -> None: response = await async_client.provider.with_raw_response.list_budgets() @@ -67,7 +67,7 @@ async def test_raw_response_list_budgets(self, async_client: AsyncHanzo) -> None provider = await response.parse() assert_matches_type(ProviderListBudgetsResponse, provider, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list_budgets(self, async_client: AsyncHanzo) -> None: async with async_client.provider.with_streaming_response.list_budgets() as response: diff --git a/tests/api_resources/test_rerank.py b/tests/api_resources/test_rerank.py index 2893a4a1..891af3cb 100644 --- a/tests/api_resources/test_rerank.py +++ b/tests/api_resources/test_rerank.py @@ -16,13 +16,13 @@ class TestRerank: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: rerank = client.rerank.create() assert_matches_type(object, rerank, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.rerank.with_raw_response.create() @@ -32,7 +32,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: rerank = response.parse() assert_matches_type(object, rerank, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.rerank.with_streaming_response.create() as response: @@ -44,13 +44,13 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_v1(self, client: Hanzo) -> None: rerank = client.rerank.create_v1() assert_matches_type(object, rerank, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create_v1(self, client: Hanzo) -> None: response = client.rerank.with_raw_response.create_v1() @@ -60,7 +60,7 @@ def test_raw_response_create_v1(self, client: Hanzo) -> None: rerank = response.parse() assert_matches_type(object, rerank, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create_v1(self, client: Hanzo) -> None: with client.rerank.with_streaming_response.create_v1() as response: @@ -72,13 +72,13 @@ def test_streaming_response_create_v1(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_v2(self, client: Hanzo) -> None: rerank = client.rerank.create_v2() assert_matches_type(object, rerank, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create_v2(self, client: Hanzo) -> None: response = client.rerank.with_raw_response.create_v2() @@ -88,7 +88,7 @@ def test_raw_response_create_v2(self, client: Hanzo) -> None: rerank = response.parse() assert_matches_type(object, rerank, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create_v2(self, client: Hanzo) -> None: with client.rerank.with_streaming_response.create_v2() as response: @@ -106,13 +106,13 @@ class TestAsyncRerank: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: rerank = await async_client.rerank.create() assert_matches_type(object, rerank, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.rerank.with_raw_response.create() @@ -122,7 +122,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: rerank = await response.parse() assert_matches_type(object, rerank, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.rerank.with_streaming_response.create() as response: @@ -134,13 +134,13 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_v1(self, async_client: AsyncHanzo) -> None: rerank = await async_client.rerank.create_v1() assert_matches_type(object, rerank, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create_v1(self, async_client: AsyncHanzo) -> None: response = await async_client.rerank.with_raw_response.create_v1() @@ -150,7 +150,7 @@ async def test_raw_response_create_v1(self, async_client: AsyncHanzo) -> None: rerank = await response.parse() assert_matches_type(object, rerank, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create_v1(self, async_client: AsyncHanzo) -> None: async with async_client.rerank.with_streaming_response.create_v1() as response: @@ -162,13 +162,13 @@ async def test_streaming_response_create_v1(self, async_client: AsyncHanzo) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_v2(self, async_client: AsyncHanzo) -> None: rerank = await async_client.rerank.create_v2() assert_matches_type(object, rerank, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create_v2(self, async_client: AsyncHanzo) -> None: response = await async_client.rerank.with_raw_response.create_v2() @@ -178,7 +178,7 @@ async def test_raw_response_create_v2(self, async_client: AsyncHanzo) -> None: rerank = await response.parse() assert_matches_type(object, rerank, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create_v2(self, async_client: AsyncHanzo) -> None: async with async_client.rerank.with_streaming_response.create_v2() as response: diff --git a/tests/api_resources/test_responses.py b/tests/api_resources/test_responses.py index f1c2b4ce..e297b637 100644 --- a/tests/api_resources/test_responses.py +++ b/tests/api_resources/test_responses.py @@ -16,13 +16,13 @@ class TestResponses: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: response = client.responses.create() assert_matches_type(object, response, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: http_response = client.responses.with_raw_response.create() @@ -32,7 +32,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: response = http_response.parse() assert_matches_type(object, response, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.responses.with_streaming_response.create() as http_response: @@ -44,7 +44,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, http_response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Hanzo) -> None: response = client.responses.retrieve( @@ -52,7 +52,7 @@ def test_method_retrieve(self, client: Hanzo) -> None: ) assert_matches_type(object, response, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Hanzo) -> None: http_response = client.responses.with_raw_response.retrieve( @@ -64,7 +64,7 @@ def test_raw_response_retrieve(self, client: Hanzo) -> None: response = http_response.parse() assert_matches_type(object, response, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Hanzo) -> None: with client.responses.with_streaming_response.retrieve( @@ -78,7 +78,7 @@ def test_streaming_response_retrieve(self, client: Hanzo) -> None: assert cast(Any, http_response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_retrieve(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `response_id` but received ''"): @@ -86,7 +86,7 @@ def test_path_params_retrieve(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: response = client.responses.delete( @@ -94,7 +94,7 @@ def test_method_delete(self, client: Hanzo) -> None: ) assert_matches_type(object, response, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: http_response = client.responses.with_raw_response.delete( @@ -106,7 +106,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: response = http_response.parse() assert_matches_type(object, response, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.responses.with_streaming_response.delete( @@ -120,7 +120,7 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: assert cast(Any, http_response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_delete(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `response_id` but received ''"): @@ -134,13 +134,13 @@ class TestAsyncResponses: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: response = await async_client.responses.create() assert_matches_type(object, response, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: http_response = await async_client.responses.with_raw_response.create() @@ -150,7 +150,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await http_response.parse() assert_matches_type(object, response, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.responses.with_streaming_response.create() as http_response: @@ -162,7 +162,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, http_response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: response = await async_client.responses.retrieve( @@ -170,7 +170,7 @@ async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, response, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: http_response = await async_client.responses.with_raw_response.retrieve( @@ -182,7 +182,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: response = await http_response.parse() assert_matches_type(object, response, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> None: async with async_client.responses.with_streaming_response.retrieve( @@ -196,7 +196,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> No assert cast(Any, http_response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `response_id` but received ''"): @@ -204,7 +204,7 @@ async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.responses.delete( @@ -212,7 +212,7 @@ async def test_method_delete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, response, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: http_response = await async_client.responses.with_raw_response.delete( @@ -224,7 +224,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await http_response.parse() assert_matches_type(object, response, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.responses.with_streaming_response.delete( @@ -238,7 +238,7 @@ async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None assert cast(Any, http_response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `response_id` but received ''"): diff --git a/tests/api_resources/test_routes.py b/tests/api_resources/test_routes.py index 3febf4f3..dadbdab9 100644 --- a/tests/api_resources/test_routes.py +++ b/tests/api_resources/test_routes.py @@ -16,13 +16,13 @@ class TestRoutes: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Hanzo) -> None: route = client.routes.list() assert_matches_type(object, route, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Hanzo) -> None: response = client.routes.with_raw_response.list() @@ -32,7 +32,7 @@ def test_raw_response_list(self, client: Hanzo) -> None: route = response.parse() assert_matches_type(object, route, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Hanzo) -> None: with client.routes.with_streaming_response.list() as response: @@ -50,13 +50,13 @@ class TestAsyncRoutes: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncHanzo) -> None: route = await async_client.routes.list() assert_matches_type(object, route, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: response = await async_client.routes.with_raw_response.list() @@ -66,7 +66,7 @@ async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: route = await response.parse() assert_matches_type(object, route, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: async with async_client.routes.with_streaming_response.list() as response: diff --git a/tests/api_resources/test_settings.py b/tests/api_resources/test_settings.py index 6146d41f..cfe2ecd5 100644 --- a/tests/api_resources/test_settings.py +++ b/tests/api_resources/test_settings.py @@ -16,13 +16,13 @@ class TestSettings: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Hanzo) -> None: setting = client.settings.retrieve() assert_matches_type(object, setting, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Hanzo) -> None: response = client.settings.with_raw_response.retrieve() @@ -32,7 +32,7 @@ def test_raw_response_retrieve(self, client: Hanzo) -> None: setting = response.parse() assert_matches_type(object, setting, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Hanzo) -> None: with client.settings.with_streaming_response.retrieve() as response: @@ -50,13 +50,13 @@ class TestAsyncSettings: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: setting = await async_client.settings.retrieve() assert_matches_type(object, setting, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: response = await async_client.settings.with_raw_response.retrieve() @@ -66,7 +66,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: setting = await response.parse() assert_matches_type(object, setting, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> None: async with async_client.settings.with_streaming_response.retrieve() as response: diff --git a/tests/api_resources/test_spend.py b/tests/api_resources/test_spend.py index c1059c3f..44669503 100644 --- a/tests/api_resources/test_spend.py +++ b/tests/api_resources/test_spend.py @@ -20,13 +20,13 @@ class TestSpend: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_calculate_spend(self, client: Hanzo) -> None: spend = client.spend.calculate_spend() assert_matches_type(object, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_calculate_spend_with_all_params(self, client: Hanzo) -> None: spend = client.spend.calculate_spend( @@ -36,7 +36,7 @@ def test_method_calculate_spend_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_calculate_spend(self, client: Hanzo) -> None: response = client.spend.with_raw_response.calculate_spend() @@ -46,7 +46,7 @@ def test_raw_response_calculate_spend(self, client: Hanzo) -> None: spend = response.parse() assert_matches_type(object, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_calculate_spend(self, client: Hanzo) -> None: with client.spend.with_streaming_response.calculate_spend() as response: @@ -58,13 +58,13 @@ def test_streaming_response_calculate_spend(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_logs(self, client: Hanzo) -> None: spend = client.spend.list_logs() assert_matches_type(SpendListLogsResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_logs_with_all_params(self, client: Hanzo) -> None: spend = client.spend.list_logs( @@ -76,7 +76,7 @@ def test_method_list_logs_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(SpendListLogsResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list_logs(self, client: Hanzo) -> None: response = client.spend.with_raw_response.list_logs() @@ -86,7 +86,7 @@ def test_raw_response_list_logs(self, client: Hanzo) -> None: spend = response.parse() assert_matches_type(SpendListLogsResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list_logs(self, client: Hanzo) -> None: with client.spend.with_streaming_response.list_logs() as response: @@ -98,13 +98,13 @@ def test_streaming_response_list_logs(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_tags(self, client: Hanzo) -> None: spend = client.spend.list_tags() assert_matches_type(SpendListTagsResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_tags_with_all_params(self, client: Hanzo) -> None: spend = client.spend.list_tags( @@ -113,7 +113,7 @@ def test_method_list_tags_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(SpendListTagsResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list_tags(self, client: Hanzo) -> None: response = client.spend.with_raw_response.list_tags() @@ -123,7 +123,7 @@ def test_raw_response_list_tags(self, client: Hanzo) -> None: spend = response.parse() assert_matches_type(SpendListTagsResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list_tags(self, client: Hanzo) -> None: with client.spend.with_streaming_response.list_tags() as response: @@ -141,13 +141,13 @@ class TestAsyncSpend: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_calculate_spend(self, async_client: AsyncHanzo) -> None: spend = await async_client.spend.calculate_spend() assert_matches_type(object, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_calculate_spend_with_all_params(self, async_client: AsyncHanzo) -> None: spend = await async_client.spend.calculate_spend( @@ -157,7 +157,7 @@ async def test_method_calculate_spend_with_all_params(self, async_client: AsyncH ) assert_matches_type(object, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_calculate_spend(self, async_client: AsyncHanzo) -> None: response = await async_client.spend.with_raw_response.calculate_spend() @@ -167,7 +167,7 @@ async def test_raw_response_calculate_spend(self, async_client: AsyncHanzo) -> N spend = await response.parse() assert_matches_type(object, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_calculate_spend(self, async_client: AsyncHanzo) -> None: async with async_client.spend.with_streaming_response.calculate_spend() as response: @@ -179,13 +179,13 @@ async def test_streaming_response_calculate_spend(self, async_client: AsyncHanzo assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_logs(self, async_client: AsyncHanzo) -> None: spend = await async_client.spend.list_logs() assert_matches_type(SpendListLogsResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_logs_with_all_params(self, async_client: AsyncHanzo) -> None: spend = await async_client.spend.list_logs( @@ -197,7 +197,7 @@ async def test_method_list_logs_with_all_params(self, async_client: AsyncHanzo) ) assert_matches_type(SpendListLogsResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list_logs(self, async_client: AsyncHanzo) -> None: response = await async_client.spend.with_raw_response.list_logs() @@ -207,7 +207,7 @@ async def test_raw_response_list_logs(self, async_client: AsyncHanzo) -> None: spend = await response.parse() assert_matches_type(SpendListLogsResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list_logs(self, async_client: AsyncHanzo) -> None: async with async_client.spend.with_streaming_response.list_logs() as response: @@ -219,13 +219,13 @@ async def test_streaming_response_list_logs(self, async_client: AsyncHanzo) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_tags(self, async_client: AsyncHanzo) -> None: spend = await async_client.spend.list_tags() assert_matches_type(SpendListTagsResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_tags_with_all_params(self, async_client: AsyncHanzo) -> None: spend = await async_client.spend.list_tags( @@ -234,7 +234,7 @@ async def test_method_list_tags_with_all_params(self, async_client: AsyncHanzo) ) assert_matches_type(SpendListTagsResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list_tags(self, async_client: AsyncHanzo) -> None: response = await async_client.spend.with_raw_response.list_tags() @@ -244,7 +244,7 @@ async def test_raw_response_list_tags(self, async_client: AsyncHanzo) -> None: spend = await response.parse() assert_matches_type(SpendListTagsResponse, spend, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list_tags(self, async_client: AsyncHanzo) -> None: async with async_client.spend.with_streaming_response.list_tags() as response: diff --git a/tests/api_resources/test_team.py b/tests/api_resources/test_team.py index a14bd1cf..50618bdd 100644 --- a/tests/api_resources/test_team.py +++ b/tests/api_resources/test_team.py @@ -21,13 +21,13 @@ class TestTeam: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: team = client.team.create() assert_matches_type(TeamCreateResponse, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Hanzo) -> None: team = client.team.create( @@ -57,7 +57,7 @@ def test_method_create_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(TeamCreateResponse, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.team.with_raw_response.create() @@ -67,7 +67,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: team = response.parse() assert_matches_type(TeamCreateResponse, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.team.with_streaming_response.create() as response: @@ -79,7 +79,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Hanzo) -> None: team = client.team.update( @@ -87,7 +87,7 @@ def test_method_update(self, client: Hanzo) -> None: ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Hanzo) -> None: team = client.team.update( @@ -108,7 +108,7 @@ def test_method_update_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Hanzo) -> None: response = client.team.with_raw_response.update( @@ -120,7 +120,7 @@ def test_raw_response_update(self, client: Hanzo) -> None: team = response.parse() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Hanzo) -> None: with client.team.with_streaming_response.update( @@ -134,13 +134,13 @@ def test_streaming_response_update(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Hanzo) -> None: team = client.team.list() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Hanzo) -> None: team = client.team.list( @@ -149,7 +149,7 @@ def test_method_list_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Hanzo) -> None: response = client.team.with_raw_response.list() @@ -159,7 +159,7 @@ def test_raw_response_list(self, client: Hanzo) -> None: team = response.parse() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Hanzo) -> None: with client.team.with_streaming_response.list() as response: @@ -171,7 +171,7 @@ def test_streaming_response_list(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: team = client.team.delete( @@ -179,7 +179,7 @@ def test_method_delete(self, client: Hanzo) -> None: ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Hanzo) -> None: team = client.team.delete( @@ -188,7 +188,7 @@ def test_method_delete_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.team.with_raw_response.delete( @@ -200,7 +200,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: team = response.parse() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.team.with_streaming_response.delete( @@ -214,7 +214,7 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_add_member(self, client: Hanzo) -> None: team = client.team.add_member( @@ -223,7 +223,7 @@ def test_method_add_member(self, client: Hanzo) -> None: ) assert_matches_type(TeamAddMemberResponse, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_add_member_with_all_params(self, client: Hanzo) -> None: team = client.team.add_member( @@ -239,7 +239,7 @@ def test_method_add_member_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(TeamAddMemberResponse, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_add_member(self, client: Hanzo) -> None: response = client.team.with_raw_response.add_member( @@ -252,7 +252,7 @@ def test_raw_response_add_member(self, client: Hanzo) -> None: team = response.parse() assert_matches_type(TeamAddMemberResponse, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_add_member(self, client: Hanzo) -> None: with client.team.with_streaming_response.add_member( @@ -267,7 +267,7 @@ def test_streaming_response_add_member(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_block(self, client: Hanzo) -> None: team = client.team.block( @@ -275,7 +275,7 @@ def test_method_block(self, client: Hanzo) -> None: ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_block(self, client: Hanzo) -> None: response = client.team.with_raw_response.block( @@ -287,7 +287,7 @@ def test_raw_response_block(self, client: Hanzo) -> None: team = response.parse() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_block(self, client: Hanzo) -> None: with client.team.with_streaming_response.block( @@ -301,7 +301,7 @@ def test_streaming_response_block(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_disable_logging(self, client: Hanzo) -> None: team = client.team.disable_logging( @@ -309,7 +309,7 @@ def test_method_disable_logging(self, client: Hanzo) -> None: ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_disable_logging(self, client: Hanzo) -> None: response = client.team.with_raw_response.disable_logging( @@ -321,7 +321,7 @@ def test_raw_response_disable_logging(self, client: Hanzo) -> None: team = response.parse() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_disable_logging(self, client: Hanzo) -> None: with client.team.with_streaming_response.disable_logging( @@ -335,7 +335,7 @@ def test_streaming_response_disable_logging(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_disable_logging(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `team_id` but received ''"): @@ -343,13 +343,13 @@ def test_path_params_disable_logging(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_available(self, client: Hanzo) -> None: team = client.team.list_available() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_available_with_all_params(self, client: Hanzo) -> None: team = client.team.list_available( @@ -357,7 +357,7 @@ def test_method_list_available_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list_available(self, client: Hanzo) -> None: response = client.team.with_raw_response.list_available() @@ -367,7 +367,7 @@ def test_raw_response_list_available(self, client: Hanzo) -> None: team = response.parse() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list_available(self, client: Hanzo) -> None: with client.team.with_streaming_response.list_available() as response: @@ -379,7 +379,7 @@ def test_streaming_response_list_available(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_remove_member(self, client: Hanzo) -> None: team = client.team.remove_member( @@ -387,7 +387,7 @@ def test_method_remove_member(self, client: Hanzo) -> None: ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_remove_member_with_all_params(self, client: Hanzo) -> None: team = client.team.remove_member( @@ -397,7 +397,7 @@ def test_method_remove_member_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_remove_member(self, client: Hanzo) -> None: response = client.team.with_raw_response.remove_member( @@ -409,7 +409,7 @@ def test_raw_response_remove_member(self, client: Hanzo) -> None: team = response.parse() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_remove_member(self, client: Hanzo) -> None: with client.team.with_streaming_response.remove_member( @@ -423,13 +423,13 @@ def test_streaming_response_remove_member(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_info(self, client: Hanzo) -> None: team = client.team.retrieve_info() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_info_with_all_params(self, client: Hanzo) -> None: team = client.team.retrieve_info( @@ -437,7 +437,7 @@ def test_method_retrieve_info_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve_info(self, client: Hanzo) -> None: response = client.team.with_raw_response.retrieve_info() @@ -447,7 +447,7 @@ def test_raw_response_retrieve_info(self, client: Hanzo) -> None: team = response.parse() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve_info(self, client: Hanzo) -> None: with client.team.with_streaming_response.retrieve_info() as response: @@ -459,7 +459,7 @@ def test_streaming_response_retrieve_info(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_unblock(self, client: Hanzo) -> None: team = client.team.unblock( @@ -467,7 +467,7 @@ def test_method_unblock(self, client: Hanzo) -> None: ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_unblock(self, client: Hanzo) -> None: response = client.team.with_raw_response.unblock( @@ -479,7 +479,7 @@ def test_raw_response_unblock(self, client: Hanzo) -> None: team = response.parse() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_unblock(self, client: Hanzo) -> None: with client.team.with_streaming_response.unblock( @@ -493,7 +493,7 @@ def test_streaming_response_unblock(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_member(self, client: Hanzo) -> None: team = client.team.update_member( @@ -501,7 +501,7 @@ def test_method_update_member(self, client: Hanzo) -> None: ) assert_matches_type(TeamUpdateMemberResponse, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_member_with_all_params(self, client: Hanzo) -> None: team = client.team.update_member( @@ -513,7 +513,7 @@ def test_method_update_member_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(TeamUpdateMemberResponse, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update_member(self, client: Hanzo) -> None: response = client.team.with_raw_response.update_member( @@ -525,7 +525,7 @@ def test_raw_response_update_member(self, client: Hanzo) -> None: team = response.parse() assert_matches_type(TeamUpdateMemberResponse, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update_member(self, client: Hanzo) -> None: with client.team.with_streaming_response.update_member( @@ -545,13 +545,13 @@ class TestAsyncTeam: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: team = await async_client.team.create() assert_matches_type(TeamCreateResponse, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> None: team = await async_client.team.create( @@ -581,7 +581,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(TeamCreateResponse, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.team.with_raw_response.create() @@ -591,7 +591,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: team = await response.parse() assert_matches_type(TeamCreateResponse, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.team.with_streaming_response.create() as response: @@ -603,7 +603,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncHanzo) -> None: team = await async_client.team.update( @@ -611,7 +611,7 @@ async def test_method_update(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncHanzo) -> None: team = await async_client.team.update( @@ -632,7 +632,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: response = await async_client.team.with_raw_response.update( @@ -644,7 +644,7 @@ async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: team = await response.parse() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None: async with async_client.team.with_streaming_response.update( @@ -658,13 +658,13 @@ async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncHanzo) -> None: team = await async_client.team.list() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncHanzo) -> None: team = await async_client.team.list( @@ -673,7 +673,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncHanzo) -> No ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: response = await async_client.team.with_raw_response.list() @@ -683,7 +683,7 @@ async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: team = await response.parse() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: async with async_client.team.with_streaming_response.list() as response: @@ -695,7 +695,7 @@ async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: team = await async_client.team.delete( @@ -703,7 +703,7 @@ async def test_method_delete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncHanzo) -> None: team = await async_client.team.delete( @@ -712,7 +712,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.team.with_raw_response.delete( @@ -724,7 +724,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: team = await response.parse() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.team.with_streaming_response.delete( @@ -738,7 +738,7 @@ async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_add_member(self, async_client: AsyncHanzo) -> None: team = await async_client.team.add_member( @@ -747,7 +747,7 @@ async def test_method_add_member(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(TeamAddMemberResponse, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_add_member_with_all_params(self, async_client: AsyncHanzo) -> None: team = await async_client.team.add_member( @@ -763,7 +763,7 @@ async def test_method_add_member_with_all_params(self, async_client: AsyncHanzo) ) assert_matches_type(TeamAddMemberResponse, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_add_member(self, async_client: AsyncHanzo) -> None: response = await async_client.team.with_raw_response.add_member( @@ -776,7 +776,7 @@ async def test_raw_response_add_member(self, async_client: AsyncHanzo) -> None: team = await response.parse() assert_matches_type(TeamAddMemberResponse, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_add_member(self, async_client: AsyncHanzo) -> None: async with async_client.team.with_streaming_response.add_member( @@ -791,7 +791,7 @@ async def test_streaming_response_add_member(self, async_client: AsyncHanzo) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_block(self, async_client: AsyncHanzo) -> None: team = await async_client.team.block( @@ -799,7 +799,7 @@ async def test_method_block(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_block(self, async_client: AsyncHanzo) -> None: response = await async_client.team.with_raw_response.block( @@ -811,7 +811,7 @@ async def test_raw_response_block(self, async_client: AsyncHanzo) -> None: team = await response.parse() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_block(self, async_client: AsyncHanzo) -> None: async with async_client.team.with_streaming_response.block( @@ -825,7 +825,7 @@ async def test_streaming_response_block(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_disable_logging(self, async_client: AsyncHanzo) -> None: team = await async_client.team.disable_logging( @@ -833,7 +833,7 @@ async def test_method_disable_logging(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_disable_logging(self, async_client: AsyncHanzo) -> None: response = await async_client.team.with_raw_response.disable_logging( @@ -845,7 +845,7 @@ async def test_raw_response_disable_logging(self, async_client: AsyncHanzo) -> N team = await response.parse() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_disable_logging(self, async_client: AsyncHanzo) -> None: async with async_client.team.with_streaming_response.disable_logging( @@ -859,7 +859,7 @@ async def test_streaming_response_disable_logging(self, async_client: AsyncHanzo assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_disable_logging(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `team_id` but received ''"): @@ -867,13 +867,13 @@ async def test_path_params_disable_logging(self, async_client: AsyncHanzo) -> No "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_available(self, async_client: AsyncHanzo) -> None: team = await async_client.team.list_available() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_available_with_all_params(self, async_client: AsyncHanzo) -> None: team = await async_client.team.list_available( @@ -881,7 +881,7 @@ async def test_method_list_available_with_all_params(self, async_client: AsyncHa ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list_available(self, async_client: AsyncHanzo) -> None: response = await async_client.team.with_raw_response.list_available() @@ -891,7 +891,7 @@ async def test_raw_response_list_available(self, async_client: AsyncHanzo) -> No team = await response.parse() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list_available(self, async_client: AsyncHanzo) -> None: async with async_client.team.with_streaming_response.list_available() as response: @@ -903,7 +903,7 @@ async def test_streaming_response_list_available(self, async_client: AsyncHanzo) assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_remove_member(self, async_client: AsyncHanzo) -> None: team = await async_client.team.remove_member( @@ -911,7 +911,7 @@ async def test_method_remove_member(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_remove_member_with_all_params(self, async_client: AsyncHanzo) -> None: team = await async_client.team.remove_member( @@ -921,7 +921,7 @@ async def test_method_remove_member_with_all_params(self, async_client: AsyncHan ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_remove_member(self, async_client: AsyncHanzo) -> None: response = await async_client.team.with_raw_response.remove_member( @@ -933,7 +933,7 @@ async def test_raw_response_remove_member(self, async_client: AsyncHanzo) -> Non team = await response.parse() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_remove_member(self, async_client: AsyncHanzo) -> None: async with async_client.team.with_streaming_response.remove_member( @@ -947,13 +947,13 @@ async def test_streaming_response_remove_member(self, async_client: AsyncHanzo) assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_info(self, async_client: AsyncHanzo) -> None: team = await async_client.team.retrieve_info() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_info_with_all_params(self, async_client: AsyncHanzo) -> None: team = await async_client.team.retrieve_info( @@ -961,7 +961,7 @@ async def test_method_retrieve_info_with_all_params(self, async_client: AsyncHan ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve_info(self, async_client: AsyncHanzo) -> None: response = await async_client.team.with_raw_response.retrieve_info() @@ -971,7 +971,7 @@ async def test_raw_response_retrieve_info(self, async_client: AsyncHanzo) -> Non team = await response.parse() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve_info(self, async_client: AsyncHanzo) -> None: async with async_client.team.with_streaming_response.retrieve_info() as response: @@ -983,7 +983,7 @@ async def test_streaming_response_retrieve_info(self, async_client: AsyncHanzo) assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_unblock(self, async_client: AsyncHanzo) -> None: team = await async_client.team.unblock( @@ -991,7 +991,7 @@ async def test_method_unblock(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_unblock(self, async_client: AsyncHanzo) -> None: response = await async_client.team.with_raw_response.unblock( @@ -1003,7 +1003,7 @@ async def test_raw_response_unblock(self, async_client: AsyncHanzo) -> None: team = await response.parse() assert_matches_type(object, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_unblock(self, async_client: AsyncHanzo) -> None: async with async_client.team.with_streaming_response.unblock( @@ -1017,7 +1017,7 @@ async def test_streaming_response_unblock(self, async_client: AsyncHanzo) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_member(self, async_client: AsyncHanzo) -> None: team = await async_client.team.update_member( @@ -1025,7 +1025,7 @@ async def test_method_update_member(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(TeamUpdateMemberResponse, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_member_with_all_params(self, async_client: AsyncHanzo) -> None: team = await async_client.team.update_member( @@ -1037,7 +1037,7 @@ async def test_method_update_member_with_all_params(self, async_client: AsyncHan ) assert_matches_type(TeamUpdateMemberResponse, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update_member(self, async_client: AsyncHanzo) -> None: response = await async_client.team.with_raw_response.update_member( @@ -1049,7 +1049,7 @@ async def test_raw_response_update_member(self, async_client: AsyncHanzo) -> Non team = await response.parse() assert_matches_type(TeamUpdateMemberResponse, team, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update_member(self, async_client: AsyncHanzo) -> None: async with async_client.team.with_streaming_response.update_member( diff --git a/tests/api_resources/test_test.py b/tests/api_resources/test_test.py index 3b10a6ed..77494cb2 100644 --- a/tests/api_resources/test_test.py +++ b/tests/api_resources/test_test.py @@ -16,13 +16,13 @@ class TestTest: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_ping(self, client: Hanzo) -> None: test = client.test.ping() assert_matches_type(object, test, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_ping(self, client: Hanzo) -> None: response = client.test.with_raw_response.ping() @@ -32,7 +32,7 @@ def test_raw_response_ping(self, client: Hanzo) -> None: test = response.parse() assert_matches_type(object, test, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_ping(self, client: Hanzo) -> None: with client.test.with_streaming_response.ping() as response: @@ -50,13 +50,13 @@ class TestAsyncTest: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_ping(self, async_client: AsyncHanzo) -> None: test = await async_client.test.ping() assert_matches_type(object, test, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_ping(self, async_client: AsyncHanzo) -> None: response = await async_client.test.with_raw_response.ping() @@ -66,7 +66,7 @@ async def test_raw_response_ping(self, async_client: AsyncHanzo) -> None: test = await response.parse() assert_matches_type(object, test, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_ping(self, async_client: AsyncHanzo) -> None: async with async_client.test.with_streaming_response.ping() as response: diff --git a/tests/api_resources/test_threads.py b/tests/api_resources/test_threads.py index d1073d05..1f312cb1 100644 --- a/tests/api_resources/test_threads.py +++ b/tests/api_resources/test_threads.py @@ -16,13 +16,13 @@ class TestThreads: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: thread = client.threads.create() assert_matches_type(object, thread, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.threads.with_raw_response.create() @@ -32,7 +32,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: thread = response.parse() assert_matches_type(object, thread, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.threads.with_streaming_response.create() as response: @@ -44,7 +44,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Hanzo) -> None: thread = client.threads.retrieve( @@ -52,7 +52,7 @@ def test_method_retrieve(self, client: Hanzo) -> None: ) assert_matches_type(object, thread, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Hanzo) -> None: response = client.threads.with_raw_response.retrieve( @@ -64,7 +64,7 @@ def test_raw_response_retrieve(self, client: Hanzo) -> None: thread = response.parse() assert_matches_type(object, thread, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Hanzo) -> None: with client.threads.with_streaming_response.retrieve( @@ -78,7 +78,7 @@ def test_streaming_response_retrieve(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_retrieve(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): @@ -92,13 +92,13 @@ class TestAsyncThreads: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: thread = await async_client.threads.create() assert_matches_type(object, thread, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.threads.with_raw_response.create() @@ -108,7 +108,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: thread = await response.parse() assert_matches_type(object, thread, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.threads.with_streaming_response.create() as response: @@ -120,7 +120,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: thread = await async_client.threads.retrieve( @@ -128,7 +128,7 @@ async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, thread, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: response = await async_client.threads.with_raw_response.retrieve( @@ -140,7 +140,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: thread = await response.parse() assert_matches_type(object, thread, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> None: async with async_client.threads.with_streaming_response.retrieve( @@ -154,7 +154,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): diff --git a/tests/api_resources/test_user.py b/tests/api_resources/test_user.py index b9af2e31..b96950bf 100644 --- a/tests/api_resources/test_user.py +++ b/tests/api_resources/test_user.py @@ -19,13 +19,13 @@ class TestUser: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: user = client.user.create() assert_matches_type(UserCreateResponse, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Hanzo) -> None: user = client.user.create( @@ -59,7 +59,7 @@ def test_method_create_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(UserCreateResponse, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.user.with_raw_response.create() @@ -69,7 +69,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: user = response.parse() assert_matches_type(UserCreateResponse, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.user.with_streaming_response.create() as response: @@ -81,13 +81,13 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Hanzo) -> None: user = client.user.update() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Hanzo) -> None: user = client.user.update( @@ -118,7 +118,7 @@ def test_method_update_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Hanzo) -> None: response = client.user.with_raw_response.update() @@ -128,7 +128,7 @@ def test_raw_response_update(self, client: Hanzo) -> None: user = response.parse() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Hanzo) -> None: with client.user.with_streaming_response.update() as response: @@ -140,13 +140,13 @@ def test_streaming_response_update(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Hanzo) -> None: user = client.user.list() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Hanzo) -> None: user = client.user.list( @@ -157,7 +157,7 @@ def test_method_list_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Hanzo) -> None: response = client.user.with_raw_response.list() @@ -167,7 +167,7 @@ def test_raw_response_list(self, client: Hanzo) -> None: user = response.parse() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Hanzo) -> None: with client.user.with_streaming_response.list() as response: @@ -179,7 +179,7 @@ def test_streaming_response_list(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: user = client.user.delete( @@ -187,7 +187,7 @@ def test_method_delete(self, client: Hanzo) -> None: ) assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete_with_all_params(self, client: Hanzo) -> None: user = client.user.delete( @@ -196,7 +196,7 @@ def test_method_delete_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.user.with_raw_response.delete( @@ -208,7 +208,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: user = response.parse() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.user.with_streaming_response.delete( @@ -222,13 +222,13 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_info(self, client: Hanzo) -> None: user = client.user.retrieve_info() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve_info_with_all_params(self, client: Hanzo) -> None: user = client.user.retrieve_info( @@ -236,7 +236,7 @@ def test_method_retrieve_info_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve_info(self, client: Hanzo) -> None: response = client.user.with_raw_response.retrieve_info() @@ -246,7 +246,7 @@ def test_raw_response_retrieve_info(self, client: Hanzo) -> None: user = response.parse() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve_info(self, client: Hanzo) -> None: with client.user.with_streaming_response.retrieve_info() as response: @@ -264,13 +264,13 @@ class TestAsyncUser: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: user = await async_client.user.create() assert_matches_type(UserCreateResponse, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> None: user = await async_client.user.create( @@ -304,7 +304,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(UserCreateResponse, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.user.with_raw_response.create() @@ -314,7 +314,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: user = await response.parse() assert_matches_type(UserCreateResponse, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.user.with_streaming_response.create() as response: @@ -326,13 +326,13 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncHanzo) -> None: user = await async_client.user.update() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncHanzo) -> None: user = await async_client.user.update( @@ -363,7 +363,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: response = await async_client.user.with_raw_response.update() @@ -373,7 +373,7 @@ async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: user = await response.parse() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None: async with async_client.user.with_streaming_response.update() as response: @@ -385,13 +385,13 @@ async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncHanzo) -> None: user = await async_client.user.list() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncHanzo) -> None: user = await async_client.user.list( @@ -402,7 +402,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncHanzo) -> No ) assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: response = await async_client.user.with_raw_response.list() @@ -412,7 +412,7 @@ async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: user = await response.parse() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: async with async_client.user.with_streaming_response.list() as response: @@ -424,7 +424,7 @@ async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: user = await async_client.user.delete( @@ -432,7 +432,7 @@ async def test_method_delete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete_with_all_params(self, async_client: AsyncHanzo) -> None: user = await async_client.user.delete( @@ -441,7 +441,7 @@ async def test_method_delete_with_all_params(self, async_client: AsyncHanzo) -> ) assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.user.with_raw_response.delete( @@ -453,7 +453,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: user = await response.parse() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.user.with_streaming_response.delete( @@ -467,13 +467,13 @@ async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_info(self, async_client: AsyncHanzo) -> None: user = await async_client.user.retrieve_info() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve_info_with_all_params(self, async_client: AsyncHanzo) -> None: user = await async_client.user.retrieve_info( @@ -481,7 +481,7 @@ async def test_method_retrieve_info_with_all_params(self, async_client: AsyncHan ) assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve_info(self, async_client: AsyncHanzo) -> None: response = await async_client.user.with_raw_response.retrieve_info() @@ -491,7 +491,7 @@ async def test_raw_response_retrieve_info(self, async_client: AsyncHanzo) -> Non user = await response.parse() assert_matches_type(object, user, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve_info(self, async_client: AsyncHanzo) -> None: async with async_client.user.with_streaming_response.retrieve_info() as response: diff --git a/tests/api_resources/test_utils.py b/tests/api_resources/test_utils.py index df4d1500..6438b37f 100644 --- a/tests/api_resources/test_utils.py +++ b/tests/api_resources/test_utils.py @@ -20,7 +20,7 @@ class TestUtils: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_get_supported_openai_params(self, client: Hanzo) -> None: util = client.utils.get_supported_openai_params( @@ -28,7 +28,7 @@ def test_method_get_supported_openai_params(self, client: Hanzo) -> None: ) assert_matches_type(object, util, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_get_supported_openai_params(self, client: Hanzo) -> None: response = client.utils.with_raw_response.get_supported_openai_params( @@ -40,7 +40,7 @@ def test_raw_response_get_supported_openai_params(self, client: Hanzo) -> None: util = response.parse() assert_matches_type(object, util, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_get_supported_openai_params(self, client: Hanzo) -> None: with client.utils.with_streaming_response.get_supported_openai_params( @@ -54,7 +54,7 @@ def test_streaming_response_get_supported_openai_params(self, client: Hanzo) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_token_counter(self, client: Hanzo) -> None: util = client.utils.token_counter( @@ -62,7 +62,7 @@ def test_method_token_counter(self, client: Hanzo) -> None: ) assert_matches_type(UtilTokenCounterResponse, util, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_token_counter_with_all_params(self, client: Hanzo) -> None: util = client.utils.token_counter( @@ -72,7 +72,7 @@ def test_method_token_counter_with_all_params(self, client: Hanzo) -> None: ) assert_matches_type(UtilTokenCounterResponse, util, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_token_counter(self, client: Hanzo) -> None: response = client.utils.with_raw_response.token_counter( @@ -84,7 +84,7 @@ def test_raw_response_token_counter(self, client: Hanzo) -> None: util = response.parse() assert_matches_type(UtilTokenCounterResponse, util, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_token_counter(self, client: Hanzo) -> None: with client.utils.with_streaming_response.token_counter( @@ -98,7 +98,7 @@ def test_streaming_response_token_counter(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_transform_request(self, client: Hanzo) -> None: util = client.utils.transform_request( @@ -107,7 +107,7 @@ def test_method_transform_request(self, client: Hanzo) -> None: ) assert_matches_type(UtilTransformRequestResponse, util, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_transform_request(self, client: Hanzo) -> None: response = client.utils.with_raw_response.transform_request( @@ -120,7 +120,7 @@ def test_raw_response_transform_request(self, client: Hanzo) -> None: util = response.parse() assert_matches_type(UtilTransformRequestResponse, util, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_transform_request(self, client: Hanzo) -> None: with client.utils.with_streaming_response.transform_request( @@ -141,7 +141,7 @@ class TestAsyncUtils: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_get_supported_openai_params(self, async_client: AsyncHanzo) -> None: util = await async_client.utils.get_supported_openai_params( @@ -149,7 +149,7 @@ async def test_method_get_supported_openai_params(self, async_client: AsyncHanzo ) assert_matches_type(object, util, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_get_supported_openai_params(self, async_client: AsyncHanzo) -> None: response = await async_client.utils.with_raw_response.get_supported_openai_params( @@ -161,7 +161,7 @@ async def test_raw_response_get_supported_openai_params(self, async_client: Asyn util = await response.parse() assert_matches_type(object, util, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_get_supported_openai_params(self, async_client: AsyncHanzo) -> None: async with async_client.utils.with_streaming_response.get_supported_openai_params( @@ -175,7 +175,7 @@ async def test_streaming_response_get_supported_openai_params(self, async_client assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_token_counter(self, async_client: AsyncHanzo) -> None: util = await async_client.utils.token_counter( @@ -183,7 +183,7 @@ async def test_method_token_counter(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(UtilTokenCounterResponse, util, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_token_counter_with_all_params(self, async_client: AsyncHanzo) -> None: util = await async_client.utils.token_counter( @@ -193,7 +193,7 @@ async def test_method_token_counter_with_all_params(self, async_client: AsyncHan ) assert_matches_type(UtilTokenCounterResponse, util, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_token_counter(self, async_client: AsyncHanzo) -> None: response = await async_client.utils.with_raw_response.token_counter( @@ -205,7 +205,7 @@ async def test_raw_response_token_counter(self, async_client: AsyncHanzo) -> Non util = await response.parse() assert_matches_type(UtilTokenCounterResponse, util, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_token_counter(self, async_client: AsyncHanzo) -> None: async with async_client.utils.with_streaming_response.token_counter( @@ -219,7 +219,7 @@ async def test_streaming_response_token_counter(self, async_client: AsyncHanzo) assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_transform_request(self, async_client: AsyncHanzo) -> None: util = await async_client.utils.transform_request( @@ -228,7 +228,7 @@ async def test_method_transform_request(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(UtilTransformRequestResponse, util, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_transform_request(self, async_client: AsyncHanzo) -> None: response = await async_client.utils.with_raw_response.transform_request( @@ -241,7 +241,7 @@ async def test_raw_response_transform_request(self, async_client: AsyncHanzo) -> util = await response.parse() assert_matches_type(UtilTransformRequestResponse, util, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_transform_request(self, async_client: AsyncHanzo) -> None: async with async_client.utils.with_streaming_response.transform_request( diff --git a/tests/api_resources/test_vertex_ai.py b/tests/api_resources/test_vertex_ai.py index eaaed0f4..2357c396 100644 --- a/tests/api_resources/test_vertex_ai.py +++ b/tests/api_resources/test_vertex_ai.py @@ -16,7 +16,7 @@ class TestVertexAI: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: vertex_ai = client.vertex_ai.create( @@ -24,7 +24,7 @@ def test_method_create(self, client: Hanzo) -> None: ) assert_matches_type(object, vertex_ai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.vertex_ai.with_raw_response.create( @@ -36,7 +36,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: vertex_ai = response.parse() assert_matches_type(object, vertex_ai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.vertex_ai.with_streaming_response.create( @@ -50,7 +50,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_create(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -58,7 +58,7 @@ def test_path_params_create(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_retrieve(self, client: Hanzo) -> None: vertex_ai = client.vertex_ai.retrieve( @@ -66,7 +66,7 @@ def test_method_retrieve(self, client: Hanzo) -> None: ) assert_matches_type(object, vertex_ai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Hanzo) -> None: response = client.vertex_ai.with_raw_response.retrieve( @@ -78,7 +78,7 @@ def test_raw_response_retrieve(self, client: Hanzo) -> None: vertex_ai = response.parse() assert_matches_type(object, vertex_ai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Hanzo) -> None: with client.vertex_ai.with_streaming_response.retrieve( @@ -92,7 +92,7 @@ def test_streaming_response_retrieve(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_retrieve(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -100,7 +100,7 @@ def test_path_params_retrieve(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update(self, client: Hanzo) -> None: vertex_ai = client.vertex_ai.update( @@ -108,7 +108,7 @@ def test_method_update(self, client: Hanzo) -> None: ) assert_matches_type(object, vertex_ai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_update(self, client: Hanzo) -> None: response = client.vertex_ai.with_raw_response.update( @@ -120,7 +120,7 @@ def test_raw_response_update(self, client: Hanzo) -> None: vertex_ai = response.parse() assert_matches_type(object, vertex_ai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_update(self, client: Hanzo) -> None: with client.vertex_ai.with_streaming_response.update( @@ -134,7 +134,7 @@ def test_streaming_response_update(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_update(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -142,7 +142,7 @@ def test_path_params_update(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_delete(self, client: Hanzo) -> None: vertex_ai = client.vertex_ai.delete( @@ -150,7 +150,7 @@ def test_method_delete(self, client: Hanzo) -> None: ) assert_matches_type(object, vertex_ai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_delete(self, client: Hanzo) -> None: response = client.vertex_ai.with_raw_response.delete( @@ -162,7 +162,7 @@ def test_raw_response_delete(self, client: Hanzo) -> None: vertex_ai = response.parse() assert_matches_type(object, vertex_ai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_delete(self, client: Hanzo) -> None: with client.vertex_ai.with_streaming_response.delete( @@ -176,7 +176,7 @@ def test_streaming_response_delete(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_delete(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -184,7 +184,7 @@ def test_path_params_delete(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_patch(self, client: Hanzo) -> None: vertex_ai = client.vertex_ai.patch( @@ -192,7 +192,7 @@ def test_method_patch(self, client: Hanzo) -> None: ) assert_matches_type(object, vertex_ai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_patch(self, client: Hanzo) -> None: response = client.vertex_ai.with_raw_response.patch( @@ -204,7 +204,7 @@ def test_raw_response_patch(self, client: Hanzo) -> None: vertex_ai = response.parse() assert_matches_type(object, vertex_ai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_patch(self, client: Hanzo) -> None: with client.vertex_ai.with_streaming_response.patch( @@ -218,7 +218,7 @@ def test_streaming_response_patch(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_patch(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -232,7 +232,7 @@ class TestAsyncVertexAI: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: vertex_ai = await async_client.vertex_ai.create( @@ -240,7 +240,7 @@ async def test_method_create(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, vertex_ai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.vertex_ai.with_raw_response.create( @@ -252,7 +252,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: vertex_ai = await response.parse() assert_matches_type(object, vertex_ai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.vertex_ai.with_streaming_response.create( @@ -266,7 +266,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_create(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -274,7 +274,7 @@ async def test_path_params_create(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: vertex_ai = await async_client.vertex_ai.retrieve( @@ -282,7 +282,7 @@ async def test_method_retrieve(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, vertex_ai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: response = await async_client.vertex_ai.with_raw_response.retrieve( @@ -294,7 +294,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None: vertex_ai = await response.parse() assert_matches_type(object, vertex_ai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> None: async with async_client.vertex_ai.with_streaming_response.retrieve( @@ -308,7 +308,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -316,7 +316,7 @@ async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncHanzo) -> None: vertex_ai = await async_client.vertex_ai.update( @@ -324,7 +324,7 @@ async def test_method_update(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, vertex_ai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: response = await async_client.vertex_ai.with_raw_response.update( @@ -336,7 +336,7 @@ async def test_raw_response_update(self, async_client: AsyncHanzo) -> None: vertex_ai = await response.parse() assert_matches_type(object, vertex_ai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None: async with async_client.vertex_ai.with_streaming_response.update( @@ -350,7 +350,7 @@ async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -358,7 +358,7 @@ async def test_path_params_update(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncHanzo) -> None: vertex_ai = await async_client.vertex_ai.delete( @@ -366,7 +366,7 @@ async def test_method_delete(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, vertex_ai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: response = await async_client.vertex_ai.with_raw_response.delete( @@ -378,7 +378,7 @@ async def test_raw_response_delete(self, async_client: AsyncHanzo) -> None: vertex_ai = await response.parse() assert_matches_type(object, vertex_ai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None: async with async_client.vertex_ai.with_streaming_response.delete( @@ -392,7 +392,7 @@ async def test_streaming_response_delete(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): @@ -400,7 +400,7 @@ async def test_path_params_delete(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_patch(self, async_client: AsyncHanzo) -> None: vertex_ai = await async_client.vertex_ai.patch( @@ -408,7 +408,7 @@ async def test_method_patch(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, vertex_ai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_patch(self, async_client: AsyncHanzo) -> None: response = await async_client.vertex_ai.with_raw_response.patch( @@ -420,7 +420,7 @@ async def test_raw_response_patch(self, async_client: AsyncHanzo) -> None: vertex_ai = await response.parse() assert_matches_type(object, vertex_ai, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_patch(self, async_client: AsyncHanzo) -> None: async with async_client.vertex_ai.with_streaming_response.patch( @@ -434,7 +434,7 @@ async def test_streaming_response_patch(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_patch(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `endpoint` but received ''"): diff --git a/tests/api_resources/threads/test_messages.py b/tests/api_resources/threads/test_messages.py index 080c51d4..27405c60 100644 --- a/tests/api_resources/threads/test_messages.py +++ b/tests/api_resources/threads/test_messages.py @@ -16,7 +16,7 @@ class TestMessages: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: message = client.threads.messages.create( @@ -24,7 +24,7 @@ def test_method_create(self, client: Hanzo) -> None: ) assert_matches_type(object, message, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.threads.messages.with_raw_response.create( @@ -36,7 +36,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: message = response.parse() assert_matches_type(object, message, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.threads.messages.with_streaming_response.create( @@ -50,7 +50,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_create(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): @@ -58,7 +58,7 @@ def test_path_params_create(self, client: Hanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Hanzo) -> None: message = client.threads.messages.list( @@ -66,7 +66,7 @@ def test_method_list(self, client: Hanzo) -> None: ) assert_matches_type(object, message, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_list(self, client: Hanzo) -> None: response = client.threads.messages.with_raw_response.list( @@ -78,7 +78,7 @@ def test_raw_response_list(self, client: Hanzo) -> None: message = response.parse() assert_matches_type(object, message, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_list(self, client: Hanzo) -> None: with client.threads.messages.with_streaming_response.list( @@ -92,7 +92,7 @@ def test_streaming_response_list(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_list(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): @@ -106,7 +106,7 @@ class TestAsyncMessages: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: message = await async_client.threads.messages.create( @@ -114,7 +114,7 @@ async def test_method_create(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, message, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.threads.messages.with_raw_response.create( @@ -126,7 +126,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: message = await response.parse() assert_matches_type(object, message, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.threads.messages.with_streaming_response.create( @@ -140,7 +140,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_create(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): @@ -148,7 +148,7 @@ async def test_path_params_create(self, async_client: AsyncHanzo) -> None: "", ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncHanzo) -> None: message = await async_client.threads.messages.list( @@ -156,7 +156,7 @@ async def test_method_list(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, message, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: response = await async_client.threads.messages.with_raw_response.list( @@ -168,7 +168,7 @@ async def test_raw_response_list(self, async_client: AsyncHanzo) -> None: message = await response.parse() assert_matches_type(object, message, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: async with async_client.threads.messages.with_streaming_response.list( @@ -182,7 +182,7 @@ async def test_streaming_response_list(self, async_client: AsyncHanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_list(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): diff --git a/tests/api_resources/threads/test_runs.py b/tests/api_resources/threads/test_runs.py index e3a3b181..6b0d05bb 100644 --- a/tests/api_resources/threads/test_runs.py +++ b/tests/api_resources/threads/test_runs.py @@ -16,7 +16,7 @@ class TestRuns: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_create(self, client: Hanzo) -> None: run = client.threads.runs.create( @@ -24,7 +24,7 @@ def test_method_create(self, client: Hanzo) -> None: ) assert_matches_type(object, run, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_raw_response_create(self, client: Hanzo) -> None: response = client.threads.runs.with_raw_response.create( @@ -36,7 +36,7 @@ def test_raw_response_create(self, client: Hanzo) -> None: run = response.parse() assert_matches_type(object, run, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_streaming_response_create(self, client: Hanzo) -> None: with client.threads.runs.with_streaming_response.create( @@ -50,7 +50,7 @@ def test_streaming_response_create(self, client: Hanzo) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_path_params_create(self, client: Hanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): @@ -64,7 +64,7 @@ class TestAsyncRuns: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncHanzo) -> None: run = await async_client.threads.runs.create( @@ -72,7 +72,7 @@ async def test_method_create(self, async_client: AsyncHanzo) -> None: ) assert_matches_type(object, run, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: response = await async_client.threads.runs.with_raw_response.create( @@ -84,7 +84,7 @@ async def test_raw_response_create(self, async_client: AsyncHanzo) -> None: run = await response.parse() assert_matches_type(object, run, path=["response"]) - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None: async with async_client.threads.runs.with_streaming_response.create( @@ -98,7 +98,7 @@ async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip() + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_path_params_create(self, async_client: AsyncHanzo) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `thread_id` but received ''"): diff --git a/tests/test_client.py b/tests/test_client.py index ccb0dbc4..227a03cf 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -6,13 +6,10 @@ import os import sys import json -import time import asyncio import inspect -import subprocess import tracemalloc from typing import Any, Union, cast -from textwrap import dedent from unittest import mock from typing_extensions import Literal @@ -23,14 +20,17 @@ from hanzoai import Hanzo, AsyncHanzo, APIResponseValidationError from hanzoai._types import Omit +from hanzoai._utils import asyncify from hanzoai._models import BaseModel, FinalRequestOptions from hanzoai._exceptions import HanzoError, APIStatusError, APITimeoutError, APIResponseValidationError from hanzoai._base_client import ( DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, + OtherPlatform, DefaultHttpxClient, DefaultAsyncHttpxClient, + get_platform, make_request_options, ) @@ -1637,50 +1637,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: assert response.http_request.headers.get("x-stainless-retry-count") == "42" - def test_get_platform(self) -> None: - # A previous implementation of asyncify could leave threads unterminated when - # used with nest_asyncio. - # - # Since nest_asyncio.apply() is global and cannot be un-applied, this - # test is run in a separate process to avoid affecting other tests. - test_code = dedent(""" - import asyncio - import nest_asyncio - import threading - - from hanzoai._utils import asyncify - from hanzoai._base_client import get_platform - - async def test_main() -> None: - result = await asyncify(get_platform)() - print(result) - for thread in threading.enumerate(): - print(thread.name) - - nest_asyncio.apply() - asyncio.run(test_main()) - """) - with subprocess.Popen( - [sys.executable, "-c", test_code], - text=True, - ) as process: - timeout = 10 # seconds - - start_time = time.monotonic() - while True: - return_code = process.poll() - if return_code is not None: - if return_code != 0: - raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code") - - # success - break - - if time.monotonic() - start_time > timeout: - process.kill() - raise AssertionError("calling get_platform using asyncify resulted in a hung process") - - time.sleep(0.1) + async def test_get_platform(self) -> None: + platform = await asyncify(get_platform)() + assert isinstance(platform, (str, OtherPlatform)) async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly diff --git a/tests/test_models.py b/tests/test_models.py index 8c0e33c1..e846633e 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -1,5 +1,5 @@ import json -from typing import Any, Dict, List, Union, Optional, cast +from typing import TYPE_CHECKING, Any, Dict, List, Union, Optional, cast from datetime import datetime, timezone from typing_extensions import Literal, Annotated, TypeAliasType @@ -8,7 +8,7 @@ from pydantic import Field from hanzoai._utils import PropertyInfo -from hanzoai._compat import PYDANTIC_V2, parse_obj, model_dump, model_json +from hanzoai._compat import PYDANTIC_V1, parse_obj, model_dump, model_json from hanzoai._models import BaseModel, construct_type @@ -294,12 +294,12 @@ class Model(BaseModel): assert cast(bool, m.foo) is True m = Model.construct(foo={"name": 3}) - if PYDANTIC_V2: - assert isinstance(m.foo, Submodel1) - assert m.foo.name == 3 # type: ignore - else: + if PYDANTIC_V1: assert isinstance(m.foo, Submodel2) assert m.foo.name == "3" + else: + assert isinstance(m.foo, Submodel1) + assert m.foo.name == 3 # type: ignore def test_list_of_unions() -> None: @@ -426,10 +426,10 @@ class Model(BaseModel): expected = datetime(2019, 12, 27, 18, 11, 19, 117000, tzinfo=timezone.utc) - if PYDANTIC_V2: - expected_json = '{"created_at":"2019-12-27T18:11:19.117000Z"}' - else: + if PYDANTIC_V1: expected_json = '{"created_at": "2019-12-27T18:11:19.117000+00:00"}' + else: + expected_json = '{"created_at":"2019-12-27T18:11:19.117000Z"}' model = Model.construct(created_at="2019-12-27T18:11:19.117Z") assert model.created_at == expected @@ -531,7 +531,7 @@ class Model2(BaseModel): assert m4.to_dict(mode="python") == {"created_at": datetime.fromisoformat(time_str)} assert m4.to_dict(mode="json") == {"created_at": time_str} - if not PYDANTIC_V2: + if PYDANTIC_V1: with pytest.raises(ValueError, match="warnings is only supported in Pydantic v2"): m.to_dict(warnings=False) @@ -556,7 +556,7 @@ class Model(BaseModel): assert m3.model_dump() == {"foo": None} assert m3.model_dump(exclude_none=True) == {} - if not PYDANTIC_V2: + if PYDANTIC_V1: with pytest.raises(ValueError, match="round_trip is only supported in Pydantic v2"): m.model_dump(round_trip=True) @@ -580,10 +580,10 @@ class Model(BaseModel): assert json.loads(m.to_json()) == {"FOO": "hello"} assert json.loads(m.to_json(use_api_names=False)) == {"foo": "hello"} - if PYDANTIC_V2: - assert m.to_json(indent=None) == '{"FOO":"hello"}' - else: + if PYDANTIC_V1: assert m.to_json(indent=None) == '{"FOO": "hello"}' + else: + assert m.to_json(indent=None) == '{"FOO":"hello"}' m2 = Model() assert json.loads(m2.to_json()) == {} @@ -595,7 +595,7 @@ class Model(BaseModel): assert json.loads(m3.to_json()) == {"FOO": None} assert json.loads(m3.to_json(exclude_none=True)) == {} - if not PYDANTIC_V2: + if PYDANTIC_V1: with pytest.raises(ValueError, match="warnings is only supported in Pydantic v2"): m.to_json(warnings=False) @@ -622,7 +622,7 @@ class Model(BaseModel): assert json.loads(m3.model_dump_json()) == {"foo": None} assert json.loads(m3.model_dump_json(exclude_none=True)) == {} - if not PYDANTIC_V2: + if PYDANTIC_V1: with pytest.raises(ValueError, match="round_trip is only supported in Pydantic v2"): m.model_dump_json(round_trip=True) @@ -679,12 +679,12 @@ class B(BaseModel): ) assert isinstance(m, A) assert m.type == "a" - if PYDANTIC_V2: - assert m.data == 100 # type: ignore[comparison-overlap] - else: + if PYDANTIC_V1: # pydantic v1 automatically converts inputs to strings # if the expected type is a str assert m.data == "100" + else: + assert m.data == 100 # type: ignore[comparison-overlap] def test_discriminated_unions_unknown_variant() -> None: @@ -768,12 +768,12 @@ class B(BaseModel): ) assert isinstance(m, A) assert m.foo_type == "a" - if PYDANTIC_V2: - assert m.data == 100 # type: ignore[comparison-overlap] - else: + if PYDANTIC_V1: # pydantic v1 automatically converts inputs to strings # if the expected type is a str assert m.data == "100" + else: + assert m.data == 100 # type: ignore[comparison-overlap] def test_discriminated_unions_overlapping_discriminators_invalid_data() -> None: @@ -833,7 +833,7 @@ class B(BaseModel): assert UnionType.__discriminator__ is discriminator -@pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1") +@pytest.mark.skipif(PYDANTIC_V1, reason="TypeAliasType is not supported in Pydantic v1") def test_type_alias_type() -> None: Alias = TypeAliasType("Alias", str) # pyright: ignore @@ -849,7 +849,7 @@ class Model(BaseModel): assert m.union == "bar" -@pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1") +@pytest.mark.skipif(PYDANTIC_V1, reason="TypeAliasType is not supported in Pydantic v1") def test_field_named_cls() -> None: class Model(BaseModel): cls: str @@ -934,3 +934,30 @@ class Type2(BaseModel): ) assert isinstance(model, Type1) assert isinstance(model.value, InnerType2) + + +@pytest.mark.skipif(PYDANTIC_V1, reason="this is only supported in pydantic v2 for now") +def test_extra_properties() -> None: + class Item(BaseModel): + prop: int + + class Model(BaseModel): + __pydantic_extra__: Dict[str, Item] = Field(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + other: str + + if TYPE_CHECKING: + + def __getattr__(self, attr: str) -> Item: ... + + model = construct_type( + type_=Model, + value={ + "a": {"prop": 1}, + "other": "foo", + }, + ) + assert isinstance(model, Model) + assert model.a.prop == 1 + assert isinstance(model.a, Item) + assert model.other == "foo" diff --git a/tests/test_transform.py b/tests/test_transform.py index a1ca361b..6a43380c 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -15,7 +15,7 @@ parse_datetime, async_transform as _async_transform, ) -from hanzoai._compat import PYDANTIC_V2 +from hanzoai._compat import PYDANTIC_V1 from hanzoai._models import BaseModel _T = TypeVar("_T") @@ -189,7 +189,7 @@ class DateModel(BaseModel): @pytest.mark.asyncio async def test_iso8601_format(use_async: bool) -> None: dt = datetime.fromisoformat("2023-02-23T14:16:36.337692+00:00") - tz = "Z" if PYDANTIC_V2 else "+00:00" + tz = "+00:00" if PYDANTIC_V1 else "Z" assert await transform({"foo": dt}, DatetimeDict, use_async) == {"foo": "2023-02-23T14:16:36.337692+00:00"} # type: ignore[comparison-overlap] assert await transform(DatetimeModel(foo=dt), Any, use_async) == {"foo": "2023-02-23T14:16:36.337692" + tz} # type: ignore[comparison-overlap] @@ -297,11 +297,11 @@ async def test_pydantic_unknown_field(use_async: bool) -> None: @pytest.mark.asyncio async def test_pydantic_mismatched_types(use_async: bool) -> None: model = MyModel.construct(foo=True) - if PYDANTIC_V2: + if PYDANTIC_V1: + params = await transform(model, Any, use_async) + else: with pytest.warns(UserWarning): params = await transform(model, Any, use_async) - else: - params = await transform(model, Any, use_async) assert cast(Any, params) == {"foo": True} @@ -309,11 +309,11 @@ async def test_pydantic_mismatched_types(use_async: bool) -> None: @pytest.mark.asyncio async def test_pydantic_mismatched_object_type(use_async: bool) -> None: model = MyModel.construct(foo=MyModel.construct(hello="world")) - if PYDANTIC_V2: + if PYDANTIC_V1: + params = await transform(model, Any, use_async) + else: with pytest.warns(UserWarning): params = await transform(model, Any, use_async) - else: - params = await transform(model, Any, use_async) assert cast(Any, params) == {"foo": {"hello": "world"}} diff --git a/tests/test_utils/test_datetime_parse.py b/tests/test_utils/test_datetime_parse.py new file mode 100644 index 00000000..467cecea --- /dev/null +++ b/tests/test_utils/test_datetime_parse.py @@ -0,0 +1,110 @@ +""" +Copied from https://github.com/pydantic/pydantic/blob/v1.10.22/tests/test_datetime_parse.py +with modifications so it works without pydantic v1 imports. +""" + +from typing import Type, Union +from datetime import date, datetime, timezone, timedelta + +import pytest + +from hanzoai._utils import parse_date, parse_datetime + + +def create_tz(minutes: int) -> timezone: + return timezone(timedelta(minutes=minutes)) + + +@pytest.mark.parametrize( + "value,result", + [ + # Valid inputs + ("1494012444.883309", date(2017, 5, 5)), + (b"1494012444.883309", date(2017, 5, 5)), + (1_494_012_444.883_309, date(2017, 5, 5)), + ("1494012444", date(2017, 5, 5)), + (1_494_012_444, date(2017, 5, 5)), + (0, date(1970, 1, 1)), + ("2012-04-23", date(2012, 4, 23)), + (b"2012-04-23", date(2012, 4, 23)), + ("2012-4-9", date(2012, 4, 9)), + (date(2012, 4, 9), date(2012, 4, 9)), + (datetime(2012, 4, 9, 12, 15), date(2012, 4, 9)), + # Invalid inputs + ("x20120423", ValueError), + ("2012-04-56", ValueError), + (19_999_999_999, date(2603, 10, 11)), # just before watershed + (20_000_000_001, date(1970, 8, 20)), # just after watershed + (1_549_316_052, date(2019, 2, 4)), # nowish in s + (1_549_316_052_104, date(2019, 2, 4)), # nowish in ms + (1_549_316_052_104_324, date(2019, 2, 4)), # nowish in μs + (1_549_316_052_104_324_096, date(2019, 2, 4)), # nowish in ns + ("infinity", date(9999, 12, 31)), + ("inf", date(9999, 12, 31)), + (float("inf"), date(9999, 12, 31)), + ("infinity ", date(9999, 12, 31)), + (int("1" + "0" * 100), date(9999, 12, 31)), + (1e1000, date(9999, 12, 31)), + ("-infinity", date(1, 1, 1)), + ("-inf", date(1, 1, 1)), + ("nan", ValueError), + ], +) +def test_date_parsing(value: Union[str, bytes, int, float], result: Union[date, Type[Exception]]) -> None: + if type(result) == type and issubclass(result, Exception): # pyright: ignore[reportUnnecessaryIsInstance] + with pytest.raises(result): + parse_date(value) + else: + assert parse_date(value) == result + + +@pytest.mark.parametrize( + "value,result", + [ + # Valid inputs + # values in seconds + ("1494012444.883309", datetime(2017, 5, 5, 19, 27, 24, 883_309, tzinfo=timezone.utc)), + (1_494_012_444.883_309, datetime(2017, 5, 5, 19, 27, 24, 883_309, tzinfo=timezone.utc)), + ("1494012444", datetime(2017, 5, 5, 19, 27, 24, tzinfo=timezone.utc)), + (b"1494012444", datetime(2017, 5, 5, 19, 27, 24, tzinfo=timezone.utc)), + (1_494_012_444, datetime(2017, 5, 5, 19, 27, 24, tzinfo=timezone.utc)), + # values in ms + ("1494012444000.883309", datetime(2017, 5, 5, 19, 27, 24, 883, tzinfo=timezone.utc)), + ("-1494012444000.883309", datetime(1922, 8, 29, 4, 32, 35, 999117, tzinfo=timezone.utc)), + (1_494_012_444_000, datetime(2017, 5, 5, 19, 27, 24, tzinfo=timezone.utc)), + ("2012-04-23T09:15:00", datetime(2012, 4, 23, 9, 15)), + ("2012-4-9 4:8:16", datetime(2012, 4, 9, 4, 8, 16)), + ("2012-04-23T09:15:00Z", datetime(2012, 4, 23, 9, 15, 0, 0, timezone.utc)), + ("2012-4-9 4:8:16-0320", datetime(2012, 4, 9, 4, 8, 16, 0, create_tz(-200))), + ("2012-04-23T10:20:30.400+02:30", datetime(2012, 4, 23, 10, 20, 30, 400_000, create_tz(150))), + ("2012-04-23T10:20:30.400+02", datetime(2012, 4, 23, 10, 20, 30, 400_000, create_tz(120))), + ("2012-04-23T10:20:30.400-02", datetime(2012, 4, 23, 10, 20, 30, 400_000, create_tz(-120))), + (b"2012-04-23T10:20:30.400-02", datetime(2012, 4, 23, 10, 20, 30, 400_000, create_tz(-120))), + (datetime(2017, 5, 5), datetime(2017, 5, 5)), + (0, datetime(1970, 1, 1, 0, 0, 0, tzinfo=timezone.utc)), + # Invalid inputs + ("x20120423091500", ValueError), + ("2012-04-56T09:15:90", ValueError), + ("2012-04-23T11:05:00-25:00", ValueError), + (19_999_999_999, datetime(2603, 10, 11, 11, 33, 19, tzinfo=timezone.utc)), # just before watershed + (20_000_000_001, datetime(1970, 8, 20, 11, 33, 20, 1000, tzinfo=timezone.utc)), # just after watershed + (1_549_316_052, datetime(2019, 2, 4, 21, 34, 12, 0, tzinfo=timezone.utc)), # nowish in s + (1_549_316_052_104, datetime(2019, 2, 4, 21, 34, 12, 104_000, tzinfo=timezone.utc)), # nowish in ms + (1_549_316_052_104_324, datetime(2019, 2, 4, 21, 34, 12, 104_324, tzinfo=timezone.utc)), # nowish in μs + (1_549_316_052_104_324_096, datetime(2019, 2, 4, 21, 34, 12, 104_324, tzinfo=timezone.utc)), # nowish in ns + ("infinity", datetime(9999, 12, 31, 23, 59, 59, 999999)), + ("inf", datetime(9999, 12, 31, 23, 59, 59, 999999)), + ("inf ", datetime(9999, 12, 31, 23, 59, 59, 999999)), + (1e50, datetime(9999, 12, 31, 23, 59, 59, 999999)), + (float("inf"), datetime(9999, 12, 31, 23, 59, 59, 999999)), + ("-infinity", datetime(1, 1, 1, 0, 0)), + ("-inf", datetime(1, 1, 1, 0, 0)), + ("nan", ValueError), + ], +) +def test_datetime_parsing(value: Union[str, bytes, int, float], result: Union[datetime, Type[Exception]]) -> None: + if type(result) == type and issubclass(result, Exception): # pyright: ignore[reportUnnecessaryIsInstance] + with pytest.raises(result): + parse_datetime(value) + else: + assert parse_datetime(value) == result diff --git a/tests/utils.py b/tests/utils.py index 9434cf5b..c9e2e5b3 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -4,7 +4,7 @@ import inspect import traceback import contextlib -from typing import Any, TypeVar, Iterator, cast +from typing import Any, TypeVar, Iterator, Sequence, cast from datetime import date, datetime from typing_extensions import Literal, get_args, get_origin, assert_type @@ -15,10 +15,11 @@ is_list_type, is_union_type, extract_type_arg, + is_sequence_type, is_annotated_type, is_type_alias_type, ) -from hanzoai._compat import PYDANTIC_V2, field_outer_type, get_model_fields +from hanzoai._compat import PYDANTIC_V1, field_outer_type, get_model_fields from hanzoai._models import BaseModel BaseModelT = TypeVar("BaseModelT", bound=BaseModel) @@ -27,12 +28,12 @@ def assert_matches_model(model: type[BaseModelT], value: BaseModelT, *, path: list[str]) -> bool: for name, field in get_model_fields(model).items(): field_value = getattr(value, name) - if PYDANTIC_V2: - allow_none = False - else: + if PYDANTIC_V1: # in v1 nullability was structured differently # https://docs.pydantic.dev/2.0/migration/#required-optional-and-nullable-fields allow_none = getattr(field, "allow_none", False) + else: + allow_none = False assert_matches_type( field_outer_type(field), @@ -71,6 +72,13 @@ def assert_matches_type( if is_list_type(type_): return _assert_list_type(type_, value) + if is_sequence_type(type_): + assert isinstance(value, Sequence) + inner_type = get_args(type_)[0] + for entry in value: # type: ignore + assert_type(inner_type, entry) # type: ignore + return + if origin == str: assert isinstance(value, str) elif origin == int: From 587462304f0473bf5e527efe54c5d6b8a0f53c2b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 6 Sep 2025 13:32:16 +0000 Subject: [PATCH 33/41] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7c3c5481..c1c3aba6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 188 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hanzo-industries-inc%2Fhanzo-ai-2d6e1036fb1eea7e95cafc281141ead9ef77796e43711b17edccaab67c5e791a.yml openapi_spec_hash: 12501774d0127be4ec1812d613a58e97 -config_hash: 5b61cc8c6c31c071a08578ad825b421d +config_hash: e927bafd76a1eace11894efc3517d245 From a05f6527170be1bd2d2c87bcd7f64057f77e8640 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Sep 2025 01:30:58 +0000 Subject: [PATCH 34/41] feat(api): api update --- .stats.yml | 4 ++-- requirements-dev.lock | 7 +++++-- requirements.lock | 7 +++++-- src/hanzoai/_models.py | 14 ++++++++++---- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index c1c3aba6..310f6103 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 188 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hanzo-industries-inc%2Fhanzo-ai-2d6e1036fb1eea7e95cafc281141ead9ef77796e43711b17edccaab67c5e791a.yml -openapi_spec_hash: 12501774d0127be4ec1812d613a58e97 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hanzo-industries-inc%2Fhanzo-ai-10a8fe872c67396add3ebc3a10252df5bcd6d0f4e9a255d923875a806b2f1609.yml +openapi_spec_hash: 495ad4b04c4dd929e9566b6a099ff931 config_hash: e927bafd76a1eace11894efc3517d245 diff --git a/requirements-dev.lock b/requirements-dev.lock index 0cd84f5a..65a6ff7e 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -88,9 +88,9 @@ pluggy==1.5.0 propcache==0.3.1 # via aiohttp # via yarl -pydantic==2.10.3 +pydantic==2.11.9 # via hanzoai -pydantic-core==2.27.1 +pydantic-core==2.33.2 # via pydantic pygments==2.18.0 # via rich @@ -126,6 +126,9 @@ typing-extensions==4.12.2 # via pydantic # via pydantic-core # via pyright + # via typing-inspection +typing-inspection==0.4.1 + # via pydantic virtualenv==20.24.5 # via nox yarl==1.20.0 diff --git a/requirements.lock b/requirements.lock index 17b05d07..72261253 100644 --- a/requirements.lock +++ b/requirements.lock @@ -55,9 +55,9 @@ multidict==6.4.4 propcache==0.3.1 # via aiohttp # via yarl -pydantic==2.10.3 +pydantic==2.11.9 # via hanzoai -pydantic-core==2.27.1 +pydantic-core==2.33.2 # via pydantic sniffio==1.3.0 # via anyio @@ -68,5 +68,8 @@ typing-extensions==4.12.2 # via multidict # via pydantic # via pydantic-core + # via typing-inspection +typing-inspection==0.4.1 + # via pydantic yarl==1.20.0 # via aiohttp diff --git a/src/hanzoai/_models.py b/src/hanzoai/_models.py index 3a6017ef..6a3cd1d2 100644 --- a/src/hanzoai/_models.py +++ b/src/hanzoai/_models.py @@ -256,7 +256,7 @@ def model_dump( mode: Literal["json", "python"] | str = "python", include: IncEx | None = None, exclude: IncEx | None = None, - by_alias: bool = False, + by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, @@ -264,6 +264,7 @@ def model_dump( warnings: bool | Literal["none", "warn", "error"] = True, context: dict[str, Any] | None = None, serialize_as_any: bool = False, + fallback: Callable[[Any], Any] | None = None, ) -> dict[str, Any]: """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump @@ -295,10 +296,12 @@ def model_dump( raise ValueError("context is only supported in Pydantic v2") if serialize_as_any != False: raise ValueError("serialize_as_any is only supported in Pydantic v2") + if fallback is not None: + raise ValueError("fallback is only supported in Pydantic v2") dumped = super().dict( # pyright: ignore[reportDeprecated] include=include, exclude=exclude, - by_alias=by_alias, + by_alias=by_alias if by_alias is not None else False, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, exclude_none=exclude_none, @@ -313,13 +316,14 @@ def model_dump_json( indent: int | None = None, include: IncEx | None = None, exclude: IncEx | None = None, - by_alias: bool = False, + by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal["none", "warn", "error"] = True, context: dict[str, Any] | None = None, + fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False, ) -> str: """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json @@ -348,11 +352,13 @@ def model_dump_json( raise ValueError("context is only supported in Pydantic v2") if serialize_as_any != False: raise ValueError("serialize_as_any is only supported in Pydantic v2") + if fallback is not None: + raise ValueError("fallback is only supported in Pydantic v2") return super().json( # type: ignore[reportDeprecated] indent=indent, include=include, exclude=exclude, - by_alias=by_alias, + by_alias=by_alias if by_alias is not None else False, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, exclude_none=exclude_none, From 7d7c3cee07ff188e208df8fc14df73d9bbc5827e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 03:43:45 +0000 Subject: [PATCH 35/41] chore(internal): codegen related update --- scripts/bootstrap | 14 +- src/hanzoai/__init__.py | 4 +- src/hanzoai/_base_client.py | 18 +- src/hanzoai/_client.py | 28 +- src/hanzoai/_qs.py | 14 +- src/hanzoai/_types.py | 29 +- src/hanzoai/_utils/_transform.py | 4 +- src/hanzoai/_utils/_utils.py | 8 +- src/hanzoai/resources/active.py | 6 +- src/hanzoai/resources/add.py | 6 +- src/hanzoai/resources/anthropic.py | 22 +- src/hanzoai/resources/assemblyai.py | 22 +- src/hanzoai/resources/assistants.py | 14 +- src/hanzoai/resources/audio/speech.py | 6 +- src/hanzoai/resources/audio/transcriptions.py | 6 +- src/hanzoai/resources/azure.py | 22 +- src/hanzoai/resources/batches/batches.py | 58 +-- src/hanzoai/resources/batches/cancel.py | 10 +- src/hanzoai/resources/bedrock.py | 22 +- src/hanzoai/resources/budget.py | 90 ++-- src/hanzoai/resources/cache/cache.py | 14 +- src/hanzoai/resources/cache/redis.py | 6 +- src/hanzoai/resources/chat/completions.py | 10 +- src/hanzoai/resources/cohere.py | 22 +- src/hanzoai/resources/completions.py | 10 +- .../resources/config/pass_through_endpoint.py | 22 +- src/hanzoai/resources/credentials.py | 22 +- src/hanzoai/resources/customer.py | 102 ++--- src/hanzoai/resources/delete.py | 6 +- src/hanzoai/resources/embeddings.py | 10 +- src/hanzoai/resources/engines/chat.py | 6 +- src/hanzoai/resources/engines/engines.py | 10 +- src/hanzoai/resources/eu_assemblyai.py | 22 +- src/hanzoai/resources/files/content.py | 6 +- src/hanzoai/resources/files/files.py | 26 +- .../resources/fine_tuning/jobs/cancel.py | 6 +- .../resources/fine_tuning/jobs/jobs.py | 42 +- src/hanzoai/resources/gemini.py | 22 +- src/hanzoai/resources/global_/spend.py | 54 +-- src/hanzoai/resources/guardrails.py | 6 +- src/hanzoai/resources/health.py | 26 +- src/hanzoai/resources/images/generations.py | 6 +- src/hanzoai/resources/key/key.py | 430 +++++++++--------- src/hanzoai/resources/langfuse.py | 22 +- src/hanzoai/resources/model/info.py | 10 +- src/hanzoai/resources/model/model.py | 10 +- src/hanzoai/resources/model/update.py | 34 +- src/hanzoai/resources/model_group.py | 10 +- src/hanzoai/resources/models.py | 14 +- src/hanzoai/resources/moderations.py | 6 +- .../resources/openai/deployments/chat.py | 6 +- .../openai/deployments/deployments.py | 10 +- src/hanzoai/resources/openai/openai.py | 22 +- src/hanzoai/resources/organization/info.py | 10 +- .../resources/organization/organization.py | 130 +++--- src/hanzoai/resources/provider.py | 6 +- src/hanzoai/resources/rerank.py | 14 +- .../resources/responses/input_items.py | 6 +- src/hanzoai/resources/responses/responses.py | 14 +- src/hanzoai/resources/routes.py | 6 +- src/hanzoai/resources/settings.py | 6 +- src/hanzoai/resources/spend.py | 54 +-- src/hanzoai/resources/team/callback.py | 18 +- src/hanzoai/resources/team/model.py | 10 +- src/hanzoai/resources/team/team.py | 218 ++++----- src/hanzoai/resources/test.py | 6 +- src/hanzoai/resources/threads/messages.py | 10 +- src/hanzoai/resources/threads/runs.py | 6 +- src/hanzoai/resources/threads/threads.py | 10 +- src/hanzoai/resources/user.py | 250 +++++----- src/hanzoai/resources/utils.py | 22 +- src/hanzoai/resources/vertex_ai.py | 22 +- tests/test_transform.py | 11 +- 73 files changed, 1143 insertions(+), 1119 deletions(-) diff --git a/scripts/bootstrap b/scripts/bootstrap index e84fe62c..b430fee3 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -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 diff --git a/src/hanzoai/__init__.py b/src/hanzoai/__init__.py index bed50af4..a48f4b27 100644 --- a/src/hanzoai/__init__.py +++ b/src/hanzoai/__init__.py @@ -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 @@ "ProxiesTypes", "NotGiven", "NOT_GIVEN", + "not_given", "Omit", + "omit", "HanzoError", "APIError", "APIStatusError", diff --git a/src/hanzoai/_base_client.py b/src/hanzoai/_base_client.py index e20c03de..13615c8c 100644 --- a/src/hanzoai/_base_client.py +++ b/src/hanzoai/_base_client.py @@ -42,7 +42,6 @@ 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 @@ 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 @@ def __init__( 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 @@ def _maybe_override_cast_to(self, cast_to: type[ResponseT], options: FinalReques # 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 @@ def __init__( 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 @@ def __init__( 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 = {} diff --git a/src/hanzoai/_client.py b/src/hanzoai/_client.py index 4c6c1a2b..4c593472 100644 --- a/src/hanzoai/_client.py +++ b/src/hanzoai/_client.py @@ -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 @@ from . import _exceptions from ._qs import Querystring from ._types import ( - NOT_GIVEN, Body, Omit, Query, @@ -21,6 +20,7 @@ Transport, ProxiesTypes, RequestOptions, + not_given, ) from ._utils import is_given, get_async_library from ._version import __version__ @@ -168,9 +168,9 @@ def __init__( 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 @@ def copy( 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 @@ def get_home( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def __init__( 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 @@ def copy( 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 @@ async def get_home( extra_headers: Headers | None = None, extra_query: Query | 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( diff --git a/src/hanzoai/_qs.py b/src/hanzoai/_qs.py index 274320ca..ada6fd3f 100644 --- a/src/hanzoai/_qs.py +++ b/src/hanzoai/_qs.py @@ -4,7 +4,7 @@ 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 @@ def stringify( 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 @@ def stringify_items( 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 @@ def __init__( 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 diff --git a/src/hanzoai/_types.py b/src/hanzoai/_types.py index 7d34e556..b81cfc77 100644 --- a/src/hanzoai/_types.py +++ b/src/hanzoai/_types.py @@ -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 @@ def __repr__(self) -> str: 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 @@ def __bool__(self) -> Literal[False]: return False +omit = Omit() + + @runtime_checkable class ModelBuilderProtocol(Protocol): @classmethod diff --git a/src/hanzoai/_utils/_transform.py b/src/hanzoai/_utils/_transform.py index c19124f0..52075492 100644 --- a/src/hanzoai/_utils/_transform.py +++ b/src/hanzoai/_utils/_transform.py @@ -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 diff --git a/src/hanzoai/_utils/_utils.py b/src/hanzoai/_utils/_utils.py index f0818595..50d59269 100644 --- a/src/hanzoai/_utils/_utils.py +++ b/src/hanzoai/_utils/_utils.py @@ -21,7 +21,7 @@ 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. diff --git a/src/hanzoai/resources/active.py b/src/hanzoai/resources/active.py index be9eaef9..224400e5 100644 --- a/src/hanzoai/resources/active.py +++ b/src/hanzoai/resources/active.py @@ -4,7 +4,7 @@ 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 @@ def list_callbacks( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def list_callbacks( extra_headers: Headers | None = None, extra_query: Query | 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 diff --git a/src/hanzoai/resources/add.py b/src/hanzoai/resources/add.py index eb775af7..f20781bf 100644 --- a/src/hanzoai/resources/add.py +++ b/src/hanzoai/resources/add.py @@ -5,7 +5,7 @@ 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 @@ def add_allowed_ip( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def add_allowed_ip( extra_headers: Headers | None = None, extra_query: Query | 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 diff --git a/src/hanzoai/resources/anthropic.py b/src/hanzoai/resources/anthropic.py index 8c7faac9..c373d061 100644 --- a/src/hanzoai/resources/anthropic.py +++ b/src/hanzoai/resources/anthropic.py @@ -4,7 +4,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def modify( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def modify( extra_headers: Headers | None = None, extra_query: Query | 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) diff --git a/src/hanzoai/resources/assemblyai.py b/src/hanzoai/resources/assemblyai.py index 20fcf8aa..84a4be3a 100644 --- a/src/hanzoai/resources/assemblyai.py +++ b/src/hanzoai/resources/assemblyai.py @@ -4,7 +4,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def patch( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def patch( extra_headers: Headers | None = None, extra_query: Query | 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 diff --git a/src/hanzoai/resources/assistants.py b/src/hanzoai/resources/assistants.py index 1dcada4b..e6f7a982 100644 --- a/src/hanzoai/resources/assistants.py +++ b/src/hanzoai/resources/assistants.py @@ -4,7 +4,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def list( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | 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 diff --git a/src/hanzoai/resources/audio/speech.py b/src/hanzoai/resources/audio/speech.py index 1463e7d5..a9f82230 100644 --- a/src/hanzoai/resources/audio/speech.py +++ b/src/hanzoai/resources/audio/speech.py @@ -4,7 +4,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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: diff --git a/src/hanzoai/resources/audio/transcriptions.py b/src/hanzoai/resources/audio/transcriptions.py index 6286a73f..5d88daa0 100644 --- a/src/hanzoai/resources/audio/transcriptions.py +++ b/src/hanzoai/resources/audio/transcriptions.py @@ -6,7 +6,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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: diff --git a/src/hanzoai/resources/azure.py b/src/hanzoai/resources/azure.py index 8cae9ed4..6cb187f9 100644 --- a/src/hanzoai/resources/azure.py +++ b/src/hanzoai/resources/azure.py @@ -4,7 +4,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def call( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def patch( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def call( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def patch( extra_headers: Headers | None = None, extra_query: Query | 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. diff --git a/src/hanzoai/resources/batches/batches.py b/src/hanzoai/resources/batches/batches.py index 619220e4..4d221c5b 100644 --- a/src/hanzoai/resources/batches/batches.py +++ b/src/hanzoai/resources/batches/batches.py @@ -15,7 +15,7 @@ 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 @@ def with_streaming_response(self) -> BatchesResourceWithStreamingResponse: 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 @@ def retrieve( 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 @@ def retrieve( 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 @@ def cancel_with_provider( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def create_with_provider( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def list_with_provider( 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 @@ def retrieve_with_provider( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def with_streaming_response(self) -> AsyncBatchesResourceWithStreamingResponse: 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 @@ async def retrieve( 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 @@ async def retrieve( 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 @@ async def cancel_with_provider( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create_with_provider( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def list_with_provider( 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 @@ async def retrieve_with_provider( extra_headers: Headers | None = None, extra_query: Query | 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. diff --git a/src/hanzoai/resources/batches/cancel.py b/src/hanzoai/resources/batches/cancel.py index 877e9351..6dfd4a57 100644 --- a/src/hanzoai/resources/batches/cancel.py +++ b/src/hanzoai/resources/batches/cancel.py @@ -6,7 +6,7 @@ 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 @@ def cancel( 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 @@ async def cancel( 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. diff --git a/src/hanzoai/resources/bedrock.py b/src/hanzoai/resources/bedrock.py index e861b44b..3910eecc 100644 --- a/src/hanzoai/resources/bedrock.py +++ b/src/hanzoai/resources/bedrock.py @@ -4,7 +4,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def patch( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def patch( extra_headers: Headers | None = None, extra_query: Query | 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) diff --git a/src/hanzoai/resources/budget.py b/src/hanzoai/resources/budget.py index 3750f713..3fdc8cc7 100644 --- a/src/hanzoai/resources/budget.py +++ b/src/hanzoai/resources/budget.py @@ -13,7 +13,7 @@ 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 @@ def with_streaming_response(self) -> BudgetResourceWithStreamingResponse: 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 @@ def create( 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 @@ def list( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def info( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def settings( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def with_streaming_response(self) -> AsyncBudgetResourceWithStreamingResponse: 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 @@ async def create( 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 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def info( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def settings( extra_headers: Headers | None = None, extra_query: Query | 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 diff --git a/src/hanzoai/resources/cache/cache.py b/src/hanzoai/resources/cache/cache.py index ed019894..bce94627 100644 --- a/src/hanzoai/resources/cache/cache.py +++ b/src/hanzoai/resources/cache/cache.py @@ -12,7 +12,7 @@ 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 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def flush_all( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def ping( extra_headers: Headers | None = None, extra_query: 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 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def flush_all( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def ping( extra_headers: Headers | None = None, extra_query: 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( diff --git a/src/hanzoai/resources/cache/redis.py b/src/hanzoai/resources/cache/redis.py index f5c63ef0..cb199ae9 100644 --- a/src/hanzoai/resources/cache/redis.py +++ b/src/hanzoai/resources/cache/redis.py @@ -4,7 +4,7 @@ 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 @@ def retrieve_info( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def retrieve_info( extra_headers: Headers | None = None, extra_query: Query | 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( diff --git a/src/hanzoai/resources/chat/completions.py b/src/hanzoai/resources/chat/completions.py index 2b2edfce..226fa58d 100644 --- a/src/hanzoai/resources/chat/completions.py +++ b/src/hanzoai/resources/chat/completions.py @@ -6,7 +6,7 @@ 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 @@ def with_streaming_response(self) -> CompletionsResourceWithStreamingResponse: 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 @@ def with_streaming_response(self) -> AsyncCompletionsResourceWithStreamingRespon 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 diff --git a/src/hanzoai/resources/cohere.py b/src/hanzoai/resources/cohere.py index c0bf56b8..05841bca 100644 --- a/src/hanzoai/resources/cohere.py +++ b/src/hanzoai/resources/cohere.py @@ -4,7 +4,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def modify( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def modify( extra_headers: Headers | None = None, extra_query: Query | 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) diff --git a/src/hanzoai/resources/completions.py b/src/hanzoai/resources/completions.py index f33d13fa..bc9987ac 100644 --- a/src/hanzoai/resources/completions.py +++ b/src/hanzoai/resources/completions.py @@ -7,7 +7,7 @@ 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 @@ def with_streaming_response(self) -> CompletionsResourceWithStreamingResponse: 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 @@ def with_streaming_response(self) -> AsyncCompletionsResourceWithStreamingRespon 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 diff --git a/src/hanzoai/resources/config/pass_through_endpoint.py b/src/hanzoai/resources/config/pass_through_endpoint.py index 10128a88..e0f22da7 100644 --- a/src/hanzoai/resources/config/pass_through_endpoint.py +++ b/src/hanzoai/resources/config/pass_through_endpoint.py @@ -6,7 +6,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def update( 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 @@ def delete( extra_headers: Headers | None = None, extra_query: 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def update( 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 @@ async def delete( extra_headers: Headers | None = None, extra_query: 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 diff --git a/src/hanzoai/resources/credentials.py b/src/hanzoai/resources/credentials.py index 21b119d2..527cd5f7 100644 --- a/src/hanzoai/resources/credentials.py +++ b/src/hanzoai/resources/credentials.py @@ -7,7 +7,7 @@ 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 @@ def create( *, 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 @@ def list( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( *, 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 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | 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. diff --git a/src/hanzoai/resources/customer.py b/src/hanzoai/resources/customer.py index da50e589..b45340ac 100644 --- a/src/hanzoai/resources/customer.py +++ b/src/hanzoai/resources/customer.py @@ -15,7 +15,7 @@ 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 @@ def create( 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 @@ def update( 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 @@ def list( extra_headers: Headers | None = None, extra_query: 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 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def block( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def retrieve_info( extra_headers: Headers | None = None, extra_query: 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 @@ def unblock( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( 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 @@ async def update( 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 @@ async def list( extra_headers: Headers | None = None, extra_query: 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 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def block( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def retrieve_info( extra_headers: Headers | None = None, extra_query: 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 @@ async def unblock( extra_headers: Headers | None = None, extra_query: Query | 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 diff --git a/src/hanzoai/resources/delete.py b/src/hanzoai/resources/delete.py index 2c87abec..e9cf9d35 100644 --- a/src/hanzoai/resources/delete.py +++ b/src/hanzoai/resources/delete.py @@ -5,7 +5,7 @@ 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 @@ def create_allowed_ip( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create_allowed_ip( extra_headers: Headers | None = None, extra_query: Query | 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 diff --git a/src/hanzoai/resources/embeddings.py b/src/hanzoai/resources/embeddings.py index 4214bed7..81752549 100644 --- a/src/hanzoai/resources/embeddings.py +++ b/src/hanzoai/resources/embeddings.py @@ -7,7 +7,7 @@ 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 @@ def with_streaming_response(self) -> EmbeddingsResourceWithStreamingResponse: 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 @@ def with_streaming_response(self) -> AsyncEmbeddingsResourceWithStreamingRespons 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 diff --git a/src/hanzoai/resources/engines/chat.py b/src/hanzoai/resources/engines/chat.py index 5ef23754..108231b6 100644 --- a/src/hanzoai/resources/engines/chat.py +++ b/src/hanzoai/resources/engines/chat.py @@ -4,7 +4,7 @@ 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 @@ def complete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def complete( extra_headers: Headers | None = None, extra_query: Query | 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 diff --git a/src/hanzoai/resources/engines/engines.py b/src/hanzoai/resources/engines/engines.py index 4bbe41c5..2396f294 100644 --- a/src/hanzoai/resources/engines/engines.py +++ b/src/hanzoai/resources/engines/engines.py @@ -12,7 +12,7 @@ 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 @@ def complete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def embed( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def complete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def embed( extra_headers: Headers | None = None, extra_query: Query | 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 diff --git a/src/hanzoai/resources/eu_assemblyai.py b/src/hanzoai/resources/eu_assemblyai.py index b9ba75b5..4931aa8c 100644 --- a/src/hanzoai/resources/eu_assemblyai.py +++ b/src/hanzoai/resources/eu_assemblyai.py @@ -4,7 +4,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def patch( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def patch( extra_headers: Headers | None = None, extra_query: Query | 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 diff --git a/src/hanzoai/resources/files/content.py b/src/hanzoai/resources/files/content.py index 1e319ff2..0896ea03 100644 --- a/src/hanzoai/resources/files/content.py +++ b/src/hanzoai/resources/files/content.py @@ -4,7 +4,7 @@ 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 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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. diff --git a/src/hanzoai/resources/files/files.py b/src/hanzoai/resources/files/files.py index acb93ec9..6e00beb1 100644 --- a/src/hanzoai/resources/files/files.py +++ b/src/hanzoai/resources/files/files.py @@ -15,7 +15,7 @@ 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 @@ def create( *, 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 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def list( 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 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( *, 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 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def list( 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 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | 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. diff --git a/src/hanzoai/resources/fine_tuning/jobs/cancel.py b/src/hanzoai/resources/fine_tuning/jobs/cancel.py index 1b4992ca..5502db1f 100644 --- a/src/hanzoai/resources/fine_tuning/jobs/cancel.py +++ b/src/hanzoai/resources/fine_tuning/jobs/cancel.py @@ -4,7 +4,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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. diff --git a/src/hanzoai/resources/fine_tuning/jobs/jobs.py b/src/hanzoai/resources/fine_tuning/jobs/jobs.py index b1600483..0da59982 100644 --- a/src/hanzoai/resources/fine_tuning/jobs/jobs.py +++ b/src/hanzoai/resources/fine_tuning/jobs/jobs.py @@ -15,7 +15,7 @@ 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 @@ def create( 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 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def list( 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 @@ async def create( 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 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def list( 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. diff --git a/src/hanzoai/resources/gemini.py b/src/hanzoai/resources/gemini.py index 4bb94aa7..233183b2 100644 --- a/src/hanzoai/resources/gemini.py +++ b/src/hanzoai/resources/gemini.py @@ -4,7 +4,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def patch( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def patch( extra_headers: Headers | None = None, extra_query: Query | 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) diff --git a/src/hanzoai/resources/global_/spend.py b/src/hanzoai/resources/global_/spend.py index c211fef0..ce1ce1ed 100644 --- a/src/hanzoai/resources/global_/spend.py +++ b/src/hanzoai/resources/global_/spend.py @@ -7,7 +7,7 @@ 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 @@ def with_streaming_response(self) -> SpendResourceWithStreamingResponse: 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 @@ def reset( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def reset( 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 @@ def with_streaming_response(self) -> AsyncSpendResourceWithStreamingResponse: 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 @@ async def reset( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def reset( 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. diff --git a/src/hanzoai/resources/guardrails.py b/src/hanzoai/resources/guardrails.py index f1c7ab38..c1f361b9 100644 --- a/src/hanzoai/resources/guardrails.py +++ b/src/hanzoai/resources/guardrails.py @@ -4,7 +4,7 @@ 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 @@ def list( extra_headers: Headers | None = None, extra_query: 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 @@ async def list( extra_headers: Headers | None = None, extra_query: 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 diff --git a/src/hanzoai/resources/health.py b/src/hanzoai/resources/health.py index 8350c3c5..6d912d9d 100644 --- a/src/hanzoai/resources/health.py +++ b/src/hanzoai/resources/health.py @@ -8,7 +8,7 @@ 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 @@ def with_streaming_response(self) -> HealthResourceWithStreamingResponse: 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 @@ def check_liveliness( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def check_liveness( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def check_readiness( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def check_services( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def with_streaming_response(self) -> AsyncHealthResourceWithStreamingResponse: 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 @@ async def check_liveliness( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def check_liveness( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def check_readiness( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def check_services( extra_headers: Headers | None = None, extra_query: Query | 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. diff --git a/src/hanzoai/resources/images/generations.py b/src/hanzoai/resources/images/generations.py index e18dc72e..830a1a8f 100644 --- a/src/hanzoai/resources/images/generations.py +++ b/src/hanzoai/resources/images/generations.py @@ -4,7 +4,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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( diff --git a/src/hanzoai/resources/key/key.py b/src/hanzoai/resources/key/key.py index 7c79dd4a..438346b5 100644 --- a/src/hanzoai/resources/key/key.py +++ b/src/hanzoai/resources/key/key.py @@ -17,7 +17,7 @@ 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 @@ def update( 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 @@ def update( 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 @@ def list( 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 @@ def block( 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 @@ def check_health( extra_headers: Headers | None = None, extra_query: 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 @@ def check_health( 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 @@ def regenerate_by_key( 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 @@ def regenerate_by_key( 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 @@ def unblock( 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 @@ async def update( 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 @@ async def update( 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 @@ async def list( 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 @@ async def block( 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 @@ async def check_health( extra_headers: Headers | None = None, extra_query: 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 @@ async def check_health( 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 @@ async def regenerate_by_key( 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 @@ async def regenerate_by_key( 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 @@ async def unblock( 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. diff --git a/src/hanzoai/resources/langfuse.py b/src/hanzoai/resources/langfuse.py index 8cd7ab95..9ce2e3c6 100644 --- a/src/hanzoai/resources/langfuse.py +++ b/src/hanzoai/resources/langfuse.py @@ -4,7 +4,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def patch( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def patch( extra_headers: Headers | None = None, extra_query: Query | 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. diff --git a/src/hanzoai/resources/model/info.py b/src/hanzoai/resources/model/info.py index bb538e85..638dd54c 100644 --- a/src/hanzoai/resources/model/info.py +++ b/src/hanzoai/resources/model/info.py @@ -6,7 +6,7 @@ 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 @@ def with_streaming_response(self) -> InfoResourceWithStreamingResponse: 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 @@ def with_streaming_response(self) -> AsyncInfoResourceWithStreamingResponse: 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 diff --git a/src/hanzoai/resources/model/model.py b/src/hanzoai/resources/model/model.py index b6b6dd41..8bace8e9 100644 --- a/src/hanzoai/resources/model/model.py +++ b/src/hanzoai/resources/model/model.py @@ -21,7 +21,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | 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 diff --git a/src/hanzoai/resources/model/update.py b/src/hanzoai/resources/model/update.py index 59cb6bdc..37830516 100644 --- a/src/hanzoai/resources/model/update.py +++ b/src/hanzoai/resources/model/update.py @@ -6,7 +6,7 @@ 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 @@ def with_streaming_response(self) -> UpdateResourceWithStreamingResponse: 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 @@ def partial( 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 @@ def with_streaming_response(self) -> AsyncUpdateResourceWithStreamingResponse: 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 @@ async def partial( 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. diff --git a/src/hanzoai/resources/model_group.py b/src/hanzoai/resources/model_group.py index 5c37397c..0202bd14 100644 --- a/src/hanzoai/resources/model_group.py +++ b/src/hanzoai/resources/model_group.py @@ -7,7 +7,7 @@ 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 @@ def with_streaming_response(self) -> ModelGroupResourceWithStreamingResponse: 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 @@ def with_streaming_response(self) -> AsyncModelGroupResourceWithStreamingRespons 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 diff --git a/src/hanzoai/resources/models.py b/src/hanzoai/resources/models.py index 962b3cf1..f24def8e 100644 --- a/src/hanzoai/resources/models.py +++ b/src/hanzoai/resources/models.py @@ -7,7 +7,7 @@ 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 @@ def with_streaming_response(self) -> ModelsResourceWithStreamingResponse: 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 @@ def with_streaming_response(self) -> AsyncModelsResourceWithStreamingResponse: 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, diff --git a/src/hanzoai/resources/moderations.py b/src/hanzoai/resources/moderations.py index bc2c2735..5e63bb8a 100644 --- a/src/hanzoai/resources/moderations.py +++ b/src/hanzoai/resources/moderations.py @@ -4,7 +4,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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 diff --git a/src/hanzoai/resources/openai/deployments/chat.py b/src/hanzoai/resources/openai/deployments/chat.py index c570b947..f0fce545 100644 --- a/src/hanzoai/resources/openai/deployments/chat.py +++ b/src/hanzoai/resources/openai/deployments/chat.py @@ -4,7 +4,7 @@ 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 @@ def complete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def complete( extra_headers: Headers | None = None, extra_query: Query | 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 diff --git a/src/hanzoai/resources/openai/deployments/deployments.py b/src/hanzoai/resources/openai/deployments/deployments.py index 37f0bb48..50fa43d7 100644 --- a/src/hanzoai/resources/openai/deployments/deployments.py +++ b/src/hanzoai/resources/openai/deployments/deployments.py @@ -12,7 +12,7 @@ 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 @@ def complete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def embed( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def complete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def embed( extra_headers: Headers | None = None, extra_query: Query | 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 diff --git a/src/hanzoai/resources/openai/openai.py b/src/hanzoai/resources/openai/openai.py index 074d660d..77a0eab9 100644 --- a/src/hanzoai/resources/openai/openai.py +++ b/src/hanzoai/resources/openai/openai.py @@ -4,7 +4,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def patch( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def patch( extra_headers: Headers | None = None, extra_query: Query | 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. diff --git a/src/hanzoai/resources/organization/info.py b/src/hanzoai/resources/organization/info.py index d43e6935..aa654937 100644 --- a/src/hanzoai/resources/organization/info.py +++ b/src/hanzoai/resources/organization/info.py @@ -4,7 +4,7 @@ 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 @@ def retrieve( extra_headers: Headers | None = None, extra_query: 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 @@ def deprecated( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: 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 @@ async def deprecated( extra_headers: Headers | None = None, extra_query: Query | 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 diff --git a/src/hanzoai/resources/organization/organization.py b/src/hanzoai/resources/organization/organization.py index 44912257..f3c164a5 100644 --- a/src/hanzoai/resources/organization/organization.py +++ b/src/hanzoai/resources/organization/organization.py @@ -23,7 +23,7 @@ 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 @@ def create( 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 @@ def create( 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 @@ def list( extra_headers: Headers | None = None, extra_query: 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 @@ def delete( extra_headers: Headers | None = None, extra_query: 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 @@ def add_member( *, 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 @@ def delete_member( 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 @@ def update_member( 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 @@ def update_member( "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 @@ async def create( 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 @@ async def create( 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 @@ async def list( extra_headers: Headers | None = None, extra_query: 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 @@ async def delete( extra_headers: Headers | None = None, extra_query: 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 @@ async def add_member( *, 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 @@ async def delete_member( 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 @@ async def update_member( 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 @@ async def update_member( "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 diff --git a/src/hanzoai/resources/provider.py b/src/hanzoai/resources/provider.py index 0d37cc2b..18b2cb1a 100644 --- a/src/hanzoai/resources/provider.py +++ b/src/hanzoai/resources/provider.py @@ -4,7 +4,7 @@ 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 @@ def list_budgets( extra_headers: Headers | None = None, extra_query: 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 @@ async def list_budgets( extra_headers: Headers | None = None, extra_query: 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 diff --git a/src/hanzoai/resources/rerank.py b/src/hanzoai/resources/rerank.py index f15d0f65..18899b40 100644 --- a/src/hanzoai/resources/rerank.py +++ b/src/hanzoai/resources/rerank.py @@ -4,7 +4,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def create_v1( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def create_v2( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create_v1( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create_v2( extra_headers: Headers | None = None, extra_query: Query | 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( diff --git a/src/hanzoai/resources/responses/input_items.py b/src/hanzoai/resources/responses/input_items.py index 7d527480..cfe0c8eb 100644 --- a/src/hanzoai/resources/responses/input_items.py +++ b/src/hanzoai/resources/responses/input_items.py @@ -4,7 +4,7 @@ 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 @@ def list( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | 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. diff --git a/src/hanzoai/resources/responses/responses.py b/src/hanzoai/resources/responses/responses.py index 19cf40c6..2aa785f6 100644 --- a/src/hanzoai/resources/responses/responses.py +++ b/src/hanzoai/resources/responses/responses.py @@ -4,7 +4,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | 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. diff --git a/src/hanzoai/resources/routes.py b/src/hanzoai/resources/routes.py index 72e31c56..f54ba2ca 100644 --- a/src/hanzoai/resources/routes.py +++ b/src/hanzoai/resources/routes.py @@ -4,7 +4,7 @@ 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 @@ def list( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | 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( diff --git a/src/hanzoai/resources/settings.py b/src/hanzoai/resources/settings.py index e969e002..89299939 100644 --- a/src/hanzoai/resources/settings.py +++ b/src/hanzoai/resources/settings.py @@ -4,7 +4,7 @@ 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 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 diff --git a/src/hanzoai/resources/spend.py b/src/hanzoai/resources/spend.py index 9b6610c6..9554e8dc 100644 --- a/src/hanzoai/resources/spend.py +++ b/src/hanzoai/resources/spend.py @@ -7,7 +7,7 @@ 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 @@ def with_streaming_response(self) -> SpendResourceWithStreamingResponse: 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 @@ def calculate_spend( 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 @@ def list_logs( 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 @@ def with_streaming_response(self) -> AsyncSpendResourceWithStreamingResponse: 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 @@ async def calculate_spend( 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 @@ async def list_logs( 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 diff --git a/src/hanzoai/resources/team/callback.py b/src/hanzoai/resources/team/callback.py index 5233497d..5fb50093 100644 --- a/src/hanzoai/resources/team/callback.py +++ b/src/hanzoai/resources/team/callback.py @@ -7,7 +7,7 @@ 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 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def add( *, 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 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def add( *, 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 diff --git a/src/hanzoai/resources/team/model.py b/src/hanzoai/resources/team/model.py index e6f19293..d88758a2 100644 --- a/src/hanzoai/resources/team/model.py +++ b/src/hanzoai/resources/team/model.py @@ -4,7 +4,7 @@ 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 @@ def add( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def remove( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def add( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def remove( extra_headers: Headers | None = None, extra_query: Query | 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. diff --git a/src/hanzoai/resources/team/team.py b/src/hanzoai/resources/team/team.py index ca0791b0..c5184501 100644 --- a/src/hanzoai/resources/team/team.py +++ b/src/hanzoai/resources/team/team.py @@ -28,7 +28,7 @@ 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 @@ def with_streaming_response(self) -> TeamResourceWithStreamingResponse: 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 @@ def update( 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 @@ def update( 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 @@ def delete( 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 @@ def add_member( *, 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 @@ def block( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def disable_logging( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def disable_logging( 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 @@ def remove_member( 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 @@ def remove_member( 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 @@ def unblock( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def update_member( 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 @@ def with_streaming_response(self) -> AsyncTeamResourceWithStreamingResponse: 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 @@ async def update( 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 @@ async def update( 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 @@ async def delete( 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 @@ async def add_member( *, 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 @@ async def block( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def disable_logging( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def disable_logging( 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 @@ async def remove_member( 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 @@ async def remove_member( 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 @@ async def unblock( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def update_member( 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] diff --git a/src/hanzoai/resources/test.py b/src/hanzoai/resources/test.py index 570560f1..390a3e61 100644 --- a/src/hanzoai/resources/test.py +++ b/src/hanzoai/resources/test.py @@ -4,7 +4,7 @@ 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 @@ def ping( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def ping( extra_headers: Headers | None = None, extra_query: Query | 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. diff --git a/src/hanzoai/resources/threads/messages.py b/src/hanzoai/resources/threads/messages.py index cdede3bf..11313370 100644 --- a/src/hanzoai/resources/threads/messages.py +++ b/src/hanzoai/resources/threads/messages.py @@ -4,7 +4,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def list( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def list( extra_headers: Headers | None = None, extra_query: Query | 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. diff --git a/src/hanzoai/resources/threads/runs.py b/src/hanzoai/resources/threads/runs.py index d180e184..107fc3b6 100644 --- a/src/hanzoai/resources/threads/runs.py +++ b/src/hanzoai/resources/threads/runs.py @@ -4,7 +4,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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. diff --git a/src/hanzoai/resources/threads/threads.py b/src/hanzoai/resources/threads/threads.py index 580dbcdf..e9e61a19 100644 --- a/src/hanzoai/resources/threads/threads.py +++ b/src/hanzoai/resources/threads/threads.py @@ -12,7 +12,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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. diff --git a/src/hanzoai/resources/user.py b/src/hanzoai/resources/user.py index 90501868..a1a4c2aa 100644 --- a/src/hanzoai/resources/user.py +++ b/src/hanzoai/resources/user.py @@ -14,7 +14,7 @@ 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 @@ def with_streaming_response(self) -> UserResourceWithStreamingResponse: 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 @@ def create( 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 @@ def update( 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 @@ def delete( 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 @@ def delete( 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 @@ def with_streaming_response(self) -> AsyncUserResourceWithStreamingResponse: 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 @@ async def create( 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 @@ async def update( 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 @@ async def delete( 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 @@ async def delete( 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. diff --git a/src/hanzoai/resources/utils.py b/src/hanzoai/resources/utils.py index ea5a3573..d5d32ce7 100644 --- a/src/hanzoai/resources/utils.py +++ b/src/hanzoai/resources/utils.py @@ -8,7 +8,7 @@ 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 @@ def get_supported_openai_params( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def token_counter( 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 @@ def transform_request( extra_headers: Headers | None = None, extra_query: 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 @@ async def get_supported_openai_params( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def token_counter( 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 @@ async def transform_request( extra_headers: Headers | None = None, extra_query: 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 diff --git a/src/hanzoai/resources/vertex_ai.py b/src/hanzoai/resources/vertex_ai.py index 980ed3f2..dd098d40 100644 --- a/src/hanzoai/resources/vertex_ai.py +++ b/src/hanzoai/resources/vertex_ai.py @@ -4,7 +4,7 @@ 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 @@ def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ def patch( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | 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 @@ async def patch( extra_headers: Headers | None = None, extra_query: Query | 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. diff --git a/tests/test_transform.py b/tests/test_transform.py index 6a43380c..bc50d64c 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -8,7 +8,7 @@ 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) == {} From eca6f3283793c38d6e070c53d5aff33977e0a279 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 11 Oct 2025 02:43:33 +0000 Subject: [PATCH 36/41] chore(internal): codegen related update --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index bb1e059a..6d771009 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -224,6 +224,8 @@ select = [ "B", # remove unused imports "F401", + # check for missing future annotations + "FA102", # bare except statements "E722", # unused arguments @@ -246,6 +248,8 @@ unfixable = [ "T203", ] +extend-safe-fixes = ["FA102"] + [tool.ruff.lint.flake8-tidy-imports.banned-api] "functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead" From b742fa12ecd53d7f94a4ef142868ee211494d39b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 18 Oct 2025 02:26:50 +0000 Subject: [PATCH 37/41] chore(internal): codegen related update --- pyproject.toml | 2 +- requirements-dev.lock | 2 +- requirements.lock | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6d771009..c5722ae4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ Homepage = "https://github.com/hanzoai/python-sdk" Repository = "https://github.com/hanzoai/python-sdk" [project.optional-dependencies] -aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"] +aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"] [tool.rye] managed = true diff --git a/requirements-dev.lock b/requirements-dev.lock index 65a6ff7e..e10407bf 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -56,7 +56,7 @@ httpx==0.28.1 # via hanzoai # via httpx-aiohttp # via respx -httpx-aiohttp==0.1.8 +httpx-aiohttp==0.1.9 # via hanzoai idna==3.4 # via anyio diff --git a/requirements.lock b/requirements.lock index 72261253..1d274971 100644 --- a/requirements.lock +++ b/requirements.lock @@ -43,7 +43,7 @@ httpcore==1.0.9 httpx==0.28.1 # via hanzoai # via httpx-aiohttp -httpx-aiohttp==0.1.8 +httpx-aiohttp==0.1.9 # via hanzoai idna==3.4 # via anyio From ccb23d013dd8c8582d49f959ed8a3342ae2b3f3f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 02:58:20 +0000 Subject: [PATCH 38/41] chore(internal): codegen related update --- src/hanzoai/_streaming.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/hanzoai/_streaming.py b/src/hanzoai/_streaming.py index cffbdfc0..c9b62fe5 100644 --- a/src/hanzoai/_streaming.py +++ b/src/hanzoai/_streaming.py @@ -57,9 +57,8 @@ def __stream__(self) -> Iterator[_T]: for sse in iterator: yield process_data(data=sse.json(), cast_to=cast_to, response=response) - # Ensure the entire stream is consumed - for _sse in iterator: - ... + # As we might not fully consume the response stream, we need to close it explicitly + response.close() def __enter__(self) -> Self: return self @@ -121,9 +120,8 @@ async def __stream__(self) -> AsyncIterator[_T]: async for sse in iterator: yield process_data(data=sse.json(), cast_to=cast_to, response=response) - # Ensure the entire stream is consumed - async for _sse in iterator: - ... + # As we might not fully consume the response stream, we need to close it explicitly + await response.aclose() async def __aenter__(self) -> Self: return self From 809bfb24f0872713c561ad0946d1581c48f53411 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Oct 2025 04:26:45 +0000 Subject: [PATCH 39/41] chore(internal): codegen related update --- tests/test_client.py | 366 ++++++++++++++++++++++++------------------- 1 file changed, 202 insertions(+), 164 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index 227a03cf..bb118ab6 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -59,51 +59,49 @@ def _get_open_connections(client: Hanzo | AsyncHanzo) -> int: class TestHanzo: - client = Hanzo(base_url=base_url, api_key=api_key, _strict_response_validation=True) - @pytest.mark.respx(base_url=base_url) - def test_raw_response(self, respx_mock: MockRouter) -> None: + def test_raw_response(self, respx_mock: MockRouter, client: Hanzo) -> None: respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = self.client.post("/foo", cast_to=httpx.Response) + response = client.post("/foo", cast_to=httpx.Response) assert response.status_code == 200 assert isinstance(response, httpx.Response) assert response.json() == {"foo": "bar"} @pytest.mark.respx(base_url=base_url) - def test_raw_response_for_binary(self, respx_mock: MockRouter) -> None: + def test_raw_response_for_binary(self, respx_mock: MockRouter, client: Hanzo) -> None: respx_mock.post("/foo").mock( return_value=httpx.Response(200, headers={"Content-Type": "application/binary"}, content='{"foo": "bar"}') ) - response = self.client.post("/foo", cast_to=httpx.Response) + response = client.post("/foo", cast_to=httpx.Response) assert response.status_code == 200 assert isinstance(response, httpx.Response) assert response.json() == {"foo": "bar"} - def test_copy(self) -> None: - copied = self.client.copy() - assert id(copied) != id(self.client) + def test_copy(self, client: Hanzo) -> None: + copied = client.copy() + assert id(copied) != id(client) - copied = self.client.copy(api_key="another My API Key") + copied = client.copy(api_key="another My API Key") assert copied.api_key == "another My API Key" - assert self.client.api_key == "My API Key" + assert client.api_key == "My API Key" - def test_copy_default_options(self) -> None: + def test_copy_default_options(self, client: Hanzo) -> None: # options that have a default are overridden correctly - copied = self.client.copy(max_retries=7) + copied = client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 2 + assert client.max_retries == 2 copied2 = copied.copy(max_retries=6) assert copied2.max_retries == 6 assert copied.max_retries == 7 # timeout - assert isinstance(self.client.timeout, httpx.Timeout) - copied = self.client.copy(timeout=None) + assert isinstance(client.timeout, httpx.Timeout) + copied = client.copy(timeout=None) assert copied.timeout is None - assert isinstance(self.client.timeout, httpx.Timeout) + assert isinstance(client.timeout, httpx.Timeout) def test_copy_default_headers(self) -> None: client = Hanzo( @@ -138,6 +136,7 @@ def test_copy_default_headers(self) -> None: match="`default_headers` and `set_default_headers` arguments are mutually exclusive", ): client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) + client.close() def test_copy_default_query(self) -> None: client = Hanzo( @@ -175,13 +174,15 @@ def test_copy_default_query(self) -> None: ): client.copy(set_default_query={}, default_query={"foo": "Bar"}) - def test_copy_signature(self) -> None: + client.close() + + def test_copy_signature(self, client: Hanzo) -> None: # ensure the same parameters that can be passed to the client are defined in the `.copy()` method init_signature = inspect.signature( # mypy doesn't like that we access the `__init__` property. - self.client.__init__, # type: ignore[misc] + client.__init__, # type: ignore[misc] ) - copy_signature = inspect.signature(self.client.copy) + copy_signature = inspect.signature(client.copy) exclude_params = {"transport", "proxies", "_strict_response_validation"} for name in init_signature.parameters.keys(): @@ -192,12 +193,12 @@ def test_copy_signature(self) -> None: assert copy_param is not None, f"copy() signature is missing the {name} param" @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12") - def test_copy_build_request(self) -> None: + def test_copy_build_request(self, client: Hanzo) -> None: options = FinalRequestOptions(method="get", url="/foo") def build_request(options: FinalRequestOptions) -> None: - client = self.client.copy() - client._build_request(options) + client_copy = client.copy() + client_copy._build_request(options) # ensure that the machinery is warmed up before tracing starts. build_request(options) @@ -254,14 +255,12 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic print(frame) raise AssertionError() - def test_request_timeout(self) -> None: - request = self.client._build_request(FinalRequestOptions(method="get", url="/foo")) + def test_request_timeout(self, client: Hanzo) -> None: + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT - request = self.client._build_request( - FinalRequestOptions(method="get", url="/foo", timeout=httpx.Timeout(100.0)) - ) + request = client._build_request(FinalRequestOptions(method="get", url="/foo", timeout=httpx.Timeout(100.0))) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(100.0) @@ -272,6 +271,8 @@ def test_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(0) + client.close() + def test_http_client_timeout_option(self) -> None: # custom timeout given to the httpx client should be used with httpx.Client(timeout=None) as http_client: @@ -283,6 +284,8 @@ def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(None) + client.close() + # no timeout given to the httpx client should not use the httpx default with httpx.Client() as http_client: client = Hanzo( @@ -293,6 +296,8 @@ def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT + client.close() + # explicitly passing the default timeout currently results in it being ignored with httpx.Client(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: client = Hanzo( @@ -303,6 +308,8 @@ def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT # our default + client.close() + async def test_invalid_http_client(self) -> None: with pytest.raises(TypeError, match="Invalid `http_client` arg"): async with httpx.AsyncClient() as http_client: @@ -314,14 +321,14 @@ async def test_invalid_http_client(self) -> None: ) def test_default_headers_option(self) -> None: - client = Hanzo( + test_client = Hanzo( base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"} ) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + request = test_client._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "bar" assert request.headers.get("x-stainless-lang") == "python" - client2 = Hanzo( + test_client2 = Hanzo( base_url=base_url, api_key=api_key, _strict_response_validation=True, @@ -330,10 +337,13 @@ def test_default_headers_option(self) -> None: "X-Stainless-Lang": "my-overriding-header", }, ) - request = client2._build_request(FinalRequestOptions(method="get", url="/foo")) + request = test_client2._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "stainless" assert request.headers.get("x-stainless-lang") == "my-overriding-header" + test_client.close() + test_client2.close() + def test_validate_headers(self) -> None: client = Hanzo(base_url=base_url, api_key=api_key, _strict_response_validation=True) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -362,8 +372,10 @@ def test_default_query_option(self) -> None: url = httpx.URL(request.url) assert dict(url.params) == {"foo": "baz", "query_param": "overridden"} - def test_request_extra_json(self) -> None: - request = self.client._build_request( + client.close() + + def test_request_extra_json(self, client: Hanzo) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -374,7 +386,7 @@ def test_request_extra_json(self) -> None: data = json.loads(request.content.decode("utf-8")) assert data == {"foo": "bar", "baz": False} - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -385,7 +397,7 @@ def test_request_extra_json(self) -> None: assert data == {"baz": False} # `extra_json` takes priority over `json_data` when keys clash - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -396,8 +408,8 @@ def test_request_extra_json(self) -> None: data = json.loads(request.content.decode("utf-8")) assert data == {"foo": "bar", "baz": None} - def test_request_extra_headers(self) -> None: - request = self.client._build_request( + def test_request_extra_headers(self, client: Hanzo) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -407,7 +419,7 @@ def test_request_extra_headers(self) -> None: assert request.headers.get("X-Foo") == "Foo" # `extra_headers` takes priority over `default_headers` when keys clash - request = self.client.with_options(default_headers={"X-Bar": "true"})._build_request( + request = client.with_options(default_headers={"X-Bar": "true"})._build_request( FinalRequestOptions( method="post", url="/foo", @@ -418,8 +430,8 @@ def test_request_extra_headers(self) -> None: ) assert request.headers.get("X-Bar") == "false" - def test_request_extra_query(self) -> None: - request = self.client._build_request( + def test_request_extra_query(self, client: Hanzo) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -432,7 +444,7 @@ def test_request_extra_query(self) -> None: assert params == {"my_query_param": "Foo"} # if both `query` and `extra_query` are given, they are merged - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -446,7 +458,7 @@ def test_request_extra_query(self) -> None: assert params == {"bar": "1", "foo": "2"} # `extra_query` takes priority over `query` when keys clash - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -489,7 +501,7 @@ def test_multipart_repeating_array(self, client: Hanzo) -> None: ] @pytest.mark.respx(base_url=base_url) - def test_basic_union_response(self, respx_mock: MockRouter) -> None: + def test_basic_union_response(self, respx_mock: MockRouter, client: Hanzo) -> None: class Model1(BaseModel): name: str @@ -498,12 +510,12 @@ class Model2(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model2) assert response.foo == "bar" @pytest.mark.respx(base_url=base_url) - def test_union_response_different_types(self, respx_mock: MockRouter) -> None: + def test_union_response_different_types(self, respx_mock: MockRouter, client: Hanzo) -> None: """Union of objects with the same field name using a different type""" class Model1(BaseModel): @@ -514,18 +526,18 @@ class Model2(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model2) assert response.foo == "bar" respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": 1})) - response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model1) assert response.foo == 1 @pytest.mark.respx(base_url=base_url) - def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter) -> None: + def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter, client: Hanzo) -> None: """ Response that sets Content-Type to something other than application/json but returns json data """ @@ -541,7 +553,7 @@ class Model(BaseModel): ) ) - response = self.client.get("/foo", cast_to=Model) + response = client.get("/foo", cast_to=Model) assert isinstance(response, Model) assert response.foo == 2 @@ -553,6 +565,8 @@ def test_base_url_setter(self) -> None: assert client.base_url == "https://example.com/from_setter/" + client.close() + def test_base_url_env(self) -> None: with update_env(HANZO_BASE_URL="http://localhost:5000/from/env"): client = Hanzo(api_key=api_key, _strict_response_validation=True) @@ -566,6 +580,8 @@ def test_base_url_env(self) -> None: client = Hanzo(base_url=None, api_key=api_key, _strict_response_validation=True, environment="production") assert str(client.base_url).startswith("https://api.hanzo.ai") + client.close() + @pytest.mark.parametrize( "client", [ @@ -588,6 +604,7 @@ def test_base_url_trailing_slash(self, client: Hanzo) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + client.close() @pytest.mark.parametrize( "client", @@ -611,6 +628,7 @@ def test_base_url_no_trailing_slash(self, client: Hanzo) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + client.close() @pytest.mark.parametrize( "client", @@ -634,35 +652,36 @@ def test_absolute_request_url(self, client: Hanzo) -> None: ), ) assert request.url == "https://myapi.com/foo" + client.close() def test_copied_client_does_not_close_http(self) -> None: - client = Hanzo(base_url=base_url, api_key=api_key, _strict_response_validation=True) - assert not client.is_closed() + test_client = Hanzo(base_url=base_url, api_key=api_key, _strict_response_validation=True) + assert not test_client.is_closed() - copied = client.copy() - assert copied is not client + copied = test_client.copy() + assert copied is not test_client del copied - assert not client.is_closed() + assert not test_client.is_closed() def test_client_context_manager(self) -> None: - client = Hanzo(base_url=base_url, api_key=api_key, _strict_response_validation=True) - with client as c2: - assert c2 is client + test_client = Hanzo(base_url=base_url, api_key=api_key, _strict_response_validation=True) + with test_client as c2: + assert c2 is test_client assert not c2.is_closed() - assert not client.is_closed() - assert client.is_closed() + assert not test_client.is_closed() + assert test_client.is_closed() @pytest.mark.respx(base_url=base_url) - def test_client_response_validation_error(self, respx_mock: MockRouter) -> None: + def test_client_response_validation_error(self, respx_mock: MockRouter, client: Hanzo) -> None: class Model(BaseModel): foo: str respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": {"invalid": True}})) with pytest.raises(APIResponseValidationError) as exc: - self.client.get("/foo", cast_to=Model) + client.get("/foo", cast_to=Model) assert isinstance(exc.value.__cause__, ValidationError) @@ -682,11 +701,14 @@ class Model(BaseModel): with pytest.raises(APIResponseValidationError): strict_client.get("/foo", cast_to=Model) - client = Hanzo(base_url=base_url, api_key=api_key, _strict_response_validation=False) + non_strict_client = Hanzo(base_url=base_url, api_key=api_key, _strict_response_validation=False) - response = client.get("/foo", cast_to=Model) + response = non_strict_client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] + strict_client.close() + non_strict_client.close() + @pytest.mark.parametrize( "remaining_retries,retry_after,timeout", [ @@ -709,9 +731,9 @@ class Model(BaseModel): ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) - def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: - client = Hanzo(base_url=base_url, api_key=api_key, _strict_response_validation=True) - + def test_parse_retry_after_header( + self, remaining_retries: int, retry_after: str, timeout: float, client: Hanzo + ) -> None: headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) calculated = client._calculate_retry_timeout(remaining_retries, options, headers) @@ -725,7 +747,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, clien with pytest.raises(APITimeoutError): client.with_streaming_response.get_home().__enter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(client) == 0 @mock.patch("hanzoai._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) @@ -734,7 +756,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client with pytest.raises(APIStatusError): client.with_streaming_response.get_home().__enter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @mock.patch("hanzoai._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @@ -834,83 +856,77 @@ def test_default_client_creation(self) -> None: ) @pytest.mark.respx(base_url=base_url) - def test_follow_redirects(self, respx_mock: MockRouter) -> None: + def test_follow_redirects(self, respx_mock: MockRouter, client: Hanzo) -> None: # Test that the default follow_redirects=True allows following redirects respx_mock.post("/redirect").mock( return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"})) - response = self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) + response = client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) assert response.status_code == 200 assert response.json() == {"status": "ok"} @pytest.mark.respx(base_url=base_url) - def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None: + def test_follow_redirects_disabled(self, respx_mock: MockRouter, client: Hanzo) -> None: # Test that follow_redirects=False prevents following redirects respx_mock.post("/redirect").mock( return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) with pytest.raises(APIStatusError) as exc_info: - self.client.post( - "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response - ) + client.post("/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response) assert exc_info.value.response.status_code == 302 assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected" class TestAsyncHanzo: - client = AsyncHanzo(base_url=base_url, api_key=api_key, _strict_response_validation=True) - @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio - async def test_raw_response(self, respx_mock: MockRouter) -> None: + async def test_raw_response(self, respx_mock: MockRouter, async_client: AsyncHanzo) -> None: respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = await self.client.post("/foo", cast_to=httpx.Response) + response = await async_client.post("/foo", cast_to=httpx.Response) assert response.status_code == 200 assert isinstance(response, httpx.Response) assert response.json() == {"foo": "bar"} @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio - async def test_raw_response_for_binary(self, respx_mock: MockRouter) -> None: + async def test_raw_response_for_binary(self, respx_mock: MockRouter, async_client: AsyncHanzo) -> None: respx_mock.post("/foo").mock( return_value=httpx.Response(200, headers={"Content-Type": "application/binary"}, content='{"foo": "bar"}') ) - response = await self.client.post("/foo", cast_to=httpx.Response) + response = await async_client.post("/foo", cast_to=httpx.Response) assert response.status_code == 200 assert isinstance(response, httpx.Response) assert response.json() == {"foo": "bar"} - def test_copy(self) -> None: - copied = self.client.copy() - assert id(copied) != id(self.client) + def test_copy(self, async_client: AsyncHanzo) -> None: + copied = async_client.copy() + assert id(copied) != id(async_client) - copied = self.client.copy(api_key="another My API Key") + copied = async_client.copy(api_key="another My API Key") assert copied.api_key == "another My API Key" - assert self.client.api_key == "My API Key" + assert async_client.api_key == "My API Key" - def test_copy_default_options(self) -> None: + def test_copy_default_options(self, async_client: AsyncHanzo) -> None: # options that have a default are overridden correctly - copied = self.client.copy(max_retries=7) + copied = async_client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 2 + assert async_client.max_retries == 2 copied2 = copied.copy(max_retries=6) assert copied2.max_retries == 6 assert copied.max_retries == 7 # timeout - assert isinstance(self.client.timeout, httpx.Timeout) - copied = self.client.copy(timeout=None) + assert isinstance(async_client.timeout, httpx.Timeout) + copied = async_client.copy(timeout=None) assert copied.timeout is None - assert isinstance(self.client.timeout, httpx.Timeout) + assert isinstance(async_client.timeout, httpx.Timeout) - def test_copy_default_headers(self) -> None: + async def test_copy_default_headers(self) -> None: client = AsyncHanzo( base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"} ) @@ -943,8 +959,9 @@ def test_copy_default_headers(self) -> None: match="`default_headers` and `set_default_headers` arguments are mutually exclusive", ): client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) + await client.close() - def test_copy_default_query(self) -> None: + async def test_copy_default_query(self) -> None: client = AsyncHanzo( base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={"foo": "bar"} ) @@ -980,13 +997,15 @@ def test_copy_default_query(self) -> None: ): client.copy(set_default_query={}, default_query={"foo": "Bar"}) - def test_copy_signature(self) -> None: + await client.close() + + def test_copy_signature(self, async_client: AsyncHanzo) -> None: # ensure the same parameters that can be passed to the client are defined in the `.copy()` method init_signature = inspect.signature( # mypy doesn't like that we access the `__init__` property. - self.client.__init__, # type: ignore[misc] + async_client.__init__, # type: ignore[misc] ) - copy_signature = inspect.signature(self.client.copy) + copy_signature = inspect.signature(async_client.copy) exclude_params = {"transport", "proxies", "_strict_response_validation"} for name in init_signature.parameters.keys(): @@ -997,12 +1016,12 @@ def test_copy_signature(self) -> None: assert copy_param is not None, f"copy() signature is missing the {name} param" @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12") - def test_copy_build_request(self) -> None: + def test_copy_build_request(self, async_client: AsyncHanzo) -> None: options = FinalRequestOptions(method="get", url="/foo") def build_request(options: FinalRequestOptions) -> None: - client = self.client.copy() - client._build_request(options) + client_copy = async_client.copy() + client_copy._build_request(options) # ensure that the machinery is warmed up before tracing starts. build_request(options) @@ -1059,12 +1078,12 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic print(frame) raise AssertionError() - async def test_request_timeout(self) -> None: - request = self.client._build_request(FinalRequestOptions(method="get", url="/foo")) + async def test_request_timeout(self, async_client: AsyncHanzo) -> None: + request = async_client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT - request = self.client._build_request( + request = async_client._build_request( FinalRequestOptions(method="get", url="/foo", timeout=httpx.Timeout(100.0)) ) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -1079,6 +1098,8 @@ async def test_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(0) + await client.close() + async def test_http_client_timeout_option(self) -> None: # custom timeout given to the httpx client should be used async with httpx.AsyncClient(timeout=None) as http_client: @@ -1090,6 +1111,8 @@ async def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(None) + await client.close() + # no timeout given to the httpx client should not use the httpx default async with httpx.AsyncClient() as http_client: client = AsyncHanzo( @@ -1100,6 +1123,8 @@ async def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT + await client.close() + # explicitly passing the default timeout currently results in it being ignored async with httpx.AsyncClient(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: client = AsyncHanzo( @@ -1110,6 +1135,8 @@ async def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT # our default + await client.close() + def test_invalid_http_client(self) -> None: with pytest.raises(TypeError, match="Invalid `http_client` arg"): with httpx.Client() as http_client: @@ -1120,15 +1147,15 @@ def test_invalid_http_client(self) -> None: http_client=cast(Any, http_client), ) - def test_default_headers_option(self) -> None: - client = AsyncHanzo( + async def test_default_headers_option(self) -> None: + test_client = AsyncHanzo( base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"} ) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + request = test_client._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "bar" assert request.headers.get("x-stainless-lang") == "python" - client2 = AsyncHanzo( + test_client2 = AsyncHanzo( base_url=base_url, api_key=api_key, _strict_response_validation=True, @@ -1137,10 +1164,13 @@ def test_default_headers_option(self) -> None: "X-Stainless-Lang": "my-overriding-header", }, ) - request = client2._build_request(FinalRequestOptions(method="get", url="/foo")) + request = test_client2._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "stainless" assert request.headers.get("x-stainless-lang") == "my-overriding-header" + await test_client.close() + await test_client2.close() + def test_validate_headers(self) -> None: client = AsyncHanzo(base_url=base_url, api_key=api_key, _strict_response_validation=True) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -1151,7 +1181,7 @@ def test_validate_headers(self) -> None: client2 = AsyncHanzo(base_url=base_url, api_key=None, _strict_response_validation=True) _ = client2 - def test_default_query_option(self) -> None: + async def test_default_query_option(self) -> None: client = AsyncHanzo( base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={"query_param": "bar"} ) @@ -1169,8 +1199,10 @@ def test_default_query_option(self) -> None: url = httpx.URL(request.url) assert dict(url.params) == {"foo": "baz", "query_param": "overridden"} - def test_request_extra_json(self) -> None: - request = self.client._build_request( + await client.close() + + def test_request_extra_json(self, client: Hanzo) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1181,7 +1213,7 @@ def test_request_extra_json(self) -> None: data = json.loads(request.content.decode("utf-8")) assert data == {"foo": "bar", "baz": False} - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1192,7 +1224,7 @@ def test_request_extra_json(self) -> None: assert data == {"baz": False} # `extra_json` takes priority over `json_data` when keys clash - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1203,8 +1235,8 @@ def test_request_extra_json(self) -> None: data = json.loads(request.content.decode("utf-8")) assert data == {"foo": "bar", "baz": None} - def test_request_extra_headers(self) -> None: - request = self.client._build_request( + def test_request_extra_headers(self, client: Hanzo) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1214,7 +1246,7 @@ def test_request_extra_headers(self) -> None: assert request.headers.get("X-Foo") == "Foo" # `extra_headers` takes priority over `default_headers` when keys clash - request = self.client.with_options(default_headers={"X-Bar": "true"})._build_request( + request = client.with_options(default_headers={"X-Bar": "true"})._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1225,8 +1257,8 @@ def test_request_extra_headers(self) -> None: ) assert request.headers.get("X-Bar") == "false" - def test_request_extra_query(self) -> None: - request = self.client._build_request( + def test_request_extra_query(self, client: Hanzo) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1239,7 +1271,7 @@ def test_request_extra_query(self) -> None: assert params == {"my_query_param": "Foo"} # if both `query` and `extra_query` are given, they are merged - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1253,7 +1285,7 @@ def test_request_extra_query(self) -> None: assert params == {"bar": "1", "foo": "2"} # `extra_query` takes priority over `query` when keys clash - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1296,7 +1328,7 @@ def test_multipart_repeating_array(self, async_client: AsyncHanzo) -> None: ] @pytest.mark.respx(base_url=base_url) - async def test_basic_union_response(self, respx_mock: MockRouter) -> None: + async def test_basic_union_response(self, respx_mock: MockRouter, async_client: AsyncHanzo) -> None: class Model1(BaseModel): name: str @@ -1305,12 +1337,12 @@ class Model2(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = await async_client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model2) assert response.foo == "bar" @pytest.mark.respx(base_url=base_url) - async def test_union_response_different_types(self, respx_mock: MockRouter) -> None: + async def test_union_response_different_types(self, respx_mock: MockRouter, async_client: AsyncHanzo) -> None: """Union of objects with the same field name using a different type""" class Model1(BaseModel): @@ -1321,18 +1353,20 @@ class Model2(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = await async_client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model2) assert response.foo == "bar" respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": 1})) - response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = await async_client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model1) assert response.foo == 1 @pytest.mark.respx(base_url=base_url) - async def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter) -> None: + async def test_non_application_json_content_type_for_json_data( + self, respx_mock: MockRouter, async_client: AsyncHanzo + ) -> None: """ Response that sets Content-Type to something other than application/json but returns json data """ @@ -1348,11 +1382,11 @@ class Model(BaseModel): ) ) - response = await self.client.get("/foo", cast_to=Model) + response = await async_client.get("/foo", cast_to=Model) assert isinstance(response, Model) assert response.foo == 2 - def test_base_url_setter(self) -> None: + async def test_base_url_setter(self) -> None: client = AsyncHanzo(base_url="https://example.com/from_init", api_key=api_key, _strict_response_validation=True) assert client.base_url == "https://example.com/from_init/" @@ -1360,7 +1394,9 @@ def test_base_url_setter(self) -> None: assert client.base_url == "https://example.com/from_setter/" - def test_base_url_env(self) -> None: + await client.close() + + async def test_base_url_env(self) -> None: with update_env(HANZO_BASE_URL="http://localhost:5000/from/env"): client = AsyncHanzo(api_key=api_key, _strict_response_validation=True) assert client.base_url == "http://localhost:5000/from/env/" @@ -1375,6 +1411,8 @@ def test_base_url_env(self) -> None: ) assert str(client.base_url).startswith("https://api.hanzo.ai") + await client.close() + @pytest.mark.parametrize( "client", [ @@ -1390,7 +1428,7 @@ def test_base_url_env(self) -> None: ], ids=["standard", "custom http client"], ) - def test_base_url_trailing_slash(self, client: AsyncHanzo) -> None: + async def test_base_url_trailing_slash(self, client: AsyncHanzo) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1399,6 +1437,7 @@ def test_base_url_trailing_slash(self, client: AsyncHanzo) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + await client.close() @pytest.mark.parametrize( "client", @@ -1415,7 +1454,7 @@ def test_base_url_trailing_slash(self, client: AsyncHanzo) -> None: ], ids=["standard", "custom http client"], ) - def test_base_url_no_trailing_slash(self, client: AsyncHanzo) -> None: + async def test_base_url_no_trailing_slash(self, client: AsyncHanzo) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1424,6 +1463,7 @@ def test_base_url_no_trailing_slash(self, client: AsyncHanzo) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + await client.close() @pytest.mark.parametrize( "client", @@ -1440,7 +1480,7 @@ def test_base_url_no_trailing_slash(self, client: AsyncHanzo) -> None: ], ids=["standard", "custom http client"], ) - def test_absolute_request_url(self, client: AsyncHanzo) -> None: + async def test_absolute_request_url(self, client: AsyncHanzo) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1449,37 +1489,37 @@ def test_absolute_request_url(self, client: AsyncHanzo) -> None: ), ) assert request.url == "https://myapi.com/foo" + await client.close() async def test_copied_client_does_not_close_http(self) -> None: - client = AsyncHanzo(base_url=base_url, api_key=api_key, _strict_response_validation=True) - assert not client.is_closed() + test_client = AsyncHanzo(base_url=base_url, api_key=api_key, _strict_response_validation=True) + assert not test_client.is_closed() - copied = client.copy() - assert copied is not client + copied = test_client.copy() + assert copied is not test_client del copied await asyncio.sleep(0.2) - assert not client.is_closed() + assert not test_client.is_closed() async def test_client_context_manager(self) -> None: - client = AsyncHanzo(base_url=base_url, api_key=api_key, _strict_response_validation=True) - async with client as c2: - assert c2 is client + test_client = AsyncHanzo(base_url=base_url, api_key=api_key, _strict_response_validation=True) + async with test_client as c2: + assert c2 is test_client assert not c2.is_closed() - assert not client.is_closed() - assert client.is_closed() + assert not test_client.is_closed() + assert test_client.is_closed() @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio - async def test_client_response_validation_error(self, respx_mock: MockRouter) -> None: + async def test_client_response_validation_error(self, respx_mock: MockRouter, async_client: AsyncHanzo) -> None: class Model(BaseModel): foo: str respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": {"invalid": True}})) with pytest.raises(APIResponseValidationError) as exc: - await self.client.get("/foo", cast_to=Model) + await async_client.get("/foo", cast_to=Model) assert isinstance(exc.value.__cause__, ValidationError) @@ -1490,7 +1530,6 @@ async def test_client_max_retries_validation(self) -> None: ) @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio async def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None: class Model(BaseModel): name: str @@ -1502,11 +1541,14 @@ class Model(BaseModel): with pytest.raises(APIResponseValidationError): await strict_client.get("/foo", cast_to=Model) - client = AsyncHanzo(base_url=base_url, api_key=api_key, _strict_response_validation=False) + non_strict_client = AsyncHanzo(base_url=base_url, api_key=api_key, _strict_response_validation=False) - response = await client.get("/foo", cast_to=Model) + response = await non_strict_client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] + await strict_client.close() + await non_strict_client.close() + @pytest.mark.parametrize( "remaining_retries,retry_after,timeout", [ @@ -1529,13 +1571,12 @@ class Model(BaseModel): ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) - @pytest.mark.asyncio - async def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: - client = AsyncHanzo(base_url=base_url, api_key=api_key, _strict_response_validation=True) - + async def test_parse_retry_after_header( + self, remaining_retries: int, retry_after: str, timeout: float, async_client: AsyncHanzo + ) -> None: headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) - calculated = client._calculate_retry_timeout(remaining_retries, options, headers) + calculated = async_client._calculate_retry_timeout(remaining_retries, options, headers) assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] @mock.patch("hanzoai._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @@ -1546,7 +1587,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, with pytest.raises(APITimeoutError): await async_client.with_streaming_response.get_home().__aenter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(async_client) == 0 @mock.patch("hanzoai._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) @@ -1555,12 +1596,11 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, with pytest.raises(APIStatusError): await async_client.with_streaming_response.get_home().__aenter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(async_client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @mock.patch("hanzoai._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio @pytest.mark.parametrize("failure_mode", ["status", "exception"]) async def test_retries_taken( self, @@ -1592,7 +1632,6 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @mock.patch("hanzoai._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio async def test_omit_retry_count_header( self, async_client: AsyncHanzo, failures_before_success: int, respx_mock: MockRouter ) -> None: @@ -1616,7 +1655,6 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @mock.patch("hanzoai._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio async def test_overwrite_retry_count_header( self, async_client: AsyncHanzo, failures_before_success: int, respx_mock: MockRouter ) -> None: @@ -1664,26 +1702,26 @@ async def test_default_client_creation(self) -> None: ) @pytest.mark.respx(base_url=base_url) - async def test_follow_redirects(self, respx_mock: MockRouter) -> None: + async def test_follow_redirects(self, respx_mock: MockRouter, async_client: AsyncHanzo) -> None: # Test that the default follow_redirects=True allows following redirects respx_mock.post("/redirect").mock( return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"})) - response = await self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) + response = await async_client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) assert response.status_code == 200 assert response.json() == {"status": "ok"} @pytest.mark.respx(base_url=base_url) - async def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None: + async def test_follow_redirects_disabled(self, respx_mock: MockRouter, async_client: AsyncHanzo) -> None: # Test that follow_redirects=False prevents following redirects respx_mock.post("/redirect").mock( return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) with pytest.raises(APIStatusError) as exc_info: - await self.client.post( + await async_client.post( "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response ) From 69e3e3a8d2abc0902ee637dbd4dab136992f5409 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Nov 2025 06:27:51 +0000 Subject: [PATCH 40/41] chore(internal): codegen related update --- src/hanzoai/_utils/_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hanzoai/_utils/_utils.py b/src/hanzoai/_utils/_utils.py index 50d59269..eec7f4a1 100644 --- a/src/hanzoai/_utils/_utils.py +++ b/src/hanzoai/_utils/_utils.py @@ -133,7 +133,7 @@ def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]: # Type safe methods for narrowing types with TypeVars. # The default narrowing for isinstance(obj, dict) is dict[unknown, unknown], # however this cause Pyright to rightfully report errors. As we know we don't -# care about the contained types we can safely use `object` in it's place. +# care about the contained types we can safely use `object` in its place. # # There are two separate functions defined, `is_*` and `is_*_t` for different use cases. # `is_*` is for when you're dealing with an unknown input From f32f6762af6e00901d05bd00f72283c32a91e8c2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Nov 2025 06:28:20 +0000 Subject: [PATCH 41/41] release: 2.1.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 53 +++++++++++++++++++++++++++++++++++ pyproject.toml | 2 +- src/hanzoai/_version.py | 2 +- 4 files changed, 56 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4c4f7f20..656a2ef1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.0.2" + ".": "2.1.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index aad87a8f..354bc565 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,58 @@ # Changelog +## 2.1.0 (2025-11-04) + +Full Changelog: [v2.0.2...v2.1.0](https://github.com/hanzoai/python-sdk/compare/v2.0.2...v2.1.0) + +### Features + +* **api:** api update ([a05f652](https://github.com/hanzoai/python-sdk/commit/a05f6527170be1bd2d2c87bcd7f64057f77e8640)) +* **api:** api update ([63610f1](https://github.com/hanzoai/python-sdk/commit/63610f15db91dbad94e87e51ebbea6ac8c85b278)) +* **client:** add follow_redirects request option ([043f901](https://github.com/hanzoai/python-sdk/commit/043f9013103047d31680d29ada3dff35e3bf3f64)) + + +### Bug Fixes + +* **docs/api:** remove references to nonexistent types ([e28c7f6](https://github.com/hanzoai/python-sdk/commit/e28c7f6386b5c42a111a85f1cd4a588747fa8d83)) +* **package:** support direct resource imports ([dd95dad](https://github.com/hanzoai/python-sdk/commit/dd95dadc573369de39916f8bf4bd0e36fbe3feaf)) +* **perf:** optimize some hot paths ([6da686a](https://github.com/hanzoai/python-sdk/commit/6da686a68775c8d364e16790752773392ed21329)) +* **perf:** skip traversing types for NotGiven values ([5eade63](https://github.com/hanzoai/python-sdk/commit/5eade63f698e112a8c2a07fb7f3466bff33fdc39)) +* **pydantic v1:** more robust ModelField.annotation check ([c060430](https://github.com/hanzoai/python-sdk/commit/c0604303395ca27f73f16ea4bc4d05841acba51d)) + + +### Chores + +* broadly detect json family of content-type headers ([11bc5fd](https://github.com/hanzoai/python-sdk/commit/11bc5fd48e6536cbec838b676c64ce7a175f6b09)) +* **ci:** add timeout thresholds for CI jobs ([a283e86](https://github.com/hanzoai/python-sdk/commit/a283e8611476e227244e75d30c0340aa6afd67a1)) +* **ci:** fix installation instructions ([d92f111](https://github.com/hanzoai/python-sdk/commit/d92f1116f14aaaa9bb2c8a5b186b37dc5781a7d7)) +* **ci:** only use depot for staging repos ([15b3705](https://github.com/hanzoai/python-sdk/commit/15b3705165b138b4827f9fa18fa9b7b8966ab5bb)) +* **ci:** upload sdks to package manager ([51807ff](https://github.com/hanzoai/python-sdk/commit/51807ff9c91fbf15152c4d8850eec0e9a300e685)) +* **client:** minor internal fixes ([8b19fe5](https://github.com/hanzoai/python-sdk/commit/8b19fe5acf34e3f9d7da0b6b8739cc893fe784ed)) +* configure new SDK language ([2d6ad21](https://github.com/hanzoai/python-sdk/commit/2d6ad21c1518cb21658d308357a4017ff3e97973)) +* **docs:** grammar improvements ([f95243c](https://github.com/hanzoai/python-sdk/commit/f95243ce876224facdb415f49a893c9c4b891b48)) +* **docs:** remove reference to rye shell ([00fb01e](https://github.com/hanzoai/python-sdk/commit/00fb01e3fec2b8c4e70158ed6bdb796acc0d33bb)) +* **docs:** remove unnecessary param examples ([389eb26](https://github.com/hanzoai/python-sdk/commit/389eb26846c6920186f1751e6dba087d9b09ab0f)) +* **internal:** avoid errors for isinstance checks on proxies ([ef6b7d3](https://github.com/hanzoai/python-sdk/commit/ef6b7d319cee29263bac020390d6b3ec513648a4)) +* **internal:** base client updates ([d417414](https://github.com/hanzoai/python-sdk/commit/d417414c3430003fed22f62c10de07c0088588a2)) +* **internal:** bump pyright version ([c7706f0](https://github.com/hanzoai/python-sdk/commit/c7706f0871c28d186e5f249d24eb3a2a93b23cb2)) +* **internal:** codegen related update ([69e3e3a](https://github.com/hanzoai/python-sdk/commit/69e3e3a8d2abc0902ee637dbd4dab136992f5409)) +* **internal:** codegen related update ([809bfb2](https://github.com/hanzoai/python-sdk/commit/809bfb24f0872713c561ad0946d1581c48f53411)) +* **internal:** codegen related update ([ccb23d0](https://github.com/hanzoai/python-sdk/commit/ccb23d013dd8c8582d49f959ed8a3342ae2b3f3f)) +* **internal:** codegen related update ([b742fa1](https://github.com/hanzoai/python-sdk/commit/b742fa12ecd53d7f94a4ef142868ee211494d39b)) +* **internal:** codegen related update ([eca6f32](https://github.com/hanzoai/python-sdk/commit/eca6f3283793c38d6e070c53d5aff33977e0a279)) +* **internal:** codegen related update ([7d7c3ce](https://github.com/hanzoai/python-sdk/commit/7d7c3cee07ff188e208df8fc14df73d9bbc5827e)) +* **internal:** codegen related update ([697ab40](https://github.com/hanzoai/python-sdk/commit/697ab40b8cd1bedf4cf7398a35408ca364e33d52)) +* **internal:** expand CI branch coverage ([fd3cd26](https://github.com/hanzoai/python-sdk/commit/fd3cd268f6d853b66702f5e05934b0b7deb29abf)) +* **internal:** fix list file params ([e2d6428](https://github.com/hanzoai/python-sdk/commit/e2d64282e2feaa9e239f434e2644d1a5e5271ede)) +* **internal:** import reformatting ([3a69aa9](https://github.com/hanzoai/python-sdk/commit/3a69aa9c55cc2bd2289335ce353c9da067a1b4f6)) +* **internal:** minor formatting changes ([c4357ac](https://github.com/hanzoai/python-sdk/commit/c4357ac7f204b602cb29c4d4beb9bd1ca99773fc)) +* **internal:** reduce CI branch coverage ([56b4e45](https://github.com/hanzoai/python-sdk/commit/56b4e459a37ed1510622d2ff2127d789ddaa9893)) +* **internal:** refactor retries to not use recursion ([25ce097](https://github.com/hanzoai/python-sdk/commit/25ce0973aaa11be64968f6236ec101ce524dc855)) +* **internal:** slight transform perf improvement ([#24](https://github.com/hanzoai/python-sdk/issues/24)) ([f35d86d](https://github.com/hanzoai/python-sdk/commit/f35d86ddeba896b99c00874cbd3bfba0086741cd)) +* **internal:** update models test ([77dbb5e](https://github.com/hanzoai/python-sdk/commit/77dbb5e3520be7aabad5a8e1259ab060d8d3dfca)) +* **internal:** update pyright settings ([bbb302d](https://github.com/hanzoai/python-sdk/commit/bbb302d80ca7a6cf3b5bf2a58fdaac4f3a6e7e2e)) +* slight wording improvement in README ([#25](https://github.com/hanzoai/python-sdk/issues/25)) ([b42f098](https://github.com/hanzoai/python-sdk/commit/b42f098ec1005979a4ee2cb1bd2bb394c16ae2a3)) + ## 2.0.2 (2025-04-04) Full Changelog: [v2.0.1...v2.0.2](https://github.com/hanzoai/python-sdk/compare/v2.0.1...v2.0.2) diff --git a/pyproject.toml b/pyproject.toml index c5722ae4..d47ec9b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "hanzoai" -version = "2.0.2" +version = "2.1.0" description = "The official Python library for the Hanzo API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/hanzoai/_version.py b/src/hanzoai/_version.py index 919978fd..add0fc28 100644 --- a/src/hanzoai/_version.py +++ b/src/hanzoai/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "hanzoai" -__version__ = "2.0.2" # x-release-please-version +__version__ = "2.1.0" # x-release-please-version