diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c523ce1..c3c9552 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.8.0" + ".": "1.9.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 183571e..0e65bf2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-e67b8e285739a9a3998fbe39b5eb97fac5bb8f571781d4f5d242b3824d4d743e.yml -openapi_spec_hash: bd661c93deb864b606bfc2d2ee110a1f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-b1433c9d499d0eee441fab12578e7c11fe2f67bbf6f9fd5f894086b21f41dd30.yml +openapi_spec_hash: 95d25454996689921708f43481d6cdcc config_hash: 00b1a3fd1b197bd253cdd6b7bc360c02 diff --git a/CHANGELOG.md b/CHANGELOG.md index 56599e3..037bd72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 1.9.0 (2025-09-20) + +Full Changelog: [v1.8.0...v1.9.0](https://github.com/ArcadeAI/arcade-py/compare/v1.8.0...v1.9.0) + +### Features + +* **api:** api update ([eebc9ed](https://github.com/ArcadeAI/arcade-py/commit/eebc9edf476f0838f584f6d356fdaee8d8d79c76)) + + +### Chores + +* do not install brew dependencies in ./scripts/bootstrap by default ([927371b](https://github.com/ArcadeAI/arcade-py/commit/927371b47365c528be87e5dce549c0363d9b7a11)) +* **internal:** update pydantic dependency ([450a852](https://github.com/ArcadeAI/arcade-py/commit/450a852ffa8000a2c7e1d4d294a925366301c3fd)) +* **types:** change optional parameter type from NotGiven to Omit ([484c472](https://github.com/ArcadeAI/arcade-py/commit/484c472696a53d5b7ea9c14d9a826bc6701f0704)) + ## 1.8.0 (2025-09-11) Full Changelog: [v1.7.0...v1.8.0](https://github.com/ArcadeAI/arcade-py/compare/v1.7.0...v1.8.0) diff --git a/pyproject.toml b/pyproject.toml index f0395f7..b313cd2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "arcadepy" -version = "1.8.0" +version = "1.9.0" description = "The official Python library for the Arcade API" dynamic = ["readme"] license = "MIT" diff --git a/requirements-dev.lock b/requirements-dev.lock index cdc05b4..d154c5c 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 arcadepy -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 453acf2..75fa625 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 arcadepy -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/scripts/bootstrap b/scripts/bootstrap index e84fe62..b430fee 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/arcadepy/__init__.py b/src/arcadepy/__init__.py index fe2533d..a66e928 100644 --- a/src/arcadepy/__init__.py +++ b/src/arcadepy/__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 Arcade, Client, Stream, Timeout, Transport, AsyncArcade, AsyncClient, AsyncStream, RequestOptions from ._models import BaseModel @@ -38,7 +38,9 @@ "ProxiesTypes", "NotGiven", "NOT_GIVEN", + "not_given", "Omit", + "omit", "ArcadeError", "APIError", "APIStatusError", diff --git a/src/arcadepy/_base_client.py b/src/arcadepy/_base_client.py index 0d9b8ac..57cf33c 100644 --- a/src/arcadepy/_base_client.py +++ b/src/arcadepy/_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/arcadepy/_client.py b/src/arcadepy/_client.py index 76bf3a2..7ad9056 100644 --- a/src/arcadepy/_client.py +++ b/src/arcadepy/_client.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Union, Mapping +from typing import Any, Mapping from typing_extensions import Self, override import httpx @@ -11,13 +11,13 @@ from . import _exceptions from ._qs import Querystring from ._types import ( - NOT_GIVEN, Omit, Timeout, NotGiven, Transport, ProxiesTypes, RequestOptions, + not_given, ) from ._utils import is_given, get_async_library from ._version import __version__ @@ -54,7 +54,7 @@ def __init__( *, api_key: str | None = None, base_url: str | httpx.URL | None = None, - timeout: Union[float, Timeout, 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, @@ -134,9 +134,9 @@ def copy( *, api_key: str | 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, @@ -232,7 +232,7 @@ def __init__( *, api_key: str | None = None, base_url: str | httpx.URL | None = None, - timeout: Union[float, Timeout, 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, @@ -312,9 +312,9 @@ def copy( *, api_key: str | 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, diff --git a/src/arcadepy/_models.py b/src/arcadepy/_models.py index 3a6017e..6a3cd1d 100644 --- a/src/arcadepy/_models.py +++ b/src/arcadepy/_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, diff --git a/src/arcadepy/_qs.py b/src/arcadepy/_qs.py index 274320c..ada6fd3 100644 --- a/src/arcadepy/_qs.py +++ b/src/arcadepy/_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/arcadepy/_types.py b/src/arcadepy/_types.py index c7ceaa8..39e9386 100644 --- a/src/arcadepy/_types.py +++ b/src/arcadepy/_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/arcadepy/_utils/_transform.py b/src/arcadepy/_utils/_transform.py index c19124f..5207549 100644 --- a/src/arcadepy/_utils/_transform.py +++ b/src/arcadepy/_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/arcadepy/_utils/_utils.py b/src/arcadepy/_utils/_utils.py index f081859..50d5926 100644 --- a/src/arcadepy/_utils/_utils.py +++ b/src/arcadepy/_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/arcadepy/_version.py b/src/arcadepy/_version.py index 39976b0..285daf2 100644 --- a/src/arcadepy/_version.py +++ b/src/arcadepy/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "arcadepy" -__version__ = "1.8.0" # x-release-please-version +__version__ = "1.9.0" # x-release-please-version diff --git a/src/arcadepy/resources/admin/auth_providers.py b/src/arcadepy/resources/admin/auth_providers.py index 076fd7e..4378409 100644 --- a/src/arcadepy/resources/admin/auth_providers.py +++ b/src/arcadepy/resources/admin/auth_providers.py @@ -4,7 +4,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,18 +46,18 @@ def create( self, *, id: str, - description: str | NotGiven = NOT_GIVEN, - external_id: str | NotGiven = NOT_GIVEN, - oauth2: auth_provider_create_params.Oauth2 | NotGiven = NOT_GIVEN, - provider_id: str | NotGiven = NOT_GIVEN, - status: str | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + external_id: str | Omit = omit, + oauth2: auth_provider_create_params.Oauth2 | Omit = omit, + provider_id: str | Omit = omit, + status: str | Omit = omit, + type: 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, ) -> AuthProviderResponse: """ Create a new auth provider @@ -101,7 +101,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, ) -> AuthProviderListResponse: """List a page of auth providers that are available to the caller""" return self._get( @@ -121,7 +121,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, ) -> AuthProviderResponse: """ Delete a specific auth provider @@ -154,7 +154,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AuthProviderResponse: """ Get the details of a specific auth provider @@ -182,18 +182,18 @@ def patch( self, path_id: str, *, - body_id: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - oauth2: auth_provider_patch_params.Oauth2 | NotGiven = NOT_GIVEN, - provider_id: str | NotGiven = NOT_GIVEN, - status: str | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + body_id: str | Omit = omit, + description: str | Omit = omit, + oauth2: auth_provider_patch_params.Oauth2 | Omit = omit, + provider_id: str | Omit = omit, + status: str | Omit = omit, + type: 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, ) -> AuthProviderResponse: """ Patch an existing auth provider @@ -253,18 +253,18 @@ async def create( self, *, id: str, - description: str | NotGiven = NOT_GIVEN, - external_id: str | NotGiven = NOT_GIVEN, - oauth2: auth_provider_create_params.Oauth2 | NotGiven = NOT_GIVEN, - provider_id: str | NotGiven = NOT_GIVEN, - status: str | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + external_id: str | Omit = omit, + oauth2: auth_provider_create_params.Oauth2 | Omit = omit, + provider_id: str | Omit = omit, + status: str | Omit = omit, + type: 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, ) -> AuthProviderResponse: """ Create a new auth provider @@ -308,7 +308,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, ) -> AuthProviderListResponse: """List a page of auth providers that are available to the caller""" return await self._get( @@ -328,7 +328,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, ) -> AuthProviderResponse: """ Delete a specific auth provider @@ -361,7 +361,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AuthProviderResponse: """ Get the details of a specific auth provider @@ -389,18 +389,18 @@ async def patch( self, path_id: str, *, - body_id: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - oauth2: auth_provider_patch_params.Oauth2 | NotGiven = NOT_GIVEN, - provider_id: str | NotGiven = NOT_GIVEN, - status: str | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + body_id: str | Omit = omit, + description: str | Omit = omit, + oauth2: auth_provider_patch_params.Oauth2 | Omit = omit, + provider_id: str | Omit = omit, + status: str | Omit = omit, + type: 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, ) -> AuthProviderResponse: """ Patch an existing auth provider diff --git a/src/arcadepy/resources/admin/secrets.py b/src/arcadepy/resources/admin/secrets.py index 88cecaa..ac839d9 100644 --- a/src/arcadepy/resources/admin/secrets.py +++ b/src/arcadepy/resources/admin/secrets.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ..._types import Body, Query, Headers, NoneType, 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, ) -> SecretListResponse: """List all secrets that are visible to the caller""" return self._get( @@ -67,7 +67,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, ) -> None: """ Delete a secret by its ID @@ -121,7 +121,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, ) -> SecretListResponse: """List all secrets that are visible to the caller""" return await self._get( @@ -141,7 +141,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, ) -> None: """ Delete a secret by its ID diff --git a/src/arcadepy/resources/admin/user_connections.py b/src/arcadepy/resources/admin/user_connections.py index 9a5e164..dc9b9b0 100644 --- a/src/arcadepy/resources/admin/user_connections.py +++ b/src/arcadepy/resources/admin/user_connections.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -45,16 +45,16 @@ def with_streaming_response(self) -> UserConnectionsResourceWithStreamingRespons def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, - provider: user_connection_list_params.Provider | NotGiven = NOT_GIVEN, - user: user_connection_list_params.User | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + offset: int | Omit = omit, + provider: user_connection_list_params.Provider | Omit = omit, + user: user_connection_list_params.User | 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, ) -> SyncOffsetPage[UserConnectionResponse]: """ List all auth connections @@ -102,7 +102,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, ) -> None: """ Delete a user/auth provider connection @@ -151,16 +151,16 @@ def with_streaming_response(self) -> AsyncUserConnectionsResourceWithStreamingRe def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, - provider: user_connection_list_params.Provider | NotGiven = NOT_GIVEN, - user: user_connection_list_params.User | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + offset: int | Omit = omit, + provider: user_connection_list_params.Provider | Omit = omit, + user: user_connection_list_params.User | 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, ) -> AsyncPaginator[UserConnectionResponse, AsyncOffsetPage[UserConnectionResponse]]: """ List all auth connections @@ -208,7 +208,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, ) -> None: """ Delete a user/auth provider connection diff --git a/src/arcadepy/resources/auth.py b/src/arcadepy/resources/auth.py index fd7afaf..b3b794e 100644 --- a/src/arcadepy/resources/auth.py +++ b/src/arcadepy/resources/auth.py @@ -5,7 +5,7 @@ import httpx from ..types import auth_status_params, auth_authorize_params, auth_confirm_user_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 @@ -49,13 +49,13 @@ def authorize( *, auth_requirement: auth_authorize_params.AuthRequirement, user_id: str, - next_uri: str | NotGiven = NOT_GIVEN, + next_uri: 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, ) -> AuthorizationResponse: """ Starts the authorization process for given authorization requirements @@ -128,7 +128,7 @@ def confirm_user( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConfirmUserResponse: """ Confirms a user's details during an authorization flow @@ -161,13 +161,13 @@ def status( self, *, id: str, - wait: int | NotGiven = NOT_GIVEN, + wait: 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, ) -> AuthorizationResponse: """Checks the status of an ongoing authorization process for a specific tool. @@ -259,13 +259,13 @@ async def authorize( *, auth_requirement: auth_authorize_params.AuthRequirement, user_id: str, - next_uri: str | NotGiven = NOT_GIVEN, + next_uri: 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, ) -> AuthorizationResponse: """ Starts the authorization process for given authorization requirements @@ -338,7 +338,7 @@ async def confirm_user( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConfirmUserResponse: """ Confirms a user's details during an authorization flow @@ -371,13 +371,13 @@ async def status( self, *, id: str, - wait: int | NotGiven = NOT_GIVEN, + wait: 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, ) -> AuthorizationResponse: """Checks the status of an ongoing authorization process for a specific tool. diff --git a/src/arcadepy/resources/chat/completions.py b/src/arcadepy/resources/chat/completions.py index 14448ad..a875aaf 100644 --- a/src/arcadepy/resources/chat/completions.py +++ b/src/arcadepy/resources/chat/completions.py @@ -6,7 +6,7 @@ import httpx -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 @@ -47,32 +47,32 @@ def with_streaming_response(self) -> CompletionsResourceWithStreamingResponse: def create( self, *, - frequency_penalty: float | NotGiven = NOT_GIVEN, - logit_bias: Dict[str, int] | NotGiven = NOT_GIVEN, - logprobs: bool | NotGiven = NOT_GIVEN, - max_tokens: int | NotGiven = NOT_GIVEN, - messages: Iterable[ChatMessageParam] | NotGiven = NOT_GIVEN, - model: str | NotGiven = NOT_GIVEN, - n: int | NotGiven = NOT_GIVEN, - parallel_tool_calls: bool | NotGiven = NOT_GIVEN, - presence_penalty: float | NotGiven = NOT_GIVEN, - response_format: completion_create_params.ResponseFormat | NotGiven = NOT_GIVEN, - seed: int | NotGiven = NOT_GIVEN, - stop: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - stream: bool | NotGiven = NOT_GIVEN, - stream_options: completion_create_params.StreamOptions | NotGiven = NOT_GIVEN, - temperature: float | NotGiven = NOT_GIVEN, - tool_choice: object | NotGiven = NOT_GIVEN, - tools: object | NotGiven = NOT_GIVEN, - top_logprobs: int | NotGiven = NOT_GIVEN, - top_p: float | NotGiven = NOT_GIVEN, - user: str | NotGiven = NOT_GIVEN, + frequency_penalty: float | Omit = omit, + logit_bias: Dict[str, int] | Omit = omit, + logprobs: bool | Omit = omit, + max_tokens: int | Omit = omit, + messages: Iterable[ChatMessageParam] | Omit = omit, + model: str | Omit = omit, + n: int | Omit = omit, + parallel_tool_calls: bool | Omit = omit, + presence_penalty: float | Omit = omit, + response_format: completion_create_params.ResponseFormat | Omit = omit, + seed: int | Omit = omit, + stop: SequenceNotStr[str] | Omit = omit, + stream: bool | Omit = omit, + stream_options: completion_create_params.StreamOptions | Omit = omit, + temperature: float | Omit = omit, + tool_choice: object | Omit = omit, + tools: object | Omit = omit, + top_logprobs: int | Omit = omit, + top_p: float | Omit = omit, + user: 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, ) -> ChatResponse: """ Interact with language models via OpenAI's chat completions API @@ -163,32 +163,32 @@ def with_streaming_response(self) -> AsyncCompletionsResourceWithStreamingRespon async def create( self, *, - frequency_penalty: float | NotGiven = NOT_GIVEN, - logit_bias: Dict[str, int] | NotGiven = NOT_GIVEN, - logprobs: bool | NotGiven = NOT_GIVEN, - max_tokens: int | NotGiven = NOT_GIVEN, - messages: Iterable[ChatMessageParam] | NotGiven = NOT_GIVEN, - model: str | NotGiven = NOT_GIVEN, - n: int | NotGiven = NOT_GIVEN, - parallel_tool_calls: bool | NotGiven = NOT_GIVEN, - presence_penalty: float | NotGiven = NOT_GIVEN, - response_format: completion_create_params.ResponseFormat | NotGiven = NOT_GIVEN, - seed: int | NotGiven = NOT_GIVEN, - stop: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - stream: bool | NotGiven = NOT_GIVEN, - stream_options: completion_create_params.StreamOptions | NotGiven = NOT_GIVEN, - temperature: float | NotGiven = NOT_GIVEN, - tool_choice: object | NotGiven = NOT_GIVEN, - tools: object | NotGiven = NOT_GIVEN, - top_logprobs: int | NotGiven = NOT_GIVEN, - top_p: float | NotGiven = NOT_GIVEN, - user: str | NotGiven = NOT_GIVEN, + frequency_penalty: float | Omit = omit, + logit_bias: Dict[str, int] | Omit = omit, + logprobs: bool | Omit = omit, + max_tokens: int | Omit = omit, + messages: Iterable[ChatMessageParam] | Omit = omit, + model: str | Omit = omit, + n: int | Omit = omit, + parallel_tool_calls: bool | Omit = omit, + presence_penalty: float | Omit = omit, + response_format: completion_create_params.ResponseFormat | Omit = omit, + seed: int | Omit = omit, + stop: SequenceNotStr[str] | Omit = omit, + stream: bool | Omit = omit, + stream_options: completion_create_params.StreamOptions | Omit = omit, + temperature: float | Omit = omit, + tool_choice: object | Omit = omit, + tools: object | Omit = omit, + top_logprobs: int | Omit = omit, + top_p: float | Omit = omit, + user: 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, ) -> ChatResponse: """ Interact with language models via OpenAI's chat completions API diff --git a/src/arcadepy/resources/health.py b/src/arcadepy/resources/health.py index 02f18e4..34d2cc7 100644 --- a/src/arcadepy/resources/health.py +++ b/src/arcadepy/resources/health.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 check( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HealthSchema: """Check if Arcade Engine is healthy""" return self._get( @@ -87,7 +87,7 @@ async def check( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HealthSchema: """Check if Arcade Engine is healthy""" return await self._get( diff --git a/src/arcadepy/resources/tools/formatted.py b/src/arcadepy/resources/tools/formatted.py index c1d4db6..4b85016 100644 --- a/src/arcadepy/resources/tools/formatted.py +++ b/src/arcadepy/resources/tools/formatted.py @@ -4,7 +4,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 @@ -44,17 +44,17 @@ def with_streaming_response(self) -> FormattedResourceWithStreamingResponse: def list( self, *, - format: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, - toolkit: str | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, + format: str | Omit = omit, + limit: int | Omit = omit, + offset: int | Omit = omit, + toolkit: str | Omit = omit, + user_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, ) -> SyncOffsetPage[object]: """ Returns a page of tools from the engine configuration, optionally filtered by @@ -105,14 +105,14 @@ def get( self, name: str, *, - format: str | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, + format: str | Omit = omit, + user_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: """ Returns the formatted tool specification for a specific tool, given a provider @@ -174,17 +174,17 @@ def with_streaming_response(self) -> AsyncFormattedResourceWithStreamingResponse def list( self, *, - format: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, - toolkit: str | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, + format: str | Omit = omit, + limit: int | Omit = omit, + offset: int | Omit = omit, + toolkit: str | Omit = omit, + user_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, ) -> AsyncPaginator[object, AsyncOffsetPage[object]]: """ Returns a page of tools from the engine configuration, optionally filtered by @@ -235,14 +235,14 @@ async def get( self, name: str, *, - format: str | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, + format: str | Omit = omit, + user_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: """ Returns the formatted tool specification for a specific tool, given a provider diff --git a/src/arcadepy/resources/tools/scheduled.py b/src/arcadepy/resources/tools/scheduled.py index af32f59..5003b23 100644 --- a/src/arcadepy/resources/tools/scheduled.py +++ b/src/arcadepy/resources/tools/scheduled.py @@ -4,7 +4,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 from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -50,14 +50,14 @@ def with_streaming_response(self) -> ScheduledResourceWithStreamingResponse: def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + offset: 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, ) -> SyncOffsetPage[ToolExecution]: """ Returns a page of scheduled tool executions @@ -103,7 +103,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScheduledGetResponse: """ Returns the details for a specific scheduled tool execution @@ -151,14 +151,14 @@ def with_streaming_response(self) -> AsyncScheduledResourceWithStreamingResponse def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + offset: 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, ) -> AsyncPaginator[ToolExecution, AsyncOffsetPage[ToolExecution]]: """ Returns a page of scheduled tool executions @@ -204,7 +204,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScheduledGetResponse: """ Returns the details for a specific scheduled tool execution diff --git a/src/arcadepy/resources/tools/tools.py b/src/arcadepy/resources/tools/tools.py index 4157070..30aec45 100644 --- a/src/arcadepy/resources/tools/tools.py +++ b/src/arcadepy/resources/tools/tools.py @@ -8,7 +8,7 @@ import httpx from ...types import tool_get_params, tool_list_params, tool_execute_params, tool_authorize_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 .formatted import ( @@ -74,17 +74,17 @@ def with_streaming_response(self) -> ToolsResourceWithStreamingResponse: def list( self, *, - include_format: List[Literal["arcade", "openai", "anthropic"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, - toolkit: str | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, + include_format: List[Literal["arcade", "openai", "anthropic"]] | Omit = omit, + limit: int | Omit = omit, + offset: int | Omit = omit, + toolkit: str | Omit = omit, + user_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, ) -> SyncOffsetPage[ToolDefinition]: """ Returns a page of tools from the engine configuration, optionally filtered by @@ -135,15 +135,15 @@ def authorize( self, *, tool_name: str, - next_uri: str | NotGiven = NOT_GIVEN, - tool_version: str | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, + next_uri: str | Omit = omit, + tool_version: str | Omit = omit, + user_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, ) -> AuthorizationResponse: """ Authorizes a user for a specific tool by name @@ -185,17 +185,17 @@ def execute( self, *, tool_name: str, - include_error_stacktrace: bool | NotGiven = NOT_GIVEN, - input: Dict[str, object] | NotGiven = NOT_GIVEN, - run_at: str | NotGiven = NOT_GIVEN, - tool_version: str | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, + include_error_stacktrace: bool | Omit = omit, + input: Dict[str, object] | Omit = omit, + run_at: str | Omit = omit, + tool_version: str | Omit = omit, + user_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, ) -> ExecuteToolResponse: """ Executes a tool by name and arguments @@ -242,14 +242,14 @@ def get( self, name: str, *, - include_format: List[Literal["arcade", "openai", "anthropic"]] | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, + include_format: List[Literal["arcade", "openai", "anthropic"]] | Omit = omit, + user_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, ) -> ToolDefinition: """ Returns the arcade tool specification for a specific tool @@ -319,17 +319,17 @@ def with_streaming_response(self) -> AsyncToolsResourceWithStreamingResponse: def list( self, *, - include_format: List[Literal["arcade", "openai", "anthropic"]] | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, - toolkit: str | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, + include_format: List[Literal["arcade", "openai", "anthropic"]] | Omit = omit, + limit: int | Omit = omit, + offset: int | Omit = omit, + toolkit: str | Omit = omit, + user_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, ) -> AsyncPaginator[ToolDefinition, AsyncOffsetPage[ToolDefinition]]: """ Returns a page of tools from the engine configuration, optionally filtered by @@ -380,15 +380,15 @@ async def authorize( self, *, tool_name: str, - next_uri: str | NotGiven = NOT_GIVEN, - tool_version: str | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, + next_uri: str | Omit = omit, + tool_version: str | Omit = omit, + user_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, ) -> AuthorizationResponse: """ Authorizes a user for a specific tool by name @@ -430,17 +430,17 @@ async def execute( self, *, tool_name: str, - include_error_stacktrace: bool | NotGiven = NOT_GIVEN, - input: Dict[str, object] | NotGiven = NOT_GIVEN, - run_at: str | NotGiven = NOT_GIVEN, - tool_version: str | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, + include_error_stacktrace: bool | Omit = omit, + input: Dict[str, object] | Omit = omit, + run_at: str | Omit = omit, + tool_version: str | Omit = omit, + user_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, ) -> ExecuteToolResponse: """ Executes a tool by name and arguments @@ -487,14 +487,14 @@ async def get( self, name: str, *, - include_format: List[Literal["arcade", "openai", "anthropic"]] | NotGiven = NOT_GIVEN, - user_id: str | NotGiven = NOT_GIVEN, + include_format: List[Literal["arcade", "openai", "anthropic"]] | Omit = omit, + user_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, ) -> ToolDefinition: """ Returns the arcade tool specification for a specific tool diff --git a/src/arcadepy/resources/workers.py b/src/arcadepy/resources/workers.py index 3fa6e2c..1bb6a03 100644 --- a/src/arcadepy/resources/workers.py +++ b/src/arcadepy/resources/workers.py @@ -5,7 +5,7 @@ import httpx from ..types import worker_list_params, worker_tools_params, worker_create_params, worker_update_params -from .._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -48,16 +48,16 @@ def create( self, *, id: str, - enabled: bool | NotGiven = NOT_GIVEN, - http: worker_create_params.HTTP | NotGiven = NOT_GIVEN, - mcp: worker_create_params.Mcp | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + enabled: bool | Omit = omit, + http: worker_create_params.HTTP | Omit = omit, + mcp: worker_create_params.Mcp | Omit = omit, + type: 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, ) -> WorkerResponse: """ Create a worker @@ -93,15 +93,15 @@ def update( self, id: str, *, - enabled: bool | NotGiven = NOT_GIVEN, - http: worker_update_params.HTTP | NotGiven = NOT_GIVEN, - mcp: worker_update_params.Mcp | NotGiven = NOT_GIVEN, + enabled: bool | Omit = omit, + http: worker_update_params.HTTP | Omit = omit, + mcp: worker_update_params.Mcp | 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, ) -> WorkerResponse: """ Update a worker @@ -136,14 +136,14 @@ def update( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + offset: 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, ) -> SyncOffsetPage[WorkerResponse]: """ List all workers with their definitions @@ -189,7 +189,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, ) -> None: """ Delete a worker @@ -223,7 +223,7 @@ def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WorkerResponse: """ Get a worker by ID @@ -256,7 +256,7 @@ def 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, ) -> WorkerHealthResponse: """ Get the health of a worker @@ -284,14 +284,14 @@ def tools( self, id: str, *, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + offset: 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, ) -> SyncOffsetPage[ToolDefinition]: """ Returns a page of tools @@ -355,16 +355,16 @@ async def create( self, *, id: str, - enabled: bool | NotGiven = NOT_GIVEN, - http: worker_create_params.HTTP | NotGiven = NOT_GIVEN, - mcp: worker_create_params.Mcp | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + enabled: bool | Omit = omit, + http: worker_create_params.HTTP | Omit = omit, + mcp: worker_create_params.Mcp | Omit = omit, + type: 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, ) -> WorkerResponse: """ Create a worker @@ -400,15 +400,15 @@ async def update( self, id: str, *, - enabled: bool | NotGiven = NOT_GIVEN, - http: worker_update_params.HTTP | NotGiven = NOT_GIVEN, - mcp: worker_update_params.Mcp | NotGiven = NOT_GIVEN, + enabled: bool | Omit = omit, + http: worker_update_params.HTTP | Omit = omit, + mcp: worker_update_params.Mcp | 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, ) -> WorkerResponse: """ Update a worker @@ -443,14 +443,14 @@ async def update( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + offset: 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, ) -> AsyncPaginator[WorkerResponse, AsyncOffsetPage[WorkerResponse]]: """ List all workers with their definitions @@ -496,7 +496,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, ) -> None: """ Delete a worker @@ -530,7 +530,7 @@ async def get( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WorkerResponse: """ Get a worker by ID @@ -563,7 +563,7 @@ async def 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, ) -> WorkerHealthResponse: """ Get the health of a worker @@ -591,14 +591,14 @@ def tools( self, id: str, *, - limit: int | NotGiven = NOT_GIVEN, - offset: int | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + offset: 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, ) -> AsyncPaginator[ToolDefinition, AsyncOffsetPage[ToolDefinition]]: """ Returns a page of tools diff --git a/src/arcadepy/types/worker_response.py b/src/arcadepy/types/worker_response.py index 47c4ea8..bd32e7a 100644 --- a/src/arcadepy/types/worker_response.py +++ b/src/arcadepy/types/worker_response.py @@ -5,7 +5,7 @@ from .._models import BaseModel -__all__ = ["WorkerResponse", "Binding", "HTTP", "HTTPSecret", "Mcp", "Oxp", "OxpSecret"] +__all__ = ["WorkerResponse", "Binding", "HTTP", "HTTPSecret", "Mcp"] class Binding(BaseModel): @@ -44,28 +44,6 @@ class Mcp(BaseModel): uri: Optional[str] = None -class OxpSecret(BaseModel): - binding: Optional[Literal["static", "tenant", "project", "account"]] = None - - editable: Optional[bool] = None - - exists: Optional[bool] = None - - hint: Optional[str] = None - - value: Optional[str] = None - - -class Oxp(BaseModel): - retry: Optional[int] = None - - secret: Optional[OxpSecret] = None - - timeout: Optional[int] = None - - uri: Optional[str] = None - - class WorkerResponse(BaseModel): id: Optional[str] = None @@ -79,6 +57,4 @@ class WorkerResponse(BaseModel): mcp: Optional[Mcp] = None - oxp: Optional[Oxp] = None - type: Optional[Literal["http", "mcp", "unknown"]] = None diff --git a/tests/test_transform.py b/tests/test_transform.py index b104e1c..bbb8c87 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -8,7 +8,7 @@ import pytest -from arcadepy._types import NOT_GIVEN, Base64FileInput +from arcadepy._types import Base64FileInput, omit, not_given from arcadepy._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) == {}