From 85bc8eb26afdfd7deb28ce2198eb3ef02181b95f Mon Sep 17 00:00:00 2001 From: Ben Batha Date: Mon, 8 Sep 2025 16:49:51 -0400 Subject: [PATCH 01/96] feat: normalize user agent with other do clients --- src/gradient/_base_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gradient/_base_client.py b/src/gradient/_base_client.py index 74f3c57a..6f2db396 100644 --- a/src/gradient/_base_client.py +++ b/src/gradient/_base_client.py @@ -671,7 +671,7 @@ def _validate_headers( @property def user_agent(self) -> str: - return f"{self.__class__.__name__}/Python {self._version}" + return f"{self.__class__.__name__}/Python/{self._version}" @property def base_url(self) -> URL: From 5a6aa9241b5e7c2f4319caa14d62f41c0c824f9e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 20:10:08 +0000 Subject: [PATCH 02/96] feat(types): replace List[str] with SequenceNotStr in params --- src/gradient/_utils/_transform.py | 6 +++ src/gradient/resources/agents/agents.py | 16 +++---- .../resources/agents/chat/completions.py | 28 +++++------ .../evaluation_metrics/workspaces/agents.py | 8 ++-- .../workspaces/workspaces.py | 8 ++-- .../resources/agents/evaluation_runs.py | 8 ++-- .../resources/agents/evaluation_test_cases.py | 8 ++-- src/gradient/resources/chat/completions.py | 28 +++++------ .../destroy_with_associated_resources.py | 24 +++++----- .../resources/gpu_droplets/firewalls/tags.py | 12 ++--- .../resources/gpu_droplets/gpu_droplets.py | 48 +++++++++---------- .../resources/gpu_droplets/images/images.py | 8 ++-- .../load_balancers/load_balancers.py | 28 +++++------ .../resources/gpu_droplets/volumes/actions.py | 20 ++++---- .../gpu_droplets/volumes/snapshots.py | 8 ++-- .../resources/gpu_droplets/volumes/volumes.py | 16 +++---- .../knowledge_bases/indexing_jobs.py | 8 ++-- .../knowledge_bases/knowledge_bases.py | 12 ++--- src/gradient/types/agent_create_params.py | 6 +-- src/gradient/types/agent_update_params.py | 4 +- .../agents/chat/completion_create_params.py | 14 +++--- .../workspace_create_params.py | 5 +- .../workspaces/agent_move_params.py | 4 +- .../agents/evaluation_run_create_params.py | 5 +- .../evaluation_test_case_create_params.py | 4 +- .../evaluation_test_case_update_params.py | 4 +- .../types/chat/completion_create_params.py | 14 +++--- .../types/gpu_droplet_create_params.py | 17 +++---- .../autoscale_pool_droplet_template_param.py | 7 +-- ...ciated_resource_delete_selective_params.py | 13 ++--- .../types/gpu_droplets/firewall_param.py | 5 +- .../gpu_droplets/firewalls/tag_add_params.py | 6 ++- .../firewalls/tag_remove_params.py | 6 ++- .../types/gpu_droplets/image_create_params.py | 6 ++- .../types/gpu_droplets/lb_firewall_param.py | 7 +-- .../load_balancer_create_params.py | 7 +-- .../load_balancer_update_params.py | 7 +-- .../gpu_droplets/volume_create_params.py | 8 ++-- .../volumes/action_initiate_by_id_params.py | 6 ++- .../volumes/action_initiate_by_name_params.py | 6 ++- .../volumes/snapshot_create_params.py | 6 ++- .../types/knowledge_base_create_params.py | 5 +- .../types/knowledge_base_update_params.py | 4 +- .../indexing_job_create_params.py | 5 +- .../shared_params/firewall_rule_target.py | 12 +++-- 45 files changed, 255 insertions(+), 232 deletions(-) diff --git a/src/gradient/_utils/_transform.py b/src/gradient/_utils/_transform.py index b0cc20a7..f0bcefd4 100644 --- a/src/gradient/_utils/_transform.py +++ b/src/gradient/_utils/_transform.py @@ -16,6 +16,7 @@ lru_cache, is_mapping, is_iterable, + is_sequence, ) from .._files import is_base64_file_input from ._typing import ( @@ -24,6 +25,7 @@ extract_type_arg, is_iterable_type, is_required_type, + is_sequence_type, is_annotated_type, strip_annotated_type, ) @@ -184,6 +186,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. @@ -346,6 +350,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/gradient/resources/agents/agents.py b/src/gradient/resources/agents/agents.py index 67f7f4ae..8d06584c 100644 --- a/src/gradient/resources/agents/agents.py +++ b/src/gradient/resources/agents/agents.py @@ -2,8 +2,6 @@ from __future__ import annotations -from typing import List - import httpx from .routes import ( @@ -22,7 +20,7 @@ agent_update_params, agent_update_status_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 .api_keys import ( APIKeysResource, @@ -183,13 +181,13 @@ def create( anthropic_key_uuid: str | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, instruction: str | NotGiven = NOT_GIVEN, - knowledge_base_uuid: List[str] | NotGiven = NOT_GIVEN, + knowledge_base_uuid: SequenceNotStr[str] | NotGiven = NOT_GIVEN, model_uuid: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, openai_key_uuid: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, region: str | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + tags: SequenceNotStr[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. extra_headers: Headers | None = None, @@ -313,7 +311,7 @@ def update( project_id: str | NotGiven = NOT_GIVEN, provide_citations: bool | NotGiven = NOT_GIVEN, retrieval_method: APIRetrievalMethod | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN, temperature: float | NotGiven = NOT_GIVEN, top_p: float | NotGiven = NOT_GIVEN, body_uuid: str | NotGiven = NOT_GIVEN, @@ -626,13 +624,13 @@ async def create( anthropic_key_uuid: str | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, instruction: str | NotGiven = NOT_GIVEN, - knowledge_base_uuid: List[str] | NotGiven = NOT_GIVEN, + knowledge_base_uuid: SequenceNotStr[str] | NotGiven = NOT_GIVEN, model_uuid: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, openai_key_uuid: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, region: str | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + tags: SequenceNotStr[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. extra_headers: Headers | None = None, @@ -756,7 +754,7 @@ async def update( project_id: str | NotGiven = NOT_GIVEN, provide_citations: bool | NotGiven = NOT_GIVEN, retrieval_method: APIRetrievalMethod | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN, temperature: float | NotGiven = NOT_GIVEN, top_p: float | NotGiven = NOT_GIVEN, body_uuid: str | NotGiven = NOT_GIVEN, diff --git a/src/gradient/resources/agents/chat/completions.py b/src/gradient/resources/agents/chat/completions.py index 88d6c241..fb4523c1 100644 --- a/src/gradient/resources/agents/chat/completions.py +++ b/src/gradient/resources/agents/chat/completions.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional +from typing import Dict, Union, Iterable, Optional from typing_extensions import Literal, overload import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from ...._utils import required_args, maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -60,7 +60,7 @@ def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, n: Optional[int] | NotGiven = NOT_GIVEN, presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, + stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, stream: Optional[Literal[False]] | NotGiven = NOT_GIVEN, stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, @@ -189,8 +189,8 @@ def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, n: Optional[int] | NotGiven = NOT_GIVEN, presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, - stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, + stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, + stream_options: Optional[completion_create_params.StreamOptions] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, @@ -317,8 +317,8 @@ def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, n: Optional[int] | NotGiven = NOT_GIVEN, presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, - stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, + stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, + stream_options: Optional[completion_create_params.StreamOptions] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, @@ -447,7 +447,7 @@ def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, n: Optional[int] | NotGiven = NOT_GIVEN, presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, + stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, stream: Optional[Literal[False]] | Literal[True] | NotGiven = NOT_GIVEN, stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, @@ -549,7 +549,7 @@ async def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, n: Optional[int] | NotGiven = NOT_GIVEN, presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, + stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, stream: Optional[Literal[False]] | NotGiven = NOT_GIVEN, stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, @@ -678,8 +678,8 @@ async def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, n: Optional[int] | NotGiven = NOT_GIVEN, presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, - stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, + stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, + stream_options: Optional[completion_create_params.StreamOptions] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, @@ -806,8 +806,8 @@ async def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, n: Optional[int] | NotGiven = NOT_GIVEN, presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, - stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, + stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, + stream_options: Optional[completion_create_params.StreamOptions] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, @@ -933,7 +933,7 @@ async def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, n: Optional[int] | NotGiven = NOT_GIVEN, presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, + stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, stream: Optional[Literal[False]] | Literal[True] | NotGiven = NOT_GIVEN, stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, diff --git a/src/gradient/resources/agents/evaluation_metrics/workspaces/agents.py b/src/gradient/resources/agents/evaluation_metrics/workspaces/agents.py index 1a73bc60..408396b1 100644 --- a/src/gradient/resources/agents/evaluation_metrics/workspaces/agents.py +++ b/src/gradient/resources/agents/evaluation_metrics/workspaces/agents.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 @@ -104,7 +102,7 @@ def move( self, path_workspace_uuid: str, *, - agent_uuids: List[str] | NotGiven = NOT_GIVEN, + agent_uuids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, body_workspace_uuid: 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. @@ -232,7 +230,7 @@ async def move( self, path_workspace_uuid: str, *, - agent_uuids: List[str] | NotGiven = NOT_GIVEN, + agent_uuids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, body_workspace_uuid: 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/gradient/resources/agents/evaluation_metrics/workspaces/workspaces.py b/src/gradient/resources/agents/evaluation_metrics/workspaces/workspaces.py index a2cf5ebc..e6f610ef 100644 --- a/src/gradient/resources/agents/evaluation_metrics/workspaces/workspaces.py +++ b/src/gradient/resources/agents/evaluation_metrics/workspaces/workspaces.py @@ -2,8 +2,6 @@ from __future__ import annotations -from typing import List - import httpx from .agents import ( @@ -14,7 +12,7 @@ AgentsResourceWithStreamingResponse, AsyncAgentsResourceWithStreamingResponse, ) -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 @@ -65,7 +63,7 @@ def with_streaming_response(self) -> WorkspacesResourceWithStreamingResponse: def create( self, *, - agent_uuids: List[str] | NotGiven = NOT_GIVEN, + agent_uuids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -327,7 +325,7 @@ def with_streaming_response(self) -> AsyncWorkspacesResourceWithStreamingRespons async def create( self, *, - agent_uuids: List[str] | NotGiven = NOT_GIVEN, + agent_uuids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/gradient/resources/agents/evaluation_runs.py b/src/gradient/resources/agents/evaluation_runs.py index e55cc275..e00c9eb3 100644 --- a/src/gradient/resources/agents/evaluation_runs.py +++ b/src/gradient/resources/agents/evaluation_runs.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 @@ -49,7 +47,7 @@ def with_streaming_response(self) -> EvaluationRunsResourceWithStreamingResponse def create( self, *, - agent_uuids: List[str] | NotGiven = NOT_GIVEN, + agent_uuids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, run_name: str | NotGiven = NOT_GIVEN, test_case_uuid: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -251,7 +249,7 @@ def with_streaming_response(self) -> AsyncEvaluationRunsResourceWithStreamingRes async def create( self, *, - agent_uuids: List[str] | NotGiven = NOT_GIVEN, + agent_uuids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, run_name: str | NotGiven = NOT_GIVEN, test_case_uuid: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/gradient/resources/agents/evaluation_test_cases.py b/src/gradient/resources/agents/evaluation_test_cases.py index 454576c8..07f0a251 100644 --- a/src/gradient/resources/agents/evaluation_test_cases.py +++ b/src/gradient/resources/agents/evaluation_test_cases.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 @@ -60,7 +58,7 @@ def create( *, dataset_uuid: str | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, - metrics: List[str] | NotGiven = NOT_GIVEN, + metrics: SequenceNotStr[str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, star_metric: APIStarMetricParam | NotGiven = NOT_GIVEN, workspace_uuid: str | NotGiven = NOT_GIVEN, @@ -322,7 +320,7 @@ async def create( *, dataset_uuid: str | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, - metrics: List[str] | NotGiven = NOT_GIVEN, + metrics: SequenceNotStr[str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, star_metric: APIStarMetricParam | NotGiven = NOT_GIVEN, workspace_uuid: str | NotGiven = NOT_GIVEN, diff --git a/src/gradient/resources/chat/completions.py b/src/gradient/resources/chat/completions.py index 3a412b10..3017deb6 100644 --- a/src/gradient/resources/chat/completions.py +++ b/src/gradient/resources/chat/completions.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional +from typing import Dict, Union, Iterable, Optional from typing_extensions import Literal, overload import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from ..._utils import required_args, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -60,7 +60,7 @@ def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, n: Optional[int] | NotGiven = NOT_GIVEN, presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, + stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, stream: Optional[Literal[False]] | NotGiven = NOT_GIVEN, stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, @@ -190,8 +190,8 @@ def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, n: Optional[int] | NotGiven = NOT_GIVEN, presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, - stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, + stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, + stream_options: Optional[completion_create_params.StreamOptions] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, @@ -318,8 +318,8 @@ def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, n: Optional[int] | NotGiven = NOT_GIVEN, presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, - stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, + stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, + stream_options: Optional[completion_create_params.StreamOptions] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, @@ -445,7 +445,7 @@ def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, n: Optional[int] | NotGiven = NOT_GIVEN, presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, + stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, stream: Optional[Literal[False]] | Literal[True] | NotGiven = NOT_GIVEN, stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, @@ -550,7 +550,7 @@ async def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, n: Optional[int] | NotGiven = NOT_GIVEN, presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, + stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, stream: Optional[Literal[False]] | NotGiven = NOT_GIVEN, stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, @@ -680,8 +680,8 @@ async def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, n: Optional[int] | NotGiven = NOT_GIVEN, presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, - stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, + stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, + stream_options: Optional[completion_create_params.StreamOptions] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, @@ -808,8 +808,8 @@ async def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, n: Optional[int] | NotGiven = NOT_GIVEN, presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, - stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, + stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, + stream_options: Optional[completion_create_params.StreamOptions] | NotGiven = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, @@ -935,7 +935,7 @@ async def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, n: Optional[int] | NotGiven = NOT_GIVEN, presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], List[str], None] | NotGiven = NOT_GIVEN, + stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, stream: Optional[Literal[False]] | Literal[True] | NotGiven = NOT_GIVEN, stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, temperature: Optional[float] | NotGiven = NOT_GIVEN, diff --git a/src/gradient/resources/gpu_droplets/destroy_with_associated_resources.py b/src/gradient/resources/gpu_droplets/destroy_with_associated_resources.py index 2f3b90cf..0d55cb48 100644 --- a/src/gradient/resources/gpu_droplets/destroy_with_associated_resources.py +++ b/src/gradient/resources/gpu_droplets/destroy_with_associated_resources.py @@ -2,11 +2,9 @@ from __future__ import annotations -from typing import List - import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, SequenceNotStr from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -174,11 +172,11 @@ def delete_selective( self, droplet_id: int, *, - floating_ips: List[str] | NotGiven = NOT_GIVEN, - reserved_ips: List[str] | NotGiven = NOT_GIVEN, - snapshots: List[str] | NotGiven = NOT_GIVEN, - volume_snapshots: List[str] | NotGiven = NOT_GIVEN, - volumes: List[str] | NotGiven = NOT_GIVEN, + floating_ips: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + reserved_ips: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + snapshots: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + volume_snapshots: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + volumes: SequenceNotStr[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. extra_headers: Headers | None = None, @@ -430,11 +428,11 @@ async def delete_selective( self, droplet_id: int, *, - floating_ips: List[str] | NotGiven = NOT_GIVEN, - reserved_ips: List[str] | NotGiven = NOT_GIVEN, - snapshots: List[str] | NotGiven = NOT_GIVEN, - volume_snapshots: List[str] | NotGiven = NOT_GIVEN, - volumes: List[str] | NotGiven = NOT_GIVEN, + floating_ips: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + reserved_ips: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + snapshots: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + volume_snapshots: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + volumes: SequenceNotStr[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. extra_headers: Headers | None = None, diff --git a/src/gradient/resources/gpu_droplets/firewalls/tags.py b/src/gradient/resources/gpu_droplets/firewalls/tags.py index dc66c72f..ee13acd5 100644 --- a/src/gradient/resources/gpu_droplets/firewalls/tags.py +++ b/src/gradient/resources/gpu_droplets/firewalls/tags.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import List, Optional +from typing import Optional import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, SequenceNotStr from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -46,7 +46,7 @@ def add( self, firewall_id: str, *, - tags: Optional[List[str]], + tags: Optional[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, @@ -95,7 +95,7 @@ def remove( self, firewall_id: str, *, - tags: Optional[List[str]], + tags: Optional[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, @@ -165,7 +165,7 @@ async def add( self, firewall_id: str, *, - tags: Optional[List[str]], + tags: Optional[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, @@ -214,7 +214,7 @@ async def remove( self, firewall_id: str, *, - tags: Optional[List[str]], + tags: Optional[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/gradient/resources/gpu_droplets/gpu_droplets.py b/src/gradient/resources/gpu_droplets/gpu_droplets.py index 0ce55ba8..48a9e5fe 100644 --- a/src/gradient/resources/gpu_droplets/gpu_droplets.py +++ b/src/gradient/resources/gpu_droplets/gpu_droplets.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Any, List, Union, Optional, cast +from typing import Any, Union, Optional, cast from typing_extensions import Literal, overload import httpx @@ -39,7 +39,7 @@ BackupsResourceWithStreamingResponse, AsyncBackupsResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, SequenceNotStr from ..._utils import required_args, maybe_transform, async_maybe_transform from ..._compat import cached_property from .autoscale import ( @@ -215,10 +215,10 @@ def create( monitoring: bool | NotGiven = NOT_GIVEN, private_networking: bool | NotGiven = NOT_GIVEN, region: str | NotGiven = NOT_GIVEN, - ssh_keys: List[Union[str, int]] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + ssh_keys: SequenceNotStr[Union[str, int]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, user_data: str | NotGiven = NOT_GIVEN, - volumes: List[str] | NotGiven = NOT_GIVEN, + volumes: SequenceNotStr[str] | NotGiven = NOT_GIVEN, vpc_uuid: str | NotGiven = NOT_GIVEN, with_droplet_agent: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -328,7 +328,7 @@ def create( self, *, image: Union[str, int], - names: List[str], + names: SequenceNotStr[str], size: str, backup_policy: DropletBackupPolicyParam | NotGiven = NOT_GIVEN, backups: bool | NotGiven = NOT_GIVEN, @@ -336,10 +336,10 @@ def create( monitoring: bool | NotGiven = NOT_GIVEN, private_networking: bool | NotGiven = NOT_GIVEN, region: str | NotGiven = NOT_GIVEN, - ssh_keys: List[Union[str, int]] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + ssh_keys: SequenceNotStr[Union[str, int]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, user_data: str | NotGiven = NOT_GIVEN, - volumes: List[str] | NotGiven = NOT_GIVEN, + volumes: SequenceNotStr[str] | NotGiven = NOT_GIVEN, vpc_uuid: str | NotGiven = NOT_GIVEN, with_droplet_agent: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -458,13 +458,13 @@ def create( monitoring: bool | NotGiven = NOT_GIVEN, private_networking: bool | NotGiven = NOT_GIVEN, region: str | NotGiven = NOT_GIVEN, - ssh_keys: List[Union[str, int]] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + ssh_keys: SequenceNotStr[Union[str, int]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, user_data: str | NotGiven = NOT_GIVEN, - volumes: List[str] | NotGiven = NOT_GIVEN, + volumes: SequenceNotStr[str] | NotGiven = NOT_GIVEN, vpc_uuid: str | NotGiven = NOT_GIVEN, with_droplet_agent: bool | NotGiven = NOT_GIVEN, - names: List[str] | NotGiven = NOT_GIVEN, + names: SequenceNotStr[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. extra_headers: Headers | None = None, @@ -986,10 +986,10 @@ async def create( monitoring: bool | NotGiven = NOT_GIVEN, private_networking: bool | NotGiven = NOT_GIVEN, region: str | NotGiven = NOT_GIVEN, - ssh_keys: List[Union[str, int]] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + ssh_keys: SequenceNotStr[Union[str, int]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, user_data: str | NotGiven = NOT_GIVEN, - volumes: List[str] | NotGiven = NOT_GIVEN, + volumes: SequenceNotStr[str] | NotGiven = NOT_GIVEN, vpc_uuid: str | NotGiven = NOT_GIVEN, with_droplet_agent: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1099,7 +1099,7 @@ async def create( self, *, image: Union[str, int], - names: List[str], + names: SequenceNotStr[str], size: str, backup_policy: DropletBackupPolicyParam | NotGiven = NOT_GIVEN, backups: bool | NotGiven = NOT_GIVEN, @@ -1107,10 +1107,10 @@ async def create( monitoring: bool | NotGiven = NOT_GIVEN, private_networking: bool | NotGiven = NOT_GIVEN, region: str | NotGiven = NOT_GIVEN, - ssh_keys: List[Union[str, int]] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + ssh_keys: SequenceNotStr[Union[str, int]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, user_data: str | NotGiven = NOT_GIVEN, - volumes: List[str] | NotGiven = NOT_GIVEN, + volumes: SequenceNotStr[str] | NotGiven = NOT_GIVEN, vpc_uuid: str | NotGiven = NOT_GIVEN, with_droplet_agent: bool | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1229,13 +1229,13 @@ async def create( monitoring: bool | NotGiven = NOT_GIVEN, private_networking: bool | NotGiven = NOT_GIVEN, region: str | NotGiven = NOT_GIVEN, - ssh_keys: List[Union[str, int]] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + ssh_keys: SequenceNotStr[Union[str, int]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, user_data: str | NotGiven = NOT_GIVEN, - volumes: List[str] | NotGiven = NOT_GIVEN, + volumes: SequenceNotStr[str] | NotGiven = NOT_GIVEN, vpc_uuid: str | NotGiven = NOT_GIVEN, with_droplet_agent: bool | NotGiven = NOT_GIVEN, - names: List[str] | NotGiven = NOT_GIVEN, + names: SequenceNotStr[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. extra_headers: Headers | None = None, diff --git a/src/gradient/resources/gpu_droplets/images/images.py b/src/gradient/resources/gpu_droplets/images/images.py index 09994263..1b00c024 100644 --- a/src/gradient/resources/gpu_droplets/images/images.py +++ b/src/gradient/resources/gpu_droplets/images/images.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Union, Optional +from typing import Union, Optional from typing_extensions import Literal import httpx @@ -15,7 +15,7 @@ ActionsResourceWithStreamingResponse, AsyncActionsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, SequenceNotStr from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -98,7 +98,7 @@ def create( "syd1", ] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, url: 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. @@ -464,7 +464,7 @@ async def create( "syd1", ] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, url: 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/gradient/resources/gpu_droplets/load_balancers/load_balancers.py b/src/gradient/resources/gpu_droplets/load_balancers/load_balancers.py index d876b50f..8f11a5da 100644 --- a/src/gradient/resources/gpu_droplets/load_balancers/load_balancers.py +++ b/src/gradient/resources/gpu_droplets/load_balancers/load_balancers.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Iterable +from typing import Iterable from typing_extensions import Literal, overload import httpx @@ -15,7 +15,7 @@ DropletsResourceWithStreamingResponse, AsyncDropletsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, SequenceNotStr from ...._utils import required_args, maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -122,7 +122,7 @@ def create( size: Literal["lb-small", "lb-medium", "lb-large"] | NotGiven = NOT_GIVEN, size_unit: int | NotGiven = NOT_GIVEN, sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, - target_load_balancer_ids: List[str] | NotGiven = NOT_GIVEN, + target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, vpc_uuid: str | NotGiven = NOT_GIVEN, @@ -281,7 +281,7 @@ def create( size_unit: int | NotGiven = NOT_GIVEN, sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, tag: str | NotGiven = NOT_GIVEN, - target_load_balancer_ids: List[str] | NotGiven = NOT_GIVEN, + target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, vpc_uuid: str | NotGiven = NOT_GIVEN, @@ -441,7 +441,7 @@ def create( size: Literal["lb-small", "lb-medium", "lb-large"] | NotGiven = NOT_GIVEN, size_unit: int | NotGiven = NOT_GIVEN, sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, - target_load_balancer_ids: List[str] | NotGiven = NOT_GIVEN, + target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, vpc_uuid: str | NotGiven = NOT_GIVEN, @@ -571,7 +571,7 @@ def update( size: Literal["lb-small", "lb-medium", "lb-large"] | NotGiven = NOT_GIVEN, size_unit: int | NotGiven = NOT_GIVEN, sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, - target_load_balancer_ids: List[str] | NotGiven = NOT_GIVEN, + target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, vpc_uuid: str | NotGiven = NOT_GIVEN, @@ -725,7 +725,7 @@ def update( size_unit: int | NotGiven = NOT_GIVEN, sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, tag: str | NotGiven = NOT_GIVEN, - target_load_balancer_ids: List[str] | NotGiven = NOT_GIVEN, + target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, vpc_uuid: str | NotGiven = NOT_GIVEN, @@ -880,7 +880,7 @@ def update( size: Literal["lb-small", "lb-medium", "lb-large"] | NotGiven = NOT_GIVEN, size_unit: int | NotGiven = NOT_GIVEN, sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, - target_load_balancer_ids: List[str] | NotGiven = NOT_GIVEN, + target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, vpc_uuid: str | NotGiven = NOT_GIVEN, @@ -1134,7 +1134,7 @@ async def create( size: Literal["lb-small", "lb-medium", "lb-large"] | NotGiven = NOT_GIVEN, size_unit: int | NotGiven = NOT_GIVEN, sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, - target_load_balancer_ids: List[str] | NotGiven = NOT_GIVEN, + target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, vpc_uuid: str | NotGiven = NOT_GIVEN, @@ -1293,7 +1293,7 @@ async def create( size_unit: int | NotGiven = NOT_GIVEN, sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, tag: str | NotGiven = NOT_GIVEN, - target_load_balancer_ids: List[str] | NotGiven = NOT_GIVEN, + target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, vpc_uuid: str | NotGiven = NOT_GIVEN, @@ -1453,7 +1453,7 @@ async def create( size: Literal["lb-small", "lb-medium", "lb-large"] | NotGiven = NOT_GIVEN, size_unit: int | NotGiven = NOT_GIVEN, sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, - target_load_balancer_ids: List[str] | NotGiven = NOT_GIVEN, + target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, vpc_uuid: str | NotGiven = NOT_GIVEN, @@ -1583,7 +1583,7 @@ async def update( size: Literal["lb-small", "lb-medium", "lb-large"] | NotGiven = NOT_GIVEN, size_unit: int | NotGiven = NOT_GIVEN, sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, - target_load_balancer_ids: List[str] | NotGiven = NOT_GIVEN, + target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, vpc_uuid: str | NotGiven = NOT_GIVEN, @@ -1737,7 +1737,7 @@ async def update( size_unit: int | NotGiven = NOT_GIVEN, sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, tag: str | NotGiven = NOT_GIVEN, - target_load_balancer_ids: List[str] | NotGiven = NOT_GIVEN, + target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, vpc_uuid: str | NotGiven = NOT_GIVEN, @@ -1892,7 +1892,7 @@ async def update( size: Literal["lb-small", "lb-medium", "lb-large"] | NotGiven = NOT_GIVEN, size_unit: int | NotGiven = NOT_GIVEN, sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, - target_load_balancer_ids: List[str] | NotGiven = NOT_GIVEN, + target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, vpc_uuid: str | NotGiven = NOT_GIVEN, diff --git a/src/gradient/resources/gpu_droplets/volumes/actions.py b/src/gradient/resources/gpu_droplets/volumes/actions.py index 2e093136..c648beaa 100644 --- a/src/gradient/resources/gpu_droplets/volumes/actions.py +++ b/src/gradient/resources/gpu_droplets/volumes/actions.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Optional +from typing import Optional from typing_extensions import Literal, overload import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from ...._utils import required_args, maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -184,7 +184,7 @@ def initiate_by_id( "syd1", ] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[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. extra_headers: Headers | None = None, @@ -474,7 +474,7 @@ def initiate_by_id( "syd1", ] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, size_gigabytes: int | 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. @@ -541,7 +541,7 @@ def initiate_by_name( "syd1", ] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[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. extra_headers: Headers | None = None, @@ -719,7 +719,7 @@ def initiate_by_name( "syd1", ] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[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. extra_headers: Headers | None = None, @@ -909,7 +909,7 @@ async def initiate_by_id( "syd1", ] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[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. extra_headers: Headers | None = None, @@ -1199,7 +1199,7 @@ async def initiate_by_id( "syd1", ] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, size_gigabytes: int | 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. @@ -1266,7 +1266,7 @@ async def initiate_by_name( "syd1", ] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[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. extra_headers: Headers | None = None, @@ -1444,7 +1444,7 @@ async def initiate_by_name( "syd1", ] | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[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. extra_headers: Headers | None = None, diff --git a/src/gradient/resources/gpu_droplets/volumes/snapshots.py b/src/gradient/resources/gpu_droplets/volumes/snapshots.py index 0f9e30fa..7e925264 100644 --- a/src/gradient/resources/gpu_droplets/volumes/snapshots.py +++ b/src/gradient/resources/gpu_droplets/volumes/snapshots.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import List, Optional +from typing import Optional import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, SequenceNotStr from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -50,7 +50,7 @@ def create( volume_id: str, *, name: str, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[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. extra_headers: Headers | None = None, @@ -251,7 +251,7 @@ async def create( volume_id: str, *, name: str, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[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. extra_headers: Headers | None = None, diff --git a/src/gradient/resources/gpu_droplets/volumes/volumes.py b/src/gradient/resources/gpu_droplets/volumes/volumes.py index ada4aedf..ee980a10 100644 --- a/src/gradient/resources/gpu_droplets/volumes/volumes.py +++ b/src/gradient/resources/gpu_droplets/volumes/volumes.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Optional +from typing import Optional from typing_extensions import Literal, overload import httpx @@ -15,7 +15,7 @@ ActionsResourceWithStreamingResponse, AsyncActionsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, SequenceNotStr from ...._utils import required_args, maybe_transform, async_maybe_transform from .snapshots import ( SnapshotsResource, @@ -97,7 +97,7 @@ def create( filesystem_label: str | NotGiven = NOT_GIVEN, filesystem_type: str | NotGiven = NOT_GIVEN, snapshot_id: str | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[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. extra_headers: Headers | None = None, @@ -182,7 +182,7 @@ def create( filesystem_label: str | NotGiven = NOT_GIVEN, filesystem_type: str | NotGiven = NOT_GIVEN, snapshot_id: str | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[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. extra_headers: Headers | None = None, @@ -267,7 +267,7 @@ def create( filesystem_label: str | NotGiven = NOT_GIVEN, filesystem_type: str | NotGiven = NOT_GIVEN, snapshot_id: str | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[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. extra_headers: Headers | None = None, @@ -590,7 +590,7 @@ async def create( filesystem_label: str | NotGiven = NOT_GIVEN, filesystem_type: str | NotGiven = NOT_GIVEN, snapshot_id: str | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[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. extra_headers: Headers | None = None, @@ -675,7 +675,7 @@ async def create( filesystem_label: str | NotGiven = NOT_GIVEN, filesystem_type: str | NotGiven = NOT_GIVEN, snapshot_id: str | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[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. extra_headers: Headers | None = None, @@ -760,7 +760,7 @@ async def create( filesystem_label: str | NotGiven = NOT_GIVEN, filesystem_type: str | NotGiven = NOT_GIVEN, snapshot_id: str | NotGiven = NOT_GIVEN, - tags: Optional[List[str]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[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. extra_headers: Headers | None = None, diff --git a/src/gradient/resources/knowledge_bases/indexing_jobs.py b/src/gradient/resources/knowledge_bases/indexing_jobs.py index 723b42f5..41e7da76 100644 --- a/src/gradient/resources/knowledge_bases/indexing_jobs.py +++ b/src/gradient/resources/knowledge_bases/indexing_jobs.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 @@ -54,7 +52,7 @@ def with_streaming_response(self) -> IndexingJobsResourceWithStreamingResponse: def create( self, *, - data_source_uuids: List[str] | NotGiven = NOT_GIVEN, + data_source_uuids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, knowledge_base_uuid: 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. @@ -285,7 +283,7 @@ def with_streaming_response(self) -> AsyncIndexingJobsResourceWithStreamingRespo async def create( self, *, - data_source_uuids: List[str] | NotGiven = NOT_GIVEN, + data_source_uuids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, knowledge_base_uuid: 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/gradient/resources/knowledge_bases/knowledge_bases.py b/src/gradient/resources/knowledge_bases/knowledge_bases.py index 594b2ba7..61fc85a8 100644 --- a/src/gradient/resources/knowledge_bases/knowledge_bases.py +++ b/src/gradient/resources/knowledge_bases/knowledge_bases.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import List, Iterable +from typing import Iterable import httpx from ...types import knowledge_base_list_params, knowledge_base_create_params, knowledge_base_update_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 @@ -80,7 +80,7 @@ def create( name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, region: str | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN, vpc_uuid: 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. @@ -189,7 +189,7 @@ def update( embedding_model_uuid: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN, body_uuid: 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. @@ -368,7 +368,7 @@ async def create( name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, region: str | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN, vpc_uuid: 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. @@ -477,7 +477,7 @@ async def update( embedding_model_uuid: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, project_id: str | NotGiven = NOT_GIVEN, - tags: List[str] | NotGiven = NOT_GIVEN, + tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN, body_uuid: 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/gradient/types/agent_create_params.py b/src/gradient/types/agent_create_params.py index 68ebd227..db84a258 100644 --- a/src/gradient/types/agent_create_params.py +++ b/src/gradient/types/agent_create_params.py @@ -2,9 +2,9 @@ from __future__ import annotations -from typing import List from typing_extensions import Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["AgentCreateParams"] @@ -25,7 +25,7 @@ class AgentCreateParams(TypedDict, total=False): for best practices. """ - knowledge_base_uuid: List[str] + knowledge_base_uuid: SequenceNotStr[str] """Ids of the knowledge base(s) to attach to the agent""" model_uuid: str @@ -43,5 +43,5 @@ class AgentCreateParams(TypedDict, total=False): region: str """The DigitalOcean region to deploy your agent in""" - tags: List[str] + tags: SequenceNotStr[str] """Agent tag to organize related resources""" diff --git a/src/gradient/types/agent_update_params.py b/src/gradient/types/agent_update_params.py index c26bf833..75c30cba 100644 --- a/src/gradient/types/agent_update_params.py +++ b/src/gradient/types/agent_update_params.py @@ -2,9 +2,9 @@ from __future__ import annotations -from typing import List from typing_extensions import Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo from .api_retrieval_method import APIRetrievalMethod @@ -64,7 +64,7 @@ class AgentUpdateParams(TypedDict, total=False): - RETRIEVAL_METHOD_NONE: The retrieval method is none """ - tags: List[str] + tags: SequenceNotStr[str] """A set of abitrary tags to organize your agent""" temperature: float diff --git a/src/gradient/types/agents/chat/completion_create_params.py b/src/gradient/types/agents/chat/completion_create_params.py index aaec2ba5..d8cf7bc1 100644 --- a/src/gradient/types/agents/chat/completion_create_params.py +++ b/src/gradient/types/agents/chat/completion_create_params.py @@ -2,9 +2,11 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional +from typing import Dict, Union, Iterable, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict +from ...._types import SequenceNotStr + __all__ = [ "CompletionCreateParamsBase", "Message", @@ -96,7 +98,7 @@ class CompletionCreateParamsBase(TypedDict, total=False): far, increasing the model's likelihood to talk about new topics. """ - stop: Union[Optional[str], List[str], None] + stop: Union[Optional[str], SequenceNotStr[str], None] """Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. @@ -156,7 +158,7 @@ class CompletionCreateParamsBase(TypedDict, total=False): class MessageChatCompletionRequestSystemMessage(TypedDict, total=False): - content: Required[Union[str, List[str]]] + content: Required[Union[str, SequenceNotStr[str]]] """The contents of the system message.""" role: Required[Literal["system"]] @@ -164,7 +166,7 @@ class MessageChatCompletionRequestSystemMessage(TypedDict, total=False): class MessageChatCompletionRequestDeveloperMessage(TypedDict, total=False): - content: Required[Union[str, List[str]]] + content: Required[Union[str, SequenceNotStr[str]]] """The contents of the developer message.""" role: Required[Literal["developer"]] @@ -172,7 +174,7 @@ class MessageChatCompletionRequestDeveloperMessage(TypedDict, total=False): class MessageChatCompletionRequestUserMessage(TypedDict, total=False): - content: Required[Union[str, List[str]]] + content: Required[Union[str, SequenceNotStr[str]]] """The contents of the user message.""" role: Required[Literal["user"]] @@ -207,7 +209,7 @@ class MessageChatCompletionRequestAssistantMessage(TypedDict, total=False): role: Required[Literal["assistant"]] """The role of the messages author, in this case `assistant`.""" - content: Union[str, List[str], None] + content: Union[str, SequenceNotStr[str], None] """The contents of the assistant message.""" tool_calls: Iterable[MessageChatCompletionRequestAssistantMessageToolCall] diff --git a/src/gradient/types/agents/evaluation_metrics/workspace_create_params.py b/src/gradient/types/agents/evaluation_metrics/workspace_create_params.py index 7a418e81..443a6f43 100644 --- a/src/gradient/types/agents/evaluation_metrics/workspace_create_params.py +++ b/src/gradient/types/agents/evaluation_metrics/workspace_create_params.py @@ -2,14 +2,15 @@ from __future__ import annotations -from typing import List from typing_extensions import TypedDict +from ...._types import SequenceNotStr + __all__ = ["WorkspaceCreateParams"] class WorkspaceCreateParams(TypedDict, total=False): - agent_uuids: List[str] + agent_uuids: SequenceNotStr[str] """Ids of the agents(s) to attach to the workspace""" description: str diff --git a/src/gradient/types/agents/evaluation_metrics/workspaces/agent_move_params.py b/src/gradient/types/agents/evaluation_metrics/workspaces/agent_move_params.py index 74e27dd2..7b451084 100644 --- a/src/gradient/types/agents/evaluation_metrics/workspaces/agent_move_params.py +++ b/src/gradient/types/agents/evaluation_metrics/workspaces/agent_move_params.py @@ -2,16 +2,16 @@ from __future__ import annotations -from typing import List from typing_extensions import Annotated, TypedDict +from ....._types import SequenceNotStr from ....._utils import PropertyInfo __all__ = ["AgentMoveParams"] class AgentMoveParams(TypedDict, total=False): - agent_uuids: List[str] + agent_uuids: SequenceNotStr[str] """Agent uuids""" body_workspace_uuid: Annotated[str, PropertyInfo(alias="workspace_uuid")] diff --git a/src/gradient/types/agents/evaluation_run_create_params.py b/src/gradient/types/agents/evaluation_run_create_params.py index 3029e192..52bbee85 100644 --- a/src/gradient/types/agents/evaluation_run_create_params.py +++ b/src/gradient/types/agents/evaluation_run_create_params.py @@ -2,14 +2,15 @@ from __future__ import annotations -from typing import List from typing_extensions import TypedDict +from ..._types import SequenceNotStr + __all__ = ["EvaluationRunCreateParams"] class EvaluationRunCreateParams(TypedDict, total=False): - agent_uuids: List[str] + agent_uuids: SequenceNotStr[str] """Agent UUIDs to run the test case against.""" run_name: str diff --git a/src/gradient/types/agents/evaluation_test_case_create_params.py b/src/gradient/types/agents/evaluation_test_case_create_params.py index 51ce20c7..af49d024 100644 --- a/src/gradient/types/agents/evaluation_test_case_create_params.py +++ b/src/gradient/types/agents/evaluation_test_case_create_params.py @@ -2,9 +2,9 @@ from __future__ import annotations -from typing import List from typing_extensions import TypedDict +from ..._types import SequenceNotStr from .api_star_metric_param import APIStarMetricParam __all__ = ["EvaluationTestCaseCreateParams"] @@ -17,7 +17,7 @@ class EvaluationTestCaseCreateParams(TypedDict, total=False): description: str """Description of the test case.""" - metrics: List[str] + metrics: SequenceNotStr[str] """Full metric list to use for evaluation test case.""" name: str diff --git a/src/gradient/types/agents/evaluation_test_case_update_params.py b/src/gradient/types/agents/evaluation_test_case_update_params.py index 825f961b..d707d909 100644 --- a/src/gradient/types/agents/evaluation_test_case_update_params.py +++ b/src/gradient/types/agents/evaluation_test_case_update_params.py @@ -2,9 +2,9 @@ from __future__ import annotations -from typing import List from typing_extensions import Annotated, TypedDict +from ..._types import SequenceNotStr from ..._utils import PropertyInfo from .api_star_metric_param import APIStarMetricParam @@ -30,4 +30,4 @@ class EvaluationTestCaseUpdateParams(TypedDict, total=False): class Metrics(TypedDict, total=False): - metric_uuids: List[str] + metric_uuids: SequenceNotStr[str] diff --git a/src/gradient/types/chat/completion_create_params.py b/src/gradient/types/chat/completion_create_params.py index aaec2ba5..17f00242 100644 --- a/src/gradient/types/chat/completion_create_params.py +++ b/src/gradient/types/chat/completion_create_params.py @@ -2,9 +2,11 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable, Optional +from typing import Dict, Union, Iterable, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict +from ..._types import SequenceNotStr + __all__ = [ "CompletionCreateParamsBase", "Message", @@ -96,7 +98,7 @@ class CompletionCreateParamsBase(TypedDict, total=False): far, increasing the model's likelihood to talk about new topics. """ - stop: Union[Optional[str], List[str], None] + stop: Union[Optional[str], SequenceNotStr[str], None] """Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. @@ -156,7 +158,7 @@ class CompletionCreateParamsBase(TypedDict, total=False): class MessageChatCompletionRequestSystemMessage(TypedDict, total=False): - content: Required[Union[str, List[str]]] + content: Required[Union[str, SequenceNotStr[str]]] """The contents of the system message.""" role: Required[Literal["system"]] @@ -164,7 +166,7 @@ class MessageChatCompletionRequestSystemMessage(TypedDict, total=False): class MessageChatCompletionRequestDeveloperMessage(TypedDict, total=False): - content: Required[Union[str, List[str]]] + content: Required[Union[str, SequenceNotStr[str]]] """The contents of the developer message.""" role: Required[Literal["developer"]] @@ -172,7 +174,7 @@ class MessageChatCompletionRequestDeveloperMessage(TypedDict, total=False): class MessageChatCompletionRequestUserMessage(TypedDict, total=False): - content: Required[Union[str, List[str]]] + content: Required[Union[str, SequenceNotStr[str]]] """The contents of the user message.""" role: Required[Literal["user"]] @@ -207,7 +209,7 @@ class MessageChatCompletionRequestAssistantMessage(TypedDict, total=False): role: Required[Literal["assistant"]] """The role of the messages author, in this case `assistant`.""" - content: Union[str, List[str], None] + content: Union[str, SequenceNotStr[str], None] """The contents of the assistant message.""" tool_calls: Iterable[MessageChatCompletionRequestAssistantMessageToolCall] diff --git a/src/gradient/types/gpu_droplet_create_params.py b/src/gradient/types/gpu_droplet_create_params.py index f38661fb..96403479 100644 --- a/src/gradient/types/gpu_droplet_create_params.py +++ b/src/gradient/types/gpu_droplet_create_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Union, Optional +from typing import Union, Optional from typing_extensions import Required, TypeAlias, TypedDict +from .._types import SequenceNotStr from .droplet_backup_policy_param import DropletBackupPolicyParam __all__ = ["GPUDropletCreateParams", "DropletSingleCreate", "DropletMultiCreate"] @@ -65,14 +66,14 @@ class DropletSingleCreate(TypedDict, total=False): the Droplet may deploy in any region. """ - ssh_keys: List[Union[str, int]] + ssh_keys: SequenceNotStr[Union[str, int]] """ An array containing the IDs or fingerprints of the SSH keys that you wish to embed in the Droplet's root account upon creation. You must add the keys to your team before they can be embedded on a Droplet. Requires `ssh_key:read` scope. """ - tags: Optional[List[str]] + tags: Optional[SequenceNotStr[str]] """A flat array of tag names as strings to apply to the Droplet after it is created. @@ -86,7 +87,7 @@ class DropletSingleCreate(TypedDict, total=False): and may not exceed 64 KiB in size. """ - volumes: List[str] + volumes: SequenceNotStr[str] """ An array of IDs for block storage volumes that will be attached to the Droplet once created. The volumes must not already be attached to an existing Droplet. @@ -118,7 +119,7 @@ class DropletMultiCreate(TypedDict, total=False): scope. """ - names: Required[List[str]] + names: Required[SequenceNotStr[str]] """ An array of human human-readable strings you wish to use when displaying the Droplet name. Each name, if set to a domain name managed in the DigitalOcean DNS @@ -165,14 +166,14 @@ class DropletMultiCreate(TypedDict, total=False): the Droplet may deploy in any region. """ - ssh_keys: List[Union[str, int]] + ssh_keys: SequenceNotStr[Union[str, int]] """ An array containing the IDs or fingerprints of the SSH keys that you wish to embed in the Droplet's root account upon creation. You must add the keys to your team before they can be embedded on a Droplet. Requires `ssh_key:read` scope. """ - tags: Optional[List[str]] + tags: Optional[SequenceNotStr[str]] """A flat array of tag names as strings to apply to the Droplet after it is created. @@ -186,7 +187,7 @@ class DropletMultiCreate(TypedDict, total=False): and may not exceed 64 KiB in size. """ - volumes: List[str] + volumes: SequenceNotStr[str] """ An array of IDs for block storage volumes that will be attached to the Droplet once created. The volumes must not already be attached to an existing Droplet. diff --git a/src/gradient/types/gpu_droplets/autoscale_pool_droplet_template_param.py b/src/gradient/types/gpu_droplets/autoscale_pool_droplet_template_param.py index c491ed55..3eb8ac89 100644 --- a/src/gradient/types/gpu_droplets/autoscale_pool_droplet_template_param.py +++ b/src/gradient/types/gpu_droplets/autoscale_pool_droplet_template_param.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List from typing_extensions import Literal, Required, TypedDict +from ..._types import SequenceNotStr + __all__ = ["AutoscalePoolDropletTemplateParam"] @@ -38,7 +39,7 @@ class AutoscalePoolDropletTemplateParam(TypedDict, total=False): size: Required[str] """The Droplet size to be used for all Droplets in the autoscale pool.""" - ssh_keys: Required[List[str]] + ssh_keys: Required[SequenceNotStr[str]] """The SSH keys to be installed on the Droplets in the autoscale pool. You can either specify the key ID or the fingerprint. Requires `ssh_key:read` @@ -57,7 +58,7 @@ class AutoscalePoolDropletTemplateParam(TypedDict, total=False): `project:read` scope. """ - tags: List[str] + tags: SequenceNotStr[str] """ The tags to apply to each of the Droplets in the autoscale pool. Requires `tag:read` scope. diff --git a/src/gradient/types/gpu_droplets/destroy_with_associated_resource_delete_selective_params.py b/src/gradient/types/gpu_droplets/destroy_with_associated_resource_delete_selective_params.py index f4037b6b..9a9730e7 100644 --- a/src/gradient/types/gpu_droplets/destroy_with_associated_resource_delete_selective_params.py +++ b/src/gradient/types/gpu_droplets/destroy_with_associated_resource_delete_selective_params.py @@ -2,33 +2,34 @@ from __future__ import annotations -from typing import List from typing_extensions import TypedDict +from ..._types import SequenceNotStr + __all__ = ["DestroyWithAssociatedResourceDeleteSelectiveParams"] class DestroyWithAssociatedResourceDeleteSelectiveParams(TypedDict, total=False): - floating_ips: List[str] + floating_ips: SequenceNotStr[str] """ An array of unique identifiers for the floating IPs to be scheduled for deletion. """ - reserved_ips: List[str] + reserved_ips: SequenceNotStr[str] """ An array of unique identifiers for the reserved IPs to be scheduled for deletion. """ - snapshots: List[str] + snapshots: SequenceNotStr[str] """An array of unique identifiers for the snapshots to be scheduled for deletion.""" - volume_snapshots: List[str] + volume_snapshots: SequenceNotStr[str] """ An array of unique identifiers for the volume snapshots to be scheduled for deletion. """ - volumes: List[str] + volumes: SequenceNotStr[str] """An array of unique identifiers for the volumes to be scheduled for deletion.""" diff --git a/src/gradient/types/gpu_droplets/firewall_param.py b/src/gradient/types/gpu_droplets/firewall_param.py index 1be9cf6a..8b5a5a15 100644 --- a/src/gradient/types/gpu_droplets/firewall_param.py +++ b/src/gradient/types/gpu_droplets/firewall_param.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Literal, Required, TypedDict +from ..._types import SequenceNotStr from ..shared_params.firewall_rule_target import FirewallRuleTarget __all__ = ["FirewallParam", "InboundRule", "OutboundRule"] @@ -58,7 +59,7 @@ class FirewallParam(TypedDict, total=False): outbound_rules: Optional[Iterable[OutboundRule]] - tags: Optional[List[str]] + tags: Optional[SequenceNotStr[str]] """A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request. diff --git a/src/gradient/types/gpu_droplets/firewalls/tag_add_params.py b/src/gradient/types/gpu_droplets/firewalls/tag_add_params.py index 63af7640..c3b9696e 100644 --- a/src/gradient/types/gpu_droplets/firewalls/tag_add_params.py +++ b/src/gradient/types/gpu_droplets/firewalls/tag_add_params.py @@ -2,14 +2,16 @@ from __future__ import annotations -from typing import List, Optional +from typing import Optional from typing_extensions import Required, TypedDict +from ...._types import SequenceNotStr + __all__ = ["TagAddParams"] class TagAddParams(TypedDict, total=False): - tags: Required[Optional[List[str]]] + tags: Required[Optional[SequenceNotStr[str]]] """A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request. diff --git a/src/gradient/types/gpu_droplets/firewalls/tag_remove_params.py b/src/gradient/types/gpu_droplets/firewalls/tag_remove_params.py index 91a3e382..bdd848f3 100644 --- a/src/gradient/types/gpu_droplets/firewalls/tag_remove_params.py +++ b/src/gradient/types/gpu_droplets/firewalls/tag_remove_params.py @@ -2,14 +2,16 @@ from __future__ import annotations -from typing import List, Optional +from typing import Optional from typing_extensions import Required, TypedDict +from ...._types import SequenceNotStr + __all__ = ["TagRemoveParams"] class TagRemoveParams(TypedDict, total=False): - tags: Required[Optional[List[str]]] + tags: Required[Optional[SequenceNotStr[str]]] """A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request. diff --git a/src/gradient/types/gpu_droplets/image_create_params.py b/src/gradient/types/gpu_droplets/image_create_params.py index efbd684c..baae3bf5 100644 --- a/src/gradient/types/gpu_droplets/image_create_params.py +++ b/src/gradient/types/gpu_droplets/image_create_params.py @@ -2,9 +2,11 @@ from __future__ import annotations -from typing import List, Optional +from typing import Optional from typing_extensions import Literal, TypedDict +from ..._types import SequenceNotStr + __all__ = ["ImageCreateParams"] @@ -64,7 +66,7 @@ class ImageCreateParams(TypedDict, total=False): available. """ - tags: Optional[List[str]] + tags: Optional[SequenceNotStr[str]] """A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags. diff --git a/src/gradient/types/gpu_droplets/lb_firewall_param.py b/src/gradient/types/gpu_droplets/lb_firewall_param.py index 6f1dcf10..7d54a048 100644 --- a/src/gradient/types/gpu_droplets/lb_firewall_param.py +++ b/src/gradient/types/gpu_droplets/lb_firewall_param.py @@ -2,20 +2,21 @@ from __future__ import annotations -from typing import List from typing_extensions import TypedDict +from ..._types import SequenceNotStr + __all__ = ["LbFirewallParam"] class LbFirewallParam(TypedDict, total=False): - allow: List[str] + allow: SequenceNotStr[str] """ the rules for allowing traffic to the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16') """ - deny: List[str] + deny: SequenceNotStr[str] """ the rules for denying traffic to the load balancer (in the form 'ip:1.2.3.4' or 'cidr:1.2.0.0/16') diff --git a/src/gradient/types/gpu_droplets/load_balancer_create_params.py b/src/gradient/types/gpu_droplets/load_balancer_create_params.py index a87d9148..06472c78 100644 --- a/src/gradient/types/gpu_droplets/load_balancer_create_params.py +++ b/src/gradient/types/gpu_droplets/load_balancer_create_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Union, Iterable +from typing import Union, Iterable from typing_extensions import Literal, Required, TypeAlias, TypedDict +from ..._types import SequenceNotStr from .domains_param import DomainsParam from .lb_firewall_param import LbFirewallParam from .glb_settings_param import GlbSettingsParam @@ -148,7 +149,7 @@ class AssignDropletsByID(TypedDict, total=False): sticky_sessions: StickySessionsParam """An object specifying sticky sessions settings for the load balancer.""" - target_load_balancer_ids: List[str] + target_load_balancer_ids: SequenceNotStr[str] """ An array containing the UUIDs of the Regional load balancers to be used as target backends for a Global load balancer. @@ -308,7 +309,7 @@ class AssignDropletsByTag(TypedDict, total=False): balancer. """ - target_load_balancer_ids: List[str] + target_load_balancer_ids: SequenceNotStr[str] """ An array containing the UUIDs of the Regional load balancers to be used as target backends for a Global load balancer. diff --git a/src/gradient/types/gpu_droplets/load_balancer_update_params.py b/src/gradient/types/gpu_droplets/load_balancer_update_params.py index 9a1906cb..01c2bda5 100644 --- a/src/gradient/types/gpu_droplets/load_balancer_update_params.py +++ b/src/gradient/types/gpu_droplets/load_balancer_update_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Union, Iterable +from typing import Union, Iterable from typing_extensions import Literal, Required, TypeAlias, TypedDict +from ..._types import SequenceNotStr from .domains_param import DomainsParam from .lb_firewall_param import LbFirewallParam from .glb_settings_param import GlbSettingsParam @@ -148,7 +149,7 @@ class AssignDropletsByID(TypedDict, total=False): sticky_sessions: StickySessionsParam """An object specifying sticky sessions settings for the load balancer.""" - target_load_balancer_ids: List[str] + target_load_balancer_ids: SequenceNotStr[str] """ An array containing the UUIDs of the Regional load balancers to be used as target backends for a Global load balancer. @@ -308,7 +309,7 @@ class AssignDropletsByTag(TypedDict, total=False): balancer. """ - target_load_balancer_ids: List[str] + target_load_balancer_ids: SequenceNotStr[str] """ An array containing the UUIDs of the Regional load balancers to be used as target backends for a Global load balancer. diff --git a/src/gradient/types/gpu_droplets/volume_create_params.py b/src/gradient/types/gpu_droplets/volume_create_params.py index fc889801..c58f7f9d 100644 --- a/src/gradient/types/gpu_droplets/volume_create_params.py +++ b/src/gradient/types/gpu_droplets/volume_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, TypeAlias, TypedDict +from ..._types import SequenceNotStr + __all__ = ["VolumeCreateParams", "VolumesExt4", "VolumesXfs"] @@ -70,7 +72,7 @@ class VolumesExt4(TypedDict, total=False): snapshot_id: str """The unique identifier for the volume snapshot from which to create the volume.""" - tags: Optional[List[str]] + tags: Optional[SequenceNotStr[str]] """A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags. @@ -141,7 +143,7 @@ class VolumesXfs(TypedDict, total=False): snapshot_id: str """The unique identifier for the volume snapshot from which to create the volume.""" - tags: Optional[List[str]] + tags: Optional[SequenceNotStr[str]] """A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags. diff --git a/src/gradient/types/gpu_droplets/volumes/action_initiate_by_id_params.py b/src/gradient/types/gpu_droplets/volumes/action_initiate_by_id_params.py index 6d41d463..bf1869af 100644 --- a/src/gradient/types/gpu_droplets/volumes/action_initiate_by_id_params.py +++ b/src/gradient/types/gpu_droplets/volumes/action_initiate_by_id_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, TypeAlias, TypedDict +from ...._types import SequenceNotStr + __all__ = ["ActionInitiateByIDParams", "VolumeActionPostAttach", "VolumeActionPostDetach", "VolumeActionPostResize"] @@ -46,7 +48,7 @@ class VolumeActionPostAttach(TypedDict, total=False): available. """ - tags: Optional[List[str]] + tags: Optional[SequenceNotStr[str]] """A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags. diff --git a/src/gradient/types/gpu_droplets/volumes/action_initiate_by_name_params.py b/src/gradient/types/gpu_droplets/volumes/action_initiate_by_name_params.py index d1a7d084..f37d6d9a 100644 --- a/src/gradient/types/gpu_droplets/volumes/action_initiate_by_name_params.py +++ b/src/gradient/types/gpu_droplets/volumes/action_initiate_by_name_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, TypeAlias, TypedDict +from ...._types import SequenceNotStr + __all__ = ["ActionInitiateByNameParams", "VolumeActionPostAttach", "VolumeActionPostDetach"] @@ -46,7 +48,7 @@ class VolumeActionPostAttach(TypedDict, total=False): available. """ - tags: Optional[List[str]] + tags: Optional[SequenceNotStr[str]] """A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags. diff --git a/src/gradient/types/gpu_droplets/volumes/snapshot_create_params.py b/src/gradient/types/gpu_droplets/volumes/snapshot_create_params.py index 8cce4a59..890dd302 100644 --- a/src/gradient/types/gpu_droplets/volumes/snapshot_create_params.py +++ b/src/gradient/types/gpu_droplets/volumes/snapshot_create_params.py @@ -2,9 +2,11 @@ from __future__ import annotations -from typing import List, Optional +from typing import Optional from typing_extensions import Required, TypedDict +from ...._types import SequenceNotStr + __all__ = ["SnapshotCreateParams"] @@ -12,7 +14,7 @@ class SnapshotCreateParams(TypedDict, total=False): name: Required[str] """A human-readable name for the volume snapshot.""" - tags: Optional[List[str]] + tags: Optional[SequenceNotStr[str]] """A flat array of tag names as strings to be applied to the resource. Tag names may be for either existing or new tags. diff --git a/src/gradient/types/knowledge_base_create_params.py b/src/gradient/types/knowledge_base_create_params.py index 5c0df9a6..e40bd598 100644 --- a/src/gradient/types/knowledge_base_create_params.py +++ b/src/gradient/types/knowledge_base_create_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Iterable +from typing import Iterable from typing_extensions import TypedDict +from .._types import SequenceNotStr from .knowledge_bases.aws_data_source_param import AwsDataSourceParam from .knowledge_bases.api_spaces_data_source_param import APISpacesDataSourceParam from .knowledge_bases.api_file_upload_data_source_param import APIFileUploadDataSourceParam @@ -44,7 +45,7 @@ class KnowledgeBaseCreateParams(TypedDict, total=False): region: str """The datacenter region to deploy the knowledge base in.""" - tags: List[str] + tags: SequenceNotStr[str] """Tags to organize your knowledge base.""" vpc_uuid: str diff --git a/src/gradient/types/knowledge_base_update_params.py b/src/gradient/types/knowledge_base_update_params.py index 7a86b40c..cfb52016 100644 --- a/src/gradient/types/knowledge_base_update_params.py +++ b/src/gradient/types/knowledge_base_update_params.py @@ -2,9 +2,9 @@ from __future__ import annotations -from typing import List from typing_extensions import Annotated, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo __all__ = ["KnowledgeBaseUpdateParams"] @@ -23,7 +23,7 @@ class KnowledgeBaseUpdateParams(TypedDict, total=False): project_id: str """The id of the DigitalOcean project this knowledge base will belong to""" - tags: List[str] + tags: SequenceNotStr[str] """Tags to organize your knowledge base.""" body_uuid: Annotated[str, PropertyInfo(alias="uuid")] diff --git a/src/gradient/types/knowledge_bases/indexing_job_create_params.py b/src/gradient/types/knowledge_bases/indexing_job_create_params.py index d92c5790..ebd8632b 100644 --- a/src/gradient/types/knowledge_bases/indexing_job_create_params.py +++ b/src/gradient/types/knowledge_bases/indexing_job_create_params.py @@ -2,14 +2,15 @@ from __future__ import annotations -from typing import List from typing_extensions import TypedDict +from ..._types import SequenceNotStr + __all__ = ["IndexingJobCreateParams"] class IndexingJobCreateParams(TypedDict, total=False): - data_source_uuids: List[str] + data_source_uuids: SequenceNotStr[str] """ List of data source ids to index, if none are provided, all data sources will be indexed diff --git a/src/gradient/types/shared_params/firewall_rule_target.py b/src/gradient/types/shared_params/firewall_rule_target.py index 49a5f75c..7f317f6c 100644 --- a/src/gradient/types/shared_params/firewall_rule_target.py +++ b/src/gradient/types/shared_params/firewall_rule_target.py @@ -2,14 +2,16 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import TypedDict +from ..._types import SequenceNotStr + __all__ = ["FirewallRuleTarget"] class FirewallRuleTarget(TypedDict, total=False): - addresses: List[str] + addresses: SequenceNotStr[str] """ An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic. @@ -21,19 +23,19 @@ class FirewallRuleTarget(TypedDict, total=False): traffic. """ - kubernetes_ids: List[str] + kubernetes_ids: SequenceNotStr[str] """ An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic. """ - load_balancer_uids: List[str] + load_balancer_uids: SequenceNotStr[str] """ An array containing the IDs of the load balancers to which the firewall will allow traffic. """ - tags: Optional[List[str]] + tags: Optional[SequenceNotStr[str]] """A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request. From 300eac0417f8f17a65bb871b15de1254f4677558 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 03:55:25 +0000 Subject: [PATCH 03/96] feat: improve future compat with pydantic v3 --- src/gradient/_base_client.py | 6 +- src/gradient/_compat.py | 96 ++++++++--------- src/gradient/_models.py | 80 +++++++------- src/gradient/_utils/__init__.py | 10 +- src/gradient/_utils/_compat.py | 45 ++++++++ src/gradient/_utils/_datetime_parse.py | 136 ++++++++++++++++++++++++ src/gradient/_utils/_transform.py | 6 +- src/gradient/_utils/_typing.py | 2 +- src/gradient/_utils/_utils.py | 1 - src/gradient/types/__init__.py | 50 ++++----- tests/test_models.py | 48 ++++----- tests/test_transform.py | 16 +-- tests/test_utils/test_datetime_parse.py | 110 +++++++++++++++++++ tests/utils.py | 8 +- 14 files changed, 457 insertions(+), 157 deletions(-) create mode 100644 src/gradient/_utils/_compat.py create mode 100644 src/gradient/_utils/_datetime_parse.py create mode 100644 tests/test_utils/test_datetime_parse.py diff --git a/src/gradient/_base_client.py b/src/gradient/_base_client.py index 6f2db396..a5a9ad8c 100644 --- a/src/gradient/_base_client.py +++ b/src/gradient/_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 diff --git a/src/gradient/_compat.py b/src/gradient/_compat.py index 92d9ee61..bdef67f0 100644 --- a/src/gradient/_compat.py +++ b/src/gradient/_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/gradient/_models.py b/src/gradient/_models.py index 92f7c10b..3a6017ef 100644 --- a/src/gradient/_models.py +++ b/src/gradient/_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, @@ -215,25 +215,25 @@ def construct( # pyright: ignore[reportIncompatibleMethodOverride] if key not in model_fields: parsed = construct_type(value=value, type_=extra_field_type) if extra_field_type is not None else value - if PYDANTIC_V2: - _extra[key] = parsed - else: + if PYDANTIC_V1: _fields_set.add(key) 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 @@ -243,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 @@ -363,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}") @@ -375,7 +375,7 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object: def _get_extra_fields_type(cls: type[pydantic.BaseModel]) -> type | None: - if not PYDANTIC_V2: + if PYDANTIC_V1: # TODO return None @@ -628,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 @@ -714,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)) @@ -782,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): @@ -820,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/gradient/_utils/__init__.py b/src/gradient/_utils/__init__.py index ca547ce5..dc64e29a 100644 --- a/src/gradient/_utils/__init__.py +++ b/src/gradient/_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,6 +30,13 @@ 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, @@ -56,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/gradient/_utils/_compat.py b/src/gradient/_utils/_compat.py new file mode 100644 index 00000000..dd703233 --- /dev/null +++ b/src/gradient/_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/gradient/_utils/_datetime_parse.py b/src/gradient/_utils/_datetime_parse.py new file mode 100644 index 00000000..7cb9d9e6 --- /dev/null +++ b/src/gradient/_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/gradient/_utils/_transform.py b/src/gradient/_utils/_transform.py index f0bcefd4..c19124f0 100644 --- a/src/gradient/_utils/_transform.py +++ b/src/gradient/_utils/_transform.py @@ -19,6 +19,7 @@ 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, @@ -29,7 +30,6 @@ is_annotated_type, strip_annotated_type, ) -from .._compat import get_origin, model_dump, is_typeddict _T = TypeVar("_T") @@ -169,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 @@ -333,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 diff --git a/src/gradient/_utils/_typing.py b/src/gradient/_utils/_typing.py index 845cd6b2..193109f3 100644 --- a/src/gradient/_utils/_typing.py +++ b/src/gradient/_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: diff --git a/src/gradient/_utils/_utils.py b/src/gradient/_utils/_utils.py index ea3cf3f2..f0818595 100644 --- a/src/gradient/_utils/_utils.py +++ b/src/gradient/_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/gradient/types/__init__.py b/src/gradient/types/__init__.py index d5486cba..d3d7dab0 100644 --- a/src/gradient/types/__init__.py +++ b/src/gradient/types/__init__.py @@ -151,7 +151,31 @@ # This ensures that, when building the deferred (due to cyclical references) model schema, # Pydantic can resolve the necessary references. # See: https://github.com/pydantic/pydantic/issues/11250 for more context. -if _compat.PYDANTIC_V2: +if _compat.PYDANTIC_V1: + api_agent.APIAgent.update_forward_refs() # type: ignore + api_workspace.APIWorkspace.update_forward_refs() # type: ignore + agent_create_response.AgentCreateResponse.update_forward_refs() # type: ignore + agent_retrieve_response.AgentRetrieveResponse.update_forward_refs() # type: ignore + agent_update_response.AgentUpdateResponse.update_forward_refs() # type: ignore + agent_delete_response.AgentDeleteResponse.update_forward_refs() # type: ignore + agent_update_status_response.AgentUpdateStatusResponse.update_forward_refs() # type: ignore + agents.evaluation_metrics.workspace_create_response.WorkspaceCreateResponse.update_forward_refs() # type: ignore + agents.evaluation_metrics.workspace_retrieve_response.WorkspaceRetrieveResponse.update_forward_refs() # type: ignore + agents.evaluation_metrics.workspace_update_response.WorkspaceUpdateResponse.update_forward_refs() # type: ignore + agents.evaluation_metrics.workspace_list_response.WorkspaceListResponse.update_forward_refs() # type: ignore + agents.evaluation_metrics.workspaces.agent_list_response.AgentListResponse.update_forward_refs() # type: ignore + agents.evaluation_metrics.workspaces.agent_move_response.AgentMoveResponse.update_forward_refs() # type: ignore + agents.evaluation_metrics.anthropic.key_list_agents_response.KeyListAgentsResponse.update_forward_refs() # type: ignore + agents.evaluation_metrics.openai.key_list_agents_response.KeyListAgentsResponse.update_forward_refs() # type: ignore + agents.function_create_response.FunctionCreateResponse.update_forward_refs() # type: ignore + agents.function_update_response.FunctionUpdateResponse.update_forward_refs() # type: ignore + agents.function_delete_response.FunctionDeleteResponse.update_forward_refs() # type: ignore + agents.api_link_knowledge_base_output.APILinkKnowledgeBaseOutput.update_forward_refs() # type: ignore + agents.knowledge_base_detach_response.KnowledgeBaseDetachResponse.update_forward_refs() # type: ignore + agents.route_view_response.RouteViewResponse.update_forward_refs() # type: ignore + models.providers.anthropic_list_agents_response.AnthropicListAgentsResponse.update_forward_refs() # type: ignore + models.providers.openai_retrieve_agents_response.OpenAIRetrieveAgentsResponse.update_forward_refs() # type: ignore +else: api_agent.APIAgent.model_rebuild(_parent_namespace_depth=0) api_workspace.APIWorkspace.model_rebuild(_parent_namespace_depth=0) agent_create_response.AgentCreateResponse.model_rebuild(_parent_namespace_depth=0) @@ -183,27 +207,3 @@ models.providers.openai_retrieve_agents_response.OpenAIRetrieveAgentsResponse.model_rebuild( _parent_namespace_depth=0 ) -else: - api_agent.APIAgent.update_forward_refs() # type: ignore - api_workspace.APIWorkspace.update_forward_refs() # type: ignore - agent_create_response.AgentCreateResponse.update_forward_refs() # type: ignore - agent_retrieve_response.AgentRetrieveResponse.update_forward_refs() # type: ignore - agent_update_response.AgentUpdateResponse.update_forward_refs() # type: ignore - agent_delete_response.AgentDeleteResponse.update_forward_refs() # type: ignore - agent_update_status_response.AgentUpdateStatusResponse.update_forward_refs() # type: ignore - agents.evaluation_metrics.workspace_create_response.WorkspaceCreateResponse.update_forward_refs() # type: ignore - agents.evaluation_metrics.workspace_retrieve_response.WorkspaceRetrieveResponse.update_forward_refs() # type: ignore - agents.evaluation_metrics.workspace_update_response.WorkspaceUpdateResponse.update_forward_refs() # type: ignore - agents.evaluation_metrics.workspace_list_response.WorkspaceListResponse.update_forward_refs() # type: ignore - agents.evaluation_metrics.workspaces.agent_list_response.AgentListResponse.update_forward_refs() # type: ignore - agents.evaluation_metrics.workspaces.agent_move_response.AgentMoveResponse.update_forward_refs() # type: ignore - agents.evaluation_metrics.anthropic.key_list_agents_response.KeyListAgentsResponse.update_forward_refs() # type: ignore - agents.evaluation_metrics.openai.key_list_agents_response.KeyListAgentsResponse.update_forward_refs() # type: ignore - agents.function_create_response.FunctionCreateResponse.update_forward_refs() # type: ignore - agents.function_update_response.FunctionUpdateResponse.update_forward_refs() # type: ignore - agents.function_delete_response.FunctionDeleteResponse.update_forward_refs() # type: ignore - agents.api_link_knowledge_base_output.APILinkKnowledgeBaseOutput.update_forward_refs() # type: ignore - agents.knowledge_base_detach_response.KnowledgeBaseDetachResponse.update_forward_refs() # type: ignore - agents.route_view_response.RouteViewResponse.update_forward_refs() # type: ignore - models.providers.anthropic_list_agents_response.AnthropicListAgentsResponse.update_forward_refs() # type: ignore - models.providers.openai_retrieve_agents_response.OpenAIRetrieveAgentsResponse.update_forward_refs() # type: ignore diff --git a/tests/test_models.py b/tests/test_models.py index 9a2ee908..de5ef465 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -8,7 +8,7 @@ from pydantic import Field from gradient._utils import PropertyInfo -from gradient._compat import PYDANTIC_V2, parse_obj, model_dump, model_json +from gradient._compat import PYDANTIC_V1, parse_obj, model_dump, model_json from gradient._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 @@ -936,7 +936,7 @@ class Type2(BaseModel): assert isinstance(model.value, InnerType2) -@pytest.mark.skipif(not PYDANTIC_V2, reason="this is only supported in pydantic v2 for now") +@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 diff --git a/tests/test_transform.py b/tests/test_transform.py index 552462fa..db909f25 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -15,7 +15,7 @@ parse_datetime, async_transform as _async_transform, ) -from gradient._compat import PYDANTIC_V2 +from gradient._compat import PYDANTIC_V1 from gradient._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..6cbb1b6f --- /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 gradient._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 ac014538..8d9112d6 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -19,7 +19,7 @@ is_annotated_type, is_type_alias_type, ) -from gradient._compat import PYDANTIC_V2, field_outer_type, get_model_fields +from gradient._compat import PYDANTIC_V1, field_outer_type, get_model_fields from gradient._models import BaseModel BaseModelT = TypeVar("BaseModelT", bound=BaseModel) @@ -28,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), From 25c044818b636e3307af2fefd2add15a6e650e8d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Sep 2025 04:30:15 +0000 Subject: [PATCH 04/96] chore(internal): move mypy configurations to `pyproject.toml` file --- mypy.ini | 50 ------------------------------------------------ pyproject.toml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 50 deletions(-) delete mode 100644 mypy.ini diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index 9a8e555e..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/gradient/_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 bde954ca..8dcc8f0c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -144,6 +144,58 @@ 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/gradient/_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" From b839e4b31c1262157544bd69536051a10d6b098d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 6 Sep 2025 05:16:48 +0000 Subject: [PATCH 05/96] chore(tests): simplify `get_platform` test `nest_asyncio` is archived and broken on some platforms so it's not worth keeping in our test suite. --- pyproject.toml | 1 - requirements-dev.lock | 1 - tests/test_client.py | 55 +++++-------------------------------------- 3 files changed, 6 insertions(+), 51 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8dcc8f0c..5fc8df7f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,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", ] diff --git a/requirements-dev.lock b/requirements-dev.lock index 7a0f60ab..af44e06b 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/tests/test_client.py b/tests/test_client.py index 9422604d..98833ff2 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,6 +20,7 @@ from gradient import Gradient, AsyncGradient, APIResponseValidationError from gradient._types import Omit +from gradient._utils import asyncify from gradient._models import BaseModel, FinalRequestOptions from gradient._streaming import Stream, AsyncStream from gradient._exceptions import ( @@ -34,8 +32,10 @@ DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, + OtherPlatform, DefaultHttpxClient, DefaultAsyncHttpxClient, + get_platform, make_request_options, ) @@ -2058,52 +2058,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 gradient._utils import asyncify - from gradient._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 From 0ad7f2f9545d1d8f7199744de9469b3507f93b7e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 12 Sep 2025 15:29:45 +0000 Subject: [PATCH 06/96] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 4a621094..512aabaf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 170 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-621c3ebf5011c5ca508f78fccbea17de4ca6b35bfe99578c1ae2265021578d6f.yml openapi_spec_hash: e29d14e3e4679fcf22b3e760e49931b1 -config_hash: 6c8d569b60ae6536708a165b72ff838f +config_hash: 08281b73cbc4aa830d1fa79914dc79fe From a3a3e302f31d92baa9b055c9c8152abd5293a6b4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 12 Sep 2025 15:30:12 +0000 Subject: [PATCH 07/96] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 512aabaf..df2d2abe 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 170 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-621c3ebf5011c5ca508f78fccbea17de4ca6b35bfe99578c1ae2265021578d6f.yml openapi_spec_hash: e29d14e3e4679fcf22b3e760e49931b1 -config_hash: 08281b73cbc4aa830d1fa79914dc79fe +config_hash: 6e3aacb34562b5a1ef74bb279f55cbec From c17086aaed18fbb8ba85f050556a193cdc4a233f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 12 Sep 2025 15:53:44 +0000 Subject: [PATCH 08/96] feat(api): enable typescript --- .stats.yml | 4 +- api.md | 26 ++ src/gradient/resources/agents/agents.py | 120 +++++++++ .../agents/evaluation_metrics/__init__.py | 14 ++ .../evaluation_metrics/evaluation_metrics.py | 32 +++ .../evaluation_metrics/oauth2/__init__.py | 33 +++ .../evaluation_metrics/oauth2/dropbox.py | 193 +++++++++++++++ .../evaluation_metrics/oauth2/oauth2.py | 229 ++++++++++++++++++ src/gradient/types/__init__.py | 2 + .../types/agent_retrieve_usage_params.py | 18 ++ .../types/agent_retrieve_usage_response.py | 48 ++++ .../agents/evaluation_metrics/__init__.py | 2 + .../evaluation_metrics/oauth2/__init__.py | 6 + .../oauth2/dropbox_create_tokens_params.py | 15 ++ .../oauth2/dropbox_create_tokens_response.py | 15 ++ .../oauth2_generate_url_params.py | 15 ++ .../oauth2_generate_url_response.py | 12 + .../evaluation_metrics/oauth2/__init__.py | 1 + .../evaluation_metrics/oauth2/test_dropbox.py | 100 ++++++++ .../agents/evaluation_metrics/test_oauth2.py | 98 ++++++++ tests/api_resources/test_agents.py | 105 ++++++++ 21 files changed, 1086 insertions(+), 2 deletions(-) create mode 100644 src/gradient/resources/agents/evaluation_metrics/oauth2/__init__.py create mode 100644 src/gradient/resources/agents/evaluation_metrics/oauth2/dropbox.py create mode 100644 src/gradient/resources/agents/evaluation_metrics/oauth2/oauth2.py create mode 100644 src/gradient/types/agent_retrieve_usage_params.py create mode 100644 src/gradient/types/agent_retrieve_usage_response.py create mode 100644 src/gradient/types/agents/evaluation_metrics/oauth2/__init__.py create mode 100644 src/gradient/types/agents/evaluation_metrics/oauth2/dropbox_create_tokens_params.py create mode 100644 src/gradient/types/agents/evaluation_metrics/oauth2/dropbox_create_tokens_response.py create mode 100644 src/gradient/types/agents/evaluation_metrics/oauth2_generate_url_params.py create mode 100644 src/gradient/types/agents/evaluation_metrics/oauth2_generate_url_response.py create mode 100644 tests/api_resources/agents/evaluation_metrics/oauth2/__init__.py create mode 100644 tests/api_resources/agents/evaluation_metrics/oauth2/test_dropbox.py create mode 100644 tests/api_resources/agents/evaluation_metrics/test_oauth2.py diff --git a/.stats.yml b/.stats.yml index df2d2abe..e30c19b7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 170 +configured_endpoints: 173 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-621c3ebf5011c5ca508f78fccbea17de4ca6b35bfe99578c1ae2265021578d6f.yml openapi_spec_hash: e29d14e3e4679fcf22b3e760e49931b1 -config_hash: 6e3aacb34562b5a1ef74bb279f55cbec +config_hash: 3d425c415b7f7ab581418b43eb521cb3 diff --git a/api.md b/api.md index 1091e4dc..7299b3c6 100644 --- a/api.md +++ b/api.md @@ -51,6 +51,7 @@ from gradient.types import ( AgentUpdateResponse, AgentListResponse, AgentDeleteResponse, + AgentRetrieveUsageResponse, AgentUpdateStatusResponse, ) ``` @@ -62,6 +63,7 @@ Methods: - client.agents.update(path_uuid, \*\*params) -> AgentUpdateResponse - client.agents.list(\*\*params) -> AgentListResponse - client.agents.delete(uuid) -> AgentDeleteResponse +- client.agents.retrieve_usage(uuid, \*\*params) -> AgentRetrieveUsageResponse - client.agents.update_status(path_uuid, \*\*params) -> AgentUpdateStatusResponse ## APIKeys @@ -214,6 +216,30 @@ Methods: - client.agents.evaluation_metrics.openai.keys.delete(api_key_uuid) -> KeyDeleteResponse - client.agents.evaluation_metrics.openai.keys.list_agents(uuid, \*\*params) -> KeyListAgentsResponse +### Oauth2 + +Types: + +```python +from gradient.types.agents.evaluation_metrics import Oauth2GenerateURLResponse +``` + +Methods: + +- client.agents.evaluation_metrics.oauth2.generate_url(\*\*params) -> Oauth2GenerateURLResponse + +#### Dropbox + +Types: + +```python +from gradient.types.agents.evaluation_metrics.oauth2 import DropboxCreateTokensResponse +``` + +Methods: + +- client.agents.evaluation_metrics.oauth2.dropbox.create_tokens(\*\*params) -> DropboxCreateTokensResponse + ## EvaluationRuns Types: diff --git a/src/gradient/resources/agents/agents.py b/src/gradient/resources/agents/agents.py index 8d06584c..590b9a76 100644 --- a/src/gradient/resources/agents/agents.py +++ b/src/gradient/resources/agents/agents.py @@ -19,6 +19,7 @@ agent_create_params, agent_update_params, agent_update_status_params, + agent_retrieve_usage_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from ..._utils import maybe_transform, async_maybe_transform @@ -103,6 +104,7 @@ from ...types.agent_retrieve_response import AgentRetrieveResponse from ...types.api_deployment_visibility import APIDeploymentVisibility from ...types.agent_update_status_response import AgentUpdateStatusResponse +from ...types.agent_retrieve_usage_response import AgentRetrieveUsageResponse from .evaluation_metrics.evaluation_metrics import ( EvaluationMetricsResource, AsyncEvaluationMetricsResource, @@ -500,6 +502,59 @@ def delete( cast_to=AgentDeleteResponse, ) + def retrieve_usage( + self, + uuid: str, + *, + start: str | NotGiven = NOT_GIVEN, + stop: 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AgentRetrieveUsageResponse: + """ + To get agent usage, send a GET request to `/v2/gen-ai/agents/{uuid}/usage`. + Returns usage metrics for the specified agent within the provided time range. + + Args: + start: Return all usage data from this date. + + stop: Return all usage data up to this date, if omitted, will return up to the current + date. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not uuid: + raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") + return self._get( + f"/v2/gen-ai/agents/{uuid}/usage" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/gen-ai/agents/{uuid}/usage", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "start": start, + "stop": stop, + }, + agent_retrieve_usage_params.AgentRetrieveUsageParams, + ), + ), + cast_to=AgentRetrieveUsageResponse, + ) + def update_status( self, path_uuid: str, @@ -943,6 +998,59 @@ async def delete( cast_to=AgentDeleteResponse, ) + async def retrieve_usage( + self, + uuid: str, + *, + start: str | NotGiven = NOT_GIVEN, + stop: 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AgentRetrieveUsageResponse: + """ + To get agent usage, send a GET request to `/v2/gen-ai/agents/{uuid}/usage`. + Returns usage metrics for the specified agent within the provided time range. + + Args: + start: Return all usage data from this date. + + stop: Return all usage data up to this date, if omitted, will return up to the current + date. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not uuid: + raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") + return await self._get( + f"/v2/gen-ai/agents/{uuid}/usage" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/gen-ai/agents/{uuid}/usage", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "start": start, + "stop": stop, + }, + agent_retrieve_usage_params.AgentRetrieveUsageParams, + ), + ), + cast_to=AgentRetrieveUsageResponse, + ) + async def update_status( self, path_uuid: str, @@ -1020,6 +1128,9 @@ def __init__(self, agents: AgentsResource) -> None: self.delete = to_raw_response_wrapper( agents.delete, ) + self.retrieve_usage = to_raw_response_wrapper( + agents.retrieve_usage, + ) self.update_status = to_raw_response_wrapper( agents.update_status, ) @@ -1084,6 +1195,9 @@ def __init__(self, agents: AsyncAgentsResource) -> None: self.delete = async_to_raw_response_wrapper( agents.delete, ) + self.retrieve_usage = async_to_raw_response_wrapper( + agents.retrieve_usage, + ) self.update_status = async_to_raw_response_wrapper( agents.update_status, ) @@ -1148,6 +1262,9 @@ def __init__(self, agents: AgentsResource) -> None: self.delete = to_streamed_response_wrapper( agents.delete, ) + self.retrieve_usage = to_streamed_response_wrapper( + agents.retrieve_usage, + ) self.update_status = to_streamed_response_wrapper( agents.update_status, ) @@ -1212,6 +1329,9 @@ def __init__(self, agents: AsyncAgentsResource) -> None: self.delete = async_to_streamed_response_wrapper( agents.delete, ) + self.retrieve_usage = async_to_streamed_response_wrapper( + agents.retrieve_usage, + ) self.update_status = async_to_streamed_response_wrapper( agents.update_status, ) diff --git a/src/gradient/resources/agents/evaluation_metrics/__init__.py b/src/gradient/resources/agents/evaluation_metrics/__init__.py index 92449820..31e2f93b 100644 --- a/src/gradient/resources/agents/evaluation_metrics/__init__.py +++ b/src/gradient/resources/agents/evaluation_metrics/__init__.py @@ -8,6 +8,14 @@ ModelsResourceWithStreamingResponse, AsyncModelsResourceWithStreamingResponse, ) +from .oauth2 import ( + Oauth2Resource, + AsyncOauth2Resource, + Oauth2ResourceWithRawResponse, + AsyncOauth2ResourceWithRawResponse, + Oauth2ResourceWithStreamingResponse, + AsyncOauth2ResourceWithStreamingResponse, +) from .openai import ( OpenAIResource, AsyncOpenAIResource, @@ -66,6 +74,12 @@ "AsyncOpenAIResourceWithRawResponse", "OpenAIResourceWithStreamingResponse", "AsyncOpenAIResourceWithStreamingResponse", + "Oauth2Resource", + "AsyncOauth2Resource", + "Oauth2ResourceWithRawResponse", + "AsyncOauth2ResourceWithRawResponse", + "Oauth2ResourceWithStreamingResponse", + "AsyncOauth2ResourceWithStreamingResponse", "EvaluationMetricsResource", "AsyncEvaluationMetricsResource", "EvaluationMetricsResourceWithRawResponse", diff --git a/src/gradient/resources/agents/evaluation_metrics/evaluation_metrics.py b/src/gradient/resources/agents/evaluation_metrics/evaluation_metrics.py index f6453d4d..b9e1386b 100644 --- a/src/gradient/resources/agents/evaluation_metrics/evaluation_metrics.py +++ b/src/gradient/resources/agents/evaluation_metrics/evaluation_metrics.py @@ -22,6 +22,14 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) +from .oauth2.oauth2 import ( + Oauth2Resource, + AsyncOauth2Resource, + Oauth2ResourceWithRawResponse, + AsyncOauth2ResourceWithRawResponse, + Oauth2ResourceWithStreamingResponse, + AsyncOauth2ResourceWithStreamingResponse, +) from .openai.openai import ( OpenAIResource, AsyncOpenAIResource, @@ -71,6 +79,10 @@ def anthropic(self) -> AnthropicResource: def openai(self) -> OpenAIResource: return OpenAIResource(self._client) + @cached_property + def oauth2(self) -> Oauth2Resource: + return Oauth2Resource(self._client) + @cached_property def with_raw_response(self) -> EvaluationMetricsResourceWithRawResponse: """ @@ -180,6 +192,10 @@ def anthropic(self) -> AsyncAnthropicResource: def openai(self) -> AsyncOpenAIResource: return AsyncOpenAIResource(self._client) + @cached_property + def oauth2(self) -> AsyncOauth2Resource: + return AsyncOauth2Resource(self._client) + @cached_property def with_raw_response(self) -> AsyncEvaluationMetricsResourceWithRawResponse: """ @@ -299,6 +315,10 @@ def anthropic(self) -> AnthropicResourceWithRawResponse: def openai(self) -> OpenAIResourceWithRawResponse: return OpenAIResourceWithRawResponse(self._evaluation_metrics.openai) + @cached_property + def oauth2(self) -> Oauth2ResourceWithRawResponse: + return Oauth2ResourceWithRawResponse(self._evaluation_metrics.oauth2) + class AsyncEvaluationMetricsResourceWithRawResponse: def __init__(self, evaluation_metrics: AsyncEvaluationMetricsResource) -> None: @@ -327,6 +347,10 @@ def anthropic(self) -> AsyncAnthropicResourceWithRawResponse: def openai(self) -> AsyncOpenAIResourceWithRawResponse: return AsyncOpenAIResourceWithRawResponse(self._evaluation_metrics.openai) + @cached_property + def oauth2(self) -> AsyncOauth2ResourceWithRawResponse: + return AsyncOauth2ResourceWithRawResponse(self._evaluation_metrics.oauth2) + class EvaluationMetricsResourceWithStreamingResponse: def __init__(self, evaluation_metrics: EvaluationMetricsResource) -> None: @@ -355,6 +379,10 @@ def anthropic(self) -> AnthropicResourceWithStreamingResponse: def openai(self) -> OpenAIResourceWithStreamingResponse: return OpenAIResourceWithStreamingResponse(self._evaluation_metrics.openai) + @cached_property + def oauth2(self) -> Oauth2ResourceWithStreamingResponse: + return Oauth2ResourceWithStreamingResponse(self._evaluation_metrics.oauth2) + class AsyncEvaluationMetricsResourceWithStreamingResponse: def __init__(self, evaluation_metrics: AsyncEvaluationMetricsResource) -> None: @@ -382,3 +410,7 @@ def anthropic(self) -> AsyncAnthropicResourceWithStreamingResponse: @cached_property def openai(self) -> AsyncOpenAIResourceWithStreamingResponse: return AsyncOpenAIResourceWithStreamingResponse(self._evaluation_metrics.openai) + + @cached_property + def oauth2(self) -> AsyncOauth2ResourceWithStreamingResponse: + return AsyncOauth2ResourceWithStreamingResponse(self._evaluation_metrics.oauth2) diff --git a/src/gradient/resources/agents/evaluation_metrics/oauth2/__init__.py b/src/gradient/resources/agents/evaluation_metrics/oauth2/__init__.py new file mode 100644 index 00000000..c74ddfe8 --- /dev/null +++ b/src/gradient/resources/agents/evaluation_metrics/oauth2/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .oauth2 import ( + Oauth2Resource, + AsyncOauth2Resource, + Oauth2ResourceWithRawResponse, + AsyncOauth2ResourceWithRawResponse, + Oauth2ResourceWithStreamingResponse, + AsyncOauth2ResourceWithStreamingResponse, +) +from .dropbox import ( + DropboxResource, + AsyncDropboxResource, + DropboxResourceWithRawResponse, + AsyncDropboxResourceWithRawResponse, + DropboxResourceWithStreamingResponse, + AsyncDropboxResourceWithStreamingResponse, +) + +__all__ = [ + "DropboxResource", + "AsyncDropboxResource", + "DropboxResourceWithRawResponse", + "AsyncDropboxResourceWithRawResponse", + "DropboxResourceWithStreamingResponse", + "AsyncDropboxResourceWithStreamingResponse", + "Oauth2Resource", + "AsyncOauth2Resource", + "Oauth2ResourceWithRawResponse", + "AsyncOauth2ResourceWithRawResponse", + "Oauth2ResourceWithStreamingResponse", + "AsyncOauth2ResourceWithStreamingResponse", +] diff --git a/src/gradient/resources/agents/evaluation_metrics/oauth2/dropbox.py b/src/gradient/resources/agents/evaluation_metrics/oauth2/dropbox.py new file mode 100644 index 00000000..caa7d0d3 --- /dev/null +++ b/src/gradient/resources/agents/evaluation_metrics/oauth2/dropbox.py @@ -0,0 +1,193 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import maybe_transform, async_maybe_transform +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ....._base_client import make_request_options +from .....types.agents.evaluation_metrics.oauth2 import dropbox_create_tokens_params +from .....types.agents.evaluation_metrics.oauth2.dropbox_create_tokens_response import DropboxCreateTokensResponse + +__all__ = ["DropboxResource", "AsyncDropboxResource"] + + +class DropboxResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> DropboxResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return DropboxResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> DropboxResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return DropboxResourceWithStreamingResponse(self) + + def create_tokens( + self, + *, + code: str | NotGiven = NOT_GIVEN, + redirect_url: 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DropboxCreateTokensResponse: + """ + To obtain the refresh token, needed for creation of data sources, send a GET + request to `/v2/gen-ai/oauth2/dropbox/tokens`. Pass the code you obtrained from + the oauth flow in the field 'code' + + Args: + code: The oauth2 code from google + + redirect_url: Redirect url + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/v2/gen-ai/oauth2/dropbox/tokens" + if self._client._base_url_overridden + else "https://api.digitalocean.com/v2/gen-ai/oauth2/dropbox/tokens", + body=maybe_transform( + { + "code": code, + "redirect_url": redirect_url, + }, + dropbox_create_tokens_params.DropboxCreateTokensParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DropboxCreateTokensResponse, + ) + + +class AsyncDropboxResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncDropboxResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return AsyncDropboxResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncDropboxResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return AsyncDropboxResourceWithStreamingResponse(self) + + async def create_tokens( + self, + *, + code: str | NotGiven = NOT_GIVEN, + redirect_url: 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DropboxCreateTokensResponse: + """ + To obtain the refresh token, needed for creation of data sources, send a GET + request to `/v2/gen-ai/oauth2/dropbox/tokens`. Pass the code you obtrained from + the oauth flow in the field 'code' + + Args: + code: The oauth2 code from google + + redirect_url: Redirect url + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/v2/gen-ai/oauth2/dropbox/tokens" + if self._client._base_url_overridden + else "https://api.digitalocean.com/v2/gen-ai/oauth2/dropbox/tokens", + body=await async_maybe_transform( + { + "code": code, + "redirect_url": redirect_url, + }, + dropbox_create_tokens_params.DropboxCreateTokensParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DropboxCreateTokensResponse, + ) + + +class DropboxResourceWithRawResponse: + def __init__(self, dropbox: DropboxResource) -> None: + self._dropbox = dropbox + + self.create_tokens = to_raw_response_wrapper( + dropbox.create_tokens, + ) + + +class AsyncDropboxResourceWithRawResponse: + def __init__(self, dropbox: AsyncDropboxResource) -> None: + self._dropbox = dropbox + + self.create_tokens = async_to_raw_response_wrapper( + dropbox.create_tokens, + ) + + +class DropboxResourceWithStreamingResponse: + def __init__(self, dropbox: DropboxResource) -> None: + self._dropbox = dropbox + + self.create_tokens = to_streamed_response_wrapper( + dropbox.create_tokens, + ) + + +class AsyncDropboxResourceWithStreamingResponse: + def __init__(self, dropbox: AsyncDropboxResource) -> None: + self._dropbox = dropbox + + self.create_tokens = async_to_streamed_response_wrapper( + dropbox.create_tokens, + ) diff --git a/src/gradient/resources/agents/evaluation_metrics/oauth2/oauth2.py b/src/gradient/resources/agents/evaluation_metrics/oauth2/oauth2.py new file mode 100644 index 00000000..8063ce5a --- /dev/null +++ b/src/gradient/resources/agents/evaluation_metrics/oauth2/oauth2.py @@ -0,0 +1,229 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from .dropbox import ( + DropboxResource, + AsyncDropboxResource, + DropboxResourceWithRawResponse, + AsyncDropboxResourceWithRawResponse, + DropboxResourceWithStreamingResponse, + AsyncDropboxResourceWithStreamingResponse, +) +from ....._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ....._utils import maybe_transform, async_maybe_transform +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ....._base_client import make_request_options +from .....types.agents.evaluation_metrics import oauth2_generate_url_params +from .....types.agents.evaluation_metrics.oauth2_generate_url_response import Oauth2GenerateURLResponse + +__all__ = ["Oauth2Resource", "AsyncOauth2Resource"] + + +class Oauth2Resource(SyncAPIResource): + @cached_property + def dropbox(self) -> DropboxResource: + return DropboxResource(self._client) + + @cached_property + def with_raw_response(self) -> Oauth2ResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return Oauth2ResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> Oauth2ResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return Oauth2ResourceWithStreamingResponse(self) + + def generate_url( + self, + *, + redirect_url: str | NotGiven = NOT_GIVEN, + type: 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Oauth2GenerateURLResponse: + """ + To generate an Oauth2-URL for use with your localhost, send a GET request to + `/v2/gen-ai/oauth2/url`. Pass 'http://localhost:3000 as redirect_url + + Args: + redirect_url: The redirect url. + + type: Type "google" / "dropbox". + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/v2/gen-ai/oauth2/url" + if self._client._base_url_overridden + else "https://api.digitalocean.com/v2/gen-ai/oauth2/url", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "redirect_url": redirect_url, + "type": type, + }, + oauth2_generate_url_params.Oauth2GenerateURLParams, + ), + ), + cast_to=Oauth2GenerateURLResponse, + ) + + +class AsyncOauth2Resource(AsyncAPIResource): + @cached_property + def dropbox(self) -> AsyncDropboxResource: + return AsyncDropboxResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncOauth2ResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return AsyncOauth2ResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncOauth2ResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return AsyncOauth2ResourceWithStreamingResponse(self) + + async def generate_url( + self, + *, + redirect_url: str | NotGiven = NOT_GIVEN, + type: 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. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Oauth2GenerateURLResponse: + """ + To generate an Oauth2-URL for use with your localhost, send a GET request to + `/v2/gen-ai/oauth2/url`. Pass 'http://localhost:3000 as redirect_url + + Args: + redirect_url: The redirect url. + + type: Type "google" / "dropbox". + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/v2/gen-ai/oauth2/url" + if self._client._base_url_overridden + else "https://api.digitalocean.com/v2/gen-ai/oauth2/url", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "redirect_url": redirect_url, + "type": type, + }, + oauth2_generate_url_params.Oauth2GenerateURLParams, + ), + ), + cast_to=Oauth2GenerateURLResponse, + ) + + +class Oauth2ResourceWithRawResponse: + def __init__(self, oauth2: Oauth2Resource) -> None: + self._oauth2 = oauth2 + + self.generate_url = to_raw_response_wrapper( + oauth2.generate_url, + ) + + @cached_property + def dropbox(self) -> DropboxResourceWithRawResponse: + return DropboxResourceWithRawResponse(self._oauth2.dropbox) + + +class AsyncOauth2ResourceWithRawResponse: + def __init__(self, oauth2: AsyncOauth2Resource) -> None: + self._oauth2 = oauth2 + + self.generate_url = async_to_raw_response_wrapper( + oauth2.generate_url, + ) + + @cached_property + def dropbox(self) -> AsyncDropboxResourceWithRawResponse: + return AsyncDropboxResourceWithRawResponse(self._oauth2.dropbox) + + +class Oauth2ResourceWithStreamingResponse: + def __init__(self, oauth2: Oauth2Resource) -> None: + self._oauth2 = oauth2 + + self.generate_url = to_streamed_response_wrapper( + oauth2.generate_url, + ) + + @cached_property + def dropbox(self) -> DropboxResourceWithStreamingResponse: + return DropboxResourceWithStreamingResponse(self._oauth2.dropbox) + + +class AsyncOauth2ResourceWithStreamingResponse: + def __init__(self, oauth2: AsyncOauth2Resource) -> None: + self._oauth2 = oauth2 + + self.generate_url = async_to_streamed_response_wrapper( + oauth2.generate_url, + ) + + @cached_property + def dropbox(self) -> AsyncDropboxResourceWithStreamingResponse: + return AsyncDropboxResourceWithStreamingResponse(self._oauth2.dropbox) diff --git a/src/gradient/types/__init__.py b/src/gradient/types/__init__.py index d3d7dab0..d28c4c1d 100644 --- a/src/gradient/types/__init__.py +++ b/src/gradient/types/__init__.py @@ -79,6 +79,7 @@ from .knowledge_base_list_params import ( KnowledgeBaseListParams as KnowledgeBaseListParams, ) +from .agent_retrieve_usage_params import AgentRetrieveUsageParams as AgentRetrieveUsageParams from .droplet_backup_policy_param import ( DropletBackupPolicyParam as DropletBackupPolicyParam, ) @@ -97,6 +98,7 @@ from .knowledge_base_update_params import ( KnowledgeBaseUpdateParams as KnowledgeBaseUpdateParams, ) +from .agent_retrieve_usage_response import AgentRetrieveUsageResponse as AgentRetrieveUsageResponse from .gpu_droplet_retrieve_response import ( GPUDropletRetrieveResponse as GPUDropletRetrieveResponse, ) diff --git a/src/gradient/types/agent_retrieve_usage_params.py b/src/gradient/types/agent_retrieve_usage_params.py new file mode 100644 index 00000000..f5471151 --- /dev/null +++ b/src/gradient/types/agent_retrieve_usage_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["AgentRetrieveUsageParams"] + + +class AgentRetrieveUsageParams(TypedDict, total=False): + start: str + """Return all usage data from this date.""" + + stop: str + """ + Return all usage data up to this date, if omitted, will return up to the current + date. + """ diff --git a/src/gradient/types/agent_retrieve_usage_response.py b/src/gradient/types/agent_retrieve_usage_response.py new file mode 100644 index 00000000..1d65addd --- /dev/null +++ b/src/gradient/types/agent_retrieve_usage_response.py @@ -0,0 +1,48 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from .._models import BaseModel + +__all__ = ["AgentRetrieveUsageResponse", "LogInsightsUsage", "LogInsightsUsageMeasurement", "Usage", "UsageMeasurement"] + + +class LogInsightsUsageMeasurement(BaseModel): + tokens: Optional[int] = None + + usage_type: Optional[str] = None + + +class LogInsightsUsage(BaseModel): + measurements: Optional[List[LogInsightsUsageMeasurement]] = None + + resource_uuid: Optional[str] = None + + start: Optional[datetime] = None + + stop: Optional[datetime] = None + + +class UsageMeasurement(BaseModel): + tokens: Optional[int] = None + + usage_type: Optional[str] = None + + +class Usage(BaseModel): + measurements: Optional[List[UsageMeasurement]] = None + + resource_uuid: Optional[str] = None + + start: Optional[datetime] = None + + stop: Optional[datetime] = None + + +class AgentRetrieveUsageResponse(BaseModel): + log_insights_usage: Optional[LogInsightsUsage] = None + """Resource Usage Description""" + + usage: Optional[Usage] = None + """Resource Usage Description""" diff --git a/src/gradient/types/agents/evaluation_metrics/__init__.py b/src/gradient/types/agents/evaluation_metrics/__init__.py index 12ca91f3..01ce5ed2 100644 --- a/src/gradient/types/agents/evaluation_metrics/__init__.py +++ b/src/gradient/types/agents/evaluation_metrics/__init__.py @@ -15,7 +15,9 @@ from .workspace_create_response import WorkspaceCreateResponse as WorkspaceCreateResponse from .workspace_delete_response import WorkspaceDeleteResponse as WorkspaceDeleteResponse from .workspace_update_response import WorkspaceUpdateResponse as WorkspaceUpdateResponse +from .oauth2_generate_url_params import Oauth2GenerateURLParams as Oauth2GenerateURLParams from .workspace_retrieve_response import WorkspaceRetrieveResponse as WorkspaceRetrieveResponse +from .oauth2_generate_url_response import Oauth2GenerateURLResponse as Oauth2GenerateURLResponse from .workspace_list_evaluation_test_cases_response import ( WorkspaceListEvaluationTestCasesResponse as WorkspaceListEvaluationTestCasesResponse, ) diff --git a/src/gradient/types/agents/evaluation_metrics/oauth2/__init__.py b/src/gradient/types/agents/evaluation_metrics/oauth2/__init__.py new file mode 100644 index 00000000..e686ce35 --- /dev/null +++ b/src/gradient/types/agents/evaluation_metrics/oauth2/__init__.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .dropbox_create_tokens_params import DropboxCreateTokensParams as DropboxCreateTokensParams +from .dropbox_create_tokens_response import DropboxCreateTokensResponse as DropboxCreateTokensResponse diff --git a/src/gradient/types/agents/evaluation_metrics/oauth2/dropbox_create_tokens_params.py b/src/gradient/types/agents/evaluation_metrics/oauth2/dropbox_create_tokens_params.py new file mode 100644 index 00000000..00d22cce --- /dev/null +++ b/src/gradient/types/agents/evaluation_metrics/oauth2/dropbox_create_tokens_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["DropboxCreateTokensParams"] + + +class DropboxCreateTokensParams(TypedDict, total=False): + code: str + """The oauth2 code from google""" + + redirect_url: str + """Redirect url""" diff --git a/src/gradient/types/agents/evaluation_metrics/oauth2/dropbox_create_tokens_response.py b/src/gradient/types/agents/evaluation_metrics/oauth2/dropbox_create_tokens_response.py new file mode 100644 index 00000000..816b89f4 --- /dev/null +++ b/src/gradient/types/agents/evaluation_metrics/oauth2/dropbox_create_tokens_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ....._models import BaseModel + +__all__ = ["DropboxCreateTokensResponse"] + + +class DropboxCreateTokensResponse(BaseModel): + token: Optional[str] = None + """The access token""" + + refresh_token: Optional[str] = None + """The refresh token""" diff --git a/src/gradient/types/agents/evaluation_metrics/oauth2_generate_url_params.py b/src/gradient/types/agents/evaluation_metrics/oauth2_generate_url_params.py new file mode 100644 index 00000000..68924774 --- /dev/null +++ b/src/gradient/types/agents/evaluation_metrics/oauth2_generate_url_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["Oauth2GenerateURLParams"] + + +class Oauth2GenerateURLParams(TypedDict, total=False): + redirect_url: str + """The redirect url.""" + + type: str + """Type "google" / "dropbox".""" diff --git a/src/gradient/types/agents/evaluation_metrics/oauth2_generate_url_response.py b/src/gradient/types/agents/evaluation_metrics/oauth2_generate_url_response.py new file mode 100644 index 00000000..8be21b8a --- /dev/null +++ b/src/gradient/types/agents/evaluation_metrics/oauth2_generate_url_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["Oauth2GenerateURLResponse"] + + +class Oauth2GenerateURLResponse(BaseModel): + url: Optional[str] = None + """The oauth2 url""" diff --git a/tests/api_resources/agents/evaluation_metrics/oauth2/__init__.py b/tests/api_resources/agents/evaluation_metrics/oauth2/__init__.py new file mode 100644 index 00000000..fd8019a9 --- /dev/null +++ b/tests/api_resources/agents/evaluation_metrics/oauth2/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/agents/evaluation_metrics/oauth2/test_dropbox.py b/tests/api_resources/agents/evaluation_metrics/oauth2/test_dropbox.py new file mode 100644 index 00000000..417bb3b1 --- /dev/null +++ b/tests/api_resources/agents/evaluation_metrics/oauth2/test_dropbox.py @@ -0,0 +1,100 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gradient import Gradient, AsyncGradient +from tests.utils import assert_matches_type +from gradient.types.agents.evaluation_metrics.oauth2 import DropboxCreateTokensResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestDropbox: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_tokens(self, client: Gradient) -> None: + dropbox = client.agents.evaluation_metrics.oauth2.dropbox.create_tokens() + assert_matches_type(DropboxCreateTokensResponse, dropbox, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_tokens_with_all_params(self, client: Gradient) -> None: + dropbox = client.agents.evaluation_metrics.oauth2.dropbox.create_tokens( + code="example string", + redirect_url="example string", + ) + assert_matches_type(DropboxCreateTokensResponse, dropbox, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create_tokens(self, client: Gradient) -> None: + response = client.agents.evaluation_metrics.oauth2.dropbox.with_raw_response.create_tokens() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + dropbox = response.parse() + assert_matches_type(DropboxCreateTokensResponse, dropbox, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create_tokens(self, client: Gradient) -> None: + with client.agents.evaluation_metrics.oauth2.dropbox.with_streaming_response.create_tokens() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + dropbox = response.parse() + assert_matches_type(DropboxCreateTokensResponse, dropbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncDropbox: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_tokens(self, async_client: AsyncGradient) -> None: + dropbox = await async_client.agents.evaluation_metrics.oauth2.dropbox.create_tokens() + assert_matches_type(DropboxCreateTokensResponse, dropbox, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_tokens_with_all_params(self, async_client: AsyncGradient) -> None: + dropbox = await async_client.agents.evaluation_metrics.oauth2.dropbox.create_tokens( + code="example string", + redirect_url="example string", + ) + assert_matches_type(DropboxCreateTokensResponse, dropbox, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create_tokens(self, async_client: AsyncGradient) -> None: + response = await async_client.agents.evaluation_metrics.oauth2.dropbox.with_raw_response.create_tokens() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + dropbox = await response.parse() + assert_matches_type(DropboxCreateTokensResponse, dropbox, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create_tokens(self, async_client: AsyncGradient) -> None: + async with ( + async_client.agents.evaluation_metrics.oauth2.dropbox.with_streaming_response.create_tokens() + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + dropbox = await response.parse() + assert_matches_type(DropboxCreateTokensResponse, dropbox, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/agents/evaluation_metrics/test_oauth2.py b/tests/api_resources/agents/evaluation_metrics/test_oauth2.py new file mode 100644 index 00000000..f247d94f --- /dev/null +++ b/tests/api_resources/agents/evaluation_metrics/test_oauth2.py @@ -0,0 +1,98 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gradient import Gradient, AsyncGradient +from tests.utils import assert_matches_type +from gradient.types.agents.evaluation_metrics import Oauth2GenerateURLResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestOauth2: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_generate_url(self, client: Gradient) -> None: + oauth2 = client.agents.evaluation_metrics.oauth2.generate_url() + assert_matches_type(Oauth2GenerateURLResponse, oauth2, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_generate_url_with_all_params(self, client: Gradient) -> None: + oauth2 = client.agents.evaluation_metrics.oauth2.generate_url( + redirect_url="redirect_url", + type="type", + ) + assert_matches_type(Oauth2GenerateURLResponse, oauth2, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_generate_url(self, client: Gradient) -> None: + response = client.agents.evaluation_metrics.oauth2.with_raw_response.generate_url() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + oauth2 = response.parse() + assert_matches_type(Oauth2GenerateURLResponse, oauth2, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_generate_url(self, client: Gradient) -> None: + with client.agents.evaluation_metrics.oauth2.with_streaming_response.generate_url() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + oauth2 = response.parse() + assert_matches_type(Oauth2GenerateURLResponse, oauth2, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncOauth2: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_generate_url(self, async_client: AsyncGradient) -> None: + oauth2 = await async_client.agents.evaluation_metrics.oauth2.generate_url() + assert_matches_type(Oauth2GenerateURLResponse, oauth2, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_generate_url_with_all_params(self, async_client: AsyncGradient) -> None: + oauth2 = await async_client.agents.evaluation_metrics.oauth2.generate_url( + redirect_url="redirect_url", + type="type", + ) + assert_matches_type(Oauth2GenerateURLResponse, oauth2, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_generate_url(self, async_client: AsyncGradient) -> None: + response = await async_client.agents.evaluation_metrics.oauth2.with_raw_response.generate_url() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + oauth2 = await response.parse() + assert_matches_type(Oauth2GenerateURLResponse, oauth2, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_generate_url(self, async_client: AsyncGradient) -> None: + async with async_client.agents.evaluation_metrics.oauth2.with_streaming_response.generate_url() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + oauth2 = await response.parse() + assert_matches_type(Oauth2GenerateURLResponse, oauth2, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index dd4dbdc4..6d040d18 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -16,6 +16,7 @@ AgentUpdateResponse, AgentRetrieveResponse, AgentUpdateStatusResponse, + AgentRetrieveUsageResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -258,6 +259,58 @@ def test_path_params_delete(self, client: Gradient) -> None: "", ) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve_usage(self, client: Gradient) -> None: + agent = client.agents.retrieve_usage( + uuid='"123e4567-e89b-12d3-a456-426614174000"', + ) + assert_matches_type(AgentRetrieveUsageResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve_usage_with_all_params(self, client: Gradient) -> None: + agent = client.agents.retrieve_usage( + uuid='"123e4567-e89b-12d3-a456-426614174000"', + start="start", + stop="stop", + ) + assert_matches_type(AgentRetrieveUsageResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_retrieve_usage(self, client: Gradient) -> None: + response = client.agents.with_raw_response.retrieve_usage( + uuid='"123e4567-e89b-12d3-a456-426614174000"', + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(AgentRetrieveUsageResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_retrieve_usage(self, client: Gradient) -> None: + with client.agents.with_streaming_response.retrieve_usage( + uuid='"123e4567-e89b-12d3-a456-426614174000"', + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(AgentRetrieveUsageResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_path_params_retrieve_usage(self, client: Gradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + client.agents.with_raw_response.retrieve_usage( + uuid="", + ) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_status(self, client: Gradient) -> None: @@ -550,6 +603,58 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: "", ) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve_usage(self, async_client: AsyncGradient) -> None: + agent = await async_client.agents.retrieve_usage( + uuid='"123e4567-e89b-12d3-a456-426614174000"', + ) + assert_matches_type(AgentRetrieveUsageResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve_usage_with_all_params(self, async_client: AsyncGradient) -> None: + agent = await async_client.agents.retrieve_usage( + uuid='"123e4567-e89b-12d3-a456-426614174000"', + start="start", + stop="stop", + ) + assert_matches_type(AgentRetrieveUsageResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_retrieve_usage(self, async_client: AsyncGradient) -> None: + response = await async_client.agents.with_raw_response.retrieve_usage( + uuid='"123e4567-e89b-12d3-a456-426614174000"', + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(AgentRetrieveUsageResponse, agent, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_retrieve_usage(self, async_client: AsyncGradient) -> None: + async with async_client.agents.with_streaming_response.retrieve_usage( + uuid='"123e4567-e89b-12d3-a456-426614174000"', + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(AgentRetrieveUsageResponse, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_path_params_retrieve_usage(self, async_client: AsyncGradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + await async_client.agents.with_raw_response.retrieve_usage( + uuid="", + ) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_status(self, async_client: AsyncGradient) -> None: From f8cd02bb84937bbf70560766022597cb71e2c8c8 Mon Sep 17 00:00:00 2001 From: Narasimha Badrinath Date: Tue, 16 Sep 2025 15:37:39 +0530 Subject: [PATCH 09/96] feat(api): add user agent parameters to base_client and client classes for tracking usage --- src/gradient/_base_client.py | 17 ++++++++++++++++- src/gradient/_client.py | 10 ++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/gradient/_base_client.py b/src/gradient/_base_client.py index 74f3c57a..cd0a8c95 100644 --- a/src/gradient/_base_client.py +++ b/src/gradient/_base_client.py @@ -376,6 +376,8 @@ def __init__( timeout: float | Timeout | None = DEFAULT_TIMEOUT, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, + user_agent: str | None = None, + user_agent_version: str | None = None, ) -> None: self._version = version self._base_url = self._enforce_trailing_slash(URL(base_url)) @@ -386,6 +388,8 @@ def __init__( self._strict_response_validation = _strict_response_validation self._idempotency_header = None self._platform: Platform | None = None + self._user_agent_name = user_agent + self._user_agent_version = user_agent_version if max_retries is None: # pyright: ignore[reportUnnecessaryComparison] raise TypeError( @@ -671,7 +675,10 @@ def _validate_headers( @property def user_agent(self) -> str: - return f"{self.__class__.__name__}/Python {self._version}" + # Format: "Gradient/package/version" + package = self._user_agent_name or "Python" + version = self._user_agent_version if self._user_agent_name and self._user_agent_version else self._version + return f"Gradient/{package}/{version}" @property def base_url(self) -> URL: @@ -830,6 +837,8 @@ def __init__( custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, _strict_response_validation: bool, + user_agent: str | None = None, + user_agent_version: str | None = None, ) -> None: if not is_given(timeout): # if the user passed in a custom http client with a non-default @@ -858,6 +867,8 @@ def __init__( custom_query=custom_query, custom_headers=custom_headers, _strict_response_validation=_strict_response_validation, + user_agent=user_agent, + user_agent_version=user_agent_version, ) self._client = http_client or SyncHttpxClientWrapper( base_url=base_url, @@ -1360,6 +1371,8 @@ def __init__( http_client: httpx.AsyncClient | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, + user_agent: str | None = None, + user_agent_version: str | None = None, ) -> None: if not is_given(timeout): # if the user passed in a custom http client with a non-default @@ -1388,6 +1401,8 @@ def __init__( custom_query=custom_query, custom_headers=custom_headers, _strict_response_validation=_strict_response_validation, + user_agent=user_agent, + user_agent_version=user_agent_version, ) self._client = http_client or AsyncHttpxClientWrapper( base_url=base_url, diff --git a/src/gradient/_client.py b/src/gradient/_client.py index 74b57d84..13751b09 100644 --- a/src/gradient/_client.py +++ b/src/gradient/_client.py @@ -106,6 +106,9 @@ def __init__( # outlining your use-case to help us decide if it should be # part of our public interface in the future. _strict_response_validation: bool = False, + # User agent tracking parameters + user_agent: str | None = None, + user_agent_version: str | None = None, ) -> None: """Construct a new synchronous Gradient client instance. @@ -169,6 +172,8 @@ def __init__( custom_headers=default_headers, custom_query=default_query, _strict_response_validation=_strict_response_validation, + user_agent=user_agent, + user_agent_version=user_agent_version, ) self._default_stream_cls = Stream @@ -410,6 +415,9 @@ def __init__( # outlining your use-case to help us decide if it should be # part of our public interface in the future. _strict_response_validation: bool = False, + # User agent tracking parameters + user_agent: str | None = None, + user_agent_version: str | None = None, ) -> None: """Construct a new async AsyncGradient client instance. @@ -473,6 +481,8 @@ def __init__( custom_headers=default_headers, custom_query=default_query, _strict_response_validation=_strict_response_validation, + user_agent=user_agent, + user_agent_version=user_agent_version, ) self._default_stream_cls = AsyncStream From 7f515bccd69b434c875053b05ff83736051a498c Mon Sep 17 00:00:00 2001 From: Narasimha Badrinath Date: Tue, 16 Sep 2025 16:06:08 +0530 Subject: [PATCH 10/96] feat(api): implement user agent parameters in Gradient and AsyncGradient classes to fix failing tests --- src/gradient/_client.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gradient/_client.py b/src/gradient/_client.py index 13751b09..c3f5b35d 100644 --- a/src/gradient/_client.py +++ b/src/gradient/_client.py @@ -299,6 +299,8 @@ def copy( set_default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, set_default_query: Mapping[str, object] | None = None, + user_agent: str | None = None, + user_agent_version: str | None = None, _extra_kwargs: Mapping[str, Any] = {}, ) -> Self: """ @@ -335,6 +337,8 @@ def copy( max_retries=max_retries if is_given(max_retries) else self.max_retries, default_headers=headers, default_query=params, + user_agent=user_agent or self._user_agent_name, + user_agent_version=user_agent_version or self._user_agent_version, **_extra_kwargs, ) client._base_url_overridden = self._base_url_overridden or base_url is not None @@ -608,6 +612,8 @@ def copy( set_default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, set_default_query: Mapping[str, object] | None = None, + user_agent: str | None = None, + user_agent_version: str | None = None, _extra_kwargs: Mapping[str, Any] = {}, ) -> Self: """ @@ -644,6 +650,8 @@ def copy( max_retries=max_retries if is_given(max_retries) else self.max_retries, default_headers=headers, default_query=params, + user_agent=user_agent or self._user_agent_name, + user_agent_version=user_agent_version or self._user_agent_version, **_extra_kwargs, ) client._base_url_overridden = self._base_url_overridden or base_url is not None From 55255fb5d51bca4204f5e741024f4184da465d78 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Sep 2025 03:17:20 +0000 Subject: [PATCH 11/96] chore(internal): update pydantic dependency --- requirements-dev.lock | 7 +++++-- requirements.lock | 7 +++++-- src/gradient/_models.py | 14 ++++++++++---- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index af44e06b..896c8c3a 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 gradient -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 f9072669..1fce47a6 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 gradient -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/gradient/_models.py b/src/gradient/_models.py index 3a6017ef..6a3cd1d2 100644 --- a/src/gradient/_models.py +++ b/src/gradient/_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 7212f62b6d3a5bbc7c8422a7fd8f336d22792049 Mon Sep 17 00:00:00 2001 From: Ben Batha Date: Wed, 17 Sep 2025 12:35:08 -0400 Subject: [PATCH 12/96] chore: clean up LICENSING after legal review (#49) --- LICENSE | 2 +- README.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 656d8887..5ab1db50 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2025 Gradient + Copyright 2025 DigitalOcean, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index b1e71b60..3e32f833 100644 --- a/README.md +++ b/README.md @@ -541,3 +541,8 @@ Python 3.8 or higher. ## Contributing See [the contributing documentation](./CONTRIBUTING.md). + + +## License + +Licensed under the Apache License 2.0. See [LICENSE](./LICENSE) \ No newline at end of file From 2fdd9db1f575730f6ab5f6a19adda98ca641e2ac Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Sep 2025 16:35:32 +0000 Subject: [PATCH 13/96] release: 3.0.0-beta.6 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 19 +++++++++++++++++++ pyproject.toml | 2 +- src/gradient/_version.py | 2 +- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 9dcd5cc8..3c4dbee7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.0.0-beta.5" + ".": "3.0.0-beta.6" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 85fdc0d1..9d1760d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## 3.0.0-beta.6 (2025-09-17) + +Full Changelog: [v3.0.0-beta.5...v3.0.0-beta.6](https://github.com/digitalocean/gradient-python/compare/v3.0.0-beta.5...v3.0.0-beta.6) + +### Features + +* **api:** enable typescript ([c17086a](https://github.com/digitalocean/gradient-python/commit/c17086aaed18fbb8ba85f050556a193cdc4a233f)) +* improve future compat with pydantic v3 ([300eac0](https://github.com/digitalocean/gradient-python/commit/300eac0417f8f17a65bb871b15de1254f4677558)) +* normalize user agent with other do clients ([85bc8eb](https://github.com/digitalocean/gradient-python/commit/85bc8eb26afdfd7deb28ce2198eb3ef02181b95f)) +* **types:** replace List[str] with SequenceNotStr in params ([5a6aa92](https://github.com/digitalocean/gradient-python/commit/5a6aa9241b5e7c2f4319caa14d62f41c0c824f9e)) + + +### Chores + +* clean up LICENSING after legal review ([#49](https://github.com/digitalocean/gradient-python/issues/49)) ([7212f62](https://github.com/digitalocean/gradient-python/commit/7212f62b6d3a5bbc7c8422a7fd8f336d22792049)) +* **internal:** move mypy configurations to `pyproject.toml` file ([25c0448](https://github.com/digitalocean/gradient-python/commit/25c044818b636e3307af2fefd2add15a6e650e8d)) +* **internal:** update pydantic dependency ([55255fb](https://github.com/digitalocean/gradient-python/commit/55255fb5d51bca4204f5e741024f4184da465d78)) +* **tests:** simplify `get_platform` test ([b839e4b](https://github.com/digitalocean/gradient-python/commit/b839e4b31c1262157544bd69536051a10d6b098d)) + ## 3.0.0-beta.5 (2025-09-08) Full Changelog: [v3.0.0-beta.4...v3.0.0-beta.5](https://github.com/digitalocean/gradient-python/compare/v3.0.0-beta.4...v3.0.0-beta.5) diff --git a/pyproject.toml b/pyproject.toml index 5fc8df7f..d6232c97 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gradient" -version = "3.0.0-beta.5" +version = "3.0.0-beta.6" description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gradient/_version.py b/src/gradient/_version.py index c7adeab4..81080cc3 100644 --- a/src/gradient/_version.py +++ b/src/gradient/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gradient" -__version__ = "3.0.0-beta.5" # x-release-please-version +__version__ = "3.0.0-beta.6" # x-release-please-version From 695cc572e7f506617b1a37ed600f4e485dbe26c0 Mon Sep 17 00:00:00 2001 From: Ben Batha Date: Wed, 17 Sep 2025 14:14:48 -0400 Subject: [PATCH 14/96] chore: update author --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d6232c97..31b6bcf2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ version = "3.0.0-beta.6" description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" -authors = [{ name = "Gradient", email = "" }] +authors = [{ name = "DigitalOcean, LLC", email = "dev@digitalocean.com" }] dependencies = [ "httpx>=0.23.0, <1", "pydantic>=1.9.0, <3", From dba36f7bae0b3d28a0013f5d23c482b7be5e238a Mon Sep 17 00:00:00 2001 From: Narasimha Badrinath Date: Thu, 18 Sep 2025 14:55:36 +0530 Subject: [PATCH 15/96] refactor(api): rename user_agent parameter to user_agent_package in BaseClient, SyncAPIClient, and AsyncAPIClient for better clarity --- src/gradient/_base_client.py | 12 ++++++------ src/gradient/_client.py | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gradient/_base_client.py b/src/gradient/_base_client.py index cd0a8c95..3c05d812 100644 --- a/src/gradient/_base_client.py +++ b/src/gradient/_base_client.py @@ -376,7 +376,7 @@ def __init__( timeout: float | Timeout | None = DEFAULT_TIMEOUT, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, - user_agent: str | None = None, + user_agent_package: str | None = None, user_agent_version: str | None = None, ) -> None: self._version = version @@ -388,7 +388,7 @@ def __init__( self._strict_response_validation = _strict_response_validation self._idempotency_header = None self._platform: Platform | None = None - self._user_agent_name = user_agent + self._user_agent_package = user_agent_package self._user_agent_version = user_agent_version if max_retries is None: # pyright: ignore[reportUnnecessaryComparison] @@ -676,8 +676,8 @@ def _validate_headers( @property def user_agent(self) -> str: # Format: "Gradient/package/version" - package = self._user_agent_name or "Python" - version = self._user_agent_version if self._user_agent_name and self._user_agent_version else self._version + package = self._user_agent_package or "Python" + version = self._user_agent_version if self._user_agent_package and self._user_agent_version else self._version return f"Gradient/{package}/{version}" @property @@ -867,7 +867,7 @@ def __init__( custom_query=custom_query, custom_headers=custom_headers, _strict_response_validation=_strict_response_validation, - user_agent=user_agent, + user_agent_package=user_agent_package, user_agent_version=user_agent_version, ) self._client = http_client or SyncHttpxClientWrapper( @@ -1401,7 +1401,7 @@ def __init__( custom_query=custom_query, custom_headers=custom_headers, _strict_response_validation=_strict_response_validation, - user_agent=user_agent, + user_agent_package=user_agent_package, user_agent_version=user_agent_version, ) self._client = http_client or AsyncHttpxClientWrapper( diff --git a/src/gradient/_client.py b/src/gradient/_client.py index c3f5b35d..8df330fb 100644 --- a/src/gradient/_client.py +++ b/src/gradient/_client.py @@ -107,7 +107,7 @@ def __init__( # part of our public interface in the future. _strict_response_validation: bool = False, # User agent tracking parameters - user_agent: str | None = None, + user_agent_package: str | None = None, user_agent_version: str | None = None, ) -> None: """Construct a new synchronous Gradient client instance. @@ -172,7 +172,7 @@ def __init__( custom_headers=default_headers, custom_query=default_query, _strict_response_validation=_strict_response_validation, - user_agent=user_agent, + user_agent_package=user_agent_package, user_agent_version=user_agent_version, ) @@ -420,7 +420,7 @@ def __init__( # part of our public interface in the future. _strict_response_validation: bool = False, # User agent tracking parameters - user_agent: str | None = None, + user_agent_package: str | None = None, user_agent_version: str | None = None, ) -> None: """Construct a new async AsyncGradient client instance. @@ -485,7 +485,7 @@ def __init__( custom_headers=default_headers, custom_query=default_query, _strict_response_validation=_strict_response_validation, - user_agent=user_agent, + user_agent_package=user_agent_package, user_agent_version=user_agent_version, ) From af7420c654bd30af4e30a939e31960ba6414adb7 Mon Sep 17 00:00:00 2001 From: Narasimha Badrinath Date: Thu, 18 Sep 2025 18:28:17 +0530 Subject: [PATCH 16/96] refactor(api): consistently rename user_agent parameter to user_agent_package in Gradient and AsyncGradient classes for clarity --- src/gradient/_base_client.py | 4 ++-- src/gradient/_client.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gradient/_base_client.py b/src/gradient/_base_client.py index 9c64f2bf..15fbd174 100644 --- a/src/gradient/_base_client.py +++ b/src/gradient/_base_client.py @@ -837,7 +837,7 @@ def __init__( custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, _strict_response_validation: bool, - user_agent: str | None = None, + user_agent_package: str | None = None, user_agent_version: str | None = None, ) -> None: if not is_given(timeout): @@ -1371,7 +1371,7 @@ def __init__( http_client: httpx.AsyncClient | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, - user_agent: str | None = None, + user_agent_package: str | None = None, user_agent_version: str | None = None, ) -> None: if not is_given(timeout): diff --git a/src/gradient/_client.py b/src/gradient/_client.py index 8df330fb..a809e56b 100644 --- a/src/gradient/_client.py +++ b/src/gradient/_client.py @@ -299,7 +299,7 @@ def copy( set_default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, set_default_query: Mapping[str, object] | None = None, - user_agent: str | None = None, + user_agent_package: str | None = None, user_agent_version: str | None = None, _extra_kwargs: Mapping[str, Any] = {}, ) -> Self: @@ -337,7 +337,7 @@ def copy( max_retries=max_retries if is_given(max_retries) else self.max_retries, default_headers=headers, default_query=params, - user_agent=user_agent or self._user_agent_name, + user_agent_package=user_agent_package or self._user_agent_package, user_agent_version=user_agent_version or self._user_agent_version, **_extra_kwargs, ) @@ -612,7 +612,7 @@ def copy( set_default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, set_default_query: Mapping[str, object] | None = None, - user_agent: str | None = None, + user_agent_package: str | None = None, user_agent_version: str | None = None, _extra_kwargs: Mapping[str, Any] = {}, ) -> Self: @@ -650,7 +650,7 @@ def copy( max_retries=max_retries if is_given(max_retries) else self.max_retries, default_headers=headers, default_query=params, - user_agent=user_agent or self._user_agent_name, + user_agent_package=user_agent_package or self._user_agent_package, user_agent_version=user_agent_version or self._user_agent_version, **_extra_kwargs, ) From 76aafd77d6cb870d07f60d75078c45d2a2eaa7ef Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 18 Sep 2025 13:54:54 -0400 Subject: [PATCH 17/96] release: 3.0.0 (#39) --- .release-please-manifest.json | 2 +- CHANGELOG.md | 16 ++++++++ README.md | 4 +- pyproject.toml | 2 +- src/do_gradientai/lib/.keep | 4 -- src/gradient/_client.py | 72 ++++++----------------------------- src/gradient/_version.py | 2 +- src/gradientai/lib/.keep | 4 -- 8 files changed, 33 insertions(+), 73 deletions(-) delete mode 100644 src/do_gradientai/lib/.keep delete mode 100644 src/gradientai/lib/.keep diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3c4dbee7..4191c889 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.0.0-beta.6" + ".": "3.0.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d1760d0..86e65d8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 3.0.0 (2025-09-18) + +Full Changelog: [v3.0.0-beta.6...v3.0.0](https://github.com/digitalocean/gradient-python/compare/v3.0.0-beta.6...v3.0.0) + +### Chores + +* remove deprecated env vars ([#50](https://github.com/digitalocean/gradient-python/issues/50)) ([32292f5](https://github.com/digitalocean/gradient-python/commit/32292f5d7cab21cfaa68577a6f838d134842e3fc)) +* remove old folders ([60545d7](https://github.com/digitalocean/gradient-python/commit/60545d7857d8c78c23fba888cc5eae29330eb521)) +* update author ([695cc57](https://github.com/digitalocean/gradient-python/commit/695cc572e7f506617b1a37ed600f4e485dbe26c0)) + + +### Refactors + +* **api:** consistently rename user_agent parameter to user_agent_package in Gradient and AsyncGradient classes for clarity ([af7420c](https://github.com/digitalocean/gradient-python/commit/af7420c654bd30af4e30a939e31960ba6414adb7)) +* **api:** rename user_agent parameter to user_agent_package in BaseClient, SyncAPIClient, and AsyncAPIClient for better clarity ([dba36f7](https://github.com/digitalocean/gradient-python/commit/dba36f7bae0b3d28a0013f5d23c482b7be5e238a)) + ## 3.0.0-beta.6 (2025-09-17) Full Changelog: [v3.0.0-beta.5...v3.0.0-beta.6](https://github.com/digitalocean/gradient-python/compare/v3.0.0-beta.5...v3.0.0-beta.6) diff --git a/README.md b/README.md index 3e32f833..a7b92030 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ The full API of this library can be found in [api.md](api.md). ```sh # install from PyPI -pip install --pre gradient +pip install gradient ``` ## Usage @@ -141,7 +141,7 @@ You can enable this by installing `aiohttp`: ```sh # install from PyPI -pip install --pre gradient[aiohttp] +pip install gradient[aiohttp] ``` Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: diff --git a/pyproject.toml b/pyproject.toml index 31b6bcf2..859b32e9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gradient" -version = "3.0.0-beta.6" +version = "3.0.0" description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/do_gradientai/lib/.keep b/src/do_gradientai/lib/.keep deleted file mode 100644 index 5e2c99fd..00000000 --- a/src/do_gradientai/lib/.keep +++ /dev/null @@ -1,4 +0,0 @@ -File generated from our OpenAPI spec by Stainless. - -This directory can be used to store custom files to expand the SDK. -It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. \ No newline at end of file diff --git a/src/gradient/_client.py b/src/gradient/_client.py index a809e56b..a50c26cf 100644 --- a/src/gradient/_client.py +++ b/src/gradient/_client.py @@ -80,9 +80,6 @@ class Gradient(SyncAPIClient): def __init__( self, *, - api_key: str | None = None, # deprecated, use `access_token` instead - inference_key: str | None = None, # deprecated, use `model_access_key` instead - agent_key: str | None = None, # deprecated, use `agent_access_key` instead access_token: str | None = None, model_access_key: str | None = None, agent_access_key: str | None = None, @@ -120,33 +117,15 @@ def __init__( - `inference_endpoint` from `GRADIENT_INFERENCE_ENDPOINT` """ if access_token is None: - if api_key is not None: - access_token = api_key - else: - access_token = os.environ.get("DIGITALOCEAN_ACCESS_TOKEN") - # support for legacy environment variable - if access_token is None: - access_token = os.environ.get("GRADIENT_API_KEY") + access_token = os.environ.get("DIGITALOCEAN_ACCESS_TOKEN") self.access_token = access_token if model_access_key is None: - if inference_key is not None: - model_access_key = inference_key - else: - model_access_key = os.environ.get("GRADIENT_INFERENCE_KEY") - # support for legacy environment variable - if model_access_key is None: - model_access_key = os.environ.get("GRADIENT_MODEL_ACCESS_KEY") + model_access_key = os.environ.get("GRADIENT_MODEL_ACCESS_KEY") self.model_access_key = model_access_key if agent_access_key is None: - if agent_key is not None: - agent_access_key = agent_key - else: - agent_access_key = os.environ.get("GRADIENT_AGENT_ACCESS_KEY") - # support for legacy environment variable - if agent_access_key is None: - agent_access_key = os.environ.get("GRADIENT_AGENT_KEY") + agent_access_key = os.environ.get("GRADIENT_AGENT_ACCESS_KEY") self.agent_access_key = agent_access_key if agent_endpoint is None: @@ -283,9 +262,6 @@ def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None: def copy( self, *, - api_key: str | None = None, # deprecated, use `access_token` instead - inference_key: str | None = None, # deprecated, use `model_access_key` instead - agent_key: str | None = None, # deprecated, use `agent_access_key` instead access_token: str | None = None, model_access_key: str | None = None, agent_access_key: str | None = None, @@ -326,9 +302,9 @@ def copy( http_client = http_client or self._client client = self.__class__( - access_token=access_token or api_key or self.access_token, - model_access_key=model_access_key or inference_key or self.model_access_key, - agent_access_key=agent_access_key or agent_key or self.agent_access_key, + access_token=access_token or self.access_token, + model_access_key=model_access_key or self.model_access_key, + agent_access_key=agent_access_key or self.agent_access_key, agent_endpoint=agent_endpoint or self._agent_endpoint, inference_endpoint=inference_endpoint or self.inference_endpoint, base_url=base_url or self.base_url, @@ -393,9 +369,6 @@ class AsyncGradient(AsyncAPIClient): def __init__( self, *, - api_key: str | None = None, # deprecated, use `access_token` instead - inference_key: str | None = None, # deprecated, use `model_access_key` instead - agent_key: str | None = None, # deprecated, use `agent_access_key` instead access_token: str | None = None, model_access_key: str | None = None, agent_access_key: str | None = None, @@ -433,33 +406,15 @@ def __init__( - `inference_endpoint` from `GRADIENT_INFERENCE_ENDPOINT` """ if access_token is None: - if api_key is not None: - access_token = api_key - else: - access_token = os.environ.get("DIGITALOCEAN_ACCESS_TOKEN") - # support for legacy environment variable - if access_token is None: - access_token = os.environ.get("GRADIENT_API_KEY") + access_token = os.environ.get("DIGITALOCEAN_ACCESS_TOKEN") self.access_token = access_token if model_access_key is None: - if inference_key is not None: - model_access_key = inference_key - else: - model_access_key = os.environ.get("GRADIENT_INFERENCE_KEY") - # support for legacy environment variable - if model_access_key is None: - model_access_key = os.environ.get("GRADIENT_MODEL_ACCESS_KEY") + model_access_key = os.environ.get("GRADIENT_MODEL_ACCESS_KEY") self.model_access_key = model_access_key if agent_access_key is None: - if agent_key is not None: - agent_access_key = agent_key - else: - agent_access_key = os.environ.get("GRADIENT_AGENT_ACCESS_KEY") - # support for legacy environment variable - if agent_access_key is None: - agent_access_key = os.environ.get("GRADIENT_AGENT_KEY") + agent_access_key = os.environ.get("GRADIENT_AGENT_ACCESS_KEY") self.agent_access_key = agent_access_key if agent_endpoint is None: @@ -596,9 +551,6 @@ def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None: def copy( self, *, - api_key: str | None = None, # deprecated, use `access_token` instead - inference_key: str | None = None, # deprecated, use `model_access_key` instead - agent_key: str | None = None, # deprecated, use `agent_access_key` instead agent_endpoint: str | None = None, access_token: str | None = None, model_access_key: str | None = None, @@ -639,9 +591,9 @@ def copy( http_client = http_client or self._client client = self.__class__( - access_token=access_token or api_key or self.access_token, - model_access_key=model_access_key or inference_key or self.model_access_key, - agent_access_key=agent_access_key or agent_key or self.agent_access_key, + access_token=access_token or self.access_token, + model_access_key=model_access_key or self.model_access_key, + agent_access_key=agent_access_key or self.agent_access_key, agent_endpoint=agent_endpoint or self._agent_endpoint, inference_endpoint=inference_endpoint or self.inference_endpoint, base_url=base_url or self.base_url, diff --git a/src/gradient/_version.py b/src/gradient/_version.py index 81080cc3..17f05c22 100644 --- a/src/gradient/_version.py +++ b/src/gradient/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gradient" -__version__ = "3.0.0-beta.6" # x-release-please-version +__version__ = "3.0.0" # x-release-please-version diff --git a/src/gradientai/lib/.keep b/src/gradientai/lib/.keep deleted file mode 100644 index 5e2c99fd..00000000 --- a/src/gradientai/lib/.keep +++ /dev/null @@ -1,4 +0,0 @@ -File generated from our OpenAPI spec by Stainless. - -This directory can be used to store custom files to expand the SDK. -It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. \ No newline at end of file From eaafa66fb5c89db14cf17a17d29e748de475cae7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Sep 2025 21:24:24 -0400 Subject: [PATCH 18/96] release: 3.0.1 (#43) * fix: add proto to default inference url (#52) * release: 3.0.1 --------- Co-authored-by: Ben Batha Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++ pyproject.toml | 2 +- src/gradient/_client.py | 70 ++++++++++++++++++++++++++--------- src/gradient/_version.py | 2 +- 5 files changed, 64 insertions(+), 20 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4191c889..56441f9d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.0.0" + ".": "3.0.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 86e65d8d..d9e90412 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 3.0.1 (2025-09-24) + +Full Changelog: [v3.0.0...v3.0.1](https://github.com/digitalocean/gradient-python/compare/v3.0.0...v3.0.1) + +### Bug Fixes + +* add proto to default inference url ([#52](https://github.com/digitalocean/gradient-python/issues/52)) ([108d7cb](https://github.com/digitalocean/gradient-python/commit/108d7cb79f4d9046136cbc03cf92056575d04f7a)) + ## 3.0.0 (2025-09-18) Full Changelog: [v3.0.0-beta.6...v3.0.0](https://github.com/digitalocean/gradient-python/compare/v3.0.0-beta.6...v3.0.0) diff --git a/pyproject.toml b/pyproject.toml index 859b32e9..623bc315 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gradient" -version = "3.0.0" +version = "3.0.1" description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gradient/_client.py b/src/gradient/_client.py index a50c26cf..10ac8c99 100644 --- a/src/gradient/_client.py +++ b/src/gradient/_client.py @@ -133,7 +133,10 @@ def __init__( self._agent_endpoint = agent_endpoint if inference_endpoint is None: - inference_endpoint = os.environ.get("GRADIENT_INFERENCE_ENDPOINT") or "inference.do-ai.run" + inference_endpoint = ( + os.environ.get("GRADIENT_INFERENCE_ENDPOINT") + or "https://inference.do-ai.run" + ) self.inference_endpoint = inference_endpoint if base_url is None: @@ -250,7 +253,9 @@ def default_headers(self) -> dict[str, str | Omit]: @override def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None: - if (self.access_token or self.agent_access_key or self.model_access_key) and headers.get("Authorization"): + if ( + self.access_token or self.agent_access_key or self.model_access_key + ) and headers.get("Authorization"): return if isinstance(custom_headers.get("Authorization"), Omit): return @@ -283,10 +288,14 @@ def copy( Create a new client instance re-using the same options given to the current client with optional overriding. """ if default_headers is not None and set_default_headers is not None: - raise ValueError("The `default_headers` and `set_default_headers` arguments are mutually exclusive") + raise ValueError( + "The `default_headers` and `set_default_headers` arguments are mutually exclusive" + ) if default_query is not None and set_default_query is not None: - raise ValueError("The `default_query` and `set_default_query` arguments are mutually exclusive") + raise ValueError( + "The `default_query` and `set_default_query` arguments are mutually exclusive" + ) headers = self._custom_headers if default_headers is not None: @@ -336,10 +345,14 @@ def _make_status_error( return _exceptions.BadRequestError(err_msg, response=response, body=body) if response.status_code == 401: - return _exceptions.AuthenticationError(err_msg, response=response, body=body) + return _exceptions.AuthenticationError( + err_msg, response=response, body=body + ) if response.status_code == 403: - return _exceptions.PermissionDeniedError(err_msg, response=response, body=body) + return _exceptions.PermissionDeniedError( + err_msg, response=response, body=body + ) if response.status_code == 404: return _exceptions.NotFoundError(err_msg, response=response, body=body) @@ -348,13 +361,17 @@ def _make_status_error( return _exceptions.ConflictError(err_msg, response=response, body=body) if response.status_code == 422: - return _exceptions.UnprocessableEntityError(err_msg, response=response, body=body) + return _exceptions.UnprocessableEntityError( + err_msg, response=response, body=body + ) if response.status_code == 429: return _exceptions.RateLimitError(err_msg, response=response, body=body) if response.status_code >= 500: - return _exceptions.InternalServerError(err_msg, response=response, body=body) + return _exceptions.InternalServerError( + err_msg, response=response, body=body + ) return APIStatusError(err_msg, response=response, body=body) @@ -422,7 +439,10 @@ def __init__( self._agent_endpoint = agent_endpoint if inference_endpoint is None: - inference_endpoint = os.environ.get("GRADIENT_INFERENCE_ENDPOINT") or "inference.do-ai.run" + inference_endpoint = ( + os.environ.get("GRADIENT_INFERENCE_ENDPOINT") + or "https://inference.do-ai.run" + ) self.inference_endpoint = inference_endpoint if base_url is None: @@ -539,7 +559,9 @@ def default_headers(self) -> dict[str, str | Omit]: @override def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None: - if (self.access_token or self.agent_access_key or self.model_access_key) and headers.get("Authorization"): + if ( + self.access_token or self.agent_access_key or self.model_access_key + ) and headers.get("Authorization"): return if isinstance(custom_headers.get("Authorization"), Omit): return @@ -572,10 +594,14 @@ def copy( Create a new client instance re-using the same options given to the current client with optional overriding. """ if default_headers is not None and set_default_headers is not None: - raise ValueError("The `default_headers` and `set_default_headers` arguments are mutually exclusive") + raise ValueError( + "The `default_headers` and `set_default_headers` arguments are mutually exclusive" + ) if default_query is not None and set_default_query is not None: - raise ValueError("The `default_query` and `set_default_query` arguments are mutually exclusive") + raise ValueError( + "The `default_query` and `set_default_query` arguments are mutually exclusive" + ) headers = self._custom_headers if default_headers is not None: @@ -625,10 +651,14 @@ def _make_status_error( return _exceptions.BadRequestError(err_msg, response=response, body=body) if response.status_code == 401: - return _exceptions.AuthenticationError(err_msg, response=response, body=body) + return _exceptions.AuthenticationError( + err_msg, response=response, body=body + ) if response.status_code == 403: - return _exceptions.PermissionDeniedError(err_msg, response=response, body=body) + return _exceptions.PermissionDeniedError( + err_msg, response=response, body=body + ) if response.status_code == 404: return _exceptions.NotFoundError(err_msg, response=response, body=body) @@ -637,13 +667,17 @@ def _make_status_error( return _exceptions.ConflictError(err_msg, response=response, body=body) if response.status_code == 422: - return _exceptions.UnprocessableEntityError(err_msg, response=response, body=body) + return _exceptions.UnprocessableEntityError( + err_msg, response=response, body=body + ) if response.status_code == 429: return _exceptions.RateLimitError(err_msg, response=response, body=body) if response.status_code >= 500: - return _exceptions.InternalServerError(err_msg, response=response, body=body) + return _exceptions.InternalServerError( + err_msg, response=response, body=body + ) return APIStatusError(err_msg, response=response, body=body) @@ -862,7 +896,9 @@ def knowledge_bases( AsyncKnowledgeBasesResourceWithStreamingResponse, ) - return AsyncKnowledgeBasesResourceWithStreamingResponse(self._client.knowledge_bases) + return AsyncKnowledgeBasesResourceWithStreamingResponse( + self._client.knowledge_bases + ) @cached_property def models(self) -> models.AsyncModelsResourceWithStreamingResponse: diff --git a/src/gradient/_version.py b/src/gradient/_version.py index 17f05c22..12d04477 100644 --- a/src/gradient/_version.py +++ b/src/gradient/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gradient" -__version__ = "3.0.0" # x-release-please-version +__version__ = "3.0.1" # x-release-please-version From 6e5b7d9ccd30cc7b301b0e791a2f33eb2490ab70 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 24 Sep 2025 11:42:19 -0400 Subject: [PATCH 19/96] release: 3.0.2 (#44) --- .env.example | 6 + .github/workflows/ci.yml | 54 +- .release-please-manifest.json | 2 +- CHANGELOG.md | 10 + CONTRIBUTING.md | 35 + README.md | 61 +- pyproject.toml | 2 +- pytest.ini | 5 + scripts/bootstrap | 14 +- scripts/smoke | 47 ++ scripts/test | 23 +- src/gradient/__init__.py | 4 +- src/gradient/_base_client.py | 18 +- src/gradient/_client.py | 86 +-- src/gradient/_qs.py | 14 +- src/gradient/_types.py | 29 +- src/gradient/_utils/_transform.py | 4 +- src/gradient/_utils/_utils.py | 8 +- src/gradient/_version.py | 2 +- src/gradient/resources/agents/agents.py | 166 ++--- src/gradient/resources/agents/api_keys.py | 50 +- .../resources/agents/chat/completions.py | 282 ++++---- .../resources/agents/evaluation_datasets.py | 22 +- .../evaluation_metrics/anthropic/keys.py | 62 +- .../evaluation_metrics/evaluation_metrics.py | 18 +- .../agents/evaluation_metrics/models.py | 22 +- .../evaluation_metrics/oauth2/dropbox.py | 14 +- .../evaluation_metrics/oauth2/oauth2.py | 14 +- .../agents/evaluation_metrics/openai/keys.py | 62 +- .../evaluation_metrics/workspaces/agents.py | 30 +- .../workspaces/workspaces.py | 50 +- .../resources/agents/evaluation_runs.py | 38 +- .../resources/agents/evaluation_test_cases.py | 78 +-- src/gradient/resources/agents/functions.py | 74 +-- .../resources/agents/knowledge_bases.py | 14 +- src/gradient/resources/agents/routes.py | 54 +- src/gradient/resources/agents/versions.py | 26 +- src/gradient/resources/chat/completions.py | 282 ++++---- .../databases/schema_registry/config.py | 18 +- .../resources/gpu_droplets/account/keys.py | 34 +- .../resources/gpu_droplets/actions.py | 150 ++--- .../resources/gpu_droplets/autoscale.py | 62 +- .../resources/gpu_droplets/backups.py | 34 +- .../destroy_with_associated_resources.py | 42 +- .../gpu_droplets/firewalls/droplets.py | 10 +- .../gpu_droplets/firewalls/firewalls.py | 34 +- .../resources/gpu_droplets/firewalls/rules.py | 26 +- .../resources/gpu_droplets/firewalls/tags.py | 10 +- .../gpu_droplets/floating_ips/actions.py | 26 +- .../gpu_droplets/floating_ips/floating_ips.py | 50 +- .../resources/gpu_droplets/gpu_droplets.py | 242 +++---- .../resources/gpu_droplets/images/actions.py | 26 +- .../resources/gpu_droplets/images/images.py | 78 +-- .../gpu_droplets/load_balancers/droplets.py | 10 +- .../load_balancers/forwarding_rules.py | 10 +- .../load_balancers/load_balancers.py | 610 +++++++++--------- src/gradient/resources/gpu_droplets/sizes.py | 14 +- .../resources/gpu_droplets/snapshots.py | 26 +- .../resources/gpu_droplets/volumes/actions.py | 162 ++--- .../gpu_droplets/volumes/snapshots.py | 30 +- .../resources/gpu_droplets/volumes/volumes.py | 114 ++-- src/gradient/resources/inference/api_keys.py | 42 +- .../resources/knowledge_bases/data_sources.py | 38 +- .../knowledge_bases/indexing_jobs.py | 42 +- .../knowledge_bases/knowledge_bases.py | 86 +-- src/gradient/resources/models/models.py | 22 +- .../resources/models/providers/anthropic.py | 62 +- .../resources/models/providers/openai.py | 62 +- src/gradient/resources/regions.py | 14 +- .../evaluation_metrics/anthropic/test_keys.py | 24 +- .../evaluation_metrics/openai/test_keys.py | 24 +- .../evaluation_metrics/test_workspaces.py | 36 +- .../agents/test_evaluation_runs.py | 12 +- .../agents/test_knowledge_bases.py | 12 +- tests/api_resources/agents/test_routes.py | 12 +- .../databases/schema_registry/test_config.py | 12 +- .../gpu_droplets/floating_ips/test_actions.py | 12 +- .../gpu_droplets/images/test_actions.py | 12 +- .../gpu_droplets/test_autoscale.py | 24 +- .../gpu_droplets/test_backups.py | 12 +- .../test_destroy_with_associated_resources.py | 36 +- .../gpu_droplets/test_firewalls.py | 24 +- .../gpu_droplets/test_floating_ips.py | 24 +- .../api_resources/gpu_droplets/test_images.py | 12 +- .../gpu_droplets/test_load_balancers.py | 36 +- .../gpu_droplets/test_volumes.py | 24 +- .../gpu_droplets/volumes/test_snapshots.py | 24 +- .../api_resources/inference/test_api_keys.py | 24 +- .../knowledge_bases/test_indexing_jobs.py | 24 +- .../models/providers/test_anthropic.py | 24 +- .../models/providers/test_openai.py | 24 +- tests/api_resources/test_agents.py | 24 +- tests/api_resources/test_gpu_droplets.py | 36 +- tests/api_resources/test_knowledge_bases.py | 24 +- tests/test_smoke_sdk.py | 84 +++ tests/test_smoke_sdk_async.py | 85 +++ tests/test_transform.py | 11 +- 97 files changed, 2530 insertions(+), 2170 deletions(-) create mode 100644 .env.example create mode 100644 pytest.ini create mode 100755 scripts/smoke create mode 100644 tests/test_smoke_sdk.py create mode 100644 tests/test_smoke_sdk_async.py diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..8608f2d0 --- /dev/null +++ b/.env.example @@ -0,0 +1,6 @@ +#! /bin/sh + +export DIGITALOCEAN_ACCESS_TOKEN=replace_me +export GRADIENT_MODEL_ACCESS_KEY=replace_me +export GRADIENT_AGENT_ACCESS_KEY=replace_me +export GRADIENT_AGENT_ENDPOINT=https://your-agent-subdomain.agents.do-ai.run \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec9a4813..b3e8ddc4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,15 +2,15 @@ name: CI on: push: branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'stl-preview-head/**' - - 'stl-preview-base/**' + - "generated" + - "codegen/**" + - "integrated/**" + - "stl-preview-head/**" + - "stl-preview-base/**" pull_request: branches-ignore: - - 'stl-preview-head/**' - - 'stl-preview-base/**' + - "stl-preview-head/**" + - "stl-preview-base/**" jobs: lint: @@ -26,8 +26,8 @@ jobs: curl -sSf https://rye.astral.sh/get | bash echo "$HOME/.rye/shims" >> $GITHUB_PATH env: - RYE_VERSION: '0.44.0' - RYE_INSTALL_OPTION: '--yes' + RYE_VERSION: "0.44.0" + RYE_INSTALL_OPTION: "--yes" - name: Install dependencies run: rye sync --all-features @@ -51,8 +51,8 @@ jobs: curl -sSf https://rye.astral.sh/get | bash echo "$HOME/.rye/shims" >> $GITHUB_PATH env: - RYE_VERSION: '0.44.0' - RYE_INSTALL_OPTION: '--yes' + RYE_VERSION: "0.44.0" + RYE_INSTALL_OPTION: "--yes" - name: Install dependencies run: rye sync --all-features @@ -88,11 +88,39 @@ jobs: curl -sSf https://rye.astral.sh/get | bash echo "$HOME/.rye/shims" >> $GITHUB_PATH env: - RYE_VERSION: '0.44.0' - RYE_INSTALL_OPTION: '--yes' + RYE_VERSION: "0.44.0" + RYE_INSTALL_OPTION: "--yes" - name: Bootstrap run: ./scripts/bootstrap - name: Run tests run: ./scripts/test + + smoke: + name: smoke + # Only run smoke tests on pushes to main repo (not forks) so that secrets can be accessed + if: github.repository == 'stainless-sdks/gradient-python' && github.event_name == 'push' + runs-on: ${{ github.repository == 'stainless-sdks/gradient-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + timeout-minutes: 10 + 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: Bootstrap + run: ./scripts/bootstrap + + - name: Run smoke tests + env: + DIGITALOCEAN_ACCESS_TOKEN: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + GRADIENT_MODEL_ACCESS_KEY: ${{ secrets.GRADIENT_MODEL_ACCESS_KEY }} + GRADIENT_AGENT_ACCESS_KEY: ${{ secrets.GRADIENT_AGENT_ACCESS_KEY }} + GRADIENT_AGENT_ENDPOINT: ${{ secrets.GRADIENT_AGENT_ENDPOINT }} + run: ./scripts/smoke diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 56441f9d..a1304a17 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.0.1" + ".": "3.0.2" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d9e90412..099062d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 3.0.2 (2025-09-24) + +Full Changelog: [v3.0.1...v3.0.2](https://github.com/digitalocean/gradient-python/compare/v3.0.1...v3.0.2) + +### Chores + +* do not install brew dependencies in ./scripts/bootstrap by default ([d83b77a](https://github.com/digitalocean/gradient-python/commit/d83b77a943d7beb3373eebc543cdc787371753a5)) +* improve example values ([8f3a107](https://github.com/digitalocean/gradient-python/commit/8f3a107935a7ef0aa7e0e93161a24c7ecf24a272)) +* **types:** change optional parameter type from NotGiven to Omit ([78eb019](https://github.com/digitalocean/gradient-python/commit/78eb019c87cc55186abffd92f1d710d0c6ef0895)) + ## 3.0.1 (2025-09-24) Full Changelog: [v3.0.0...v3.0.1](https://github.com/digitalocean/gradient-python/compare/v3.0.0...v3.0.1) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 212c4e40..140a090b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -96,6 +96,41 @@ $ npx prism mock path/to/your/openapi.yml $ ./scripts/test ``` +## Smoke tests & environment variables + +The repository includes a small set of live "smoke" tests (see the `smoke` pytest marker) that exercise real Gradient API endpoints. These are excluded from the default test run and only executed when you explicitly target them (`pytest -m smoke`) or in CI via the dedicated `smoke` job. + +Required environment variables for smoke tests (all must be set): + +| Variable | Purpose | +|----------|---------| +| `DIGITALOCEAN_ACCESS_TOKEN` | Access token for core DigitalOcean Gradient API operations (e.g. listing agents). | +| `GRADIENT_MODEL_ACCESS_KEY` | Key used for serverless inference (chat completions, etc.). | +| `GRADIENT_AGENT_ACCESS_KEY` | Key used for agent-scoped inference requests. | +| `GRADIENT_AGENT_ENDPOINT` | Fully-qualified HTTPS endpoint for your deployed agent (e.g. `https://my-agent.agents.do-ai.run`). | + +Optional override: + +| Variable | Purpose | +|----------|---------| +| `GRADIENT_INFERENCE_ENDPOINT` | Override default inference endpoint (`https://inference.do-ai.run`). | + +Create a local `.env` file (never commit real secrets). A template is provided at `.env.example`. + +Key design notes: +* Sync & async suites each have a single central test that asserts environment presence and client auto-loaded properties. +* Other smoke tests intentionally avoid repeating environment / property assertions to keep noise low. +* Add new credentials by updating the `REQUIRED_ENV_VARS` tuple in both smoke test files and documenting them here and in the README. + +Run smoke tests locally: + +```bash +./scripts/smoke # convenience wrapper +pytest -m smoke -q # direct invocation +``` + +Do NOT run smoke tests against production credentials unless you understand the API calls performed—they make real network requests. + ## Linting and formatting This repository uses [ruff](https://github.com/astral-sh/ruff) and diff --git a/README.md b/README.md index a7b92030..873e2693 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ print(agent_response.choices[0].message.content) While you can provide an `access_token`, `model_access_key` keyword argument, we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/) -to add `DIGITALOCEAN_ACCESS_TOKEN="My API Key"`, `GRADIENT_MODEL_ACCESS_KEY="My INFERENCE Key"` to your `.env` file +to add `DIGITALOCEAN_ACCESS_TOKEN="My Access Token"`, `GRADIENT_MODEL_ACCESS_KEY="My Model Access Key"` to your `.env` file so that your keys are not stored in source control. ## Async usage @@ -542,7 +542,64 @@ Python 3.8 or higher. See [the contributing documentation](./CONTRIBUTING.md). +## Smoke tests + +The repository includes a small set of "smoke" tests that exercise live Gradient API / Inference / Agent endpoints to catch integration regressions early. These tests are intentionally excluded from the standard test run (they are marked with the `smoke` pytest marker) and only run in CI via the dedicated `smoke` job, or when you explicitly target them locally. + +### Required environment variables + +All of the following environment variables must be set for the smoke tests (both sync & async) to run. If any are missing the smoke tests will fail fast: + +| Variable | Purpose | +|----------|---------| +| `DIGITALOCEAN_ACCESS_TOKEN` | Access token for core DigitalOcean Gradient API operations (e.g. listing agents). | +| `GRADIENT_MODEL_ACCESS_KEY` | Key used for serverless inference (chat completions, etc.). | +| `GRADIENT_AGENT_ACCESS_KEY` | Key used for agent-scoped inference requests. | +| `GRADIENT_AGENT_ENDPOINT` | Fully-qualified HTTPS endpoint for your deployed agent (e.g. `https://my-agent.agents.do-ai.run`). | + +> Optional override: `GRADIENT_INFERENCE_ENDPOINT` can be provided to point inference to a non-default endpoint (defaults to `https://inference.do-ai.run`). + +### Running smoke tests locally + +1. Export the required environment variables (or place them in a `.env` file and use a tool like `direnv` or `python-dotenv`). +2. Run only the smoke tests: + +```bash +rye run pytest -m smoke -q +``` + +To include them alongside the regular suite: + +```bash +./scripts/test -m smoke +``` + +Convenience wrapper (auto-loads a local `.env` if present): + +```bash +./scripts/smoke +``` + +See `.env.example` for a template of required variables you can copy into a `.env` file (do not commit secrets). + +### Async variants + +Each smoke test has an async counterpart in `tests/test_smoke_sdk_async.py`. Both sets are covered automatically by the `-m smoke` selection. + +### CI behavior + +The default `test` job excludes smoke tests (`-m 'not smoke'`). A separate `smoke` job runs on pushes to the main repository with the required secrets injected. This keeps contributors from inadvertently hitting live services while still providing integration coverage in controlled environments. + +### Adding new smoke tests + +1. Add a new test function to `tests/test_smoke_sdk.py` and/or `tests/test_smoke_sdk_async.py`. +2. Mark it with `@pytest.mark.smoke`. +3. Avoid duplicating environment or client property assertions—those live in the central environment/client state test (sync & async). +4. Keep assertions minimal—verify only surface contract / structure; deeper behavior belongs in unit tests with mocks. + +If a new credential is required, update this README section, the `REQUIRED_ENV_VARS` list in both smoke test files, and the CI workflow's `smoke` job environment. + ## License -Licensed under the Apache License 2.0. See [LICENSE](./LICENSE) \ No newline at end of file +Licensed under the Apache License 2.0. See [LICENSE](./LICENSE) diff --git a/pyproject.toml b/pyproject.toml index 623bc315..62741433 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gradient" -version = "3.0.1" +version = "3.0.2" description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 00000000..55e560ae --- /dev/null +++ b/pytest.ini @@ -0,0 +1,5 @@ +[pytest] +markers = + smoke: lightweight external integration smoke tests hitting live Gradient services +addopts = -m "not smoke" +asyncio_mode = auto 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/scripts/smoke b/scripts/smoke new file mode 100755 index 00000000..02df51b9 --- /dev/null +++ b/scripts/smoke @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + +# Purpose: Run live smoke tests (sync + async) against real Gradient services. +# These tests require valid credentials and are excluded from the normal test run. +# Usage: +# ./scripts/smoke # run all smoke tests +# ./scripts/smoke -k agents # pass through extra pytest args +# +# If a .env file exists in the repo root it will be sourced automatically. + +set -euo pipefail + +cd "$(dirname "$0")/.." + +if [ -f .env ]; then + echo "==> Loading .env" + # export variables declared in .env + set -a + # shellcheck disable=SC1091 + source .env + set +a +fi + +required=( + DIGITALOCEAN_ACCESS_TOKEN + GRADIENT_MODEL_ACCESS_KEY + GRADIENT_AGENT_ACCESS_KEY + GRADIENT_AGENT_ENDPOINT +) + +missing=() +for var in "${required[@]}"; do + if [ -z "${!var:-}" ]; then + missing+=("$var") + fi +done + +if [ ${#missing[@]} -ne 0 ]; then + echo "ERROR: Missing required environment variables for smoke tests:" >&2 + printf ' %s\n' "${missing[@]}" >&2 + echo >&2 + echo "Provide them via your shell environment or a .env file (see .env.example)." >&2 + exit 1 +fi + +echo "==> Running smoke tests (marker: smoke)" +rye run pytest -m smoke "$@" diff --git a/scripts/test b/scripts/test index dbeda2d2..4aa8fd64 100755 --- a/scripts/test +++ b/scripts/test @@ -54,8 +54,23 @@ fi export DEFER_PYDANTIC_BUILD=false -echo "==> Running tests" -rye run pytest "$@" +# Clear out any existing API keys to ensure tests run in a clean environment +unset DIGITALOCEAN_ACCESS_TOKEN +unset GRADIENT_MODEL_ACCESS_KEY +unset GRADIENT_AGENT_ACCESS_KEY +unset GRADIENT_AGENT_ENDPOINT -echo "==> Running Pydantic v1 tests" -rye run nox -s test-pydantic-v1 -- "$@" +echo "==> Running tests (excluding smoke tests by default)" +if [ $# -eq 0 ]; then + # No explicit args provided; exclude smoke tests by default + rye run pytest -m 'not smoke' +else + rye run pytest "$@" +fi + +echo "==> Running Pydantic v1 tests (excluding smoke tests by default)" +if [ $# -eq 0 ]; then + rye run nox -s test-pydantic-v1 -- -m 'not smoke' +else + rye run nox -s test-pydantic-v1 -- "$@" +fi diff --git a/src/gradient/__init__.py b/src/gradient/__init__.py index c78eff30..a67cd2a7 100644 --- a/src/gradient/__init__.py +++ b/src/gradient/__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 ( Client, @@ -48,7 +48,9 @@ "ProxiesTypes", "NotGiven", "NOT_GIVEN", + "not_given", "Omit", + "omit", "GradientError", "APIError", "APIStatusError", diff --git a/src/gradient/_base_client.py b/src/gradient/_base_client.py index 15fbd174..89146b71 100644 --- a/src/gradient/_base_client.py +++ b/src/gradient/_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 @@ -599,7 +599,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) @@ -832,7 +832,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, @@ -1367,7 +1367,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, @@ -1833,8 +1833,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/gradient/_client.py b/src/gradient/_client.py index 10ac8c99..338d343e 100644 --- a/src/gradient/_client.py +++ b/src/gradient/_client.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import TYPE_CHECKING, Any, Union, Mapping +from typing import TYPE_CHECKING, Any, Mapping from typing_extensions import Self, override import httpx @@ -11,7 +11,6 @@ from . import _exceptions from ._qs import Querystring from ._types import ( - NOT_GIVEN, Omit, Headers, Timeout, @@ -19,6 +18,7 @@ Transport, ProxiesTypes, RequestOptions, + not_given, ) from ._utils import is_given, get_async_library from ._compat import cached_property @@ -86,7 +86,7 @@ def __init__( agent_endpoint: str | None = None, inference_endpoint: 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, @@ -133,10 +133,7 @@ def __init__( self._agent_endpoint = agent_endpoint if inference_endpoint is None: - inference_endpoint = ( - os.environ.get("GRADIENT_INFERENCE_ENDPOINT") - or "https://inference.do-ai.run" - ) + inference_endpoint = os.environ.get("GRADIENT_INFERENCE_ENDPOINT") or "https://inference.do-ai.run" self.inference_endpoint = inference_endpoint if base_url is None: @@ -253,9 +250,7 @@ def default_headers(self) -> dict[str, str | Omit]: @override def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None: - if ( - self.access_token or self.agent_access_key or self.model_access_key - ) and headers.get("Authorization"): + if (self.access_token or self.agent_access_key or self.model_access_key) and headers.get("Authorization"): return if isinstance(custom_headers.get("Authorization"), Omit): return @@ -273,9 +268,9 @@ def copy( agent_endpoint: str | None = None, inference_endpoint: 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, @@ -288,14 +283,10 @@ def copy( Create a new client instance re-using the same options given to the current client with optional overriding. """ if default_headers is not None and set_default_headers is not None: - raise ValueError( - "The `default_headers` and `set_default_headers` arguments are mutually exclusive" - ) + raise ValueError("The `default_headers` and `set_default_headers` arguments are mutually exclusive") if default_query is not None and set_default_query is not None: - raise ValueError( - "The `default_query` and `set_default_query` arguments are mutually exclusive" - ) + raise ValueError("The `default_query` and `set_default_query` arguments are mutually exclusive") headers = self._custom_headers if default_headers is not None: @@ -345,14 +336,10 @@ def _make_status_error( return _exceptions.BadRequestError(err_msg, response=response, body=body) if response.status_code == 401: - return _exceptions.AuthenticationError( - err_msg, response=response, body=body - ) + return _exceptions.AuthenticationError(err_msg, response=response, body=body) if response.status_code == 403: - return _exceptions.PermissionDeniedError( - err_msg, response=response, body=body - ) + return _exceptions.PermissionDeniedError(err_msg, response=response, body=body) if response.status_code == 404: return _exceptions.NotFoundError(err_msg, response=response, body=body) @@ -361,17 +348,13 @@ def _make_status_error( return _exceptions.ConflictError(err_msg, response=response, body=body) if response.status_code == 422: - return _exceptions.UnprocessableEntityError( - err_msg, response=response, body=body - ) + return _exceptions.UnprocessableEntityError(err_msg, response=response, body=body) if response.status_code == 429: return _exceptions.RateLimitError(err_msg, response=response, body=body) if response.status_code >= 500: - return _exceptions.InternalServerError( - err_msg, response=response, body=body - ) + return _exceptions.InternalServerError(err_msg, response=response, body=body) return APIStatusError(err_msg, response=response, body=body) @@ -392,7 +375,7 @@ def __init__( agent_endpoint: str | None = None, inference_endpoint: 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, @@ -439,10 +422,7 @@ def __init__( self._agent_endpoint = agent_endpoint if inference_endpoint is None: - inference_endpoint = ( - os.environ.get("GRADIENT_INFERENCE_ENDPOINT") - or "https://inference.do-ai.run" - ) + inference_endpoint = os.environ.get("GRADIENT_INFERENCE_ENDPOINT") or "https://inference.do-ai.run" self.inference_endpoint = inference_endpoint if base_url is None: @@ -559,9 +539,7 @@ def default_headers(self) -> dict[str, str | Omit]: @override def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None: - if ( - self.access_token or self.agent_access_key or self.model_access_key - ) and headers.get("Authorization"): + if (self.access_token or self.agent_access_key or self.model_access_key) and headers.get("Authorization"): return if isinstance(custom_headers.get("Authorization"), Omit): return @@ -579,9 +557,9 @@ def copy( agent_access_key: str | None = None, inference_endpoint: 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, @@ -594,14 +572,10 @@ def copy( Create a new client instance re-using the same options given to the current client with optional overriding. """ if default_headers is not None and set_default_headers is not None: - raise ValueError( - "The `default_headers` and `set_default_headers` arguments are mutually exclusive" - ) + raise ValueError("The `default_headers` and `set_default_headers` arguments are mutually exclusive") if default_query is not None and set_default_query is not None: - raise ValueError( - "The `default_query` and `set_default_query` arguments are mutually exclusive" - ) + raise ValueError("The `default_query` and `set_default_query` arguments are mutually exclusive") headers = self._custom_headers if default_headers is not None: @@ -651,14 +625,10 @@ def _make_status_error( return _exceptions.BadRequestError(err_msg, response=response, body=body) if response.status_code == 401: - return _exceptions.AuthenticationError( - err_msg, response=response, body=body - ) + return _exceptions.AuthenticationError(err_msg, response=response, body=body) if response.status_code == 403: - return _exceptions.PermissionDeniedError( - err_msg, response=response, body=body - ) + return _exceptions.PermissionDeniedError(err_msg, response=response, body=body) if response.status_code == 404: return _exceptions.NotFoundError(err_msg, response=response, body=body) @@ -667,17 +637,13 @@ def _make_status_error( return _exceptions.ConflictError(err_msg, response=response, body=body) if response.status_code == 422: - return _exceptions.UnprocessableEntityError( - err_msg, response=response, body=body - ) + return _exceptions.UnprocessableEntityError(err_msg, response=response, body=body) if response.status_code == 429: return _exceptions.RateLimitError(err_msg, response=response, body=body) if response.status_code >= 500: - return _exceptions.InternalServerError( - err_msg, response=response, body=body - ) + return _exceptions.InternalServerError(err_msg, response=response, body=body) return APIStatusError(err_msg, response=response, body=body) @@ -896,9 +862,7 @@ def knowledge_bases( AsyncKnowledgeBasesResourceWithStreamingResponse, ) - return AsyncKnowledgeBasesResourceWithStreamingResponse( - self._client.knowledge_bases - ) + return AsyncKnowledgeBasesResourceWithStreamingResponse(self._client.knowledge_bases) @cached_property def models(self) -> models.AsyncModelsResourceWithStreamingResponse: diff --git a/src/gradient/_qs.py b/src/gradient/_qs.py index 274320ca..ada6fd3f 100644 --- a/src/gradient/_qs.py +++ b/src/gradient/_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/gradient/_types.py b/src/gradient/_types.py index 32375713..11a40997 100644 --- a/src/gradient/_types.py +++ b/src/gradient/_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/gradient/_utils/_transform.py b/src/gradient/_utils/_transform.py index c19124f0..52075492 100644 --- a/src/gradient/_utils/_transform.py +++ b/src/gradient/_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/gradient/_utils/_utils.py b/src/gradient/_utils/_utils.py index f0818595..50d59269 100644 --- a/src/gradient/_utils/_utils.py +++ b/src/gradient/_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/gradient/_version.py b/src/gradient/_version.py index 12d04477..bd32dfe9 100644 --- a/src/gradient/_version.py +++ b/src/gradient/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gradient" -__version__ = "3.0.1" # x-release-please-version +__version__ = "3.0.2" # x-release-please-version diff --git a/src/gradient/resources/agents/agents.py b/src/gradient/resources/agents/agents.py index 590b9a76..a4d32fca 100644 --- a/src/gradient/resources/agents/agents.py +++ b/src/gradient/resources/agents/agents.py @@ -21,7 +21,7 @@ agent_update_status_params, agent_retrieve_usage_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 .api_keys import ( APIKeysResource, @@ -180,22 +180,22 @@ def with_streaming_response(self) -> AgentsResourceWithStreamingResponse: def create( self, *, - anthropic_key_uuid: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - instruction: str | NotGiven = NOT_GIVEN, - knowledge_base_uuid: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - model_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - openai_key_uuid: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - region: str | NotGiven = NOT_GIVEN, - tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + anthropic_key_uuid: str | Omit = omit, + description: str | Omit = omit, + instruction: str | Omit = omit, + knowledge_base_uuid: SequenceNotStr[str] | Omit = omit, + model_uuid: str | Omit = omit, + name: str | Omit = omit, + openai_key_uuid: str | Omit = omit, + project_id: str | Omit = omit, + region: str | Omit = omit, + tags: SequenceNotStr[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, ) -> AgentCreateResponse: """To create a new agent, send a POST request to `/v2/gen-ai/agents`. @@ -268,7 +268,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, ) -> AgentRetrieveResponse: """To retrieve details of an agent, GET request to `/v2/gen-ai/agents/{uuid}`. @@ -300,29 +300,29 @@ def update( self, path_uuid: str, *, - agent_log_insights_enabled: bool | NotGiven = NOT_GIVEN, - anthropic_key_uuid: str | NotGiven = NOT_GIVEN, - conversation_logs_enabled: bool | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - instruction: str | NotGiven = NOT_GIVEN, - k: int | NotGiven = NOT_GIVEN, - max_tokens: int | NotGiven = NOT_GIVEN, - model_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - openai_key_uuid: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - provide_citations: bool | NotGiven = NOT_GIVEN, - retrieval_method: APIRetrievalMethod | NotGiven = NOT_GIVEN, - tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - temperature: float | NotGiven = NOT_GIVEN, - top_p: float | NotGiven = NOT_GIVEN, - body_uuid: str | NotGiven = NOT_GIVEN, + agent_log_insights_enabled: bool | Omit = omit, + anthropic_key_uuid: str | Omit = omit, + conversation_logs_enabled: bool | Omit = omit, + description: str | Omit = omit, + instruction: str | Omit = omit, + k: int | Omit = omit, + max_tokens: int | Omit = omit, + model_uuid: str | Omit = omit, + name: str | Omit = omit, + openai_key_uuid: str | Omit = omit, + project_id: str | Omit = omit, + provide_citations: bool | Omit = omit, + retrieval_method: APIRetrievalMethod | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + temperature: float | Omit = omit, + top_p: float | Omit = omit, + body_uuid: 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, ) -> AgentUpdateResponse: """To update an agent, send a PUT request to `/v2/gen-ai/agents/{uuid}`. @@ -418,15 +418,15 @@ def update( def list( self, *, - only_deployed: bool | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + only_deployed: bool | Omit = omit, + page: int | Omit = omit, + per_page: 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, ) -> AgentListResponse: """ To list all agents, send a GET request to `/v2/gen-ai/agents`. @@ -476,7 +476,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, ) -> AgentDeleteResponse: """ To delete an agent, send a DELETE request to `/v2/gen-ai/agents/{uuid}`. @@ -506,14 +506,14 @@ def retrieve_usage( self, uuid: str, *, - start: str | NotGiven = NOT_GIVEN, - stop: str | NotGiven = NOT_GIVEN, + start: str | Omit = omit, + stop: 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, ) -> AgentRetrieveUsageResponse: """ To get agent usage, send a GET request to `/v2/gen-ai/agents/{uuid}/usage`. @@ -559,14 +559,14 @@ def update_status( self, path_uuid: str, *, - body_uuid: str | NotGiven = NOT_GIVEN, - visibility: APIDeploymentVisibility | NotGiven = NOT_GIVEN, + body_uuid: str | Omit = omit, + visibility: APIDeploymentVisibility | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AgentUpdateStatusResponse: """Check whether an agent is public or private. @@ -676,22 +676,22 @@ def with_streaming_response(self) -> AsyncAgentsResourceWithStreamingResponse: async def create( self, *, - anthropic_key_uuid: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - instruction: str | NotGiven = NOT_GIVEN, - knowledge_base_uuid: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - model_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - openai_key_uuid: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - region: str | NotGiven = NOT_GIVEN, - tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + anthropic_key_uuid: str | Omit = omit, + description: str | Omit = omit, + instruction: str | Omit = omit, + knowledge_base_uuid: SequenceNotStr[str] | Omit = omit, + model_uuid: str | Omit = omit, + name: str | Omit = omit, + openai_key_uuid: str | Omit = omit, + project_id: str | Omit = omit, + region: str | Omit = omit, + tags: SequenceNotStr[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, ) -> AgentCreateResponse: """To create a new agent, send a POST request to `/v2/gen-ai/agents`. @@ -764,7 +764,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, ) -> AgentRetrieveResponse: """To retrieve details of an agent, GET request to `/v2/gen-ai/agents/{uuid}`. @@ -796,29 +796,29 @@ async def update( self, path_uuid: str, *, - agent_log_insights_enabled: bool | NotGiven = NOT_GIVEN, - anthropic_key_uuid: str | NotGiven = NOT_GIVEN, - conversation_logs_enabled: bool | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - instruction: str | NotGiven = NOT_GIVEN, - k: int | NotGiven = NOT_GIVEN, - max_tokens: int | NotGiven = NOT_GIVEN, - model_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - openai_key_uuid: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - provide_citations: bool | NotGiven = NOT_GIVEN, - retrieval_method: APIRetrievalMethod | NotGiven = NOT_GIVEN, - tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - temperature: float | NotGiven = NOT_GIVEN, - top_p: float | NotGiven = NOT_GIVEN, - body_uuid: str | NotGiven = NOT_GIVEN, + agent_log_insights_enabled: bool | Omit = omit, + anthropic_key_uuid: str | Omit = omit, + conversation_logs_enabled: bool | Omit = omit, + description: str | Omit = omit, + instruction: str | Omit = omit, + k: int | Omit = omit, + max_tokens: int | Omit = omit, + model_uuid: str | Omit = omit, + name: str | Omit = omit, + openai_key_uuid: str | Omit = omit, + project_id: str | Omit = omit, + provide_citations: bool | Omit = omit, + retrieval_method: APIRetrievalMethod | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + temperature: float | Omit = omit, + top_p: float | Omit = omit, + body_uuid: 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, ) -> AgentUpdateResponse: """To update an agent, send a PUT request to `/v2/gen-ai/agents/{uuid}`. @@ -914,15 +914,15 @@ async def update( async def list( self, *, - only_deployed: bool | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + only_deployed: bool | Omit = omit, + page: int | Omit = omit, + per_page: 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, ) -> AgentListResponse: """ To list all agents, send a GET request to `/v2/gen-ai/agents`. @@ -972,7 +972,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, ) -> AgentDeleteResponse: """ To delete an agent, send a DELETE request to `/v2/gen-ai/agents/{uuid}`. @@ -1002,14 +1002,14 @@ async def retrieve_usage( self, uuid: str, *, - start: str | NotGiven = NOT_GIVEN, - stop: str | NotGiven = NOT_GIVEN, + start: str | Omit = omit, + stop: 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, ) -> AgentRetrieveUsageResponse: """ To get agent usage, send a GET request to `/v2/gen-ai/agents/{uuid}/usage`. @@ -1055,14 +1055,14 @@ async def update_status( self, path_uuid: str, *, - body_uuid: str | NotGiven = NOT_GIVEN, - visibility: APIDeploymentVisibility | NotGiven = NOT_GIVEN, + body_uuid: str | Omit = omit, + visibility: APIDeploymentVisibility | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AgentUpdateStatusResponse: """Check whether an agent is public or private. diff --git a/src/gradient/resources/agents/api_keys.py b/src/gradient/resources/agents/api_keys.py index 7e9feb51..174ebf60 100644 --- a/src/gradient/resources/agents/api_keys.py +++ b/src/gradient/resources/agents/api_keys.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 @@ -49,14 +49,14 @@ def create( self, path_agent_uuid: str, *, - body_agent_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + body_agent_uuid: str | Omit = omit, + name: 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, ) -> APIKeyCreateResponse: """ To create an agent API key, send a POST request to @@ -99,15 +99,15 @@ def update( path_api_key_uuid: str, *, path_agent_uuid: str, - body_agent_uuid: str | NotGiven = NOT_GIVEN, - body_api_key_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + body_agent_uuid: str | Omit = omit, + body_api_key_uuid: str | Omit = omit, + name: 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, ) -> APIKeyUpdateResponse: """ To update an agent API key, send a PUT request to @@ -154,14 +154,14 @@ def list( self, agent_uuid: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> APIKeyListResponse: """ To list all agent API keys, send a GET request to @@ -212,7 +212,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, ) -> APIKeyDeleteResponse: """ To delete an API key for an agent, send a DELETE request to @@ -251,7 +251,7 @@ def regenerate( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> APIKeyRegenerateResponse: """ To regenerate an agent API key, send a PUT request to @@ -305,14 +305,14 @@ async def create( self, path_agent_uuid: str, *, - body_agent_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + body_agent_uuid: str | Omit = omit, + name: 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, ) -> APIKeyCreateResponse: """ To create an agent API key, send a POST request to @@ -355,15 +355,15 @@ async def update( path_api_key_uuid: str, *, path_agent_uuid: str, - body_agent_uuid: str | NotGiven = NOT_GIVEN, - body_api_key_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + body_agent_uuid: str | Omit = omit, + body_api_key_uuid: str | Omit = omit, + name: 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, ) -> APIKeyUpdateResponse: """ To update an agent API key, send a PUT request to @@ -410,14 +410,14 @@ async def list( self, agent_uuid: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> APIKeyListResponse: """ To list all agent API keys, send a GET request to @@ -468,7 +468,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, ) -> APIKeyDeleteResponse: """ To delete an API key for an agent, send a DELETE request to @@ -507,7 +507,7 @@ async def regenerate( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> APIKeyRegenerateResponse: """ To regenerate an agent API key, send a PUT request to diff --git a/src/gradient/resources/agents/chat/completions.py b/src/gradient/resources/agents/chat/completions.py index fb4523c1..374fdc16 100644 --- a/src/gradient/resources/agents/chat/completions.py +++ b/src/gradient/resources/agents/chat/completions.py @@ -7,7 +7,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 required_args, maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -52,29 +52,29 @@ def create( *, messages: Iterable[completion_create_params.Message], model: str, - frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, - logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN, - logprobs: Optional[bool] | NotGiven = NOT_GIVEN, - max_completion_tokens: Optional[int] | NotGiven = NOT_GIVEN, - max_tokens: Optional[int] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - n: Optional[int] | NotGiven = NOT_GIVEN, - presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - stream: Optional[Literal[False]] | NotGiven = NOT_GIVEN, - stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, - temperature: Optional[float] | NotGiven = NOT_GIVEN, - tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, - tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, - top_logprobs: Optional[int] | NotGiven = NOT_GIVEN, - top_p: Optional[float] | NotGiven = NOT_GIVEN, - user: str | NotGiven = NOT_GIVEN, + frequency_penalty: Optional[float] | Omit = omit, + logit_bias: Optional[Dict[str, int]] | Omit = omit, + logprobs: Optional[bool] | Omit = omit, + max_completion_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + n: Optional[int] | Omit = omit, + presence_penalty: Optional[float] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream: Optional[Literal[False]] | Omit = omit, + stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: completion_create_params.ToolChoice | Omit = omit, + tools: Iterable[completion_create_params.Tool] | Omit = omit, + top_logprobs: Optional[int] | Omit = omit, + top_p: Optional[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, ) -> CompletionCreateResponse: """ Creates a model response for the given chat conversation. @@ -181,28 +181,28 @@ def create( messages: Iterable[completion_create_params.Message], model: str, stream: Literal[True], - frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, - logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN, - logprobs: Optional[bool] | NotGiven = NOT_GIVEN, - max_completion_tokens: Optional[int] | NotGiven = NOT_GIVEN, - max_tokens: Optional[int] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - n: Optional[int] | NotGiven = NOT_GIVEN, - presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - stream_options: Optional[completion_create_params.StreamOptions] | NotGiven = NOT_GIVEN, - temperature: Optional[float] | NotGiven = NOT_GIVEN, - tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, - tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, - top_logprobs: Optional[int] | NotGiven = NOT_GIVEN, - top_p: Optional[float] | NotGiven = NOT_GIVEN, - user: str | NotGiven = NOT_GIVEN, + frequency_penalty: Optional[float] | Omit = omit, + logit_bias: Optional[Dict[str, int]] | Omit = omit, + logprobs: Optional[bool] | Omit = omit, + max_completion_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + n: Optional[int] | Omit = omit, + presence_penalty: Optional[float] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: completion_create_params.ToolChoice | Omit = omit, + tools: Iterable[completion_create_params.Tool] | Omit = omit, + top_logprobs: Optional[int] | Omit = omit, + top_p: Optional[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, ) -> Stream[ChatCompletionChunk]: """ Creates a model response for the given chat conversation. @@ -309,28 +309,28 @@ def create( messages: Iterable[completion_create_params.Message], model: str, stream: bool, - frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, - logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN, - logprobs: Optional[bool] | NotGiven = NOT_GIVEN, - max_completion_tokens: Optional[int] | NotGiven = NOT_GIVEN, - max_tokens: Optional[int] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - n: Optional[int] | NotGiven = NOT_GIVEN, - presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - stream_options: Optional[completion_create_params.StreamOptions] | NotGiven = NOT_GIVEN, - temperature: Optional[float] | NotGiven = NOT_GIVEN, - tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, - tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, - top_logprobs: Optional[int] | NotGiven = NOT_GIVEN, - top_p: Optional[float] | NotGiven = NOT_GIVEN, - user: str | NotGiven = NOT_GIVEN, + frequency_penalty: Optional[float] | Omit = omit, + logit_bias: Optional[Dict[str, int]] | Omit = omit, + logprobs: Optional[bool] | Omit = omit, + max_completion_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + n: Optional[int] | Omit = omit, + presence_penalty: Optional[float] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: completion_create_params.ToolChoice | Omit = omit, + tools: Iterable[completion_create_params.Tool] | Omit = omit, + top_logprobs: Optional[int] | Omit = omit, + top_p: Optional[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, ) -> CompletionCreateResponse | Stream[ChatCompletionChunk]: """ Creates a model response for the given chat conversation. @@ -439,29 +439,29 @@ def create( *, messages: Iterable[completion_create_params.Message], model: str, - frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, - logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN, - logprobs: Optional[bool] | NotGiven = NOT_GIVEN, - max_completion_tokens: Optional[int] | NotGiven = NOT_GIVEN, - max_tokens: Optional[int] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - n: Optional[int] | NotGiven = NOT_GIVEN, - presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - stream: Optional[Literal[False]] | Literal[True] | NotGiven = NOT_GIVEN, - stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, - temperature: Optional[float] | NotGiven = NOT_GIVEN, - tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, - tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, - top_logprobs: Optional[int] | NotGiven = NOT_GIVEN, - top_p: Optional[float] | NotGiven = NOT_GIVEN, - user: str | NotGiven = NOT_GIVEN, + frequency_penalty: Optional[float] | Omit = omit, + logit_bias: Optional[Dict[str, int]] | Omit = omit, + logprobs: Optional[bool] | Omit = omit, + max_completion_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + n: Optional[int] | Omit = omit, + presence_penalty: Optional[float] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream: Optional[Literal[False]] | Literal[True] | Omit = omit, + stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: completion_create_params.ToolChoice | Omit = omit, + tools: Iterable[completion_create_params.Tool] | Omit = omit, + top_logprobs: Optional[int] | Omit = omit, + top_p: Optional[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, ) -> CompletionCreateResponse | Stream[ChatCompletionChunk]: # This method requires an agent_access_key to be set via client argument or environment variable if not self._client.agent_access_key: @@ -541,29 +541,29 @@ async def create( *, messages: Iterable[completion_create_params.Message], model: str, - frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, - logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN, - logprobs: Optional[bool] | NotGiven = NOT_GIVEN, - max_completion_tokens: Optional[int] | NotGiven = NOT_GIVEN, - max_tokens: Optional[int] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - n: Optional[int] | NotGiven = NOT_GIVEN, - presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - stream: Optional[Literal[False]] | NotGiven = NOT_GIVEN, - stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, - temperature: Optional[float] | NotGiven = NOT_GIVEN, - tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, - tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, - top_logprobs: Optional[int] | NotGiven = NOT_GIVEN, - top_p: Optional[float] | NotGiven = NOT_GIVEN, - user: str | NotGiven = NOT_GIVEN, + frequency_penalty: Optional[float] | Omit = omit, + logit_bias: Optional[Dict[str, int]] | Omit = omit, + logprobs: Optional[bool] | Omit = omit, + max_completion_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + n: Optional[int] | Omit = omit, + presence_penalty: Optional[float] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream: Optional[Literal[False]] | Omit = omit, + stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: completion_create_params.ToolChoice | Omit = omit, + tools: Iterable[completion_create_params.Tool] | Omit = omit, + top_logprobs: Optional[int] | Omit = omit, + top_p: Optional[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, ) -> CompletionCreateResponse: """ Creates a model response for the given chat conversation. @@ -670,28 +670,28 @@ async def create( messages: Iterable[completion_create_params.Message], model: str, stream: Literal[True], - frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, - logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN, - logprobs: Optional[bool] | NotGiven = NOT_GIVEN, - max_completion_tokens: Optional[int] | NotGiven = NOT_GIVEN, - max_tokens: Optional[int] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - n: Optional[int] | NotGiven = NOT_GIVEN, - presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - stream_options: Optional[completion_create_params.StreamOptions] | NotGiven = NOT_GIVEN, - temperature: Optional[float] | NotGiven = NOT_GIVEN, - tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, - tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, - top_logprobs: Optional[int] | NotGiven = NOT_GIVEN, - top_p: Optional[float] | NotGiven = NOT_GIVEN, - user: str | NotGiven = NOT_GIVEN, + frequency_penalty: Optional[float] | Omit = omit, + logit_bias: Optional[Dict[str, int]] | Omit = omit, + logprobs: Optional[bool] | Omit = omit, + max_completion_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + n: Optional[int] | Omit = omit, + presence_penalty: Optional[float] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: completion_create_params.ToolChoice | Omit = omit, + tools: Iterable[completion_create_params.Tool] | Omit = omit, + top_logprobs: Optional[int] | Omit = omit, + top_p: Optional[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, ) -> AsyncStream[ChatCompletionChunk]: """ Creates a model response for the given chat conversation. @@ -798,28 +798,28 @@ async def create( messages: Iterable[completion_create_params.Message], model: str, stream: bool, - frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, - logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN, - logprobs: Optional[bool] | NotGiven = NOT_GIVEN, - max_completion_tokens: Optional[int] | NotGiven = NOT_GIVEN, - max_tokens: Optional[int] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - n: Optional[int] | NotGiven = NOT_GIVEN, - presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - stream_options: Optional[completion_create_params.StreamOptions] | NotGiven = NOT_GIVEN, - temperature: Optional[float] | NotGiven = NOT_GIVEN, - tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, - tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, - top_logprobs: Optional[int] | NotGiven = NOT_GIVEN, - top_p: Optional[float] | NotGiven = NOT_GIVEN, - user: str | NotGiven = NOT_GIVEN, + frequency_penalty: Optional[float] | Omit = omit, + logit_bias: Optional[Dict[str, int]] | Omit = omit, + logprobs: Optional[bool] | Omit = omit, + max_completion_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + n: Optional[int] | Omit = omit, + presence_penalty: Optional[float] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: completion_create_params.ToolChoice | Omit = omit, + tools: Iterable[completion_create_params.Tool] | Omit = omit, + top_logprobs: Optional[int] | Omit = omit, + top_p: Optional[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, ) -> CompletionCreateResponse | AsyncStream[ChatCompletionChunk]: """ Creates a model response for the given chat conversation. @@ -925,29 +925,29 @@ async def create( *, messages: Iterable[completion_create_params.Message], model: str, - frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, - logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN, - logprobs: Optional[bool] | NotGiven = NOT_GIVEN, - max_completion_tokens: Optional[int] | NotGiven = NOT_GIVEN, - max_tokens: Optional[int] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - n: Optional[int] | NotGiven = NOT_GIVEN, - presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - stream: Optional[Literal[False]] | Literal[True] | NotGiven = NOT_GIVEN, - stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, - temperature: Optional[float] | NotGiven = NOT_GIVEN, - tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, - tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, - top_logprobs: Optional[int] | NotGiven = NOT_GIVEN, - top_p: Optional[float] | NotGiven = NOT_GIVEN, - user: str | NotGiven = NOT_GIVEN, + frequency_penalty: Optional[float] | Omit = omit, + logit_bias: Optional[Dict[str, int]] | Omit = omit, + logprobs: Optional[bool] | Omit = omit, + max_completion_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + n: Optional[int] | Omit = omit, + presence_penalty: Optional[float] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream: Optional[Literal[False]] | Literal[True] | Omit = omit, + stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: completion_create_params.ToolChoice | Omit = omit, + tools: Iterable[completion_create_params.Tool] | Omit = omit, + top_logprobs: Optional[int] | Omit = omit, + top_p: Optional[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, ) -> CompletionCreateResponse | AsyncStream[ChatCompletionChunk]: # This method requires an agent_access_key to be set via client argument or environment variable if not self._client.agent_access_key: diff --git a/src/gradient/resources/agents/evaluation_datasets.py b/src/gradient/resources/agents/evaluation_datasets.py index d8e960de..0f9631ba 100644 --- a/src/gradient/resources/agents/evaluation_datasets.py +++ b/src/gradient/resources/agents/evaluation_datasets.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 @@ -53,14 +53,14 @@ def with_streaming_response(self) -> EvaluationDatasetsResourceWithStreamingResp def create( self, *, - file_upload_dataset: APIFileUploadDataSourceParam | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + file_upload_dataset: APIFileUploadDataSourceParam | Omit = omit, + name: 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, ) -> EvaluationDatasetCreateResponse: """ To create an evaluation dataset, send a POST request to @@ -99,13 +99,13 @@ def create( def create_file_upload_presigned_urls( self, *, - files: Iterable[evaluation_dataset_create_file_upload_presigned_urls_params.File] | NotGiven = NOT_GIVEN, + files: Iterable[evaluation_dataset_create_file_upload_presigned_urls_params.File] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EvaluationDatasetCreateFileUploadPresignedURLsResponse: """ To create presigned URLs for evaluation dataset file upload, send a POST request @@ -160,14 +160,14 @@ def with_streaming_response(self) -> AsyncEvaluationDatasetsResourceWithStreamin async def create( self, *, - file_upload_dataset: APIFileUploadDataSourceParam | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + file_upload_dataset: APIFileUploadDataSourceParam | Omit = omit, + name: 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, ) -> EvaluationDatasetCreateResponse: """ To create an evaluation dataset, send a POST request to @@ -206,13 +206,13 @@ async def create( async def create_file_upload_presigned_urls( self, *, - files: Iterable[evaluation_dataset_create_file_upload_presigned_urls_params.File] | NotGiven = NOT_GIVEN, + files: Iterable[evaluation_dataset_create_file_upload_presigned_urls_params.File] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EvaluationDatasetCreateFileUploadPresignedURLsResponse: """ To create presigned URLs for evaluation dataset file upload, send a POST request diff --git a/src/gradient/resources/agents/evaluation_metrics/anthropic/keys.py b/src/gradient/resources/agents/evaluation_metrics/anthropic/keys.py index 6111bf6f..e015bf5c 100644 --- a/src/gradient/resources/agents/evaluation_metrics/anthropic/keys.py +++ b/src/gradient/resources/agents/evaluation_metrics/anthropic/keys.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 @@ -54,14 +54,14 @@ def with_streaming_response(self) -> KeysResourceWithStreamingResponse: def create( self, *, - api_key: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + api_key: str | Omit = omit, + name: 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, ) -> KeyCreateResponse: """ To create an Anthropic API key, send a POST request to @@ -106,7 +106,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, ) -> KeyRetrieveResponse: """ To retrieve details of an Anthropic API key, send a GET request to @@ -137,15 +137,15 @@ def update( self, path_api_key_uuid: str, *, - api_key: str | NotGiven = NOT_GIVEN, - body_api_key_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + api_key: str | Omit = omit, + body_api_key_uuid: str | Omit = omit, + name: 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, ) -> KeyUpdateResponse: """ To update an Anthropic API key, send a PUT request to @@ -189,14 +189,14 @@ def update( def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> KeyListResponse: """ To list all Anthropic API keys, send a GET request to @@ -244,7 +244,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, ) -> KeyDeleteResponse: """ To delete an Anthropic API key, send a DELETE request to @@ -275,14 +275,14 @@ def list_agents( self, uuid: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> KeyListAgentsResponse: """ List Agents by Anthropic Key. @@ -346,14 +346,14 @@ def with_streaming_response(self) -> AsyncKeysResourceWithStreamingResponse: async def create( self, *, - api_key: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + api_key: str | Omit = omit, + name: 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, ) -> KeyCreateResponse: """ To create an Anthropic API key, send a POST request to @@ -398,7 +398,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, ) -> KeyRetrieveResponse: """ To retrieve details of an Anthropic API key, send a GET request to @@ -429,15 +429,15 @@ async def update( self, path_api_key_uuid: str, *, - api_key: str | NotGiven = NOT_GIVEN, - body_api_key_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + api_key: str | Omit = omit, + body_api_key_uuid: str | Omit = omit, + name: 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, ) -> KeyUpdateResponse: """ To update an Anthropic API key, send a PUT request to @@ -481,14 +481,14 @@ async def update( async def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> KeyListResponse: """ To list all Anthropic API keys, send a GET request to @@ -536,7 +536,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, ) -> KeyDeleteResponse: """ To delete an Anthropic API key, send a DELETE request to @@ -567,14 +567,14 @@ async def list_agents( self, uuid: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> KeyListAgentsResponse: """ List Agents by Anthropic Key. diff --git a/src/gradient/resources/agents/evaluation_metrics/evaluation_metrics.py b/src/gradient/resources/agents/evaluation_metrics/evaluation_metrics.py index b9e1386b..43c1aa9b 100644 --- a/src/gradient/resources/agents/evaluation_metrics/evaluation_metrics.py +++ b/src/gradient/resources/agents/evaluation_metrics/evaluation_metrics.py @@ -12,7 +12,7 @@ ModelsResourceWithStreamingResponse, AsyncModelsResourceWithStreamingResponse, ) -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 @@ -110,7 +110,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, ) -> EvaluationMetricListResponse: """ To list all evaluation metrics, send a GET request to @@ -129,14 +129,14 @@ def list( def list_regions( self, *, - serves_batch: bool | NotGiven = NOT_GIVEN, - serves_inference: bool | NotGiven = NOT_GIVEN, + serves_batch: bool | Omit = omit, + serves_inference: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EvaluationMetricListRegionsResponse: """ To list all datacenter regions, send a GET request to `/v2/gen-ai/regions`. @@ -223,7 +223,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, ) -> EvaluationMetricListResponse: """ To list all evaluation metrics, send a GET request to @@ -242,14 +242,14 @@ async def list( async def list_regions( self, *, - serves_batch: bool | NotGiven = NOT_GIVEN, - serves_inference: bool | NotGiven = NOT_GIVEN, + serves_batch: bool | Omit = omit, + serves_inference: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EvaluationMetricListRegionsResponse: """ To list all datacenter regions, send a GET request to `/v2/gen-ai/regions`. diff --git a/src/gradient/resources/agents/evaluation_metrics/models.py b/src/gradient/resources/agents/evaluation_metrics/models.py index 1902a4f0..7728e662 100644 --- a/src/gradient/resources/agents/evaluation_metrics/models.py +++ b/src/gradient/resources/agents/evaluation_metrics/models.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 @@ -47,9 +47,9 @@ def with_streaming_response(self) -> ModelsResourceWithStreamingResponse: def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - public_only: bool | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, + public_only: bool | Omit = omit, usecases: List[ Literal[ "MODEL_USECASE_UNKNOWN", @@ -61,13 +61,13 @@ def list( "MODEL_USECASE_SERVERLESS", ] ] - | 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, ) -> ModelListResponse: """ To list all models, send a GET request to `/v2/gen-ai/models`. @@ -144,9 +144,9 @@ def with_streaming_response(self) -> AsyncModelsResourceWithStreamingResponse: async def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - public_only: bool | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, + public_only: bool | Omit = omit, usecases: List[ Literal[ "MODEL_USECASE_UNKNOWN", @@ -158,13 +158,13 @@ async def list( "MODEL_USECASE_SERVERLESS", ] ] - | 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, ) -> ModelListResponse: """ To list all models, send a GET request to `/v2/gen-ai/models`. diff --git a/src/gradient/resources/agents/evaluation_metrics/oauth2/dropbox.py b/src/gradient/resources/agents/evaluation_metrics/oauth2/dropbox.py index caa7d0d3..256040ba 100644 --- a/src/gradient/resources/agents/evaluation_metrics/oauth2/dropbox.py +++ b/src/gradient/resources/agents/evaluation_metrics/oauth2/dropbox.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,14 +44,14 @@ def with_streaming_response(self) -> DropboxResourceWithStreamingResponse: def create_tokens( self, *, - code: str | NotGiven = NOT_GIVEN, - redirect_url: str | NotGiven = NOT_GIVEN, + code: str | Omit = omit, + redirect_url: 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, ) -> DropboxCreateTokensResponse: """ To obtain the refresh token, needed for creation of data sources, send a GET @@ -112,14 +112,14 @@ def with_streaming_response(self) -> AsyncDropboxResourceWithStreamingResponse: async def create_tokens( self, *, - code: str | NotGiven = NOT_GIVEN, - redirect_url: str | NotGiven = NOT_GIVEN, + code: str | Omit = omit, + redirect_url: 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, ) -> DropboxCreateTokensResponse: """ To obtain the refresh token, needed for creation of data sources, send a GET diff --git a/src/gradient/resources/agents/evaluation_metrics/oauth2/oauth2.py b/src/gradient/resources/agents/evaluation_metrics/oauth2/oauth2.py index 8063ce5a..335e58d7 100644 --- a/src/gradient/resources/agents/evaluation_metrics/oauth2/oauth2.py +++ b/src/gradient/resources/agents/evaluation_metrics/oauth2/oauth2.py @@ -12,7 +12,7 @@ DropboxResourceWithStreamingResponse, AsyncDropboxResourceWithStreamingResponse, ) -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 @@ -56,14 +56,14 @@ def with_streaming_response(self) -> Oauth2ResourceWithStreamingResponse: def generate_url( self, *, - redirect_url: str | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + redirect_url: 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, ) -> Oauth2GenerateURLResponse: """ To generate an Oauth2-URL for use with your localhost, send a GET request to @@ -130,14 +130,14 @@ def with_streaming_response(self) -> AsyncOauth2ResourceWithStreamingResponse: async def generate_url( self, *, - redirect_url: str | NotGiven = NOT_GIVEN, - type: str | NotGiven = NOT_GIVEN, + redirect_url: 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, ) -> Oauth2GenerateURLResponse: """ To generate an Oauth2-URL for use with your localhost, send a GET request to diff --git a/src/gradient/resources/agents/evaluation_metrics/openai/keys.py b/src/gradient/resources/agents/evaluation_metrics/openai/keys.py index 00131691..9ab5cbad 100644 --- a/src/gradient/resources/agents/evaluation_metrics/openai/keys.py +++ b/src/gradient/resources/agents/evaluation_metrics/openai/keys.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 @@ -54,14 +54,14 @@ def with_streaming_response(self) -> KeysResourceWithStreamingResponse: def create( self, *, - api_key: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + api_key: str | Omit = omit, + name: 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, ) -> KeyCreateResponse: """ To create an OpenAI API key, send a POST request to `/v2/gen-ai/openai/keys`. @@ -105,7 +105,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, ) -> KeyRetrieveResponse: """ To retrieve details of an OpenAI API key, send a GET request to @@ -136,15 +136,15 @@ def update( self, path_api_key_uuid: str, *, - api_key: str | NotGiven = NOT_GIVEN, - body_api_key_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + api_key: str | Omit = omit, + body_api_key_uuid: str | Omit = omit, + name: 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, ) -> KeyUpdateResponse: """ To update an OpenAI API key, send a PUT request to @@ -188,14 +188,14 @@ def update( def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> KeyListResponse: """ To list all OpenAI API keys, send a GET request to `/v2/gen-ai/openai/keys`. @@ -242,7 +242,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, ) -> KeyDeleteResponse: """ To delete an OpenAI API key, send a DELETE request to @@ -273,14 +273,14 @@ def list_agents( self, uuid: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> KeyListAgentsResponse: """ List Agents by OpenAI Key. @@ -344,14 +344,14 @@ def with_streaming_response(self) -> AsyncKeysResourceWithStreamingResponse: async def create( self, *, - api_key: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + api_key: str | Omit = omit, + name: 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, ) -> KeyCreateResponse: """ To create an OpenAI API key, send a POST request to `/v2/gen-ai/openai/keys`. @@ -395,7 +395,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, ) -> KeyRetrieveResponse: """ To retrieve details of an OpenAI API key, send a GET request to @@ -426,15 +426,15 @@ async def update( self, path_api_key_uuid: str, *, - api_key: str | NotGiven = NOT_GIVEN, - body_api_key_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + api_key: str | Omit = omit, + body_api_key_uuid: str | Omit = omit, + name: 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, ) -> KeyUpdateResponse: """ To update an OpenAI API key, send a PUT request to @@ -478,14 +478,14 @@ async def update( async def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> KeyListResponse: """ To list all OpenAI API keys, send a GET request to `/v2/gen-ai/openai/keys`. @@ -532,7 +532,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, ) -> KeyDeleteResponse: """ To delete an OpenAI API key, send a DELETE request to @@ -563,14 +563,14 @@ async def list_agents( self, uuid: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> KeyListAgentsResponse: """ List Agents by OpenAI Key. diff --git a/src/gradient/resources/agents/evaluation_metrics/workspaces/agents.py b/src/gradient/resources/agents/evaluation_metrics/workspaces/agents.py index 408396b1..7f9a766a 100644 --- a/src/gradient/resources/agents/evaluation_metrics/workspaces/agents.py +++ b/src/gradient/resources/agents/evaluation_metrics/workspaces/agents.py @@ -4,7 +4,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 @@ -46,15 +46,15 @@ def list( self, workspace_uuid: str, *, - only_deployed: bool | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + only_deployed: bool | Omit = omit, + page: int | Omit = omit, + per_page: 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, ) -> AgentListResponse: """ To list all agents by a Workspace, send a GET request to @@ -102,14 +102,14 @@ def move( self, path_workspace_uuid: str, *, - agent_uuids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - body_workspace_uuid: str | NotGiven = NOT_GIVEN, + agent_uuids: SequenceNotStr[str] | Omit = omit, + body_workspace_uuid: 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, ) -> AgentMoveResponse: """ To move all listed agents a given workspace, send a PUT request to @@ -174,15 +174,15 @@ async def list( self, workspace_uuid: str, *, - only_deployed: bool | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + only_deployed: bool | Omit = omit, + page: int | Omit = omit, + per_page: 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, ) -> AgentListResponse: """ To list all agents by a Workspace, send a GET request to @@ -230,14 +230,14 @@ async def move( self, path_workspace_uuid: str, *, - agent_uuids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - body_workspace_uuid: str | NotGiven = NOT_GIVEN, + agent_uuids: SequenceNotStr[str] | Omit = omit, + body_workspace_uuid: 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, ) -> AgentMoveResponse: """ To move all listed agents a given workspace, send a PUT request to diff --git a/src/gradient/resources/agents/evaluation_metrics/workspaces/workspaces.py b/src/gradient/resources/agents/evaluation_metrics/workspaces/workspaces.py index e6f610ef..73539bbd 100644 --- a/src/gradient/resources/agents/evaluation_metrics/workspaces/workspaces.py +++ b/src/gradient/resources/agents/evaluation_metrics/workspaces/workspaces.py @@ -12,7 +12,7 @@ AgentsResourceWithStreamingResponse, AsyncAgentsResourceWithStreamingResponse, ) -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 @@ -63,15 +63,15 @@ def with_streaming_response(self) -> WorkspacesResourceWithStreamingResponse: def create( self, *, - agent_uuids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + agent_uuids: SequenceNotStr[str] | Omit = omit, + description: str | Omit = omit, + name: 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, ) -> WorkspaceCreateResponse: """To create a new workspace, send a POST request to `/v2/gen-ai/workspaces`. @@ -120,7 +120,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, ) -> WorkspaceRetrieveResponse: """ To retrieve details of a workspace, GET request to @@ -152,15 +152,15 @@ def update( self, path_workspace_uuid: str, *, - description: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - body_workspace_uuid: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + name: str | Omit = omit, + body_workspace_uuid: 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, ) -> WorkspaceUpdateResponse: """ To update a workspace, send a PUT request to @@ -212,7 +212,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, ) -> WorkspaceListResponse: """To list all workspaces, send a GET request to `/v2/gen-ai/workspaces`.""" return self._get( @@ -234,7 +234,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, ) -> WorkspaceDeleteResponse: """ To delete a workspace, send a DELETE request to @@ -270,7 +270,7 @@ def list_evaluation_test_cases( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WorkspaceListEvaluationTestCasesResponse: """ To list all evaluation test cases by a workspace, send a GET request to @@ -325,15 +325,15 @@ def with_streaming_response(self) -> AsyncWorkspacesResourceWithStreamingRespons async def create( self, *, - agent_uuids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + agent_uuids: SequenceNotStr[str] | Omit = omit, + description: str | Omit = omit, + name: 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, ) -> WorkspaceCreateResponse: """To create a new workspace, send a POST request to `/v2/gen-ai/workspaces`. @@ -382,7 +382,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, ) -> WorkspaceRetrieveResponse: """ To retrieve details of a workspace, GET request to @@ -414,15 +414,15 @@ async def update( self, path_workspace_uuid: str, *, - description: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - body_workspace_uuid: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + name: str | Omit = omit, + body_workspace_uuid: 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, ) -> WorkspaceUpdateResponse: """ To update a workspace, send a PUT request to @@ -474,7 +474,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, ) -> WorkspaceListResponse: """To list all workspaces, send a GET request to `/v2/gen-ai/workspaces`.""" return await self._get( @@ -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, ) -> WorkspaceDeleteResponse: """ To delete a workspace, send a DELETE request to @@ -532,7 +532,7 @@ async def list_evaluation_test_cases( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WorkspaceListEvaluationTestCasesResponse: """ To list all evaluation test cases by a workspace, send a GET request to diff --git a/src/gradient/resources/agents/evaluation_runs.py b/src/gradient/resources/agents/evaluation_runs.py index e00c9eb3..8506b00f 100644 --- a/src/gradient/resources/agents/evaluation_runs.py +++ b/src/gradient/resources/agents/evaluation_runs.py @@ -4,7 +4,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,15 +47,15 @@ def with_streaming_response(self) -> EvaluationRunsResourceWithStreamingResponse def create( self, *, - agent_uuids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - run_name: str | NotGiven = NOT_GIVEN, - test_case_uuid: str | NotGiven = NOT_GIVEN, + agent_uuids: SequenceNotStr[str] | Omit = omit, + run_name: str | Omit = omit, + test_case_uuid: 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, ) -> EvaluationRunCreateResponse: """ To run an evaluation test case, send a POST request to @@ -103,7 +103,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, ) -> EvaluationRunRetrieveResponse: """ To retrive information about an existing evaluation run, send a GET request to @@ -136,14 +136,14 @@ def list_results( self, evaluation_run_uuid: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> EvaluationRunListResultsResponse: """ To retrieve results of an evaluation run, send a GET request to @@ -196,7 +196,7 @@ def retrieve_results( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EvaluationRunRetrieveResultsResponse: """ To retrieve results of an evaluation run, send a GET request to @@ -249,15 +249,15 @@ def with_streaming_response(self) -> AsyncEvaluationRunsResourceWithStreamingRes async def create( self, *, - agent_uuids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - run_name: str | NotGiven = NOT_GIVEN, - test_case_uuid: str | NotGiven = NOT_GIVEN, + agent_uuids: SequenceNotStr[str] | Omit = omit, + run_name: str | Omit = omit, + test_case_uuid: 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, ) -> EvaluationRunCreateResponse: """ To run an evaluation test case, send a POST request to @@ -305,7 +305,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, ) -> EvaluationRunRetrieveResponse: """ To retrive information about an existing evaluation run, send a GET request to @@ -338,14 +338,14 @@ async def list_results( self, evaluation_run_uuid: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> EvaluationRunListResultsResponse: """ To retrieve results of an evaluation run, send a GET request to @@ -398,7 +398,7 @@ async def retrieve_results( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EvaluationRunRetrieveResultsResponse: """ To retrieve results of an evaluation run, send a GET request to diff --git a/src/gradient/resources/agents/evaluation_test_cases.py b/src/gradient/resources/agents/evaluation_test_cases.py index 07f0a251..d53b8c26 100644 --- a/src/gradient/resources/agents/evaluation_test_cases.py +++ b/src/gradient/resources/agents/evaluation_test_cases.py @@ -4,7 +4,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 @@ -56,18 +56,18 @@ def with_streaming_response(self) -> EvaluationTestCasesResourceWithStreamingRes def create( self, *, - dataset_uuid: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - metrics: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - star_metric: APIStarMetricParam | NotGiven = NOT_GIVEN, - workspace_uuid: str | NotGiven = NOT_GIVEN, + dataset_uuid: str | Omit = omit, + description: str | Omit = omit, + metrics: SequenceNotStr[str] | Omit = omit, + name: str | Omit = omit, + star_metric: APIStarMetricParam | Omit = omit, + workspace_uuid: 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, ) -> EvaluationTestCaseCreateResponse: """ To create an evaluation test-case send a POST request to @@ -117,13 +117,13 @@ def retrieve( self, test_case_uuid: str, *, - evaluation_test_case_version: int | NotGiven = NOT_GIVEN, + evaluation_test_case_version: 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, ) -> EvaluationTestCaseRetrieveResponse: """ To retrive information about an existing evaluation test case, send a GET @@ -163,18 +163,18 @@ def update( self, path_test_case_uuid: str, *, - dataset_uuid: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - metrics: evaluation_test_case_update_params.Metrics | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - star_metric: APIStarMetricParam | NotGiven = NOT_GIVEN, - body_test_case_uuid: str | NotGiven = NOT_GIVEN, + dataset_uuid: str | Omit = omit, + description: str | Omit = omit, + metrics: evaluation_test_case_update_params.Metrics | Omit = omit, + name: str | Omit = omit, + star_metric: APIStarMetricParam | Omit = omit, + body_test_case_uuid: 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, ) -> EvaluationTestCaseUpdateResponse: """ To update an evaluation test-case send a PUT request to @@ -230,7 +230,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, ) -> EvaluationTestCaseListResponse: """ To list all evaluation test cases, send a GET request to @@ -250,13 +250,13 @@ def list_evaluation_runs( self, evaluation_test_case_uuid: str, *, - evaluation_test_case_version: int | NotGiven = NOT_GIVEN, + evaluation_test_case_version: 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, ) -> EvaluationTestCaseListEvaluationRunsResponse: """ To list all evaluation runs by test case, send a GET request to @@ -318,18 +318,18 @@ def with_streaming_response(self) -> AsyncEvaluationTestCasesResourceWithStreami async def create( self, *, - dataset_uuid: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - metrics: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - star_metric: APIStarMetricParam | NotGiven = NOT_GIVEN, - workspace_uuid: str | NotGiven = NOT_GIVEN, + dataset_uuid: str | Omit = omit, + description: str | Omit = omit, + metrics: SequenceNotStr[str] | Omit = omit, + name: str | Omit = omit, + star_metric: APIStarMetricParam | Omit = omit, + workspace_uuid: 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, ) -> EvaluationTestCaseCreateResponse: """ To create an evaluation test-case send a POST request to @@ -379,13 +379,13 @@ async def retrieve( self, test_case_uuid: str, *, - evaluation_test_case_version: int | NotGiven = NOT_GIVEN, + evaluation_test_case_version: 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, ) -> EvaluationTestCaseRetrieveResponse: """ To retrive information about an existing evaluation test case, send a GET @@ -425,18 +425,18 @@ async def update( self, path_test_case_uuid: str, *, - dataset_uuid: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - metrics: evaluation_test_case_update_params.Metrics | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - star_metric: APIStarMetricParam | NotGiven = NOT_GIVEN, - body_test_case_uuid: str | NotGiven = NOT_GIVEN, + dataset_uuid: str | Omit = omit, + description: str | Omit = omit, + metrics: evaluation_test_case_update_params.Metrics | Omit = omit, + name: str | Omit = omit, + star_metric: APIStarMetricParam | Omit = omit, + body_test_case_uuid: 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, ) -> EvaluationTestCaseUpdateResponse: """ To update an evaluation test-case send a PUT request to @@ -492,7 +492,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, ) -> EvaluationTestCaseListResponse: """ To list all evaluation test cases, send a GET request to @@ -512,13 +512,13 @@ async def list_evaluation_runs( self, evaluation_test_case_uuid: str, *, - evaluation_test_case_version: int | NotGiven = NOT_GIVEN, + evaluation_test_case_version: 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, ) -> EvaluationTestCaseListEvaluationRunsResponse: """ To list all evaluation runs by test case, send a GET request to diff --git a/src/gradient/resources/agents/functions.py b/src/gradient/resources/agents/functions.py index 7986f750..3d995d24 100644 --- a/src/gradient/resources/agents/functions.py +++ b/src/gradient/resources/agents/functions.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 @@ -47,19 +47,19 @@ def create( self, path_agent_uuid: str, *, - body_agent_uuid: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - faas_name: str | NotGiven = NOT_GIVEN, - faas_namespace: str | NotGiven = NOT_GIVEN, - function_name: str | NotGiven = NOT_GIVEN, - input_schema: object | NotGiven = NOT_GIVEN, - output_schema: object | NotGiven = NOT_GIVEN, + body_agent_uuid: str | Omit = omit, + description: str | Omit = omit, + faas_name: str | Omit = omit, + faas_namespace: str | Omit = omit, + function_name: str | Omit = omit, + input_schema: object | Omit = omit, + output_schema: 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, ) -> FunctionCreateResponse: """ To create a function route for an agent, send a POST request to @@ -117,20 +117,20 @@ def update( path_function_uuid: str, *, path_agent_uuid: str, - body_agent_uuid: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - faas_name: str | NotGiven = NOT_GIVEN, - faas_namespace: str | NotGiven = NOT_GIVEN, - function_name: str | NotGiven = NOT_GIVEN, - body_function_uuid: str | NotGiven = NOT_GIVEN, - input_schema: object | NotGiven = NOT_GIVEN, - output_schema: object | NotGiven = NOT_GIVEN, + body_agent_uuid: str | Omit = omit, + description: str | Omit = omit, + faas_name: str | Omit = omit, + faas_namespace: str | Omit = omit, + function_name: str | Omit = omit, + body_function_uuid: str | Omit = omit, + input_schema: object | Omit = omit, + output_schema: 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, ) -> FunctionUpdateResponse: """ To update the function route, send a PUT request to @@ -198,7 +198,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, ) -> FunctionDeleteResponse: """ To delete a function route from an agent, send a DELETE request to @@ -252,19 +252,19 @@ async def create( self, path_agent_uuid: str, *, - body_agent_uuid: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - faas_name: str | NotGiven = NOT_GIVEN, - faas_namespace: str | NotGiven = NOT_GIVEN, - function_name: str | NotGiven = NOT_GIVEN, - input_schema: object | NotGiven = NOT_GIVEN, - output_schema: object | NotGiven = NOT_GIVEN, + body_agent_uuid: str | Omit = omit, + description: str | Omit = omit, + faas_name: str | Omit = omit, + faas_namespace: str | Omit = omit, + function_name: str | Omit = omit, + input_schema: object | Omit = omit, + output_schema: 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, ) -> FunctionCreateResponse: """ To create a function route for an agent, send a POST request to @@ -322,20 +322,20 @@ async def update( path_function_uuid: str, *, path_agent_uuid: str, - body_agent_uuid: str | NotGiven = NOT_GIVEN, - description: str | NotGiven = NOT_GIVEN, - faas_name: str | NotGiven = NOT_GIVEN, - faas_namespace: str | NotGiven = NOT_GIVEN, - function_name: str | NotGiven = NOT_GIVEN, - body_function_uuid: str | NotGiven = NOT_GIVEN, - input_schema: object | NotGiven = NOT_GIVEN, - output_schema: object | NotGiven = NOT_GIVEN, + body_agent_uuid: str | Omit = omit, + description: str | Omit = omit, + faas_name: str | Omit = omit, + faas_namespace: str | Omit = omit, + function_name: str | Omit = omit, + body_function_uuid: str | Omit = omit, + input_schema: object | Omit = omit, + output_schema: 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, ) -> FunctionUpdateResponse: """ To update the function route, send a PUT request to @@ -403,7 +403,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, ) -> FunctionDeleteResponse: """ To delete a function route from an agent, send a DELETE request to diff --git a/src/gradient/resources/agents/knowledge_bases.py b/src/gradient/resources/agents/knowledge_bases.py index 1664ee84..deefd123 100644 --- a/src/gradient/resources/agents/knowledge_bases.py +++ b/src/gradient/resources/agents/knowledge_bases.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 ( @@ -49,7 +49,7 @@ def attach( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> APILinkKnowledgeBaseOutput: """ To attach knowledge bases to an agent, send a POST request to @@ -86,7 +86,7 @@ def attach_single( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> APILinkKnowledgeBaseOutput: """ To attach a knowledge base to an agent, send a POST request to @@ -127,7 +127,7 @@ def detach( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> KnowledgeBaseDetachResponse: """ To detach a knowledge base from an agent, send a DELETE request to @@ -188,7 +188,7 @@ async def attach( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> APILinkKnowledgeBaseOutput: """ To attach knowledge bases to an agent, send a POST request to @@ -225,7 +225,7 @@ async def attach_single( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> APILinkKnowledgeBaseOutput: """ To attach a knowledge base to an agent, send a POST request to @@ -266,7 +266,7 @@ async def detach( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> KnowledgeBaseDetachResponse: """ To detach a knowledge base from an agent, send a DELETE request to diff --git a/src/gradient/resources/agents/routes.py b/src/gradient/resources/agents/routes.py index 1007b08f..dc37b7d2 100644 --- a/src/gradient/resources/agents/routes.py +++ b/src/gradient/resources/agents/routes.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 @@ -49,17 +49,17 @@ def update( path_child_agent_uuid: str, *, path_parent_agent_uuid: str, - body_child_agent_uuid: str | NotGiven = NOT_GIVEN, - if_case: str | NotGiven = NOT_GIVEN, - body_parent_agent_uuid: str | NotGiven = NOT_GIVEN, - route_name: str | NotGiven = NOT_GIVEN, - uuid: str | NotGiven = NOT_GIVEN, + body_child_agent_uuid: str | Omit = omit, + if_case: str | Omit = omit, + body_parent_agent_uuid: str | Omit = omit, + route_name: str | Omit = omit, + uuid: 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, ) -> RouteUpdateResponse: """ To update an agent route for an agent, send a PUT request to @@ -122,7 +122,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, ) -> RouteDeleteResponse: """ To delete an agent route from a parent agent, send a DELETE request to @@ -156,16 +156,16 @@ def add( path_child_agent_uuid: str, *, path_parent_agent_uuid: str, - body_child_agent_uuid: str | NotGiven = NOT_GIVEN, - if_case: str | NotGiven = NOT_GIVEN, - body_parent_agent_uuid: str | NotGiven = NOT_GIVEN, - route_name: str | NotGiven = NOT_GIVEN, + body_child_agent_uuid: str | Omit = omit, + if_case: str | Omit = omit, + body_parent_agent_uuid: str | Omit = omit, + route_name: 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, ) -> RouteAddResponse: """ To add an agent route to an agent, send a POST request to @@ -222,7 +222,7 @@ def view( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteViewResponse: """ To view agent routes for an agent, send a GET requtest to @@ -275,17 +275,17 @@ async def update( path_child_agent_uuid: str, *, path_parent_agent_uuid: str, - body_child_agent_uuid: str | NotGiven = NOT_GIVEN, - if_case: str | NotGiven = NOT_GIVEN, - body_parent_agent_uuid: str | NotGiven = NOT_GIVEN, - route_name: str | NotGiven = NOT_GIVEN, - uuid: str | NotGiven = NOT_GIVEN, + body_child_agent_uuid: str | Omit = omit, + if_case: str | Omit = omit, + body_parent_agent_uuid: str | Omit = omit, + route_name: str | Omit = omit, + uuid: 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, ) -> RouteUpdateResponse: """ To update an agent route for an agent, send a PUT request to @@ -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, ) -> RouteDeleteResponse: """ To delete an agent route from a parent agent, send a DELETE request to @@ -382,16 +382,16 @@ async def add( path_child_agent_uuid: str, *, path_parent_agent_uuid: str, - body_child_agent_uuid: str | NotGiven = NOT_GIVEN, - if_case: str | NotGiven = NOT_GIVEN, - body_parent_agent_uuid: str | NotGiven = NOT_GIVEN, - route_name: str | NotGiven = NOT_GIVEN, + body_child_agent_uuid: str | Omit = omit, + if_case: str | Omit = omit, + body_parent_agent_uuid: str | Omit = omit, + route_name: 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, ) -> RouteAddResponse: """ To add an agent route to an agent, send a POST request to @@ -448,7 +448,7 @@ async def view( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RouteViewResponse: """ To view agent routes for an agent, send a GET requtest to diff --git a/src/gradient/resources/agents/versions.py b/src/gradient/resources/agents/versions.py index bc56e032..0331344a 100644 --- a/src/gradient/resources/agents/versions.py +++ b/src/gradient/resources/agents/versions.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,14 +46,14 @@ def update( self, path_uuid: str, *, - body_uuid: str | NotGiven = NOT_GIVEN, - version_hash: str | NotGiven = NOT_GIVEN, + body_uuid: str | Omit = omit, + version_hash: 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, ) -> VersionUpdateResponse: """ To update to a specific agent version, send a PUT request to @@ -95,14 +95,14 @@ def list( self, uuid: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> VersionListResponse: """ To list all agent versions, send a GET request to @@ -168,14 +168,14 @@ async def update( self, path_uuid: str, *, - body_uuid: str | NotGiven = NOT_GIVEN, - version_hash: str | NotGiven = NOT_GIVEN, + body_uuid: str | Omit = omit, + version_hash: 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, ) -> VersionUpdateResponse: """ To update to a specific agent version, send a PUT request to @@ -217,14 +217,14 @@ async def list( self, uuid: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> VersionListResponse: """ To list all agent versions, send a GET request to diff --git a/src/gradient/resources/chat/completions.py b/src/gradient/resources/chat/completions.py index 3017deb6..779fffb0 100644 --- a/src/gradient/resources/chat/completions.py +++ b/src/gradient/resources/chat/completions.py @@ -7,7 +7,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 required_args, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -52,29 +52,29 @@ def create( *, messages: Iterable[completion_create_params.Message], model: str, - frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, - logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN, - logprobs: Optional[bool] | NotGiven = NOT_GIVEN, - max_completion_tokens: Optional[int] | NotGiven = NOT_GIVEN, - max_tokens: Optional[int] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - n: Optional[int] | NotGiven = NOT_GIVEN, - presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - stream: Optional[Literal[False]] | NotGiven = NOT_GIVEN, - stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, - temperature: Optional[float] | NotGiven = NOT_GIVEN, - tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, - tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, - top_logprobs: Optional[int] | NotGiven = NOT_GIVEN, - top_p: Optional[float] | NotGiven = NOT_GIVEN, - user: str | NotGiven = NOT_GIVEN, + frequency_penalty: Optional[float] | Omit = omit, + logit_bias: Optional[Dict[str, int]] | Omit = omit, + logprobs: Optional[bool] | Omit = omit, + max_completion_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + n: Optional[int] | Omit = omit, + presence_penalty: Optional[float] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream: Optional[Literal[False]] | Omit = omit, + stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: completion_create_params.ToolChoice | Omit = omit, + tools: Iterable[completion_create_params.Tool] | Omit = omit, + top_logprobs: Optional[int] | Omit = omit, + top_p: Optional[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, ) -> CompletionCreateResponse: """ Creates a model response for the given chat conversation. @@ -182,28 +182,28 @@ def create( messages: Iterable[completion_create_params.Message], model: str, stream: Literal[True], - frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, - logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN, - logprobs: Optional[bool] | NotGiven = NOT_GIVEN, - max_completion_tokens: Optional[int] | NotGiven = NOT_GIVEN, - max_tokens: Optional[int] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - n: Optional[int] | NotGiven = NOT_GIVEN, - presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - stream_options: Optional[completion_create_params.StreamOptions] | NotGiven = NOT_GIVEN, - temperature: Optional[float] | NotGiven = NOT_GIVEN, - tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, - tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, - top_logprobs: Optional[int] | NotGiven = NOT_GIVEN, - top_p: Optional[float] | NotGiven = NOT_GIVEN, - user: str | NotGiven = NOT_GIVEN, + frequency_penalty: Optional[float] | Omit = omit, + logit_bias: Optional[Dict[str, int]] | Omit = omit, + logprobs: Optional[bool] | Omit = omit, + max_completion_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + n: Optional[int] | Omit = omit, + presence_penalty: Optional[float] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: completion_create_params.ToolChoice | Omit = omit, + tools: Iterable[completion_create_params.Tool] | Omit = omit, + top_logprobs: Optional[int] | Omit = omit, + top_p: Optional[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, ) -> Stream[ChatCompletionChunk]: """ Creates a model response for the given chat conversation. @@ -310,28 +310,28 @@ def create( messages: Iterable[completion_create_params.Message], model: str, stream: bool, - frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, - logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN, - logprobs: Optional[bool] | NotGiven = NOT_GIVEN, - max_completion_tokens: Optional[int] | NotGiven = NOT_GIVEN, - max_tokens: Optional[int] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - n: Optional[int] | NotGiven = NOT_GIVEN, - presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - stream_options: Optional[completion_create_params.StreamOptions] | NotGiven = NOT_GIVEN, - temperature: Optional[float] | NotGiven = NOT_GIVEN, - tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, - tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, - top_logprobs: Optional[int] | NotGiven = NOT_GIVEN, - top_p: Optional[float] | NotGiven = NOT_GIVEN, - user: str | NotGiven = NOT_GIVEN, + frequency_penalty: Optional[float] | Omit = omit, + logit_bias: Optional[Dict[str, int]] | Omit = omit, + logprobs: Optional[bool] | Omit = omit, + max_completion_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + n: Optional[int] | Omit = omit, + presence_penalty: Optional[float] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: completion_create_params.ToolChoice | Omit = omit, + tools: Iterable[completion_create_params.Tool] | Omit = omit, + top_logprobs: Optional[int] | Omit = omit, + top_p: Optional[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, ) -> CompletionCreateResponse | Stream[ChatCompletionChunk]: """ Creates a model response for the given chat conversation. @@ -437,29 +437,29 @@ def create( *, messages: Iterable[completion_create_params.Message], model: str, - frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, - logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN, - logprobs: Optional[bool] | NotGiven = NOT_GIVEN, - max_completion_tokens: Optional[int] | NotGiven = NOT_GIVEN, - max_tokens: Optional[int] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - n: Optional[int] | NotGiven = NOT_GIVEN, - presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - stream: Optional[Literal[False]] | Literal[True] | NotGiven = NOT_GIVEN, - stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, - temperature: Optional[float] | NotGiven = NOT_GIVEN, - tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, - tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, - top_logprobs: Optional[int] | NotGiven = NOT_GIVEN, - top_p: Optional[float] | NotGiven = NOT_GIVEN, - user: str | NotGiven = NOT_GIVEN, + frequency_penalty: Optional[float] | Omit = omit, + logit_bias: Optional[Dict[str, int]] | Omit = omit, + logprobs: Optional[bool] | Omit = omit, + max_completion_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + n: Optional[int] | Omit = omit, + presence_penalty: Optional[float] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream: Optional[Literal[False]] | Literal[True] | Omit = omit, + stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: completion_create_params.ToolChoice | Omit = omit, + tools: Iterable[completion_create_params.Tool] | Omit = omit, + top_logprobs: Optional[int] | Omit = omit, + top_p: Optional[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, ) -> CompletionCreateResponse | Stream[ChatCompletionChunk]: # This method requires an model_access_key to be set via client argument or environment variable if not self._client.model_access_key: @@ -542,29 +542,29 @@ async def create( *, messages: Iterable[completion_create_params.Message], model: str, - frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, - logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN, - logprobs: Optional[bool] | NotGiven = NOT_GIVEN, - max_completion_tokens: Optional[int] | NotGiven = NOT_GIVEN, - max_tokens: Optional[int] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - n: Optional[int] | NotGiven = NOT_GIVEN, - presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - stream: Optional[Literal[False]] | NotGiven = NOT_GIVEN, - stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, - temperature: Optional[float] | NotGiven = NOT_GIVEN, - tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, - tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, - top_logprobs: Optional[int] | NotGiven = NOT_GIVEN, - top_p: Optional[float] | NotGiven = NOT_GIVEN, - user: str | NotGiven = NOT_GIVEN, + frequency_penalty: Optional[float] | Omit = omit, + logit_bias: Optional[Dict[str, int]] | Omit = omit, + logprobs: Optional[bool] | Omit = omit, + max_completion_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + n: Optional[int] | Omit = omit, + presence_penalty: Optional[float] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream: Optional[Literal[False]] | Omit = omit, + stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: completion_create_params.ToolChoice | Omit = omit, + tools: Iterable[completion_create_params.Tool] | Omit = omit, + top_logprobs: Optional[int] | Omit = omit, + top_p: Optional[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, ) -> CompletionCreateResponse: """ Creates a model response for the given chat conversation. @@ -672,28 +672,28 @@ async def create( messages: Iterable[completion_create_params.Message], model: str, stream: Literal[True], - frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, - logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN, - logprobs: Optional[bool] | NotGiven = NOT_GIVEN, - max_completion_tokens: Optional[int] | NotGiven = NOT_GIVEN, - max_tokens: Optional[int] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - n: Optional[int] | NotGiven = NOT_GIVEN, - presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - stream_options: Optional[completion_create_params.StreamOptions] | NotGiven = NOT_GIVEN, - temperature: Optional[float] | NotGiven = NOT_GIVEN, - tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, - tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, - top_logprobs: Optional[int] | NotGiven = NOT_GIVEN, - top_p: Optional[float] | NotGiven = NOT_GIVEN, - user: str | NotGiven = NOT_GIVEN, + frequency_penalty: Optional[float] | Omit = omit, + logit_bias: Optional[Dict[str, int]] | Omit = omit, + logprobs: Optional[bool] | Omit = omit, + max_completion_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + n: Optional[int] | Omit = omit, + presence_penalty: Optional[float] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: completion_create_params.ToolChoice | Omit = omit, + tools: Iterable[completion_create_params.Tool] | Omit = omit, + top_logprobs: Optional[int] | Omit = omit, + top_p: Optional[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, ) -> AsyncStream[ChatCompletionChunk]: """ Creates a model response for the given chat conversation. @@ -800,28 +800,28 @@ async def create( messages: Iterable[completion_create_params.Message], model: str, stream: bool, - frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, - logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN, - logprobs: Optional[bool] | NotGiven = NOT_GIVEN, - max_completion_tokens: Optional[int] | NotGiven = NOT_GIVEN, - max_tokens: Optional[int] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - n: Optional[int] | NotGiven = NOT_GIVEN, - presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - stream_options: Optional[completion_create_params.StreamOptions] | NotGiven = NOT_GIVEN, - temperature: Optional[float] | NotGiven = NOT_GIVEN, - tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, - tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, - top_logprobs: Optional[int] | NotGiven = NOT_GIVEN, - top_p: Optional[float] | NotGiven = NOT_GIVEN, - user: str | NotGiven = NOT_GIVEN, + frequency_penalty: Optional[float] | Omit = omit, + logit_bias: Optional[Dict[str, int]] | Omit = omit, + logprobs: Optional[bool] | Omit = omit, + max_completion_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + n: Optional[int] | Omit = omit, + presence_penalty: Optional[float] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: completion_create_params.ToolChoice | Omit = omit, + tools: Iterable[completion_create_params.Tool] | Omit = omit, + top_logprobs: Optional[int] | Omit = omit, + top_p: Optional[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, ) -> CompletionCreateResponse | AsyncStream[ChatCompletionChunk]: """ Creates a model response for the given chat conversation. @@ -927,29 +927,29 @@ async def create( *, messages: Iterable[completion_create_params.Message], model: str, - frequency_penalty: Optional[float] | NotGiven = NOT_GIVEN, - logit_bias: Optional[Dict[str, int]] | NotGiven = NOT_GIVEN, - logprobs: Optional[bool] | NotGiven = NOT_GIVEN, - max_completion_tokens: Optional[int] | NotGiven = NOT_GIVEN, - max_tokens: Optional[int] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - n: Optional[int] | NotGiven = NOT_GIVEN, - presence_penalty: Optional[float] | NotGiven = NOT_GIVEN, - stop: Union[Optional[str], SequenceNotStr[str], None] | NotGiven = NOT_GIVEN, - stream: Optional[Literal[False]] | Literal[True] | NotGiven = NOT_GIVEN, - stream_options: (Optional[completion_create_params.StreamOptions] | NotGiven) = NOT_GIVEN, - temperature: Optional[float] | NotGiven = NOT_GIVEN, - tool_choice: completion_create_params.ToolChoice | NotGiven = NOT_GIVEN, - tools: Iterable[completion_create_params.Tool] | NotGiven = NOT_GIVEN, - top_logprobs: Optional[int] | NotGiven = NOT_GIVEN, - top_p: Optional[float] | NotGiven = NOT_GIVEN, - user: str | NotGiven = NOT_GIVEN, + frequency_penalty: Optional[float] | Omit = omit, + logit_bias: Optional[Dict[str, int]] | Omit = omit, + logprobs: Optional[bool] | Omit = omit, + max_completion_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + n: Optional[int] | Omit = omit, + presence_penalty: Optional[float] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream: Optional[Literal[False]] | Literal[True] | Omit = omit, + stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: completion_create_params.ToolChoice | Omit = omit, + tools: Iterable[completion_create_params.Tool] | Omit = omit, + top_logprobs: Optional[int] | Omit = omit, + top_p: Optional[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, ) -> CompletionCreateResponse | AsyncStream[ChatCompletionChunk]: # This method requires an model_access_key to be set via client argument or environment variable if not hasattr(self._client, "model_access_key") or not self._client.model_access_key: diff --git a/src/gradient/resources/databases/schema_registry/config.py b/src/gradient/resources/databases/schema_registry/config.py index f9c0d8d0..e012dd77 100644 --- a/src/gradient/resources/databases/schema_registry/config.py +++ b/src/gradient/resources/databases/schema_registry/config.py @@ -6,7 +6,7 @@ import httpx -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 @@ -55,7 +55,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, ) -> ConfigRetrieveResponse: """ To retrieve the Schema Registry configuration for a Kafka cluster, send a GET @@ -98,7 +98,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, ) -> ConfigUpdateResponse: """ To update the Schema Registry configuration for a Kafka cluster, send a PUT @@ -142,7 +142,7 @@ def retrieve_subject( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConfigRetrieveSubjectResponse: """ To retrieve the Schema Registry configuration for a Subject of a Kafka cluster, @@ -189,7 +189,7 @@ def update_subject( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConfigUpdateSubjectResponse: """ To update the Schema Registry configuration for a Subject of a Kafka cluster, @@ -258,7 +258,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, ) -> ConfigRetrieveResponse: """ To retrieve the Schema Registry configuration for a Kafka cluster, send a GET @@ -301,7 +301,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, ) -> ConfigUpdateResponse: """ To update the Schema Registry configuration for a Kafka cluster, send a PUT @@ -347,7 +347,7 @@ async def retrieve_subject( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConfigRetrieveSubjectResponse: """ To retrieve the Schema Registry configuration for a Subject of a Kafka cluster, @@ -394,7 +394,7 @@ async def update_subject( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ConfigUpdateSubjectResponse: """ To update the Schema Registry configuration for a Subject of a Kafka cluster, diff --git a/src/gradient/resources/gpu_droplets/account/keys.py b/src/gradient/resources/gpu_droplets/account/keys.py index f5cd4120..f50b9945 100644 --- a/src/gradient/resources/gpu_droplets/account/keys.py +++ b/src/gradient/resources/gpu_droplets/account/keys.py @@ -6,7 +6,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, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -56,7 +56,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, ) -> KeyCreateResponse: """ To add a new SSH public key to your DigitalOcean account, send a POST request to @@ -102,7 +102,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, ) -> KeyRetrieveResponse: """ To get information about a key, send a GET request to `/v2/account/keys/$KEY_ID` @@ -136,13 +136,13 @@ def update( self, ssh_key_identifier: Union[int, str], *, - name: str | NotGiven = NOT_GIVEN, + name: 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, ) -> KeyUpdateResponse: """ To update the name of an SSH key, send a PUT request to either @@ -178,14 +178,14 @@ def update( def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> KeyListResponse: """ To list all of the keys in your account, send a GET request to @@ -233,7 +233,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: """ To destroy a public SSH key that you have in your account, send a DELETE request @@ -295,7 +295,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, ) -> KeyCreateResponse: """ To add a new SSH public key to your DigitalOcean account, send a POST request to @@ -341,7 +341,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, ) -> KeyRetrieveResponse: """ To get information about a key, send a GET request to `/v2/account/keys/$KEY_ID` @@ -375,13 +375,13 @@ async def update( self, ssh_key_identifier: Union[int, str], *, - name: str | NotGiven = NOT_GIVEN, + name: 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, ) -> KeyUpdateResponse: """ To update the name of an SSH key, send a PUT request to either @@ -417,14 +417,14 @@ async def update( async def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> KeyListResponse: """ To list all of the keys in your account, send a GET request to @@ -472,7 +472,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: """ To destroy a public SSH key that you have in your account, send a DELETE request diff --git a/src/gradient/resources/gpu_droplets/actions.py b/src/gradient/resources/gpu_droplets/actions.py index 715fb076..a708fb67 100644 --- a/src/gradient/resources/gpu_droplets/actions.py +++ b/src/gradient/resources/gpu_droplets/actions.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 required_args, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -58,7 +58,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, ) -> ActionRetrieveResponse: """ To retrieve a Droplet action, send a GET request to @@ -90,14 +90,14 @@ def list( self, droplet_id: int, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> ActionListResponse: """ To retrieve a list of all actions that have been executed for a Droplet, send a @@ -161,13 +161,13 @@ def bulk_initiate( "enable_ipv6", "snapshot", ], - tag_name: str | NotGiven = NOT_GIVEN, + tag_name: 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, ) -> ActionBulkInitiateResponse: """Some actions can be performed in bulk on tagged Droplets. @@ -223,14 +223,14 @@ def bulk_initiate( "enable_ipv6", "snapshot", ], - tag_name: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + tag_name: str | Omit = omit, + name: 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, ) -> ActionBulkInitiateResponse: """Some actions can be performed in bulk on tagged Droplets. @@ -288,14 +288,14 @@ def bulk_initiate( "enable_ipv6", "snapshot", ], - tag_name: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + tag_name: str | Omit = omit, + name: 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, ) -> ActionBulkInitiateResponse: return self._post( "/v2/droplets/actions" @@ -345,7 +345,7 @@ def initiate( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ActionInitiateResponse: """ To initiate an action on a Droplet send a POST request to @@ -406,13 +406,13 @@ def initiate( "enable_ipv6", "snapshot", ], - backup_policy: DropletBackupPolicyParam | NotGiven = NOT_GIVEN, + backup_policy: DropletBackupPolicyParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ActionInitiateResponse: """ To initiate an action on a Droplet send a POST request to @@ -476,13 +476,13 @@ def initiate( "enable_ipv6", "snapshot", ], - backup_policy: DropletBackupPolicyParam | NotGiven = NOT_GIVEN, + backup_policy: DropletBackupPolicyParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ActionInitiateResponse: """ To initiate an action on a Droplet send a POST request to @@ -545,13 +545,13 @@ def initiate( "enable_ipv6", "snapshot", ], - image: int | NotGiven = NOT_GIVEN, + image: 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, ) -> ActionInitiateResponse: """ To initiate an action on a Droplet send a POST request to @@ -614,14 +614,14 @@ def initiate( "enable_ipv6", "snapshot", ], - disk: bool | NotGiven = NOT_GIVEN, - size: str | NotGiven = NOT_GIVEN, + disk: bool | Omit = omit, + size: 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, ) -> ActionInitiateResponse: """ To initiate an action on a Droplet send a POST request to @@ -688,13 +688,13 @@ def initiate( "enable_ipv6", "snapshot", ], - image: Union[str, int] | NotGiven = NOT_GIVEN, + image: Union[str, 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, ) -> ActionInitiateResponse: """ To initiate an action on a Droplet send a POST request to @@ -758,13 +758,13 @@ def initiate( "enable_ipv6", "snapshot", ], - name: str | NotGiven = NOT_GIVEN, + name: 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, ) -> ActionInitiateResponse: """ To initiate an action on a Droplet send a POST request to @@ -827,13 +827,13 @@ def initiate( "enable_ipv6", "snapshot", ], - kernel: int | NotGiven = NOT_GIVEN, + kernel: 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, ) -> ActionInitiateResponse: """ To initiate an action on a Droplet send a POST request to @@ -896,13 +896,13 @@ def initiate( "enable_ipv6", "snapshot", ], - name: str | NotGiven = NOT_GIVEN, + name: 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, ) -> ActionInitiateResponse: """ To initiate an action on a Droplet send a POST request to @@ -965,18 +965,18 @@ def initiate( "enable_ipv6", "snapshot", ], - backup_policy: DropletBackupPolicyParam | NotGiven = NOT_GIVEN, - image: int | Union[str, int] | NotGiven = NOT_GIVEN, - disk: bool | NotGiven = NOT_GIVEN, - size: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - kernel: int | NotGiven = NOT_GIVEN, + backup_policy: DropletBackupPolicyParam | Omit = omit, + image: int | Union[str, int] | Omit = omit, + disk: bool | Omit = omit, + size: str | Omit = omit, + name: str | Omit = omit, + kernel: 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, ) -> ActionInitiateResponse: return self._post( f"/v2/droplets/{droplet_id}/actions" @@ -1031,7 +1031,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, ) -> ActionRetrieveResponse: """ To retrieve a Droplet action, send a GET request to @@ -1063,14 +1063,14 @@ async def list( self, droplet_id: int, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> ActionListResponse: """ To retrieve a list of all actions that have been executed for a Droplet, send a @@ -1134,13 +1134,13 @@ async def bulk_initiate( "enable_ipv6", "snapshot", ], - tag_name: str | NotGiven = NOT_GIVEN, + tag_name: 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, ) -> ActionBulkInitiateResponse: """Some actions can be performed in bulk on tagged Droplets. @@ -1196,14 +1196,14 @@ async def bulk_initiate( "enable_ipv6", "snapshot", ], - tag_name: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + tag_name: str | Omit = omit, + name: 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, ) -> ActionBulkInitiateResponse: """Some actions can be performed in bulk on tagged Droplets. @@ -1261,14 +1261,14 @@ async def bulk_initiate( "enable_ipv6", "snapshot", ], - tag_name: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + tag_name: str | Omit = omit, + name: 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, ) -> ActionBulkInitiateResponse: return await self._post( "/v2/droplets/actions" @@ -1320,7 +1320,7 @@ async def initiate( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ActionInitiateResponse: """ To initiate an action on a Droplet send a POST request to @@ -1381,13 +1381,13 @@ async def initiate( "enable_ipv6", "snapshot", ], - backup_policy: DropletBackupPolicyParam | NotGiven = NOT_GIVEN, + backup_policy: DropletBackupPolicyParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ActionInitiateResponse: """ To initiate an action on a Droplet send a POST request to @@ -1451,13 +1451,13 @@ async def initiate( "enable_ipv6", "snapshot", ], - backup_policy: DropletBackupPolicyParam | NotGiven = NOT_GIVEN, + backup_policy: DropletBackupPolicyParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ActionInitiateResponse: """ To initiate an action on a Droplet send a POST request to @@ -1520,13 +1520,13 @@ async def initiate( "enable_ipv6", "snapshot", ], - image: int | NotGiven = NOT_GIVEN, + image: 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, ) -> ActionInitiateResponse: """ To initiate an action on a Droplet send a POST request to @@ -1589,14 +1589,14 @@ async def initiate( "enable_ipv6", "snapshot", ], - disk: bool | NotGiven = NOT_GIVEN, - size: str | NotGiven = NOT_GIVEN, + disk: bool | Omit = omit, + size: 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, ) -> ActionInitiateResponse: """ To initiate an action on a Droplet send a POST request to @@ -1663,13 +1663,13 @@ async def initiate( "enable_ipv6", "snapshot", ], - image: Union[str, int] | NotGiven = NOT_GIVEN, + image: Union[str, 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, ) -> ActionInitiateResponse: """ To initiate an action on a Droplet send a POST request to @@ -1733,13 +1733,13 @@ async def initiate( "enable_ipv6", "snapshot", ], - name: str | NotGiven = NOT_GIVEN, + name: 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, ) -> ActionInitiateResponse: """ To initiate an action on a Droplet send a POST request to @@ -1802,13 +1802,13 @@ async def initiate( "enable_ipv6", "snapshot", ], - kernel: int | NotGiven = NOT_GIVEN, + kernel: 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, ) -> ActionInitiateResponse: """ To initiate an action on a Droplet send a POST request to @@ -1871,13 +1871,13 @@ async def initiate( "enable_ipv6", "snapshot", ], - name: str | NotGiven = NOT_GIVEN, + name: 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, ) -> ActionInitiateResponse: """ To initiate an action on a Droplet send a POST request to @@ -1940,18 +1940,18 @@ async def initiate( "enable_ipv6", "snapshot", ], - backup_policy: DropletBackupPolicyParam | NotGiven = NOT_GIVEN, - image: int | Union[str, int] | NotGiven = NOT_GIVEN, - disk: bool | NotGiven = NOT_GIVEN, - size: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - kernel: int | NotGiven = NOT_GIVEN, + backup_policy: DropletBackupPolicyParam | Omit = omit, + image: int | Union[str, int] | Omit = omit, + disk: bool | Omit = omit, + size: str | Omit = omit, + name: str | Omit = omit, + kernel: 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, ) -> ActionInitiateResponse: return await self._post( f"/v2/droplets/{droplet_id}/actions" diff --git a/src/gradient/resources/gpu_droplets/autoscale.py b/src/gradient/resources/gpu_droplets/autoscale.py index 342256f6..8df17f7a 100644 --- a/src/gradient/resources/gpu_droplets/autoscale.py +++ b/src/gradient/resources/gpu_droplets/autoscale.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, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -64,7 +64,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, ) -> AutoscaleCreateResponse: """ To create a new autoscale pool, send a POST request to `/v2/droplets/autoscale` @@ -114,7 +114,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, ) -> AutoscaleRetrieveResponse: """ To show information about an individual autoscale pool, send a GET request to @@ -153,7 +153,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, ) -> AutoscaleUpdateResponse: """ To update the configuration of an existing autoscale pool, send a PUT request to @@ -197,15 +197,15 @@ def update( def list( self, *, - name: str | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + page: int | Omit = omit, + per_page: 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, ) -> AutoscaleListResponse: """ To list all autoscale pools in your team, send a GET request to @@ -258,7 +258,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: """ To destroy an autoscale pool, send a DELETE request to the @@ -298,7 +298,7 @@ def delete_dangerous( extra_headers: Headers | None = None, extra_query: 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: """ To destroy an autoscale pool and its associated resources (Droplets), send a @@ -332,14 +332,14 @@ def list_history( self, autoscale_pool_id: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> AutoscaleListHistoryResponse: """ To list all of the scaling history events of an autoscale pool, send a GET @@ -387,14 +387,14 @@ def list_members( self, autoscale_pool_id: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> AutoscaleListMembersResponse: """ To list the Droplets in an autoscale pool, send a GET request to @@ -471,7 +471,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, ) -> AutoscaleCreateResponse: """ To create a new autoscale pool, send a POST request to `/v2/droplets/autoscale` @@ -521,7 +521,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, ) -> AutoscaleRetrieveResponse: """ To show information about an individual autoscale pool, send a GET request to @@ -560,7 +560,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, ) -> AutoscaleUpdateResponse: """ To update the configuration of an existing autoscale pool, send a PUT request to @@ -604,15 +604,15 @@ async def update( async def list( self, *, - name: str | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + page: int | Omit = omit, + per_page: 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, ) -> AutoscaleListResponse: """ To list all autoscale pools in your team, send a GET request to @@ -665,7 +665,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: """ To destroy an autoscale pool, send a DELETE request to the @@ -705,7 +705,7 @@ async def delete_dangerous( extra_headers: Headers | None = None, extra_query: 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: """ To destroy an autoscale pool and its associated resources (Droplets), send a @@ -739,14 +739,14 @@ async def list_history( self, autoscale_pool_id: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> AutoscaleListHistoryResponse: """ To list all of the scaling history events of an autoscale pool, send a GET @@ -794,14 +794,14 @@ async def list_members( self, autoscale_pool_id: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> AutoscaleListMembersResponse: """ To list the Droplets in an autoscale pool, send a GET request to diff --git a/src/gradient/resources/gpu_droplets/backups.py b/src/gradient/resources/gpu_droplets/backups.py index 9f20a047..065aa3d1 100644 --- a/src/gradient/resources/gpu_droplets/backups.py +++ b/src/gradient/resources/gpu_droplets/backups.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 @@ -48,14 +48,14 @@ def list( self, droplet_id: int, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> BackupListResponse: """ To retrieve any backups associated with a Droplet, send a GET request to @@ -101,14 +101,14 @@ def list( def list_policies( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> BackupListPoliciesResponse: """ To list information about the backup policies for all Droplets in the account, @@ -155,7 +155,7 @@ def list_supported_policies( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BackupListSupportedPoliciesResponse: """ To retrieve a list of all supported Droplet backup policies, send a GET request @@ -180,7 +180,7 @@ def retrieve_policy( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BackupRetrievePolicyResponse: """ To show information about an individual Droplet's backup policy, send a GET @@ -230,14 +230,14 @@ async def list( self, droplet_id: int, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> BackupListResponse: """ To retrieve any backups associated with a Droplet, send a GET request to @@ -283,14 +283,14 @@ async def list( async def list_policies( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> BackupListPoliciesResponse: """ To list information about the backup policies for all Droplets in the account, @@ -337,7 +337,7 @@ async def list_supported_policies( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BackupListSupportedPoliciesResponse: """ To retrieve a list of all supported Droplet backup policies, send a GET request @@ -362,7 +362,7 @@ async def retrieve_policy( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BackupRetrievePolicyResponse: """ To show information about an individual Droplet's backup policy, send a GET diff --git a/src/gradient/resources/gpu_droplets/destroy_with_associated_resources.py b/src/gradient/resources/gpu_droplets/destroy_with_associated_resources.py index 0d55cb48..2ccad852 100644 --- a/src/gradient/resources/gpu_droplets/destroy_with_associated_resources.py +++ b/src/gradient/resources/gpu_droplets/destroy_with_associated_resources.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, SequenceNotStr +from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -55,7 +55,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, ) -> DestroyWithAssociatedResourceListResponse: """ To list the associated billable resources that can be destroyed along with a @@ -97,7 +97,7 @@ def check_status( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DestroyWithAssociatedResourceCheckStatusResponse: """ To check on the status of a request to destroy a Droplet with its associated @@ -133,7 +133,7 @@ def delete_dangerous( extra_headers: Headers | None = None, extra_query: 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: """ To destroy a Droplet along with all of its associated resources, send a DELETE @@ -172,17 +172,17 @@ def delete_selective( self, droplet_id: int, *, - floating_ips: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - reserved_ips: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - snapshots: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - volume_snapshots: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - volumes: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + floating_ips: SequenceNotStr[str] | Omit = omit, + reserved_ips: SequenceNotStr[str] | Omit = omit, + snapshots: SequenceNotStr[str] | Omit = omit, + volume_snapshots: SequenceNotStr[str] | Omit = omit, + volumes: SequenceNotStr[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, ) -> None: """ To destroy a Droplet along with a sub-set of its associated resources, send a @@ -250,7 +250,7 @@ def retry( extra_headers: Headers | None = None, extra_query: 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: """ If the status of a request to destroy a Droplet with its associated resources @@ -311,7 +311,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, ) -> DestroyWithAssociatedResourceListResponse: """ To list the associated billable resources that can be destroyed along with a @@ -353,7 +353,7 @@ async def check_status( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DestroyWithAssociatedResourceCheckStatusResponse: """ To check on the status of a request to destroy a Droplet with its associated @@ -389,7 +389,7 @@ async def delete_dangerous( extra_headers: Headers | None = None, extra_query: 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: """ To destroy a Droplet along with all of its associated resources, send a DELETE @@ -428,17 +428,17 @@ async def delete_selective( self, droplet_id: int, *, - floating_ips: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - reserved_ips: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - snapshots: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - volume_snapshots: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - volumes: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + floating_ips: SequenceNotStr[str] | Omit = omit, + reserved_ips: SequenceNotStr[str] | Omit = omit, + snapshots: SequenceNotStr[str] | Omit = omit, + volume_snapshots: SequenceNotStr[str] | Omit = omit, + volumes: SequenceNotStr[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, ) -> None: """ To destroy a Droplet along with a sub-set of its associated resources, send a @@ -506,7 +506,7 @@ async def retry( extra_headers: Headers | None = None, extra_query: 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: """ If the status of a request to destroy a Droplet with its associated resources diff --git a/src/gradient/resources/gpu_droplets/firewalls/droplets.py b/src/gradient/resources/gpu_droplets/firewalls/droplets.py index b25aa3e3..90bcb47e 100644 --- a/src/gradient/resources/gpu_droplets/firewalls/droplets.py +++ b/src/gradient/resources/gpu_droplets/firewalls/droplets.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ...._types import Body, Query, Headers, NoneType, NotGiven, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -52,7 +52,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, ) -> None: """ To assign a Droplet to a firewall, send a POST request to @@ -98,7 +98,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, ) -> None: """ To remove a Droplet from a firewall, send a DELETE request to @@ -165,7 +165,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, ) -> None: """ To assign a Droplet to a firewall, send a POST request to @@ -211,7 +211,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, ) -> None: """ To remove a Droplet from a firewall, send a DELETE request to diff --git a/src/gradient/resources/gpu_droplets/firewalls/firewalls.py b/src/gradient/resources/gpu_droplets/firewalls/firewalls.py index 116cde8d..a5fee406 100644 --- a/src/gradient/resources/gpu_droplets/firewalls/firewalls.py +++ b/src/gradient/resources/gpu_droplets/firewalls/firewalls.py @@ -28,7 +28,7 @@ DropletsResourceWithStreamingResponse, AsyncDropletsResourceWithStreamingResponse, ) -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 @@ -84,13 +84,13 @@ def with_streaming_response(self) -> FirewallsResourceWithStreamingResponse: def create( self, *, - body: firewall_create_params.Body | NotGiven = NOT_GIVEN, + body: firewall_create_params.Body | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FirewallCreateResponse: """To create a new firewall, send a POST request to `/v2/firewalls`. @@ -124,7 +124,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, ) -> FirewallRetrieveResponse: """ To show information about an existing firewall, send a GET request to @@ -161,7 +161,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, ) -> FirewallUpdateResponse: """ To update the configuration of an existing firewall, send a PUT request to @@ -197,14 +197,14 @@ def update( def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> FirewallListResponse: """ To list all of the firewalls available on your account, send a GET request to @@ -250,7 +250,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: """ To delete a firewall send a DELETE request to `/v2/firewalls/$FIREWALL_ID`. @@ -317,13 +317,13 @@ def with_streaming_response(self) -> AsyncFirewallsResourceWithStreamingResponse async def create( self, *, - body: firewall_create_params.Body | NotGiven = NOT_GIVEN, + body: firewall_create_params.Body | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FirewallCreateResponse: """To create a new firewall, send a POST request to `/v2/firewalls`. @@ -357,7 +357,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, ) -> FirewallRetrieveResponse: """ To show information about an existing firewall, send a GET request to @@ -394,7 +394,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, ) -> FirewallUpdateResponse: """ To update the configuration of an existing firewall, send a PUT request to @@ -430,14 +430,14 @@ async def update( async def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> FirewallListResponse: """ To list all of the firewalls available on your account, send a GET request to @@ -483,7 +483,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: """ To delete a firewall send a DELETE request to `/v2/firewalls/$FIREWALL_ID`. diff --git a/src/gradient/resources/gpu_droplets/firewalls/rules.py b/src/gradient/resources/gpu_droplets/firewalls/rules.py index d3a77cd9..f669fc6d 100644 --- a/src/gradient/resources/gpu_droplets/firewalls/rules.py +++ b/src/gradient/resources/gpu_droplets/firewalls/rules.py @@ -6,7 +6,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, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -46,14 +46,14 @@ def add( self, firewall_id: str, *, - inbound_rules: Optional[Iterable[rule_add_params.InboundRule]] | NotGiven = NOT_GIVEN, - outbound_rules: Optional[Iterable[rule_add_params.OutboundRule]] | NotGiven = NOT_GIVEN, + inbound_rules: Optional[Iterable[rule_add_params.InboundRule]] | Omit = omit, + outbound_rules: Optional[Iterable[rule_add_params.OutboundRule]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: 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: """ To add additional access rules to a firewall, send a POST request to @@ -98,14 +98,14 @@ def remove( self, firewall_id: str, *, - inbound_rules: Optional[Iterable[rule_remove_params.InboundRule]] | NotGiven = NOT_GIVEN, - outbound_rules: Optional[Iterable[rule_remove_params.OutboundRule]] | NotGiven = NOT_GIVEN, + inbound_rules: Optional[Iterable[rule_remove_params.InboundRule]] | Omit = omit, + outbound_rules: Optional[Iterable[rule_remove_params.OutboundRule]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: 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: """ To remove access rules from a firewall, send a DELETE request to @@ -171,14 +171,14 @@ async def add( self, firewall_id: str, *, - inbound_rules: Optional[Iterable[rule_add_params.InboundRule]] | NotGiven = NOT_GIVEN, - outbound_rules: Optional[Iterable[rule_add_params.OutboundRule]] | NotGiven = NOT_GIVEN, + inbound_rules: Optional[Iterable[rule_add_params.InboundRule]] | Omit = omit, + outbound_rules: Optional[Iterable[rule_add_params.OutboundRule]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: 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: """ To add additional access rules to a firewall, send a POST request to @@ -223,14 +223,14 @@ async def remove( self, firewall_id: str, *, - inbound_rules: Optional[Iterable[rule_remove_params.InboundRule]] | NotGiven = NOT_GIVEN, - outbound_rules: Optional[Iterable[rule_remove_params.OutboundRule]] | NotGiven = NOT_GIVEN, + inbound_rules: Optional[Iterable[rule_remove_params.InboundRule]] | Omit = omit, + outbound_rules: Optional[Iterable[rule_remove_params.OutboundRule]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: 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: """ To remove access rules from a firewall, send a DELETE request to diff --git a/src/gradient/resources/gpu_droplets/firewalls/tags.py b/src/gradient/resources/gpu_droplets/firewalls/tags.py index ee13acd5..82d613fb 100644 --- a/src/gradient/resources/gpu_droplets/firewalls/tags.py +++ b/src/gradient/resources/gpu_droplets/firewalls/tags.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, SequenceNotStr +from ...._types import Body, Query, Headers, NoneType, NotGiven, SequenceNotStr, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -52,7 +52,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, ) -> None: """ To assign a tag representing a group of Droplets to a firewall, send a POST @@ -101,7 +101,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, ) -> None: """ To remove a tag representing a group of Droplets from a firewall, send a DELETE @@ -171,7 +171,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, ) -> None: """ To assign a tag representing a group of Droplets to a firewall, send a POST @@ -220,7 +220,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, ) -> None: """ To remove a tag representing a group of Droplets from a firewall, send a DELETE diff --git a/src/gradient/resources/gpu_droplets/floating_ips/actions.py b/src/gradient/resources/gpu_droplets/floating_ips/actions.py index ecf88993..f73d5707 100644 --- a/src/gradient/resources/gpu_droplets/floating_ips/actions.py +++ b/src/gradient/resources/gpu_droplets/floating_ips/actions.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 required_args, maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -56,7 +56,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, ) -> ActionCreateResponse: """ To initiate an action on a floating IP send a POST request to @@ -93,7 +93,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, ) -> ActionCreateResponse: """ To initiate an action on a floating IP send a POST request to @@ -126,13 +126,13 @@ def create( floating_ip: str, *, type: Literal["assign", "unassign"], - droplet_id: int | NotGiven = NOT_GIVEN, + droplet_id: 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, ) -> ActionCreateResponse: if not floating_ip: raise ValueError(f"Expected a non-empty value for `floating_ip` but received {floating_ip!r}") @@ -163,7 +163,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, ) -> ActionRetrieveResponse: """ To retrieve the status of a floating IP action, send a GET request to @@ -199,7 +199,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, ) -> ActionListResponse: """ To retrieve all actions that have been executed on a floating IP, send a GET @@ -258,7 +258,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, ) -> ActionCreateResponse: """ To initiate an action on a floating IP send a POST request to @@ -295,7 +295,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, ) -> ActionCreateResponse: """ To initiate an action on a floating IP send a POST request to @@ -328,13 +328,13 @@ async def create( floating_ip: str, *, type: Literal["assign", "unassign"], - droplet_id: int | NotGiven = NOT_GIVEN, + droplet_id: 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, ) -> ActionCreateResponse: if not floating_ip: raise ValueError(f"Expected a non-empty value for `floating_ip` but received {floating_ip!r}") @@ -365,7 +365,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, ) -> ActionRetrieveResponse: """ To retrieve the status of a floating IP action, send a GET request to @@ -401,7 +401,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, ) -> ActionListResponse: """ To retrieve all actions that have been executed on a floating IP, send a GET diff --git a/src/gradient/resources/gpu_droplets/floating_ips/floating_ips.py b/src/gradient/resources/gpu_droplets/floating_ips/floating_ips.py index f70f153f..58b4bdb0 100644 --- a/src/gradient/resources/gpu_droplets/floating_ips/floating_ips.py +++ b/src/gradient/resources/gpu_droplets/floating_ips/floating_ips.py @@ -14,7 +14,7 @@ ActionsResourceWithStreamingResponse, AsyncActionsResourceWithStreamingResponse, ) -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 required_args, maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -67,7 +67,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, ) -> FloatingIPCreateResponse: """ On creation, a floating IP must be either assigned to a Droplet or reserved to a @@ -100,13 +100,13 @@ def create( self, *, region: str, - project_id: str | NotGiven = NOT_GIVEN, + project_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, ) -> FloatingIPCreateResponse: """ On creation, a floating IP must be either assigned to a Droplet or reserved to a @@ -140,15 +140,15 @@ def create( def create( self, *, - droplet_id: int | NotGiven = NOT_GIVEN, - region: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, + droplet_id: int | Omit = omit, + region: str | Omit = omit, + project_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, ) -> FloatingIPCreateResponse: return self._post( "/v2/floating_ips" if self._client._base_url_overridden else "https://api.digitalocean.com/v2/floating_ips", @@ -175,7 +175,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, ) -> FloatingIPRetrieveResponse: """ To show information about a floating IP, send a GET request to @@ -205,14 +205,14 @@ def retrieve( def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> FloatingIPListResponse: """ To list all of the floating IPs available on your account, send a GET request to @@ -258,7 +258,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: """ To delete a floating IP and remove it from your account, send a DELETE request @@ -324,7 +324,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, ) -> FloatingIPCreateResponse: """ On creation, a floating IP must be either assigned to a Droplet or reserved to a @@ -357,13 +357,13 @@ async def create( self, *, region: str, - project_id: str | NotGiven = NOT_GIVEN, + project_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, ) -> FloatingIPCreateResponse: """ On creation, a floating IP must be either assigned to a Droplet or reserved to a @@ -397,15 +397,15 @@ async def create( async def create( self, *, - droplet_id: int | NotGiven = NOT_GIVEN, - region: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, + droplet_id: int | Omit = omit, + region: str | Omit = omit, + project_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, ) -> FloatingIPCreateResponse: return await self._post( "/v2/floating_ips" if self._client._base_url_overridden else "https://api.digitalocean.com/v2/floating_ips", @@ -432,7 +432,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, ) -> FloatingIPRetrieveResponse: """ To show information about a floating IP, send a GET request to @@ -462,14 +462,14 @@ async def retrieve( async def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> FloatingIPListResponse: """ To list all of the floating IPs available on your account, send a GET request to @@ -515,7 +515,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: """ To delete a floating IP and remove it from your account, send a DELETE request diff --git a/src/gradient/resources/gpu_droplets/gpu_droplets.py b/src/gradient/resources/gpu_droplets/gpu_droplets.py index 48a9e5fe..c9f84747 100644 --- a/src/gradient/resources/gpu_droplets/gpu_droplets.py +++ b/src/gradient/resources/gpu_droplets/gpu_droplets.py @@ -39,7 +39,7 @@ BackupsResourceWithStreamingResponse, AsyncBackupsResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, SequenceNotStr +from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given from ..._utils import required_args, maybe_transform, async_maybe_transform from ..._compat import cached_property from .autoscale import ( @@ -209,24 +209,24 @@ def create( image: Union[str, int], name: str, size: str, - backup_policy: DropletBackupPolicyParam | NotGiven = NOT_GIVEN, - backups: bool | NotGiven = NOT_GIVEN, - ipv6: bool | NotGiven = NOT_GIVEN, - monitoring: bool | NotGiven = NOT_GIVEN, - private_networking: bool | NotGiven = NOT_GIVEN, - region: str | NotGiven = NOT_GIVEN, - ssh_keys: SequenceNotStr[Union[str, int]] | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - user_data: str | NotGiven = NOT_GIVEN, - volumes: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - vpc_uuid: str | NotGiven = NOT_GIVEN, - with_droplet_agent: bool | NotGiven = NOT_GIVEN, + backup_policy: DropletBackupPolicyParam | Omit = omit, + backups: bool | Omit = omit, + ipv6: bool | Omit = omit, + monitoring: bool | Omit = omit, + private_networking: bool | Omit = omit, + region: str | Omit = omit, + ssh_keys: SequenceNotStr[Union[str, int]] | Omit = omit, + tags: Optional[SequenceNotStr[str]] | Omit = omit, + user_data: str | Omit = omit, + volumes: SequenceNotStr[str] | Omit = omit, + vpc_uuid: str | Omit = omit, + with_droplet_agent: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GPUDropletCreateResponse: """ To create a new Droplet, send a POST request to `/v2/droplets` setting the @@ -330,24 +330,24 @@ def create( image: Union[str, int], names: SequenceNotStr[str], size: str, - backup_policy: DropletBackupPolicyParam | NotGiven = NOT_GIVEN, - backups: bool | NotGiven = NOT_GIVEN, - ipv6: bool | NotGiven = NOT_GIVEN, - monitoring: bool | NotGiven = NOT_GIVEN, - private_networking: bool | NotGiven = NOT_GIVEN, - region: str | NotGiven = NOT_GIVEN, - ssh_keys: SequenceNotStr[Union[str, int]] | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - user_data: str | NotGiven = NOT_GIVEN, - volumes: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - vpc_uuid: str | NotGiven = NOT_GIVEN, - with_droplet_agent: bool | NotGiven = NOT_GIVEN, + backup_policy: DropletBackupPolicyParam | Omit = omit, + backups: bool | Omit = omit, + ipv6: bool | Omit = omit, + monitoring: bool | Omit = omit, + private_networking: bool | Omit = omit, + region: str | Omit = omit, + ssh_keys: SequenceNotStr[Union[str, int]] | Omit = omit, + tags: Optional[SequenceNotStr[str]] | Omit = omit, + user_data: str | Omit = omit, + volumes: SequenceNotStr[str] | Omit = omit, + vpc_uuid: str | Omit = omit, + with_droplet_agent: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GPUDropletCreateResponse: """ To create a new Droplet, send a POST request to `/v2/droplets` setting the @@ -450,27 +450,27 @@ def create( self, *, image: Union[str, int], - name: str | NotGiven = NOT_GIVEN, + name: str | Omit = omit, size: str, - backup_policy: DropletBackupPolicyParam | NotGiven = NOT_GIVEN, - backups: bool | NotGiven = NOT_GIVEN, - ipv6: bool | NotGiven = NOT_GIVEN, - monitoring: bool | NotGiven = NOT_GIVEN, - private_networking: bool | NotGiven = NOT_GIVEN, - region: str | NotGiven = NOT_GIVEN, - ssh_keys: SequenceNotStr[Union[str, int]] | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - user_data: str | NotGiven = NOT_GIVEN, - volumes: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - vpc_uuid: str | NotGiven = NOT_GIVEN, - with_droplet_agent: bool | NotGiven = NOT_GIVEN, - names: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + backup_policy: DropletBackupPolicyParam | Omit = omit, + backups: bool | Omit = omit, + ipv6: bool | Omit = omit, + monitoring: bool | Omit = omit, + private_networking: bool | Omit = omit, + region: str | Omit = omit, + ssh_keys: SequenceNotStr[Union[str, int]] | Omit = omit, + tags: Optional[SequenceNotStr[str]] | Omit = omit, + user_data: str | Omit = omit, + volumes: SequenceNotStr[str] | Omit = omit, + vpc_uuid: str | Omit = omit, + with_droplet_agent: bool | Omit = omit, + names: SequenceNotStr[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, ) -> GPUDropletCreateResponse: return cast( GPUDropletCreateResponse, @@ -515,7 +515,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, ) -> GPUDropletRetrieveResponse: """ To show information about an individual Droplet, send a GET request to @@ -543,17 +543,17 @@ def retrieve( def list( self, *, - name: str | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - tag_name: str | NotGiven = NOT_GIVEN, - type: Literal["droplets", "gpus"] | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + tag_name: str | Omit = omit, + type: Literal["droplets", "gpus"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GPUDropletListResponse: """ To list all Droplets in your account, send a GET request to `/v2/droplets`. @@ -626,7 +626,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: """ To delete a Droplet, send a DELETE request to `/v2/droplets/$DROPLET_ID`. @@ -663,7 +663,7 @@ def delete_by_tag( extra_headers: Headers | None = None, extra_query: 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: """ To delete **all** Droplets assigned to a specific tag, include the `tag_name` @@ -705,14 +705,14 @@ def list_firewalls( self, droplet_id: int, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> GPUDropletListFirewallsResponse: """ To retrieve a list of all firewalls available to a Droplet, send a GET request @@ -759,14 +759,14 @@ def list_kernels( self, droplet_id: int, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> GPUDropletListKernelsResponse: """ To retrieve a list of all kernels available to a Droplet, send a GET request to @@ -818,7 +818,7 @@ def list_neighbors( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GPUDropletListNeighborsResponse: """To retrieve a list of any "neighbors" (i.e. @@ -854,14 +854,14 @@ def list_snapshots( self, droplet_id: int, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> GPUDropletListSnapshotsResponse: """ To retrieve the snapshots that have been created from a Droplet, send a GET @@ -980,24 +980,24 @@ async def create( image: Union[str, int], name: str, size: str, - backup_policy: DropletBackupPolicyParam | NotGiven = NOT_GIVEN, - backups: bool | NotGiven = NOT_GIVEN, - ipv6: bool | NotGiven = NOT_GIVEN, - monitoring: bool | NotGiven = NOT_GIVEN, - private_networking: bool | NotGiven = NOT_GIVEN, - region: str | NotGiven = NOT_GIVEN, - ssh_keys: SequenceNotStr[Union[str, int]] | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - user_data: str | NotGiven = NOT_GIVEN, - volumes: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - vpc_uuid: str | NotGiven = NOT_GIVEN, - with_droplet_agent: bool | NotGiven = NOT_GIVEN, + backup_policy: DropletBackupPolicyParam | Omit = omit, + backups: bool | Omit = omit, + ipv6: bool | Omit = omit, + monitoring: bool | Omit = omit, + private_networking: bool | Omit = omit, + region: str | Omit = omit, + ssh_keys: SequenceNotStr[Union[str, int]] | Omit = omit, + tags: Optional[SequenceNotStr[str]] | Omit = omit, + user_data: str | Omit = omit, + volumes: SequenceNotStr[str] | Omit = omit, + vpc_uuid: str | Omit = omit, + with_droplet_agent: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GPUDropletCreateResponse: """ To create a new Droplet, send a POST request to `/v2/droplets` setting the @@ -1101,24 +1101,24 @@ async def create( image: Union[str, int], names: SequenceNotStr[str], size: str, - backup_policy: DropletBackupPolicyParam | NotGiven = NOT_GIVEN, - backups: bool | NotGiven = NOT_GIVEN, - ipv6: bool | NotGiven = NOT_GIVEN, - monitoring: bool | NotGiven = NOT_GIVEN, - private_networking: bool | NotGiven = NOT_GIVEN, - region: str | NotGiven = NOT_GIVEN, - ssh_keys: SequenceNotStr[Union[str, int]] | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - user_data: str | NotGiven = NOT_GIVEN, - volumes: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - vpc_uuid: str | NotGiven = NOT_GIVEN, - with_droplet_agent: bool | NotGiven = NOT_GIVEN, + backup_policy: DropletBackupPolicyParam | Omit = omit, + backups: bool | Omit = omit, + ipv6: bool | Omit = omit, + monitoring: bool | Omit = omit, + private_networking: bool | Omit = omit, + region: str | Omit = omit, + ssh_keys: SequenceNotStr[Union[str, int]] | Omit = omit, + tags: Optional[SequenceNotStr[str]] | Omit = omit, + user_data: str | Omit = omit, + volumes: SequenceNotStr[str] | Omit = omit, + vpc_uuid: str | Omit = omit, + with_droplet_agent: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GPUDropletCreateResponse: """ To create a new Droplet, send a POST request to `/v2/droplets` setting the @@ -1221,27 +1221,27 @@ async def create( self, *, image: Union[str, int], - name: str | NotGiven = NOT_GIVEN, + name: str | Omit = omit, size: str, - backup_policy: DropletBackupPolicyParam | NotGiven = NOT_GIVEN, - backups: bool | NotGiven = NOT_GIVEN, - ipv6: bool | NotGiven = NOT_GIVEN, - monitoring: bool | NotGiven = NOT_GIVEN, - private_networking: bool | NotGiven = NOT_GIVEN, - region: str | NotGiven = NOT_GIVEN, - ssh_keys: SequenceNotStr[Union[str, int]] | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - user_data: str | NotGiven = NOT_GIVEN, - volumes: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - vpc_uuid: str | NotGiven = NOT_GIVEN, - with_droplet_agent: bool | NotGiven = NOT_GIVEN, - names: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + backup_policy: DropletBackupPolicyParam | Omit = omit, + backups: bool | Omit = omit, + ipv6: bool | Omit = omit, + monitoring: bool | Omit = omit, + private_networking: bool | Omit = omit, + region: str | Omit = omit, + ssh_keys: SequenceNotStr[Union[str, int]] | Omit = omit, + tags: Optional[SequenceNotStr[str]] | Omit = omit, + user_data: str | Omit = omit, + volumes: SequenceNotStr[str] | Omit = omit, + vpc_uuid: str | Omit = omit, + with_droplet_agent: bool | Omit = omit, + names: SequenceNotStr[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, ) -> GPUDropletCreateResponse: return cast( GPUDropletCreateResponse, @@ -1286,7 +1286,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, ) -> GPUDropletRetrieveResponse: """ To show information about an individual Droplet, send a GET request to @@ -1314,17 +1314,17 @@ async def retrieve( async def list( self, *, - name: str | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - tag_name: str | NotGiven = NOT_GIVEN, - type: Literal["droplets", "gpus"] | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, + tag_name: str | Omit = omit, + type: Literal["droplets", "gpus"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GPUDropletListResponse: """ To list all Droplets in your account, send a GET request to `/v2/droplets`. @@ -1397,7 +1397,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: """ To delete a Droplet, send a DELETE request to `/v2/droplets/$DROPLET_ID`. @@ -1434,7 +1434,7 @@ async def delete_by_tag( extra_headers: Headers | None = None, extra_query: 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: """ To delete **all** Droplets assigned to a specific tag, include the `tag_name` @@ -1476,14 +1476,14 @@ async def list_firewalls( self, droplet_id: int, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> GPUDropletListFirewallsResponse: """ To retrieve a list of all firewalls available to a Droplet, send a GET request @@ -1530,14 +1530,14 @@ async def list_kernels( self, droplet_id: int, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> GPUDropletListKernelsResponse: """ To retrieve a list of all kernels available to a Droplet, send a GET request to @@ -1589,7 +1589,7 @@ async def list_neighbors( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GPUDropletListNeighborsResponse: """To retrieve a list of any "neighbors" (i.e. @@ -1625,14 +1625,14 @@ async def list_snapshots( self, droplet_id: int, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> GPUDropletListSnapshotsResponse: """ To retrieve the snapshots that have been created from a Droplet, send a GET diff --git a/src/gradient/resources/gpu_droplets/images/actions.py b/src/gradient/resources/gpu_droplets/images/actions.py index 287558ca..d2d33f11 100644 --- a/src/gradient/resources/gpu_droplets/images/actions.py +++ b/src/gradient/resources/gpu_droplets/images/actions.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 required_args, maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -55,7 +55,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, ) -> Action: """ The following actions are available on an Image. @@ -112,7 +112,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, ) -> Action: """ The following actions are available on an Image. @@ -167,13 +167,13 @@ def create( "tor1", "syd1", ] - | 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, ) -> Action: return self._post( f"/v2/images/{image_id}/actions" @@ -202,7 +202,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, ) -> Action: """ To retrieve the status of an image action, send a GET request to @@ -236,7 +236,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, ) -> ActionListResponse: """ To retrieve all actions that have been executed on an image, send a GET request @@ -293,7 +293,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, ) -> Action: """ The following actions are available on an Image. @@ -350,7 +350,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, ) -> Action: """ The following actions are available on an Image. @@ -405,13 +405,13 @@ async def create( "tor1", "syd1", ] - | 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, ) -> Action: return await self._post( f"/v2/images/{image_id}/actions" @@ -440,7 +440,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, ) -> Action: """ To retrieve the status of an image action, send a GET request to @@ -474,7 +474,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, ) -> ActionListResponse: """ To retrieve all actions that have been executed on an image, send a GET request diff --git a/src/gradient/resources/gpu_droplets/images/images.py b/src/gradient/resources/gpu_droplets/images/images.py index 1b00c024..83e04d13 100644 --- a/src/gradient/resources/gpu_droplets/images/images.py +++ b/src/gradient/resources/gpu_droplets/images/images.py @@ -15,7 +15,7 @@ ActionsResourceWithStreamingResponse, AsyncActionsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, SequenceNotStr +from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -62,7 +62,7 @@ def with_streaming_response(self) -> ImagesResourceWithStreamingResponse: def create( self, *, - description: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, distribution: Literal[ "Arch Linux", "CentOS", @@ -78,8 +78,8 @@ def create( "Ubuntu", "Unknown", ] - | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + | Omit = omit, + name: str | Omit = omit, region: Literal[ "ams1", "ams2", @@ -97,15 +97,15 @@ def create( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, + | Omit = omit, + tags: Optional[SequenceNotStr[str]] | Omit = omit, + url: 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, ) -> ImageCreateResponse: """To create a new custom image, send a POST request to /v2/images. @@ -176,7 +176,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, ) -> ImageRetrieveResponse: """ To retrieve information about an image, send a `GET` request to @@ -205,7 +205,7 @@ def update( self, image_id: int, *, - description: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, distribution: Literal[ "Arch Linux", "CentOS", @@ -221,14 +221,14 @@ def update( "Ubuntu", "Unknown", ] - | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, ) -> ImageUpdateResponse: """To update an image, send a `PUT` request to `/v2/images/$IMAGE_ID`. @@ -277,17 +277,17 @@ def update( def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - private: bool | NotGiven = NOT_GIVEN, - tag_name: str | NotGiven = NOT_GIVEN, - type: Literal["application", "distribution"] | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, + private: bool | Omit = omit, + tag_name: str | Omit = omit, + type: Literal["application", "distribution"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ImageListResponse: """ To list all of the images available on your account, send a GET request to @@ -374,7 +374,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: """ To delete a snapshot or custom image, send a `DELETE` request to @@ -428,7 +428,7 @@ def with_streaming_response(self) -> AsyncImagesResourceWithStreamingResponse: async def create( self, *, - description: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, distribution: Literal[ "Arch Linux", "CentOS", @@ -444,8 +444,8 @@ async def create( "Ubuntu", "Unknown", ] - | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + | Omit = omit, + name: str | Omit = omit, region: Literal[ "ams1", "ams2", @@ -463,15 +463,15 @@ async def create( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - url: str | NotGiven = NOT_GIVEN, + | Omit = omit, + tags: Optional[SequenceNotStr[str]] | Omit = omit, + url: 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, ) -> ImageCreateResponse: """To create a new custom image, send a POST request to /v2/images. @@ -542,7 +542,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, ) -> ImageRetrieveResponse: """ To retrieve information about an image, send a `GET` request to @@ -571,7 +571,7 @@ async def update( self, image_id: int, *, - description: str | NotGiven = NOT_GIVEN, + description: str | Omit = omit, distribution: Literal[ "Arch Linux", "CentOS", @@ -587,14 +587,14 @@ async def update( "Ubuntu", "Unknown", ] - | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + | Omit = omit, + name: 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, ) -> ImageUpdateResponse: """To update an image, send a `PUT` request to `/v2/images/$IMAGE_ID`. @@ -643,17 +643,17 @@ async def update( async def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - private: bool | NotGiven = NOT_GIVEN, - tag_name: str | NotGiven = NOT_GIVEN, - type: Literal["application", "distribution"] | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, + private: bool | Omit = omit, + tag_name: str | Omit = omit, + type: Literal["application", "distribution"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ImageListResponse: """ To list all of the images available on your account, send a GET request to @@ -740,7 +740,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: """ To delete a snapshot or custom image, send a `DELETE` request to diff --git a/src/gradient/resources/gpu_droplets/load_balancers/droplets.py b/src/gradient/resources/gpu_droplets/load_balancers/droplets.py index 4d8eb4c5..ddcdc63a 100644 --- a/src/gradient/resources/gpu_droplets/load_balancers/droplets.py +++ b/src/gradient/resources/gpu_droplets/load_balancers/droplets.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ...._types import Body, Query, Headers, NoneType, NotGiven, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -52,7 +52,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, ) -> None: """ To assign a Droplet to a load balancer instance, send a POST request to @@ -101,7 +101,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, ) -> None: """ To remove a Droplet from a load balancer instance, send a DELETE request to @@ -168,7 +168,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, ) -> None: """ To assign a Droplet to a load balancer instance, send a POST request to @@ -217,7 +217,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, ) -> None: """ To remove a Droplet from a load balancer instance, send a DELETE request to diff --git a/src/gradient/resources/gpu_droplets/load_balancers/forwarding_rules.py b/src/gradient/resources/gpu_droplets/load_balancers/forwarding_rules.py index c4be65e7..8f9092e0 100644 --- a/src/gradient/resources/gpu_droplets/load_balancers/forwarding_rules.py +++ b/src/gradient/resources/gpu_droplets/load_balancers/forwarding_rules.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ...._types import Body, Query, Headers, NoneType, NotGiven, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -53,7 +53,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, ) -> None: """ To add an additional forwarding rule to a load balancer instance, send a POST @@ -100,7 +100,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, ) -> None: """ To remove forwarding rules from a load balancer instance, send a DELETE request @@ -168,7 +168,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, ) -> None: """ To add an additional forwarding rule to a load balancer instance, send a POST @@ -215,7 +215,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, ) -> None: """ To remove forwarding rules from a load balancer instance, send a DELETE request diff --git a/src/gradient/resources/gpu_droplets/load_balancers/load_balancers.py b/src/gradient/resources/gpu_droplets/load_balancers/load_balancers.py index 8f11a5da..2a1e52d9 100644 --- a/src/gradient/resources/gpu_droplets/load_balancers/load_balancers.py +++ b/src/gradient/resources/gpu_droplets/load_balancers/load_balancers.py @@ -15,7 +15,7 @@ DropletsResourceWithStreamingResponse, AsyncDropletsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, SequenceNotStr +from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given from ...._utils import required_args, maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -86,21 +86,21 @@ def create( self, *, forwarding_rules: Iterable[ForwardingRuleParam], - algorithm: Literal["round_robin", "least_connections"] | NotGiven = NOT_GIVEN, - disable_lets_encrypt_dns_records: bool | NotGiven = NOT_GIVEN, - domains: Iterable[DomainsParam] | NotGiven = NOT_GIVEN, - droplet_ids: Iterable[int] | NotGiven = NOT_GIVEN, - enable_backend_keepalive: bool | NotGiven = NOT_GIVEN, - enable_proxy_protocol: bool | NotGiven = NOT_GIVEN, - firewall: LbFirewallParam | NotGiven = NOT_GIVEN, - glb_settings: GlbSettingsParam | NotGiven = NOT_GIVEN, - health_check: HealthCheckParam | NotGiven = NOT_GIVEN, - http_idle_timeout_seconds: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - network: Literal["EXTERNAL", "INTERNAL"] | NotGiven = NOT_GIVEN, - network_stack: Literal["IPV4", "DUALSTACK"] | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - redirect_http_to_https: bool | NotGiven = NOT_GIVEN, + algorithm: Literal["round_robin", "least_connections"] | Omit = omit, + disable_lets_encrypt_dns_records: bool | Omit = omit, + domains: Iterable[DomainsParam] | Omit = omit, + droplet_ids: Iterable[int] | Omit = omit, + enable_backend_keepalive: bool | Omit = omit, + enable_proxy_protocol: bool | Omit = omit, + firewall: LbFirewallParam | Omit = omit, + glb_settings: GlbSettingsParam | Omit = omit, + health_check: HealthCheckParam | Omit = omit, + http_idle_timeout_seconds: int | Omit = omit, + name: str | Omit = omit, + network: Literal["EXTERNAL", "INTERNAL"] | Omit = omit, + network_stack: Literal["IPV4", "DUALSTACK"] | Omit = omit, + project_id: str | Omit = omit, + redirect_http_to_https: bool | Omit = omit, region: Literal[ "ams1", "ams2", @@ -118,20 +118,20 @@ def create( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - size: Literal["lb-small", "lb-medium", "lb-large"] | NotGiven = NOT_GIVEN, - size_unit: int | NotGiven = NOT_GIVEN, - sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, - target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, - type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, - vpc_uuid: str | NotGiven = NOT_GIVEN, + | Omit = omit, + size: Literal["lb-small", "lb-medium", "lb-large"] | Omit = omit, + size_unit: int | Omit = omit, + sticky_sessions: StickySessionsParam | Omit = omit, + target_load_balancer_ids: SequenceNotStr[str] | Omit = omit, + tls_cipher_policy: Literal["DEFAULT", "STRONG"] | Omit = omit, + type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | Omit = omit, + vpc_uuid: 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, ) -> LoadBalancerCreateResponse: """ To create a new load balancer instance, send a POST request to @@ -245,20 +245,20 @@ def create( self, *, forwarding_rules: Iterable[ForwardingRuleParam], - algorithm: Literal["round_robin", "least_connections"] | NotGiven = NOT_GIVEN, - disable_lets_encrypt_dns_records: bool | NotGiven = NOT_GIVEN, - domains: Iterable[DomainsParam] | NotGiven = NOT_GIVEN, - enable_backend_keepalive: bool | NotGiven = NOT_GIVEN, - enable_proxy_protocol: bool | NotGiven = NOT_GIVEN, - firewall: LbFirewallParam | NotGiven = NOT_GIVEN, - glb_settings: GlbSettingsParam | NotGiven = NOT_GIVEN, - health_check: HealthCheckParam | NotGiven = NOT_GIVEN, - http_idle_timeout_seconds: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - network: Literal["EXTERNAL", "INTERNAL"] | NotGiven = NOT_GIVEN, - network_stack: Literal["IPV4", "DUALSTACK"] | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - redirect_http_to_https: bool | NotGiven = NOT_GIVEN, + algorithm: Literal["round_robin", "least_connections"] | Omit = omit, + disable_lets_encrypt_dns_records: bool | Omit = omit, + domains: Iterable[DomainsParam] | Omit = omit, + enable_backend_keepalive: bool | Omit = omit, + enable_proxy_protocol: bool | Omit = omit, + firewall: LbFirewallParam | Omit = omit, + glb_settings: GlbSettingsParam | Omit = omit, + health_check: HealthCheckParam | Omit = omit, + http_idle_timeout_seconds: int | Omit = omit, + name: str | Omit = omit, + network: Literal["EXTERNAL", "INTERNAL"] | Omit = omit, + network_stack: Literal["IPV4", "DUALSTACK"] | Omit = omit, + project_id: str | Omit = omit, + redirect_http_to_https: bool | Omit = omit, region: Literal[ "ams1", "ams2", @@ -276,21 +276,21 @@ def create( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - size: Literal["lb-small", "lb-medium", "lb-large"] | NotGiven = NOT_GIVEN, - size_unit: int | NotGiven = NOT_GIVEN, - sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, - tag: str | NotGiven = NOT_GIVEN, - target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, - type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, - vpc_uuid: str | NotGiven = NOT_GIVEN, + | Omit = omit, + size: Literal["lb-small", "lb-medium", "lb-large"] | Omit = omit, + size_unit: int | Omit = omit, + sticky_sessions: StickySessionsParam | Omit = omit, + tag: str | Omit = omit, + target_load_balancer_ids: SequenceNotStr[str] | Omit = omit, + tls_cipher_policy: Literal["DEFAULT", "STRONG"] | Omit = omit, + type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | Omit = omit, + vpc_uuid: 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, ) -> LoadBalancerCreateResponse: """ To create a new load balancer instance, send a POST request to @@ -405,21 +405,21 @@ def create( self, *, forwarding_rules: Iterable[ForwardingRuleParam], - algorithm: Literal["round_robin", "least_connections"] | NotGiven = NOT_GIVEN, - disable_lets_encrypt_dns_records: bool | NotGiven = NOT_GIVEN, - domains: Iterable[DomainsParam] | NotGiven = NOT_GIVEN, - droplet_ids: Iterable[int] | NotGiven = NOT_GIVEN, - enable_backend_keepalive: bool | NotGiven = NOT_GIVEN, - enable_proxy_protocol: bool | NotGiven = NOT_GIVEN, - firewall: LbFirewallParam | NotGiven = NOT_GIVEN, - glb_settings: GlbSettingsParam | NotGiven = NOT_GIVEN, - health_check: HealthCheckParam | NotGiven = NOT_GIVEN, - http_idle_timeout_seconds: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - network: Literal["EXTERNAL", "INTERNAL"] | NotGiven = NOT_GIVEN, - network_stack: Literal["IPV4", "DUALSTACK"] | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - redirect_http_to_https: bool | NotGiven = NOT_GIVEN, + algorithm: Literal["round_robin", "least_connections"] | Omit = omit, + disable_lets_encrypt_dns_records: bool | Omit = omit, + domains: Iterable[DomainsParam] | Omit = omit, + droplet_ids: Iterable[int] | Omit = omit, + enable_backend_keepalive: bool | Omit = omit, + enable_proxy_protocol: bool | Omit = omit, + firewall: LbFirewallParam | Omit = omit, + glb_settings: GlbSettingsParam | Omit = omit, + health_check: HealthCheckParam | Omit = omit, + http_idle_timeout_seconds: int | Omit = omit, + name: str | Omit = omit, + network: Literal["EXTERNAL", "INTERNAL"] | Omit = omit, + network_stack: Literal["IPV4", "DUALSTACK"] | Omit = omit, + project_id: str | Omit = omit, + redirect_http_to_https: bool | Omit = omit, region: Literal[ "ams1", "ams2", @@ -437,21 +437,21 @@ def create( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - size: Literal["lb-small", "lb-medium", "lb-large"] | NotGiven = NOT_GIVEN, - size_unit: int | NotGiven = NOT_GIVEN, - sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, - target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, - type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, - vpc_uuid: str | NotGiven = NOT_GIVEN, - tag: str | NotGiven = NOT_GIVEN, + | Omit = omit, + size: Literal["lb-small", "lb-medium", "lb-large"] | Omit = omit, + size_unit: int | Omit = omit, + sticky_sessions: StickySessionsParam | Omit = omit, + target_load_balancer_ids: SequenceNotStr[str] | Omit = omit, + tls_cipher_policy: Literal["DEFAULT", "STRONG"] | Omit = omit, + type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | Omit = omit, + vpc_uuid: str | Omit = omit, + tag: 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, ) -> LoadBalancerCreateResponse: return self._post( "/v2/load_balancers" @@ -502,7 +502,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, ) -> LoadBalancerRetrieveResponse: """ To show information about a load balancer instance, send a GET request to @@ -535,21 +535,21 @@ def update( lb_id: str, *, forwarding_rules: Iterable[ForwardingRuleParam], - algorithm: Literal["round_robin", "least_connections"] | NotGiven = NOT_GIVEN, - disable_lets_encrypt_dns_records: bool | NotGiven = NOT_GIVEN, - domains: Iterable[DomainsParam] | NotGiven = NOT_GIVEN, - droplet_ids: Iterable[int] | NotGiven = NOT_GIVEN, - enable_backend_keepalive: bool | NotGiven = NOT_GIVEN, - enable_proxy_protocol: bool | NotGiven = NOT_GIVEN, - firewall: LbFirewallParam | NotGiven = NOT_GIVEN, - glb_settings: GlbSettingsParam | NotGiven = NOT_GIVEN, - health_check: HealthCheckParam | NotGiven = NOT_GIVEN, - http_idle_timeout_seconds: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - network: Literal["EXTERNAL", "INTERNAL"] | NotGiven = NOT_GIVEN, - network_stack: Literal["IPV4", "DUALSTACK"] | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - redirect_http_to_https: bool | NotGiven = NOT_GIVEN, + algorithm: Literal["round_robin", "least_connections"] | Omit = omit, + disable_lets_encrypt_dns_records: bool | Omit = omit, + domains: Iterable[DomainsParam] | Omit = omit, + droplet_ids: Iterable[int] | Omit = omit, + enable_backend_keepalive: bool | Omit = omit, + enable_proxy_protocol: bool | Omit = omit, + firewall: LbFirewallParam | Omit = omit, + glb_settings: GlbSettingsParam | Omit = omit, + health_check: HealthCheckParam | Omit = omit, + http_idle_timeout_seconds: int | Omit = omit, + name: str | Omit = omit, + network: Literal["EXTERNAL", "INTERNAL"] | Omit = omit, + network_stack: Literal["IPV4", "DUALSTACK"] | Omit = omit, + project_id: str | Omit = omit, + redirect_http_to_https: bool | Omit = omit, region: Literal[ "ams1", "ams2", @@ -567,20 +567,20 @@ def update( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - size: Literal["lb-small", "lb-medium", "lb-large"] | NotGiven = NOT_GIVEN, - size_unit: int | NotGiven = NOT_GIVEN, - sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, - target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, - type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, - vpc_uuid: str | NotGiven = NOT_GIVEN, + | Omit = omit, + size: Literal["lb-small", "lb-medium", "lb-large"] | Omit = omit, + size_unit: int | Omit = omit, + sticky_sessions: StickySessionsParam | Omit = omit, + target_load_balancer_ids: SequenceNotStr[str] | Omit = omit, + tls_cipher_policy: Literal["DEFAULT", "STRONG"] | Omit = omit, + type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | Omit = omit, + vpc_uuid: 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, ) -> LoadBalancerUpdateResponse: """ To update a load balancer's settings, send a PUT request to @@ -689,20 +689,20 @@ def update( lb_id: str, *, forwarding_rules: Iterable[ForwardingRuleParam], - algorithm: Literal["round_robin", "least_connections"] | NotGiven = NOT_GIVEN, - disable_lets_encrypt_dns_records: bool | NotGiven = NOT_GIVEN, - domains: Iterable[DomainsParam] | NotGiven = NOT_GIVEN, - enable_backend_keepalive: bool | NotGiven = NOT_GIVEN, - enable_proxy_protocol: bool | NotGiven = NOT_GIVEN, - firewall: LbFirewallParam | NotGiven = NOT_GIVEN, - glb_settings: GlbSettingsParam | NotGiven = NOT_GIVEN, - health_check: HealthCheckParam | NotGiven = NOT_GIVEN, - http_idle_timeout_seconds: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - network: Literal["EXTERNAL", "INTERNAL"] | NotGiven = NOT_GIVEN, - network_stack: Literal["IPV4", "DUALSTACK"] | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - redirect_http_to_https: bool | NotGiven = NOT_GIVEN, + algorithm: Literal["round_robin", "least_connections"] | Omit = omit, + disable_lets_encrypt_dns_records: bool | Omit = omit, + domains: Iterable[DomainsParam] | Omit = omit, + enable_backend_keepalive: bool | Omit = omit, + enable_proxy_protocol: bool | Omit = omit, + firewall: LbFirewallParam | Omit = omit, + glb_settings: GlbSettingsParam | Omit = omit, + health_check: HealthCheckParam | Omit = omit, + http_idle_timeout_seconds: int | Omit = omit, + name: str | Omit = omit, + network: Literal["EXTERNAL", "INTERNAL"] | Omit = omit, + network_stack: Literal["IPV4", "DUALSTACK"] | Omit = omit, + project_id: str | Omit = omit, + redirect_http_to_https: bool | Omit = omit, region: Literal[ "ams1", "ams2", @@ -720,21 +720,21 @@ def update( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - size: Literal["lb-small", "lb-medium", "lb-large"] | NotGiven = NOT_GIVEN, - size_unit: int | NotGiven = NOT_GIVEN, - sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, - tag: str | NotGiven = NOT_GIVEN, - target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, - type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, - vpc_uuid: str | NotGiven = NOT_GIVEN, + | Omit = omit, + size: Literal["lb-small", "lb-medium", "lb-large"] | Omit = omit, + size_unit: int | Omit = omit, + sticky_sessions: StickySessionsParam | Omit = omit, + tag: str | Omit = omit, + target_load_balancer_ids: SequenceNotStr[str] | Omit = omit, + tls_cipher_policy: Literal["DEFAULT", "STRONG"] | Omit = omit, + type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | Omit = omit, + vpc_uuid: 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, ) -> LoadBalancerUpdateResponse: """ To update a load balancer's settings, send a PUT request to @@ -844,21 +844,21 @@ def update( lb_id: str, *, forwarding_rules: Iterable[ForwardingRuleParam], - algorithm: Literal["round_robin", "least_connections"] | NotGiven = NOT_GIVEN, - disable_lets_encrypt_dns_records: bool | NotGiven = NOT_GIVEN, - domains: Iterable[DomainsParam] | NotGiven = NOT_GIVEN, - droplet_ids: Iterable[int] | NotGiven = NOT_GIVEN, - enable_backend_keepalive: bool | NotGiven = NOT_GIVEN, - enable_proxy_protocol: bool | NotGiven = NOT_GIVEN, - firewall: LbFirewallParam | NotGiven = NOT_GIVEN, - glb_settings: GlbSettingsParam | NotGiven = NOT_GIVEN, - health_check: HealthCheckParam | NotGiven = NOT_GIVEN, - http_idle_timeout_seconds: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - network: Literal["EXTERNAL", "INTERNAL"] | NotGiven = NOT_GIVEN, - network_stack: Literal["IPV4", "DUALSTACK"] | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - redirect_http_to_https: bool | NotGiven = NOT_GIVEN, + algorithm: Literal["round_robin", "least_connections"] | Omit = omit, + disable_lets_encrypt_dns_records: bool | Omit = omit, + domains: Iterable[DomainsParam] | Omit = omit, + droplet_ids: Iterable[int] | Omit = omit, + enable_backend_keepalive: bool | Omit = omit, + enable_proxy_protocol: bool | Omit = omit, + firewall: LbFirewallParam | Omit = omit, + glb_settings: GlbSettingsParam | Omit = omit, + health_check: HealthCheckParam | Omit = omit, + http_idle_timeout_seconds: int | Omit = omit, + name: str | Omit = omit, + network: Literal["EXTERNAL", "INTERNAL"] | Omit = omit, + network_stack: Literal["IPV4", "DUALSTACK"] | Omit = omit, + project_id: str | Omit = omit, + redirect_http_to_https: bool | Omit = omit, region: Literal[ "ams1", "ams2", @@ -876,21 +876,21 @@ def update( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - size: Literal["lb-small", "lb-medium", "lb-large"] | NotGiven = NOT_GIVEN, - size_unit: int | NotGiven = NOT_GIVEN, - sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, - target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, - type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, - vpc_uuid: str | NotGiven = NOT_GIVEN, - tag: str | NotGiven = NOT_GIVEN, + | Omit = omit, + size: Literal["lb-small", "lb-medium", "lb-large"] | Omit = omit, + size_unit: int | Omit = omit, + sticky_sessions: StickySessionsParam | Omit = omit, + target_load_balancer_ids: SequenceNotStr[str] | Omit = omit, + tls_cipher_policy: Literal["DEFAULT", "STRONG"] | Omit = omit, + type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | Omit = omit, + vpc_uuid: str | Omit = omit, + tag: 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, ) -> LoadBalancerUpdateResponse: if not lb_id: raise ValueError(f"Expected a non-empty value for `lb_id` but received {lb_id!r}") @@ -937,14 +937,14 @@ def update( def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> LoadBalancerListResponse: """ To list all of the load balancer instances on your account, send a GET request @@ -992,7 +992,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: """ To delete a load balancer instance, disassociating any Droplets assigned to it @@ -1033,7 +1033,7 @@ def delete_cache( extra_headers: Headers | None = None, extra_query: 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: """ To delete a Global load balancer CDN cache, send a DELETE request to @@ -1098,21 +1098,21 @@ async def create( self, *, forwarding_rules: Iterable[ForwardingRuleParam], - algorithm: Literal["round_robin", "least_connections"] | NotGiven = NOT_GIVEN, - disable_lets_encrypt_dns_records: bool | NotGiven = NOT_GIVEN, - domains: Iterable[DomainsParam] | NotGiven = NOT_GIVEN, - droplet_ids: Iterable[int] | NotGiven = NOT_GIVEN, - enable_backend_keepalive: bool | NotGiven = NOT_GIVEN, - enable_proxy_protocol: bool | NotGiven = NOT_GIVEN, - firewall: LbFirewallParam | NotGiven = NOT_GIVEN, - glb_settings: GlbSettingsParam | NotGiven = NOT_GIVEN, - health_check: HealthCheckParam | NotGiven = NOT_GIVEN, - http_idle_timeout_seconds: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - network: Literal["EXTERNAL", "INTERNAL"] | NotGiven = NOT_GIVEN, - network_stack: Literal["IPV4", "DUALSTACK"] | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - redirect_http_to_https: bool | NotGiven = NOT_GIVEN, + algorithm: Literal["round_robin", "least_connections"] | Omit = omit, + disable_lets_encrypt_dns_records: bool | Omit = omit, + domains: Iterable[DomainsParam] | Omit = omit, + droplet_ids: Iterable[int] | Omit = omit, + enable_backend_keepalive: bool | Omit = omit, + enable_proxy_protocol: bool | Omit = omit, + firewall: LbFirewallParam | Omit = omit, + glb_settings: GlbSettingsParam | Omit = omit, + health_check: HealthCheckParam | Omit = omit, + http_idle_timeout_seconds: int | Omit = omit, + name: str | Omit = omit, + network: Literal["EXTERNAL", "INTERNAL"] | Omit = omit, + network_stack: Literal["IPV4", "DUALSTACK"] | Omit = omit, + project_id: str | Omit = omit, + redirect_http_to_https: bool | Omit = omit, region: Literal[ "ams1", "ams2", @@ -1130,20 +1130,20 @@ async def create( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - size: Literal["lb-small", "lb-medium", "lb-large"] | NotGiven = NOT_GIVEN, - size_unit: int | NotGiven = NOT_GIVEN, - sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, - target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, - type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, - vpc_uuid: str | NotGiven = NOT_GIVEN, + | Omit = omit, + size: Literal["lb-small", "lb-medium", "lb-large"] | Omit = omit, + size_unit: int | Omit = omit, + sticky_sessions: StickySessionsParam | Omit = omit, + target_load_balancer_ids: SequenceNotStr[str] | Omit = omit, + tls_cipher_policy: Literal["DEFAULT", "STRONG"] | Omit = omit, + type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | Omit = omit, + vpc_uuid: 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, ) -> LoadBalancerCreateResponse: """ To create a new load balancer instance, send a POST request to @@ -1257,20 +1257,20 @@ async def create( self, *, forwarding_rules: Iterable[ForwardingRuleParam], - algorithm: Literal["round_robin", "least_connections"] | NotGiven = NOT_GIVEN, - disable_lets_encrypt_dns_records: bool | NotGiven = NOT_GIVEN, - domains: Iterable[DomainsParam] | NotGiven = NOT_GIVEN, - enable_backend_keepalive: bool | NotGiven = NOT_GIVEN, - enable_proxy_protocol: bool | NotGiven = NOT_GIVEN, - firewall: LbFirewallParam | NotGiven = NOT_GIVEN, - glb_settings: GlbSettingsParam | NotGiven = NOT_GIVEN, - health_check: HealthCheckParam | NotGiven = NOT_GIVEN, - http_idle_timeout_seconds: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - network: Literal["EXTERNAL", "INTERNAL"] | NotGiven = NOT_GIVEN, - network_stack: Literal["IPV4", "DUALSTACK"] | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - redirect_http_to_https: bool | NotGiven = NOT_GIVEN, + algorithm: Literal["round_robin", "least_connections"] | Omit = omit, + disable_lets_encrypt_dns_records: bool | Omit = omit, + domains: Iterable[DomainsParam] | Omit = omit, + enable_backend_keepalive: bool | Omit = omit, + enable_proxy_protocol: bool | Omit = omit, + firewall: LbFirewallParam | Omit = omit, + glb_settings: GlbSettingsParam | Omit = omit, + health_check: HealthCheckParam | Omit = omit, + http_idle_timeout_seconds: int | Omit = omit, + name: str | Omit = omit, + network: Literal["EXTERNAL", "INTERNAL"] | Omit = omit, + network_stack: Literal["IPV4", "DUALSTACK"] | Omit = omit, + project_id: str | Omit = omit, + redirect_http_to_https: bool | Omit = omit, region: Literal[ "ams1", "ams2", @@ -1288,21 +1288,21 @@ async def create( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - size: Literal["lb-small", "lb-medium", "lb-large"] | NotGiven = NOT_GIVEN, - size_unit: int | NotGiven = NOT_GIVEN, - sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, - tag: str | NotGiven = NOT_GIVEN, - target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, - type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, - vpc_uuid: str | NotGiven = NOT_GIVEN, + | Omit = omit, + size: Literal["lb-small", "lb-medium", "lb-large"] | Omit = omit, + size_unit: int | Omit = omit, + sticky_sessions: StickySessionsParam | Omit = omit, + tag: str | Omit = omit, + target_load_balancer_ids: SequenceNotStr[str] | Omit = omit, + tls_cipher_policy: Literal["DEFAULT", "STRONG"] | Omit = omit, + type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | Omit = omit, + vpc_uuid: 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, ) -> LoadBalancerCreateResponse: """ To create a new load balancer instance, send a POST request to @@ -1417,21 +1417,21 @@ async def create( self, *, forwarding_rules: Iterable[ForwardingRuleParam], - algorithm: Literal["round_robin", "least_connections"] | NotGiven = NOT_GIVEN, - disable_lets_encrypt_dns_records: bool | NotGiven = NOT_GIVEN, - domains: Iterable[DomainsParam] | NotGiven = NOT_GIVEN, - droplet_ids: Iterable[int] | NotGiven = NOT_GIVEN, - enable_backend_keepalive: bool | NotGiven = NOT_GIVEN, - enable_proxy_protocol: bool | NotGiven = NOT_GIVEN, - firewall: LbFirewallParam | NotGiven = NOT_GIVEN, - glb_settings: GlbSettingsParam | NotGiven = NOT_GIVEN, - health_check: HealthCheckParam | NotGiven = NOT_GIVEN, - http_idle_timeout_seconds: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - network: Literal["EXTERNAL", "INTERNAL"] | NotGiven = NOT_GIVEN, - network_stack: Literal["IPV4", "DUALSTACK"] | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - redirect_http_to_https: bool | NotGiven = NOT_GIVEN, + algorithm: Literal["round_robin", "least_connections"] | Omit = omit, + disable_lets_encrypt_dns_records: bool | Omit = omit, + domains: Iterable[DomainsParam] | Omit = omit, + droplet_ids: Iterable[int] | Omit = omit, + enable_backend_keepalive: bool | Omit = omit, + enable_proxy_protocol: bool | Omit = omit, + firewall: LbFirewallParam | Omit = omit, + glb_settings: GlbSettingsParam | Omit = omit, + health_check: HealthCheckParam | Omit = omit, + http_idle_timeout_seconds: int | Omit = omit, + name: str | Omit = omit, + network: Literal["EXTERNAL", "INTERNAL"] | Omit = omit, + network_stack: Literal["IPV4", "DUALSTACK"] | Omit = omit, + project_id: str | Omit = omit, + redirect_http_to_https: bool | Omit = omit, region: Literal[ "ams1", "ams2", @@ -1449,21 +1449,21 @@ async def create( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - size: Literal["lb-small", "lb-medium", "lb-large"] | NotGiven = NOT_GIVEN, - size_unit: int | NotGiven = NOT_GIVEN, - sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, - target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, - type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, - vpc_uuid: str | NotGiven = NOT_GIVEN, - tag: str | NotGiven = NOT_GIVEN, + | Omit = omit, + size: Literal["lb-small", "lb-medium", "lb-large"] | Omit = omit, + size_unit: int | Omit = omit, + sticky_sessions: StickySessionsParam | Omit = omit, + target_load_balancer_ids: SequenceNotStr[str] | Omit = omit, + tls_cipher_policy: Literal["DEFAULT", "STRONG"] | Omit = omit, + type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | Omit = omit, + vpc_uuid: str | Omit = omit, + tag: 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, ) -> LoadBalancerCreateResponse: return await self._post( "/v2/load_balancers" @@ -1514,7 +1514,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, ) -> LoadBalancerRetrieveResponse: """ To show information about a load balancer instance, send a GET request to @@ -1547,21 +1547,21 @@ async def update( lb_id: str, *, forwarding_rules: Iterable[ForwardingRuleParam], - algorithm: Literal["round_robin", "least_connections"] | NotGiven = NOT_GIVEN, - disable_lets_encrypt_dns_records: bool | NotGiven = NOT_GIVEN, - domains: Iterable[DomainsParam] | NotGiven = NOT_GIVEN, - droplet_ids: Iterable[int] | NotGiven = NOT_GIVEN, - enable_backend_keepalive: bool | NotGiven = NOT_GIVEN, - enable_proxy_protocol: bool | NotGiven = NOT_GIVEN, - firewall: LbFirewallParam | NotGiven = NOT_GIVEN, - glb_settings: GlbSettingsParam | NotGiven = NOT_GIVEN, - health_check: HealthCheckParam | NotGiven = NOT_GIVEN, - http_idle_timeout_seconds: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - network: Literal["EXTERNAL", "INTERNAL"] | NotGiven = NOT_GIVEN, - network_stack: Literal["IPV4", "DUALSTACK"] | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - redirect_http_to_https: bool | NotGiven = NOT_GIVEN, + algorithm: Literal["round_robin", "least_connections"] | Omit = omit, + disable_lets_encrypt_dns_records: bool | Omit = omit, + domains: Iterable[DomainsParam] | Omit = omit, + droplet_ids: Iterable[int] | Omit = omit, + enable_backend_keepalive: bool | Omit = omit, + enable_proxy_protocol: bool | Omit = omit, + firewall: LbFirewallParam | Omit = omit, + glb_settings: GlbSettingsParam | Omit = omit, + health_check: HealthCheckParam | Omit = omit, + http_idle_timeout_seconds: int | Omit = omit, + name: str | Omit = omit, + network: Literal["EXTERNAL", "INTERNAL"] | Omit = omit, + network_stack: Literal["IPV4", "DUALSTACK"] | Omit = omit, + project_id: str | Omit = omit, + redirect_http_to_https: bool | Omit = omit, region: Literal[ "ams1", "ams2", @@ -1579,20 +1579,20 @@ async def update( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - size: Literal["lb-small", "lb-medium", "lb-large"] | NotGiven = NOT_GIVEN, - size_unit: int | NotGiven = NOT_GIVEN, - sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, - target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, - type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, - vpc_uuid: str | NotGiven = NOT_GIVEN, + | Omit = omit, + size: Literal["lb-small", "lb-medium", "lb-large"] | Omit = omit, + size_unit: int | Omit = omit, + sticky_sessions: StickySessionsParam | Omit = omit, + target_load_balancer_ids: SequenceNotStr[str] | Omit = omit, + tls_cipher_policy: Literal["DEFAULT", "STRONG"] | Omit = omit, + type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | Omit = omit, + vpc_uuid: 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, ) -> LoadBalancerUpdateResponse: """ To update a load balancer's settings, send a PUT request to @@ -1701,20 +1701,20 @@ async def update( lb_id: str, *, forwarding_rules: Iterable[ForwardingRuleParam], - algorithm: Literal["round_robin", "least_connections"] | NotGiven = NOT_GIVEN, - disable_lets_encrypt_dns_records: bool | NotGiven = NOT_GIVEN, - domains: Iterable[DomainsParam] | NotGiven = NOT_GIVEN, - enable_backend_keepalive: bool | NotGiven = NOT_GIVEN, - enable_proxy_protocol: bool | NotGiven = NOT_GIVEN, - firewall: LbFirewallParam | NotGiven = NOT_GIVEN, - glb_settings: GlbSettingsParam | NotGiven = NOT_GIVEN, - health_check: HealthCheckParam | NotGiven = NOT_GIVEN, - http_idle_timeout_seconds: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - network: Literal["EXTERNAL", "INTERNAL"] | NotGiven = NOT_GIVEN, - network_stack: Literal["IPV4", "DUALSTACK"] | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - redirect_http_to_https: bool | NotGiven = NOT_GIVEN, + algorithm: Literal["round_robin", "least_connections"] | Omit = omit, + disable_lets_encrypt_dns_records: bool | Omit = omit, + domains: Iterable[DomainsParam] | Omit = omit, + enable_backend_keepalive: bool | Omit = omit, + enable_proxy_protocol: bool | Omit = omit, + firewall: LbFirewallParam | Omit = omit, + glb_settings: GlbSettingsParam | Omit = omit, + health_check: HealthCheckParam | Omit = omit, + http_idle_timeout_seconds: int | Omit = omit, + name: str | Omit = omit, + network: Literal["EXTERNAL", "INTERNAL"] | Omit = omit, + network_stack: Literal["IPV4", "DUALSTACK"] | Omit = omit, + project_id: str | Omit = omit, + redirect_http_to_https: bool | Omit = omit, region: Literal[ "ams1", "ams2", @@ -1732,21 +1732,21 @@ async def update( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - size: Literal["lb-small", "lb-medium", "lb-large"] | NotGiven = NOT_GIVEN, - size_unit: int | NotGiven = NOT_GIVEN, - sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, - tag: str | NotGiven = NOT_GIVEN, - target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, - type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, - vpc_uuid: str | NotGiven = NOT_GIVEN, + | Omit = omit, + size: Literal["lb-small", "lb-medium", "lb-large"] | Omit = omit, + size_unit: int | Omit = omit, + sticky_sessions: StickySessionsParam | Omit = omit, + tag: str | Omit = omit, + target_load_balancer_ids: SequenceNotStr[str] | Omit = omit, + tls_cipher_policy: Literal["DEFAULT", "STRONG"] | Omit = omit, + type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | Omit = omit, + vpc_uuid: 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, ) -> LoadBalancerUpdateResponse: """ To update a load balancer's settings, send a PUT request to @@ -1856,21 +1856,21 @@ async def update( lb_id: str, *, forwarding_rules: Iterable[ForwardingRuleParam], - algorithm: Literal["round_robin", "least_connections"] | NotGiven = NOT_GIVEN, - disable_lets_encrypt_dns_records: bool | NotGiven = NOT_GIVEN, - domains: Iterable[DomainsParam] | NotGiven = NOT_GIVEN, - droplet_ids: Iterable[int] | NotGiven = NOT_GIVEN, - enable_backend_keepalive: bool | NotGiven = NOT_GIVEN, - enable_proxy_protocol: bool | NotGiven = NOT_GIVEN, - firewall: LbFirewallParam | NotGiven = NOT_GIVEN, - glb_settings: GlbSettingsParam | NotGiven = NOT_GIVEN, - health_check: HealthCheckParam | NotGiven = NOT_GIVEN, - http_idle_timeout_seconds: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - network: Literal["EXTERNAL", "INTERNAL"] | NotGiven = NOT_GIVEN, - network_stack: Literal["IPV4", "DUALSTACK"] | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - redirect_http_to_https: bool | NotGiven = NOT_GIVEN, + algorithm: Literal["round_robin", "least_connections"] | Omit = omit, + disable_lets_encrypt_dns_records: bool | Omit = omit, + domains: Iterable[DomainsParam] | Omit = omit, + droplet_ids: Iterable[int] | Omit = omit, + enable_backend_keepalive: bool | Omit = omit, + enable_proxy_protocol: bool | Omit = omit, + firewall: LbFirewallParam | Omit = omit, + glb_settings: GlbSettingsParam | Omit = omit, + health_check: HealthCheckParam | Omit = omit, + http_idle_timeout_seconds: int | Omit = omit, + name: str | Omit = omit, + network: Literal["EXTERNAL", "INTERNAL"] | Omit = omit, + network_stack: Literal["IPV4", "DUALSTACK"] | Omit = omit, + project_id: str | Omit = omit, + redirect_http_to_https: bool | Omit = omit, region: Literal[ "ams1", "ams2", @@ -1888,21 +1888,21 @@ async def update( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - size: Literal["lb-small", "lb-medium", "lb-large"] | NotGiven = NOT_GIVEN, - size_unit: int | NotGiven = NOT_GIVEN, - sticky_sessions: StickySessionsParam | NotGiven = NOT_GIVEN, - target_load_balancer_ids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - tls_cipher_policy: Literal["DEFAULT", "STRONG"] | NotGiven = NOT_GIVEN, - type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | NotGiven = NOT_GIVEN, - vpc_uuid: str | NotGiven = NOT_GIVEN, - tag: str | NotGiven = NOT_GIVEN, + | Omit = omit, + size: Literal["lb-small", "lb-medium", "lb-large"] | Omit = omit, + size_unit: int | Omit = omit, + sticky_sessions: StickySessionsParam | Omit = omit, + target_load_balancer_ids: SequenceNotStr[str] | Omit = omit, + tls_cipher_policy: Literal["DEFAULT", "STRONG"] | Omit = omit, + type: Literal["REGIONAL", "REGIONAL_NETWORK", "GLOBAL"] | Omit = omit, + vpc_uuid: str | Omit = omit, + tag: 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, ) -> LoadBalancerUpdateResponse: if not lb_id: raise ValueError(f"Expected a non-empty value for `lb_id` but received {lb_id!r}") @@ -1949,14 +1949,14 @@ async def update( async def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> LoadBalancerListResponse: """ To list all of the load balancer instances on your account, send a GET request @@ -2004,7 +2004,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: """ To delete a load balancer instance, disassociating any Droplets assigned to it @@ -2045,7 +2045,7 @@ async def delete_cache( extra_headers: Headers | None = None, extra_query: 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: """ To delete a Global load balancer CDN cache, send a DELETE request to diff --git a/src/gradient/resources/gpu_droplets/sizes.py b/src/gradient/resources/gpu_droplets/sizes.py index 7cfc5629..9893903f 100644 --- a/src/gradient/resources/gpu_droplets/sizes.py +++ b/src/gradient/resources/gpu_droplets/sizes.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,14 +44,14 @@ def with_streaming_response(self) -> SizesResourceWithStreamingResponse: def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> SizeListResponse: """To list all of available Droplet sizes, send a GET request to `/v2/sizes`. @@ -115,14 +115,14 @@ def with_streaming_response(self) -> AsyncSizesResourceWithStreamingResponse: async def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> SizeListResponse: """To list all of available Droplet sizes, send a GET request to `/v2/sizes`. diff --git a/src/gradient/resources/gpu_droplets/snapshots.py b/src/gradient/resources/gpu_droplets/snapshots.py index eed93cfd..78bd01ac 100644 --- a/src/gradient/resources/gpu_droplets/snapshots.py +++ b/src/gradient/resources/gpu_droplets/snapshots.py @@ -7,7 +7,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, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -54,7 +54,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, ) -> SnapshotRetrieveResponse: """ To retrieve information about a snapshot, send a GET request to @@ -87,15 +87,15 @@ def retrieve( def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - resource_type: Literal["droplet", "volume"] | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, + resource_type: Literal["droplet", "volume"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SnapshotListResponse: """ To list all of the snapshots available on your account, send a GET request to @@ -162,7 +162,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: """ Both Droplet and volume snapshots are managed through the `/v2/snapshots/` @@ -224,7 +224,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, ) -> SnapshotRetrieveResponse: """ To retrieve information about a snapshot, send a GET request to @@ -257,15 +257,15 @@ async def retrieve( async def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - resource_type: Literal["droplet", "volume"] | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, + resource_type: Literal["droplet", "volume"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SnapshotListResponse: """ To list all of the snapshots available on your account, send a GET request to @@ -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, ) -> None: """ Both Droplet and volume snapshots are managed through the `/v2/snapshots/` diff --git a/src/gradient/resources/gpu_droplets/volumes/actions.py b/src/gradient/resources/gpu_droplets/volumes/actions.py index c648beaa..1c0c66a0 100644 --- a/src/gradient/resources/gpu_droplets/volumes/actions.py +++ b/src/gradient/resources/gpu_droplets/volumes/actions.py @@ -7,7 +7,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 required_args, maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -57,14 +57,14 @@ def retrieve( action_id: int, *, volume_id: str, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> ActionRetrieveResponse: """ To retrieve the status of a volume action, send a GET request to @@ -109,14 +109,14 @@ def list( self, volume_id: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> ActionListResponse: """ To retrieve all actions that have been executed on a volume, send a GET request @@ -164,8 +164,8 @@ def initiate_by_id( *, droplet_id: int, type: Literal["attach", "detach", "resize"], - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, region: Literal[ "ams1", "ams2", @@ -183,14 +183,14 @@ def initiate_by_id( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + | Omit = omit, + tags: Optional[SequenceNotStr[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, ) -> ActionInitiateByIDResponse: """ To initiate an action on a block storage volume by Id, send a POST request to @@ -265,8 +265,8 @@ def initiate_by_id( *, droplet_id: int, type: Literal["attach", "detach", "resize"], - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, region: Literal[ "ams1", "ams2", @@ -284,13 +284,13 @@ def initiate_by_id( "tor1", "syd1", ] - | 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, ) -> ActionInitiateByIDResponse: """ To initiate an action on a block storage volume by Id, send a POST request to @@ -360,8 +360,8 @@ def initiate_by_id( *, size_gigabytes: int, type: Literal["attach", "detach", "resize"], - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, region: Literal[ "ams1", "ams2", @@ -379,13 +379,13 @@ def initiate_by_id( "tor1", "syd1", ] - | 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, ) -> ActionInitiateByIDResponse: """ To initiate an action on a block storage volume by Id, send a POST request to @@ -452,10 +452,10 @@ def initiate_by_id( self, volume_id: str, *, - droplet_id: int | NotGiven = NOT_GIVEN, + droplet_id: int | Omit = omit, type: Literal["attach", "detach", "resize"], - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, region: Literal[ "ams1", "ams2", @@ -473,15 +473,15 @@ def initiate_by_id( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - size_gigabytes: int | NotGiven = NOT_GIVEN, + | Omit = omit, + tags: Optional[SequenceNotStr[str]] | Omit = omit, + size_gigabytes: 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, ) -> ActionInitiateByIDResponse: if not volume_id: raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}") @@ -521,8 +521,8 @@ def initiate_by_name( *, droplet_id: int, type: Literal["attach", "detach", "resize"], - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, region: Literal[ "ams1", "ams2", @@ -540,14 +540,14 @@ def initiate_by_name( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + | Omit = omit, + tags: Optional[SequenceNotStr[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, ) -> ActionInitiateByNameResponse: """ To initiate an action on a block storage volume by Name, send a POST request to @@ -613,8 +613,8 @@ def initiate_by_name( *, droplet_id: int, type: Literal["attach", "detach", "resize"], - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, region: Literal[ "ams1", "ams2", @@ -632,13 +632,13 @@ def initiate_by_name( "tor1", "syd1", ] - | 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, ) -> ActionInitiateByNameResponse: """ To initiate an action on a block storage volume by Name, send a POST request to @@ -699,8 +699,8 @@ def initiate_by_name( *, droplet_id: int, type: Literal["attach", "detach", "resize"], - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, region: Literal[ "ams1", "ams2", @@ -718,14 +718,14 @@ def initiate_by_name( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + | Omit = omit, + tags: Optional[SequenceNotStr[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, ) -> ActionInitiateByNameResponse: return self._post( "/v2/volumes/actions" @@ -782,14 +782,14 @@ async def retrieve( action_id: int, *, volume_id: str, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> ActionRetrieveResponse: """ To retrieve the status of a volume action, send a GET request to @@ -834,14 +834,14 @@ async def list( self, volume_id: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> ActionListResponse: """ To retrieve all actions that have been executed on a volume, send a GET request @@ -889,8 +889,8 @@ async def initiate_by_id( *, droplet_id: int, type: Literal["attach", "detach", "resize"], - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, region: Literal[ "ams1", "ams2", @@ -908,14 +908,14 @@ async def initiate_by_id( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + | Omit = omit, + tags: Optional[SequenceNotStr[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, ) -> ActionInitiateByIDResponse: """ To initiate an action on a block storage volume by Id, send a POST request to @@ -990,8 +990,8 @@ async def initiate_by_id( *, droplet_id: int, type: Literal["attach", "detach", "resize"], - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, region: Literal[ "ams1", "ams2", @@ -1009,13 +1009,13 @@ async def initiate_by_id( "tor1", "syd1", ] - | 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, ) -> ActionInitiateByIDResponse: """ To initiate an action on a block storage volume by Id, send a POST request to @@ -1085,8 +1085,8 @@ async def initiate_by_id( *, size_gigabytes: int, type: Literal["attach", "detach", "resize"], - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, region: Literal[ "ams1", "ams2", @@ -1104,13 +1104,13 @@ async def initiate_by_id( "tor1", "syd1", ] - | 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, ) -> ActionInitiateByIDResponse: """ To initiate an action on a block storage volume by Id, send a POST request to @@ -1177,10 +1177,10 @@ async def initiate_by_id( self, volume_id: str, *, - droplet_id: int | NotGiven = NOT_GIVEN, + droplet_id: int | Omit = omit, type: Literal["attach", "detach", "resize"], - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, region: Literal[ "ams1", "ams2", @@ -1198,15 +1198,15 @@ async def initiate_by_id( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - size_gigabytes: int | NotGiven = NOT_GIVEN, + | Omit = omit, + tags: Optional[SequenceNotStr[str]] | Omit = omit, + size_gigabytes: 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, ) -> ActionInitiateByIDResponse: if not volume_id: raise ValueError(f"Expected a non-empty value for `volume_id` but received {volume_id!r}") @@ -1246,8 +1246,8 @@ async def initiate_by_name( *, droplet_id: int, type: Literal["attach", "detach", "resize"], - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, region: Literal[ "ams1", "ams2", @@ -1265,14 +1265,14 @@ async def initiate_by_name( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + | Omit = omit, + tags: Optional[SequenceNotStr[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, ) -> ActionInitiateByNameResponse: """ To initiate an action on a block storage volume by Name, send a POST request to @@ -1338,8 +1338,8 @@ async def initiate_by_name( *, droplet_id: int, type: Literal["attach", "detach", "resize"], - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, region: Literal[ "ams1", "ams2", @@ -1357,13 +1357,13 @@ async def initiate_by_name( "tor1", "syd1", ] - | 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, ) -> ActionInitiateByNameResponse: """ To initiate an action on a block storage volume by Name, send a POST request to @@ -1424,8 +1424,8 @@ async def initiate_by_name( *, droplet_id: int, type: Literal["attach", "detach", "resize"], - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, region: Literal[ "ams1", "ams2", @@ -1443,14 +1443,14 @@ async def initiate_by_name( "tor1", "syd1", ] - | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + | Omit = omit, + tags: Optional[SequenceNotStr[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, ) -> ActionInitiateByNameResponse: return await self._post( "/v2/volumes/actions" diff --git a/src/gradient/resources/gpu_droplets/volumes/snapshots.py b/src/gradient/resources/gpu_droplets/volumes/snapshots.py index 7e925264..694de074 100644 --- a/src/gradient/resources/gpu_droplets/volumes/snapshots.py +++ b/src/gradient/resources/gpu_droplets/volumes/snapshots.py @@ -6,7 +6,7 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, SequenceNotStr +from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -50,13 +50,13 @@ def create( volume_id: str, *, name: str, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[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, ) -> SnapshotCreateResponse: """ To create a snapshot from a volume, sent a POST request to @@ -106,7 +106,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, ) -> SnapshotRetrieveResponse: """ To retrieve the details of a snapshot that has been created from a volume, send @@ -137,14 +137,14 @@ def list( self, volume_id: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> SnapshotListResponse: """ To retrieve the snapshots that have been created from a volume, send a GET @@ -194,7 +194,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: """ To delete a volume snapshot, send a DELETE request to @@ -251,13 +251,13 @@ async def create( volume_id: str, *, name: str, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + tags: Optional[SequenceNotStr[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, ) -> SnapshotCreateResponse: """ To create a snapshot from a volume, sent a POST request to @@ -307,7 +307,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, ) -> SnapshotRetrieveResponse: """ To retrieve the details of a snapshot that has been created from a volume, send @@ -338,14 +338,14 @@ async def list( self, volume_id: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> SnapshotListResponse: """ To retrieve the snapshots that have been created from a volume, send a GET @@ -395,7 +395,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: """ To delete a volume snapshot, send a DELETE request to diff --git a/src/gradient/resources/gpu_droplets/volumes/volumes.py b/src/gradient/resources/gpu_droplets/volumes/volumes.py index ee980a10..fb86c288 100644 --- a/src/gradient/resources/gpu_droplets/volumes/volumes.py +++ b/src/gradient/resources/gpu_droplets/volumes/volumes.py @@ -15,7 +15,7 @@ ActionsResourceWithStreamingResponse, AsyncActionsResourceWithStreamingResponse, ) -from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, SequenceNotStr +from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given from ...._utils import required_args, maybe_transform, async_maybe_transform from .snapshots import ( SnapshotsResource, @@ -93,17 +93,17 @@ def create( "syd1", ], size_gigabytes: int, - description: str | NotGiven = NOT_GIVEN, - filesystem_label: str | NotGiven = NOT_GIVEN, - filesystem_type: str | NotGiven = NOT_GIVEN, - snapshot_id: str | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + filesystem_label: str | Omit = omit, + filesystem_type: str | Omit = omit, + snapshot_id: str | Omit = omit, + tags: Optional[SequenceNotStr[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, ) -> VolumeCreateResponse: """To create a new volume, send a POST request to `/v2/volumes`. @@ -178,17 +178,17 @@ def create( "syd1", ], size_gigabytes: int, - description: str | NotGiven = NOT_GIVEN, - filesystem_label: str | NotGiven = NOT_GIVEN, - filesystem_type: str | NotGiven = NOT_GIVEN, - snapshot_id: str | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + filesystem_label: str | Omit = omit, + filesystem_type: str | Omit = omit, + snapshot_id: str | Omit = omit, + tags: Optional[SequenceNotStr[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, ) -> VolumeCreateResponse: """To create a new volume, send a POST request to `/v2/volumes`. @@ -263,17 +263,17 @@ def create( "syd1", ], size_gigabytes: int, - description: str | NotGiven = NOT_GIVEN, - filesystem_label: str | NotGiven = NOT_GIVEN, - filesystem_type: str | NotGiven = NOT_GIVEN, - snapshot_id: str | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + filesystem_label: str | Omit = omit, + filesystem_type: str | Omit = omit, + snapshot_id: str | Omit = omit, + tags: Optional[SequenceNotStr[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, ) -> VolumeCreateResponse: return self._post( "/v2/volumes" if self._client._base_url_overridden else "https://api.digitalocean.com/v2/volumes", @@ -305,7 +305,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, ) -> VolumeRetrieveResponse: """ To show information about a block storage volume, send a GET request to @@ -335,9 +335,9 @@ def retrieve( def list( self, *, - name: str | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, region: Literal[ "ams1", "ams2", @@ -355,13 +355,13 @@ def list( "tor1", "syd1", ] - | 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, ) -> VolumeListResponse: """ To list all of the block storage volumes available on your account, send a GET @@ -434,7 +434,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: """ To delete a block storage volume, destroying all data and removing it from your @@ -468,7 +468,7 @@ def delete( def delete_by_name( self, *, - name: str | NotGiven = NOT_GIVEN, + name: str | Omit = omit, region: Literal[ "ams1", "ams2", @@ -486,13 +486,13 @@ def delete_by_name( "tor1", "syd1", ] - | 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, ) -> None: """ Block storage volumes may also be deleted by name by sending a DELETE request @@ -586,17 +586,17 @@ async def create( "syd1", ], size_gigabytes: int, - description: str | NotGiven = NOT_GIVEN, - filesystem_label: str | NotGiven = NOT_GIVEN, - filesystem_type: str | NotGiven = NOT_GIVEN, - snapshot_id: str | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + filesystem_label: str | Omit = omit, + filesystem_type: str | Omit = omit, + snapshot_id: str | Omit = omit, + tags: Optional[SequenceNotStr[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, ) -> VolumeCreateResponse: """To create a new volume, send a POST request to `/v2/volumes`. @@ -671,17 +671,17 @@ async def create( "syd1", ], size_gigabytes: int, - description: str | NotGiven = NOT_GIVEN, - filesystem_label: str | NotGiven = NOT_GIVEN, - filesystem_type: str | NotGiven = NOT_GIVEN, - snapshot_id: str | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + filesystem_label: str | Omit = omit, + filesystem_type: str | Omit = omit, + snapshot_id: str | Omit = omit, + tags: Optional[SequenceNotStr[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, ) -> VolumeCreateResponse: """To create a new volume, send a POST request to `/v2/volumes`. @@ -756,17 +756,17 @@ async def create( "syd1", ], size_gigabytes: int, - description: str | NotGiven = NOT_GIVEN, - filesystem_label: str | NotGiven = NOT_GIVEN, - filesystem_type: str | NotGiven = NOT_GIVEN, - snapshot_id: str | NotGiven = NOT_GIVEN, - tags: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + description: str | Omit = omit, + filesystem_label: str | Omit = omit, + filesystem_type: str | Omit = omit, + snapshot_id: str | Omit = omit, + tags: Optional[SequenceNotStr[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, ) -> VolumeCreateResponse: return await self._post( "/v2/volumes" if self._client._base_url_overridden else "https://api.digitalocean.com/v2/volumes", @@ -798,7 +798,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, ) -> VolumeRetrieveResponse: """ To show information about a block storage volume, send a GET request to @@ -828,9 +828,9 @@ async def retrieve( async def list( self, *, - name: str | NotGiven = NOT_GIVEN, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + name: str | Omit = omit, + page: int | Omit = omit, + per_page: int | Omit = omit, region: Literal[ "ams1", "ams2", @@ -848,13 +848,13 @@ async def list( "tor1", "syd1", ] - | 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, ) -> VolumeListResponse: """ To list all of the block storage volumes available on your account, send a GET @@ -927,7 +927,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: """ To delete a block storage volume, destroying all data and removing it from your @@ -961,7 +961,7 @@ async def delete( async def delete_by_name( self, *, - name: str | NotGiven = NOT_GIVEN, + name: str | Omit = omit, region: Literal[ "ams1", "ams2", @@ -979,13 +979,13 @@ async def delete_by_name( "tor1", "syd1", ] - | 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, ) -> None: """ Block storage volumes may also be deleted by name by sending a DELETE request diff --git a/src/gradient/resources/inference/api_keys.py b/src/gradient/resources/inference/api_keys.py index fa7f86dc..8dfa54e1 100644 --- a/src/gradient/resources/inference/api_keys.py +++ b/src/gradient/resources/inference/api_keys.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 @@ -48,13 +48,13 @@ def with_streaming_response(self) -> APIKeysResourceWithStreamingResponse: def create( self, *, - name: str | NotGiven = NOT_GIVEN, + name: 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, ) -> APIKeyCreateResponse: """ To create a model API key, send a POST request to `/v2/gen-ai/models/api_keys`. @@ -85,14 +85,14 @@ def update( self, path_api_key_uuid: str, *, - body_api_key_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + body_api_key_uuid: str | Omit = omit, + name: 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, ) -> APIKeyUpdateResponse: """ To update a model API key, send a PUT request to @@ -133,14 +133,14 @@ def update( def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> APIKeyListResponse: """ To list all model API keys, send a GET request to `/v2/gen-ai/models/api_keys`. @@ -187,7 +187,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, ) -> APIKeyDeleteResponse: """ To delete an API key for a model, send a DELETE request to @@ -223,7 +223,7 @@ def update_regenerate( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> APIKeyUpdateRegenerateResponse: """ To regenerate a model API key, send a PUT request to @@ -274,13 +274,13 @@ def with_streaming_response(self) -> AsyncAPIKeysResourceWithStreamingResponse: async def create( self, *, - name: str | NotGiven = NOT_GIVEN, + name: 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, ) -> APIKeyCreateResponse: """ To create a model API key, send a POST request to `/v2/gen-ai/models/api_keys`. @@ -311,14 +311,14 @@ async def update( self, path_api_key_uuid: str, *, - body_api_key_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + body_api_key_uuid: str | Omit = omit, + name: 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, ) -> APIKeyUpdateResponse: """ To update a model API key, send a PUT request to @@ -359,14 +359,14 @@ async def update( async def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> APIKeyListResponse: """ To list all model API keys, send a GET request to `/v2/gen-ai/models/api_keys`. @@ -413,7 +413,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, ) -> APIKeyDeleteResponse: """ To delete an API key for a model, send a DELETE request to @@ -449,7 +449,7 @@ async def update_regenerate( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> APIKeyUpdateRegenerateResponse: """ To regenerate a model API key, send a PUT request to diff --git a/src/gradient/resources/knowledge_bases/data_sources.py b/src/gradient/resources/knowledge_bases/data_sources.py index 16252324..083ea45f 100644 --- a/src/gradient/resources/knowledge_bases/data_sources.py +++ b/src/gradient/resources/knowledge_bases/data_sources.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 @@ -53,16 +53,16 @@ def create( self, path_knowledge_base_uuid: str, *, - aws_data_source: AwsDataSourceParam | NotGiven = NOT_GIVEN, - body_knowledge_base_uuid: str | NotGiven = NOT_GIVEN, - spaces_data_source: APISpacesDataSourceParam | NotGiven = NOT_GIVEN, - web_crawler_data_source: APIWebCrawlerDataSourceParam | NotGiven = NOT_GIVEN, + aws_data_source: AwsDataSourceParam | Omit = omit, + body_knowledge_base_uuid: str | Omit = omit, + spaces_data_source: APISpacesDataSourceParam | Omit = omit, + web_crawler_data_source: APIWebCrawlerDataSourceParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSourceCreateResponse: """ To add a data source to a knowledge base, send a POST request to @@ -112,14 +112,14 @@ def list( self, knowledge_base_uuid: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> DataSourceListResponse: """ To list all data sources for a knowledge base, send a GET request to @@ -172,7 +172,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, ) -> DataSourceDeleteResponse: """ To delete a data source from a knowledge base, send a DELETE request to @@ -228,16 +228,16 @@ async def create( self, path_knowledge_base_uuid: str, *, - aws_data_source: AwsDataSourceParam | NotGiven = NOT_GIVEN, - body_knowledge_base_uuid: str | NotGiven = NOT_GIVEN, - spaces_data_source: APISpacesDataSourceParam | NotGiven = NOT_GIVEN, - web_crawler_data_source: APIWebCrawlerDataSourceParam | NotGiven = NOT_GIVEN, + aws_data_source: AwsDataSourceParam | Omit = omit, + body_knowledge_base_uuid: str | Omit = omit, + spaces_data_source: APISpacesDataSourceParam | Omit = omit, + web_crawler_data_source: APIWebCrawlerDataSourceParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DataSourceCreateResponse: """ To add a data source to a knowledge base, send a POST request to @@ -287,14 +287,14 @@ async def list( self, knowledge_base_uuid: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> DataSourceListResponse: """ To list all data sources for a knowledge base, send a GET request to @@ -347,7 +347,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, ) -> DataSourceDeleteResponse: """ To delete a data source from a knowledge base, send a DELETE request to diff --git a/src/gradient/resources/knowledge_bases/indexing_jobs.py b/src/gradient/resources/knowledge_bases/indexing_jobs.py index 41e7da76..95898c2a 100644 --- a/src/gradient/resources/knowledge_bases/indexing_jobs.py +++ b/src/gradient/resources/knowledge_bases/indexing_jobs.py @@ -4,7 +4,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 @@ -52,14 +52,14 @@ def with_streaming_response(self) -> IndexingJobsResourceWithStreamingResponse: def create( self, *, - data_source_uuids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - knowledge_base_uuid: str | NotGiven = NOT_GIVEN, + data_source_uuids: SequenceNotStr[str] | Omit = omit, + knowledge_base_uuid: 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, ) -> IndexingJobCreateResponse: """ To start an indexing job for a knowledge base, send a POST request to @@ -105,7 +105,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, ) -> IndexingJobRetrieveResponse: """ To get status of an indexing Job for a knowledge base, send a GET request to @@ -135,14 +135,14 @@ def retrieve( def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> IndexingJobListResponse: """ To list all indexing jobs for a knowledge base, send a GET request to @@ -190,7 +190,7 @@ def retrieve_data_sources( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IndexingJobRetrieveDataSourcesResponse: """ To list all datasources for an indexing job, send a GET request to @@ -221,13 +221,13 @@ def update_cancel( self, path_uuid: str, *, - body_uuid: str | NotGiven = NOT_GIVEN, + body_uuid: 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, ) -> IndexingJobUpdateCancelResponse: """ To cancel an indexing job for a knowledge base, send a PUT request to @@ -283,14 +283,14 @@ def with_streaming_response(self) -> AsyncIndexingJobsResourceWithStreamingRespo async def create( self, *, - data_source_uuids: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - knowledge_base_uuid: str | NotGiven = NOT_GIVEN, + data_source_uuids: SequenceNotStr[str] | Omit = omit, + knowledge_base_uuid: 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, ) -> IndexingJobCreateResponse: """ To start an indexing job for a knowledge base, send a POST request to @@ -336,7 +336,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, ) -> IndexingJobRetrieveResponse: """ To get status of an indexing Job for a knowledge base, send a GET request to @@ -366,14 +366,14 @@ async def retrieve( async def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> IndexingJobListResponse: """ To list all indexing jobs for a knowledge base, send a GET request to @@ -421,7 +421,7 @@ async def retrieve_data_sources( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> IndexingJobRetrieveDataSourcesResponse: """ To list all datasources for an indexing job, send a GET request to @@ -452,13 +452,13 @@ async def update_cancel( self, path_uuid: str, *, - body_uuid: str | NotGiven = NOT_GIVEN, + body_uuid: 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, ) -> IndexingJobUpdateCancelResponse: """ To cancel an indexing job for a knowledge base, send a PUT request to diff --git a/src/gradient/resources/knowledge_bases/knowledge_bases.py b/src/gradient/resources/knowledge_bases/knowledge_bases.py index 61fc85a8..00fa0659 100644 --- a/src/gradient/resources/knowledge_bases/knowledge_bases.py +++ b/src/gradient/resources/knowledge_bases/knowledge_bases.py @@ -7,7 +7,7 @@ import httpx from ...types import knowledge_base_list_params, knowledge_base_create_params, knowledge_base_update_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 @@ -74,20 +74,20 @@ def with_streaming_response(self) -> KnowledgeBasesResourceWithStreamingResponse def create( self, *, - database_id: str | NotGiven = NOT_GIVEN, - datasources: Iterable[knowledge_base_create_params.Datasource] | NotGiven = NOT_GIVEN, - embedding_model_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - region: str | NotGiven = NOT_GIVEN, - tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - vpc_uuid: str | NotGiven = NOT_GIVEN, + database_id: str | Omit = omit, + datasources: Iterable[knowledge_base_create_params.Datasource] | Omit = omit, + embedding_model_uuid: str | Omit = omit, + name: str | Omit = omit, + project_id: str | Omit = omit, + region: str | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + vpc_uuid: 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, ) -> KnowledgeBaseCreateResponse: """ To create a knowledge base, send a POST request to `/v2/gen-ai/knowledge_bases`. @@ -154,7 +154,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, ) -> KnowledgeBaseRetrieveResponse: """ To retrive information about an existing knowledge base, send a GET request to @@ -185,18 +185,18 @@ def update( self, path_uuid: str, *, - database_id: str | NotGiven = NOT_GIVEN, - embedding_model_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - body_uuid: str | NotGiven = NOT_GIVEN, + database_id: str | Omit = omit, + embedding_model_uuid: str | Omit = omit, + name: str | Omit = omit, + project_id: str | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + body_uuid: 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, ) -> KnowledgeBaseUpdateResponse: """ To update a knowledge base, send a PUT request to @@ -249,14 +249,14 @@ def update( def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> KnowledgeBaseListResponse: """ To list all knowledge bases, send a GET request to `/v2/gen-ai/knowledge_bases`. @@ -303,7 +303,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, ) -> KnowledgeBaseDeleteResponse: """ To delete a knowledge base, send a DELETE request to @@ -362,20 +362,20 @@ def with_streaming_response(self) -> AsyncKnowledgeBasesResourceWithStreamingRes async def create( self, *, - database_id: str | NotGiven = NOT_GIVEN, - datasources: Iterable[knowledge_base_create_params.Datasource] | NotGiven = NOT_GIVEN, - embedding_model_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - region: str | NotGiven = NOT_GIVEN, - tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - vpc_uuid: str | NotGiven = NOT_GIVEN, + database_id: str | Omit = omit, + datasources: Iterable[knowledge_base_create_params.Datasource] | Omit = omit, + embedding_model_uuid: str | Omit = omit, + name: str | Omit = omit, + project_id: str | Omit = omit, + region: str | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + vpc_uuid: 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, ) -> KnowledgeBaseCreateResponse: """ To create a knowledge base, send a POST request to `/v2/gen-ai/knowledge_bases`. @@ -442,7 +442,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, ) -> KnowledgeBaseRetrieveResponse: """ To retrive information about an existing knowledge base, send a GET request to @@ -473,18 +473,18 @@ async def update( self, path_uuid: str, *, - database_id: str | NotGiven = NOT_GIVEN, - embedding_model_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - project_id: str | NotGiven = NOT_GIVEN, - tags: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - body_uuid: str | NotGiven = NOT_GIVEN, + database_id: str | Omit = omit, + embedding_model_uuid: str | Omit = omit, + name: str | Omit = omit, + project_id: str | Omit = omit, + tags: SequenceNotStr[str] | Omit = omit, + body_uuid: 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, ) -> KnowledgeBaseUpdateResponse: """ To update a knowledge base, send a PUT request to @@ -537,14 +537,14 @@ async def update( async def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> KnowledgeBaseListResponse: """ To list all knowledge bases, send a GET request to `/v2/gen-ai/knowledge_bases`. @@ -591,7 +591,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, ) -> KnowledgeBaseDeleteResponse: """ To delete a knowledge base, send a DELETE request to diff --git a/src/gradient/resources/models/models.py b/src/gradient/resources/models/models.py index ffb5fea9..650c49c9 100644 --- a/src/gradient/resources/models/models.py +++ b/src/gradient/resources/models/models.py @@ -8,7 +8,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 @@ -59,9 +59,9 @@ def with_streaming_response(self) -> ModelsResourceWithStreamingResponse: def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - public_only: bool | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, + public_only: bool | Omit = omit, usecases: List[ Literal[ "MODEL_USECASE_UNKNOWN", @@ -73,13 +73,13 @@ def list( "MODEL_USECASE_SERVERLESS", ] ] - | 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, ) -> ModelListResponse: """ To list all models, send a GET request to `/v2/gen-ai/models`. @@ -160,9 +160,9 @@ def with_streaming_response(self) -> AsyncModelsResourceWithStreamingResponse: async def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, - public_only: bool | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: int | Omit = omit, + public_only: bool | Omit = omit, usecases: List[ Literal[ "MODEL_USECASE_UNKNOWN", @@ -174,13 +174,13 @@ async def list( "MODEL_USECASE_SERVERLESS", ] ] - | 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, ) -> ModelListResponse: """ To list all models, send a GET request to `/v2/gen-ai/models`. diff --git a/src/gradient/resources/models/providers/anthropic.py b/src/gradient/resources/models/providers/anthropic.py index ddb0eef8..33b2ec80 100644 --- a/src/gradient/resources/models/providers/anthropic.py +++ b/src/gradient/resources/models/providers/anthropic.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 @@ -54,14 +54,14 @@ def with_streaming_response(self) -> AnthropicResourceWithStreamingResponse: def create( self, *, - api_key: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + api_key: str | Omit = omit, + name: 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, ) -> AnthropicCreateResponse: """ To create an Anthropic API key, send a POST request to @@ -106,7 +106,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, ) -> AnthropicRetrieveResponse: """ To retrieve details of an Anthropic API key, send a GET request to @@ -137,15 +137,15 @@ def update( self, path_api_key_uuid: str, *, - api_key: str | NotGiven = NOT_GIVEN, - body_api_key_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + api_key: str | Omit = omit, + body_api_key_uuid: str | Omit = omit, + name: 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, ) -> AnthropicUpdateResponse: """ To update an Anthropic API key, send a PUT request to @@ -189,14 +189,14 @@ def update( def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> AnthropicListResponse: """ To list all Anthropic API keys, send a GET request to @@ -244,7 +244,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, ) -> AnthropicDeleteResponse: """ To delete an Anthropic API key, send a DELETE request to @@ -275,14 +275,14 @@ def list_agents( self, uuid: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> AnthropicListAgentsResponse: """ List Agents by Anthropic Key. @@ -346,14 +346,14 @@ def with_streaming_response(self) -> AsyncAnthropicResourceWithStreamingResponse async def create( self, *, - api_key: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + api_key: str | Omit = omit, + name: 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, ) -> AnthropicCreateResponse: """ To create an Anthropic API key, send a POST request to @@ -398,7 +398,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, ) -> AnthropicRetrieveResponse: """ To retrieve details of an Anthropic API key, send a GET request to @@ -429,15 +429,15 @@ async def update( self, path_api_key_uuid: str, *, - api_key: str | NotGiven = NOT_GIVEN, - body_api_key_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + api_key: str | Omit = omit, + body_api_key_uuid: str | Omit = omit, + name: 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, ) -> AnthropicUpdateResponse: """ To update an Anthropic API key, send a PUT request to @@ -481,14 +481,14 @@ async def update( async def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> AnthropicListResponse: """ To list all Anthropic API keys, send a GET request to @@ -536,7 +536,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, ) -> AnthropicDeleteResponse: """ To delete an Anthropic API key, send a DELETE request to @@ -567,14 +567,14 @@ async def list_agents( self, uuid: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> AnthropicListAgentsResponse: """ List Agents by Anthropic Key. diff --git a/src/gradient/resources/models/providers/openai.py b/src/gradient/resources/models/providers/openai.py index 166e284d..5bdc3f20 100644 --- a/src/gradient/resources/models/providers/openai.py +++ b/src/gradient/resources/models/providers/openai.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 @@ -54,14 +54,14 @@ def with_streaming_response(self) -> OpenAIResourceWithStreamingResponse: def create( self, *, - api_key: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + api_key: str | Omit = omit, + name: 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, ) -> OpenAICreateResponse: """ To create an OpenAI API key, send a POST request to `/v2/gen-ai/openai/keys`. @@ -105,7 +105,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, ) -> OpenAIRetrieveResponse: """ To retrieve details of an OpenAI API key, send a GET request to @@ -136,15 +136,15 @@ def update( self, path_api_key_uuid: str, *, - api_key: str | NotGiven = NOT_GIVEN, - body_api_key_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + api_key: str | Omit = omit, + body_api_key_uuid: str | Omit = omit, + name: 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, ) -> OpenAIUpdateResponse: """ To update an OpenAI API key, send a PUT request to @@ -188,14 +188,14 @@ def update( def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> OpenAIListResponse: """ To list all OpenAI API keys, send a GET request to `/v2/gen-ai/openai/keys`. @@ -242,7 +242,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, ) -> OpenAIDeleteResponse: """ To delete an OpenAI API key, send a DELETE request to @@ -273,14 +273,14 @@ def retrieve_agents( self, uuid: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> OpenAIRetrieveAgentsResponse: """ List Agents by OpenAI Key. @@ -344,14 +344,14 @@ def with_streaming_response(self) -> AsyncOpenAIResourceWithStreamingResponse: async def create( self, *, - api_key: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + api_key: str | Omit = omit, + name: 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, ) -> OpenAICreateResponse: """ To create an OpenAI API key, send a POST request to `/v2/gen-ai/openai/keys`. @@ -395,7 +395,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, ) -> OpenAIRetrieveResponse: """ To retrieve details of an OpenAI API key, send a GET request to @@ -426,15 +426,15 @@ async def update( self, path_api_key_uuid: str, *, - api_key: str | NotGiven = NOT_GIVEN, - body_api_key_uuid: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + api_key: str | Omit = omit, + body_api_key_uuid: str | Omit = omit, + name: 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, ) -> OpenAIUpdateResponse: """ To update an OpenAI API key, send a PUT request to @@ -478,14 +478,14 @@ async def update( async def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> OpenAIListResponse: """ To list all OpenAI API keys, send a GET request to `/v2/gen-ai/openai/keys`. @@ -532,7 +532,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, ) -> OpenAIDeleteResponse: """ To delete an OpenAI API key, send a DELETE request to @@ -563,14 +563,14 @@ async def retrieve_agents( self, uuid: str, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> OpenAIRetrieveAgentsResponse: """ List Agents by OpenAI Key. diff --git a/src/gradient/resources/regions.py b/src/gradient/resources/regions.py index 779bd4dd..3b0f22fa 100644 --- a/src/gradient/resources/regions.py +++ b/src/gradient/resources/regions.py @@ -5,7 +5,7 @@ import httpx from ..types import region_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 @@ -44,14 +44,14 @@ def with_streaming_response(self) -> RegionsResourceWithStreamingResponse: def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> RegionListResponse: """ To list all of the regions that are available, send a GET request to @@ -114,14 +114,14 @@ def with_streaming_response(self) -> AsyncRegionsResourceWithStreamingResponse: async def list( self, *, - page: int | NotGiven = NOT_GIVEN, - per_page: int | NotGiven = NOT_GIVEN, + page: int | Omit = omit, + per_page: 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, ) -> RegionListResponse: """ To list all of the regions that are available, send a GET request to diff --git a/tests/api_resources/agents/evaluation_metrics/anthropic/test_keys.py b/tests/api_resources/agents/evaluation_metrics/anthropic/test_keys.py index b6b461e6..5028698c 100644 --- a/tests/api_resources/agents/evaluation_metrics/anthropic/test_keys.py +++ b/tests/api_resources/agents/evaluation_metrics/anthropic/test_keys.py @@ -65,7 +65,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: @parametrize def test_method_retrieve(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.anthropic.keys.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(KeyRetrieveResponse, key, path=["response"]) @@ -73,7 +73,7 @@ def test_method_retrieve(self, client: Gradient) -> None: @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.anthropic.keys.with_raw_response.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -85,7 +85,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.agents.evaluation_metrics.anthropic.keys.with_streaming_response.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -197,7 +197,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: @parametrize def test_method_delete(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.anthropic.keys.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(KeyDeleteResponse, key, path=["response"]) @@ -205,7 +205,7 @@ def test_method_delete(self, client: Gradient) -> None: @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.anthropic.keys.with_raw_response.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -217,7 +217,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.agents.evaluation_metrics.anthropic.keys.with_streaming_response.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -334,7 +334,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.anthropic.keys.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(KeyRetrieveResponse, key, path=["response"]) @@ -342,7 +342,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.anthropic.keys.with_raw_response.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -354,7 +354,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.anthropic.keys.with_streaming_response.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -466,7 +466,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.anthropic.keys.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(KeyDeleteResponse, key, path=["response"]) @@ -474,7 +474,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.anthropic.keys.with_raw_response.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -486,7 +486,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.anthropic.keys.with_streaming_response.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/agents/evaluation_metrics/openai/test_keys.py b/tests/api_resources/agents/evaluation_metrics/openai/test_keys.py index da5cf8e1..7da165c2 100644 --- a/tests/api_resources/agents/evaluation_metrics/openai/test_keys.py +++ b/tests/api_resources/agents/evaluation_metrics/openai/test_keys.py @@ -65,7 +65,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: @parametrize def test_method_retrieve(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.openai.keys.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(KeyRetrieveResponse, key, path=["response"]) @@ -73,7 +73,7 @@ def test_method_retrieve(self, client: Gradient) -> None: @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.openai.keys.with_raw_response.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -85,7 +85,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.agents.evaluation_metrics.openai.keys.with_streaming_response.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -197,7 +197,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: @parametrize def test_method_delete(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.openai.keys.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(KeyDeleteResponse, key, path=["response"]) @@ -205,7 +205,7 @@ def test_method_delete(self, client: Gradient) -> None: @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.openai.keys.with_raw_response.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -217,7 +217,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.agents.evaluation_metrics.openai.keys.with_streaming_response.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -334,7 +334,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.openai.keys.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(KeyRetrieveResponse, key, path=["response"]) @@ -342,7 +342,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.openai.keys.with_raw_response.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -354,7 +354,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.openai.keys.with_streaming_response.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -466,7 +466,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.openai.keys.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(KeyDeleteResponse, key, path=["response"]) @@ -474,7 +474,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.openai.keys.with_raw_response.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -486,7 +486,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.openai.keys.with_streaming_response.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/agents/evaluation_metrics/test_workspaces.py b/tests/api_resources/agents/evaluation_metrics/test_workspaces.py index 3acede09..4f85212d 100644 --- a/tests/api_resources/agents/evaluation_metrics/test_workspaces.py +++ b/tests/api_resources/agents/evaluation_metrics/test_workspaces.py @@ -66,7 +66,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: @parametrize def test_method_retrieve(self, client: Gradient) -> None: workspace = client.agents.evaluation_metrics.workspaces.retrieve( - "workspace_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(WorkspaceRetrieveResponse, workspace, path=["response"]) @@ -74,7 +74,7 @@ def test_method_retrieve(self, client: Gradient) -> None: @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.workspaces.with_raw_response.retrieve( - "workspace_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -86,7 +86,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.agents.evaluation_metrics.workspaces.with_streaming_response.retrieve( - "workspace_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -189,7 +189,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: @parametrize def test_method_delete(self, client: Gradient) -> None: workspace = client.agents.evaluation_metrics.workspaces.delete( - "workspace_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(WorkspaceDeleteResponse, workspace, path=["response"]) @@ -197,7 +197,7 @@ def test_method_delete(self, client: Gradient) -> None: @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.workspaces.with_raw_response.delete( - "workspace_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -209,7 +209,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.agents.evaluation_metrics.workspaces.with_streaming_response.delete( - "workspace_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -231,7 +231,7 @@ def test_path_params_delete(self, client: Gradient) -> None: @parametrize def test_method_list_evaluation_test_cases(self, client: Gradient) -> None: workspace = client.agents.evaluation_metrics.workspaces.list_evaluation_test_cases( - "workspace_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(WorkspaceListEvaluationTestCasesResponse, workspace, path=["response"]) @@ -239,7 +239,7 @@ def test_method_list_evaluation_test_cases(self, client: Gradient) -> None: @parametrize def test_raw_response_list_evaluation_test_cases(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.workspaces.with_raw_response.list_evaluation_test_cases( - "workspace_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -251,7 +251,7 @@ def test_raw_response_list_evaluation_test_cases(self, client: Gradient) -> None @parametrize def test_streaming_response_list_evaluation_test_cases(self, client: Gradient) -> None: with client.agents.evaluation_metrics.workspaces.with_streaming_response.list_evaluation_test_cases( - "workspace_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -317,7 +317,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: workspace = await async_client.agents.evaluation_metrics.workspaces.retrieve( - "workspace_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(WorkspaceRetrieveResponse, workspace, path=["response"]) @@ -325,7 +325,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.workspaces.with_raw_response.retrieve( - "workspace_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -337,7 +337,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.workspaces.with_streaming_response.retrieve( - "workspace_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -440,7 +440,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: workspace = await async_client.agents.evaluation_metrics.workspaces.delete( - "workspace_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(WorkspaceDeleteResponse, workspace, path=["response"]) @@ -448,7 +448,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.workspaces.with_raw_response.delete( - "workspace_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -460,7 +460,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.workspaces.with_streaming_response.delete( - "workspace_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -482,7 +482,7 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_method_list_evaluation_test_cases(self, async_client: AsyncGradient) -> None: workspace = await async_client.agents.evaluation_metrics.workspaces.list_evaluation_test_cases( - "workspace_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(WorkspaceListEvaluationTestCasesResponse, workspace, path=["response"]) @@ -490,7 +490,7 @@ async def test_method_list_evaluation_test_cases(self, async_client: AsyncGradie @parametrize async def test_raw_response_list_evaluation_test_cases(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.workspaces.with_raw_response.list_evaluation_test_cases( - "workspace_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -502,7 +502,7 @@ async def test_raw_response_list_evaluation_test_cases(self, async_client: Async @parametrize async def test_streaming_response_list_evaluation_test_cases(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.workspaces.with_streaming_response.list_evaluation_test_cases( - "workspace_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/agents/test_evaluation_runs.py b/tests/api_resources/agents/test_evaluation_runs.py index 8d7e1826..c6acaf82 100644 --- a/tests/api_resources/agents/test_evaluation_runs.py +++ b/tests/api_resources/agents/test_evaluation_runs.py @@ -64,7 +64,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: @parametrize def test_method_retrieve(self, client: Gradient) -> None: evaluation_run = client.agents.evaluation_runs.retrieve( - "evaluation_run_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(EvaluationRunRetrieveResponse, evaluation_run, path=["response"]) @@ -72,7 +72,7 @@ def test_method_retrieve(self, client: Gradient) -> None: @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.agents.evaluation_runs.with_raw_response.retrieve( - "evaluation_run_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -84,7 +84,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.agents.evaluation_runs.with_streaming_response.retrieve( - "evaluation_run_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -248,7 +248,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: evaluation_run = await async_client.agents.evaluation_runs.retrieve( - "evaluation_run_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(EvaluationRunRetrieveResponse, evaluation_run, path=["response"]) @@ -256,7 +256,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_runs.with_raw_response.retrieve( - "evaluation_run_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -268,7 +268,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_runs.with_streaming_response.retrieve( - "evaluation_run_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/agents/test_knowledge_bases.py b/tests/api_resources/agents/test_knowledge_bases.py index 60dae7d0..2cf09753 100644 --- a/tests/api_resources/agents/test_knowledge_bases.py +++ b/tests/api_resources/agents/test_knowledge_bases.py @@ -21,7 +21,7 @@ class TestKnowledgeBases: @parametrize def test_method_attach(self, client: Gradient) -> None: knowledge_base = client.agents.knowledge_bases.attach( - "agent_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(APILinkKnowledgeBaseOutput, knowledge_base, path=["response"]) @@ -29,7 +29,7 @@ def test_method_attach(self, client: Gradient) -> None: @parametrize def test_raw_response_attach(self, client: Gradient) -> None: response = client.agents.knowledge_bases.with_raw_response.attach( - "agent_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -41,7 +41,7 @@ def test_raw_response_attach(self, client: Gradient) -> None: @parametrize def test_streaming_response_attach(self, client: Gradient) -> None: with client.agents.knowledge_bases.with_streaming_response.attach( - "agent_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -173,7 +173,7 @@ class TestAsyncKnowledgeBases: @parametrize async def test_method_attach(self, async_client: AsyncGradient) -> None: knowledge_base = await async_client.agents.knowledge_bases.attach( - "agent_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(APILinkKnowledgeBaseOutput, knowledge_base, path=["response"]) @@ -181,7 +181,7 @@ async def test_method_attach(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_attach(self, async_client: AsyncGradient) -> None: response = await async_client.agents.knowledge_bases.with_raw_response.attach( - "agent_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -193,7 +193,7 @@ async def test_raw_response_attach(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_attach(self, async_client: AsyncGradient) -> None: async with async_client.agents.knowledge_bases.with_streaming_response.attach( - "agent_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/agents/test_routes.py b/tests/api_resources/agents/test_routes.py index 37bc4eac..3444dcc7 100644 --- a/tests/api_resources/agents/test_routes.py +++ b/tests/api_resources/agents/test_routes.py @@ -213,7 +213,7 @@ def test_path_params_add(self, client: Gradient) -> None: @parametrize def test_method_view(self, client: Gradient) -> None: route = client.agents.routes.view( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(RouteViewResponse, route, path=["response"]) @@ -221,7 +221,7 @@ def test_method_view(self, client: Gradient) -> None: @parametrize def test_raw_response_view(self, client: Gradient) -> None: response = client.agents.routes.with_raw_response.view( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -233,7 +233,7 @@ def test_raw_response_view(self, client: Gradient) -> None: @parametrize def test_streaming_response_view(self, client: Gradient) -> None: with client.agents.routes.with_streaming_response.view( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -448,7 +448,7 @@ async def test_path_params_add(self, async_client: AsyncGradient) -> None: @parametrize async def test_method_view(self, async_client: AsyncGradient) -> None: route = await async_client.agents.routes.view( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(RouteViewResponse, route, path=["response"]) @@ -456,7 +456,7 @@ async def test_method_view(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_view(self, async_client: AsyncGradient) -> None: response = await async_client.agents.routes.with_raw_response.view( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -468,7 +468,7 @@ async def test_raw_response_view(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_view(self, async_client: AsyncGradient) -> None: async with async_client.agents.routes.with_streaming_response.view( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/databases/schema_registry/test_config.py b/tests/api_resources/databases/schema_registry/test_config.py index b1d21f62..ebd60c4c 100644 --- a/tests/api_resources/databases/schema_registry/test_config.py +++ b/tests/api_resources/databases/schema_registry/test_config.py @@ -26,7 +26,7 @@ class TestConfig: @parametrize def test_method_retrieve(self, client: Gradient) -> None: config = client.databases.schema_registry.config.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30", ) assert_matches_type(ConfigRetrieveResponse, config, path=["response"]) @@ -34,7 +34,7 @@ def test_method_retrieve(self, client: Gradient) -> None: @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.databases.schema_registry.config.with_raw_response.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30", ) assert response.is_closed is True @@ -46,7 +46,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.databases.schema_registry.config.with_streaming_response.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -229,7 +229,7 @@ class TestAsyncConfig: @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: config = await async_client.databases.schema_registry.config.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30", ) assert_matches_type(ConfigRetrieveResponse, config, path=["response"]) @@ -237,7 +237,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.databases.schema_registry.config.with_raw_response.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30", ) assert response.is_closed is True @@ -249,7 +249,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.databases.schema_registry.config.with_streaming_response.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/gpu_droplets/floating_ips/test_actions.py b/tests/api_resources/gpu_droplets/floating_ips/test_actions.py index 0d678103..7f7ab06a 100644 --- a/tests/api_resources/gpu_droplets/floating_ips/test_actions.py +++ b/tests/api_resources/gpu_droplets/floating_ips/test_actions.py @@ -167,7 +167,7 @@ def test_path_params_retrieve(self, client: Gradient) -> None: @parametrize def test_method_list(self, client: Gradient) -> None: action = client.gpu_droplets.floating_ips.actions.list( - "192.168.1.1", + "45.55.96.47", ) assert_matches_type(ActionListResponse, action, path=["response"]) @@ -175,7 +175,7 @@ def test_method_list(self, client: Gradient) -> None: @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.gpu_droplets.floating_ips.actions.with_raw_response.list( - "192.168.1.1", + "45.55.96.47", ) assert response.is_closed is True @@ -187,7 +187,7 @@ def test_raw_response_list(self, client: Gradient) -> None: @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.gpu_droplets.floating_ips.actions.with_streaming_response.list( - "192.168.1.1", + "45.55.96.47", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -357,7 +357,7 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.floating_ips.actions.list( - "192.168.1.1", + "45.55.96.47", ) assert_matches_type(ActionListResponse, action, path=["response"]) @@ -365,7 +365,7 @@ async def test_method_list(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.floating_ips.actions.with_raw_response.list( - "192.168.1.1", + "45.55.96.47", ) assert response.is_closed is True @@ -377,7 +377,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.floating_ips.actions.with_streaming_response.list( - "192.168.1.1", + "45.55.96.47", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/gpu_droplets/images/test_actions.py b/tests/api_resources/gpu_droplets/images/test_actions.py index ad8b9585..ad5d4892 100644 --- a/tests/api_resources/gpu_droplets/images/test_actions.py +++ b/tests/api_resources/gpu_droplets/images/test_actions.py @@ -136,7 +136,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: @parametrize def test_method_list(self, client: Gradient) -> None: action = client.gpu_droplets.images.actions.list( - 0, + 62137902, ) assert_matches_type(ActionListResponse, action, path=["response"]) @@ -144,7 +144,7 @@ def test_method_list(self, client: Gradient) -> None: @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.gpu_droplets.images.actions.with_raw_response.list( - 0, + 62137902, ) assert response.is_closed is True @@ -156,7 +156,7 @@ def test_raw_response_list(self, client: Gradient) -> None: @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.gpu_droplets.images.actions.with_streaming_response.list( - 0, + 62137902, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -290,7 +290,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.images.actions.list( - 0, + 62137902, ) assert_matches_type(ActionListResponse, action, path=["response"]) @@ -298,7 +298,7 @@ async def test_method_list(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.images.actions.with_raw_response.list( - 0, + 62137902, ) assert response.is_closed is True @@ -310,7 +310,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.images.actions.with_streaming_response.list( - 0, + 62137902, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/gpu_droplets/test_autoscale.py b/tests/api_resources/gpu_droplets/test_autoscale.py index cbf67b19..bbb0c2e4 100644 --- a/tests/api_resources/gpu_droplets/test_autoscale.py +++ b/tests/api_resources/gpu_droplets/test_autoscale.py @@ -120,7 +120,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: @parametrize def test_method_retrieve(self, client: Gradient) -> None: autoscale = client.gpu_droplets.autoscale.retrieve( - "autoscale_pool_id", + "0d3db13e-a604-4944-9827-7ec2642d32ac", ) assert_matches_type(AutoscaleRetrieveResponse, autoscale, path=["response"]) @@ -128,7 +128,7 @@ def test_method_retrieve(self, client: Gradient) -> None: @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.gpu_droplets.autoscale.with_raw_response.retrieve( - "autoscale_pool_id", + "0d3db13e-a604-4944-9827-7ec2642d32ac", ) assert response.is_closed is True @@ -140,7 +140,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.gpu_droplets.autoscale.with_streaming_response.retrieve( - "autoscale_pool_id", + "0d3db13e-a604-4944-9827-7ec2642d32ac", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -297,7 +297,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: @parametrize def test_method_delete(self, client: Gradient) -> None: autoscale = client.gpu_droplets.autoscale.delete( - "autoscale_pool_id", + "0d3db13e-a604-4944-9827-7ec2642d32ac", ) assert autoscale is None @@ -305,7 +305,7 @@ def test_method_delete(self, client: Gradient) -> None: @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.gpu_droplets.autoscale.with_raw_response.delete( - "autoscale_pool_id", + "0d3db13e-a604-4944-9827-7ec2642d32ac", ) assert response.is_closed is True @@ -317,7 +317,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.gpu_droplets.autoscale.with_streaming_response.delete( - "autoscale_pool_id", + "0d3db13e-a604-4944-9827-7ec2642d32ac", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -587,7 +587,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: autoscale = await async_client.gpu_droplets.autoscale.retrieve( - "autoscale_pool_id", + "0d3db13e-a604-4944-9827-7ec2642d32ac", ) assert_matches_type(AutoscaleRetrieveResponse, autoscale, path=["response"]) @@ -595,7 +595,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.autoscale.with_raw_response.retrieve( - "autoscale_pool_id", + "0d3db13e-a604-4944-9827-7ec2642d32ac", ) assert response.is_closed is True @@ -607,7 +607,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.autoscale.with_streaming_response.retrieve( - "autoscale_pool_id", + "0d3db13e-a604-4944-9827-7ec2642d32ac", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -764,7 +764,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: autoscale = await async_client.gpu_droplets.autoscale.delete( - "autoscale_pool_id", + "0d3db13e-a604-4944-9827-7ec2642d32ac", ) assert autoscale is None @@ -772,7 +772,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.autoscale.with_raw_response.delete( - "autoscale_pool_id", + "0d3db13e-a604-4944-9827-7ec2642d32ac", ) assert response.is_closed is True @@ -784,7 +784,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.autoscale.with_streaming_response.delete( - "autoscale_pool_id", + "0d3db13e-a604-4944-9827-7ec2642d32ac", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/gpu_droplets/test_backups.py b/tests/api_resources/gpu_droplets/test_backups.py index 4a0d36b9..c6e854e4 100644 --- a/tests/api_resources/gpu_droplets/test_backups.py +++ b/tests/api_resources/gpu_droplets/test_backups.py @@ -135,7 +135,7 @@ def test_streaming_response_list_supported_policies(self, client: Gradient) -> N @parametrize def test_method_retrieve_policy(self, client: Gradient) -> None: backup = client.gpu_droplets.backups.retrieve_policy( - 1, + 3164444, ) assert_matches_type(BackupRetrievePolicyResponse, backup, path=["response"]) @@ -143,7 +143,7 @@ def test_method_retrieve_policy(self, client: Gradient) -> None: @parametrize def test_raw_response_retrieve_policy(self, client: Gradient) -> None: response = client.gpu_droplets.backups.with_raw_response.retrieve_policy( - 1, + 3164444, ) assert response.is_closed is True @@ -155,7 +155,7 @@ def test_raw_response_retrieve_policy(self, client: Gradient) -> None: @parametrize def test_streaming_response_retrieve_policy(self, client: Gradient) -> None: with client.gpu_droplets.backups.with_streaming_response.retrieve_policy( - 1, + 3164444, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -284,7 +284,7 @@ async def test_streaming_response_list_supported_policies(self, async_client: As @parametrize async def test_method_retrieve_policy(self, async_client: AsyncGradient) -> None: backup = await async_client.gpu_droplets.backups.retrieve_policy( - 1, + 3164444, ) assert_matches_type(BackupRetrievePolicyResponse, backup, path=["response"]) @@ -292,7 +292,7 @@ async def test_method_retrieve_policy(self, async_client: AsyncGradient) -> None @parametrize async def test_raw_response_retrieve_policy(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.backups.with_raw_response.retrieve_policy( - 1, + 3164444, ) assert response.is_closed is True @@ -304,7 +304,7 @@ async def test_raw_response_retrieve_policy(self, async_client: AsyncGradient) - @parametrize async def test_streaming_response_retrieve_policy(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.backups.with_streaming_response.retrieve_policy( - 1, + 3164444, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/gpu_droplets/test_destroy_with_associated_resources.py b/tests/api_resources/gpu_droplets/test_destroy_with_associated_resources.py index 166206d2..80f1bd7c 100644 --- a/tests/api_resources/gpu_droplets/test_destroy_with_associated_resources.py +++ b/tests/api_resources/gpu_droplets/test_destroy_with_associated_resources.py @@ -24,7 +24,7 @@ class TestDestroyWithAssociatedResources: @parametrize def test_method_list(self, client: Gradient) -> None: destroy_with_associated_resource = client.gpu_droplets.destroy_with_associated_resources.list( - 1, + 3164444, ) assert_matches_type( DestroyWithAssociatedResourceListResponse, destroy_with_associated_resource, path=["response"] @@ -34,7 +34,7 @@ def test_method_list(self, client: Gradient) -> None: @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.gpu_droplets.destroy_with_associated_resources.with_raw_response.list( - 1, + 3164444, ) assert response.is_closed is True @@ -48,7 +48,7 @@ def test_raw_response_list(self, client: Gradient) -> None: @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.gpu_droplets.destroy_with_associated_resources.with_streaming_response.list( - 1, + 3164444, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -64,7 +64,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: @parametrize def test_method_check_status(self, client: Gradient) -> None: destroy_with_associated_resource = client.gpu_droplets.destroy_with_associated_resources.check_status( - 1, + 3164444, ) assert_matches_type( DestroyWithAssociatedResourceCheckStatusResponse, destroy_with_associated_resource, path=["response"] @@ -74,7 +74,7 @@ def test_method_check_status(self, client: Gradient) -> None: @parametrize def test_raw_response_check_status(self, client: Gradient) -> None: response = client.gpu_droplets.destroy_with_associated_resources.with_raw_response.check_status( - 1, + 3164444, ) assert response.is_closed is True @@ -88,7 +88,7 @@ def test_raw_response_check_status(self, client: Gradient) -> None: @parametrize def test_streaming_response_check_status(self, client: Gradient) -> None: with client.gpu_droplets.destroy_with_associated_resources.with_streaming_response.check_status( - 1, + 3164444, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -188,7 +188,7 @@ def test_streaming_response_delete_selective(self, client: Gradient) -> None: @parametrize def test_method_retry(self, client: Gradient) -> None: destroy_with_associated_resource = client.gpu_droplets.destroy_with_associated_resources.retry( - 1, + 3164444, ) assert destroy_with_associated_resource is None @@ -196,7 +196,7 @@ def test_method_retry(self, client: Gradient) -> None: @parametrize def test_raw_response_retry(self, client: Gradient) -> None: response = client.gpu_droplets.destroy_with_associated_resources.with_raw_response.retry( - 1, + 3164444, ) assert response.is_closed is True @@ -208,7 +208,7 @@ def test_raw_response_retry(self, client: Gradient) -> None: @parametrize def test_streaming_response_retry(self, client: Gradient) -> None: with client.gpu_droplets.destroy_with_associated_resources.with_streaming_response.retry( - 1, + 3164444, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -228,7 +228,7 @@ class TestAsyncDestroyWithAssociatedResources: @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: destroy_with_associated_resource = await async_client.gpu_droplets.destroy_with_associated_resources.list( - 1, + 3164444, ) assert_matches_type( DestroyWithAssociatedResourceListResponse, destroy_with_associated_resource, path=["response"] @@ -238,7 +238,7 @@ async def test_method_list(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.destroy_with_associated_resources.with_raw_response.list( - 1, + 3164444, ) assert response.is_closed is True @@ -252,7 +252,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.destroy_with_associated_resources.with_streaming_response.list( - 1, + 3164444, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -269,7 +269,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non async def test_method_check_status(self, async_client: AsyncGradient) -> None: destroy_with_associated_resource = ( await async_client.gpu_droplets.destroy_with_associated_resources.check_status( - 1, + 3164444, ) ) assert_matches_type( @@ -280,7 +280,7 @@ async def test_method_check_status(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_check_status(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.destroy_with_associated_resources.with_raw_response.check_status( - 1, + 3164444, ) assert response.is_closed is True @@ -294,7 +294,7 @@ async def test_raw_response_check_status(self, async_client: AsyncGradient) -> N @parametrize async def test_streaming_response_check_status(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.destroy_with_associated_resources.with_streaming_response.check_status( - 1, + 3164444, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -400,7 +400,7 @@ async def test_streaming_response_delete_selective(self, async_client: AsyncGrad @parametrize async def test_method_retry(self, async_client: AsyncGradient) -> None: destroy_with_associated_resource = await async_client.gpu_droplets.destroy_with_associated_resources.retry( - 1, + 3164444, ) assert destroy_with_associated_resource is None @@ -408,7 +408,7 @@ async def test_method_retry(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_retry(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.destroy_with_associated_resources.with_raw_response.retry( - 1, + 3164444, ) assert response.is_closed is True @@ -420,7 +420,7 @@ async def test_raw_response_retry(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_retry(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.destroy_with_associated_resources.with_streaming_response.retry( - 1, + 3164444, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/gpu_droplets/test_firewalls.py b/tests/api_resources/gpu_droplets/test_firewalls.py index 83142b93..3d8469b3 100644 --- a/tests/api_resources/gpu_droplets/test_firewalls.py +++ b/tests/api_resources/gpu_droplets/test_firewalls.py @@ -103,7 +103,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: @parametrize def test_method_retrieve(self, client: Gradient) -> None: firewall = client.gpu_droplets.firewalls.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "bb4b2611-3d72-467b-8602-280330ecd65c", ) assert_matches_type(FirewallRetrieveResponse, firewall, path=["response"]) @@ -111,7 +111,7 @@ def test_method_retrieve(self, client: Gradient) -> None: @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.gpu_droplets.firewalls.with_raw_response.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "bb4b2611-3d72-467b-8602-280330ecd65c", ) assert response.is_closed is True @@ -123,7 +123,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.gpu_droplets.firewalls.with_streaming_response.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "bb4b2611-3d72-467b-8602-280330ecd65c", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -278,7 +278,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: @parametrize def test_method_delete(self, client: Gradient) -> None: firewall = client.gpu_droplets.firewalls.delete( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "bb4b2611-3d72-467b-8602-280330ecd65c", ) assert firewall is None @@ -286,7 +286,7 @@ def test_method_delete(self, client: Gradient) -> None: @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.gpu_droplets.firewalls.with_raw_response.delete( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "bb4b2611-3d72-467b-8602-280330ecd65c", ) assert response.is_closed is True @@ -298,7 +298,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.gpu_droplets.firewalls.with_streaming_response.delete( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "bb4b2611-3d72-467b-8602-280330ecd65c", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -403,7 +403,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: firewall = await async_client.gpu_droplets.firewalls.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "bb4b2611-3d72-467b-8602-280330ecd65c", ) assert_matches_type(FirewallRetrieveResponse, firewall, path=["response"]) @@ -411,7 +411,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.firewalls.with_raw_response.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "bb4b2611-3d72-467b-8602-280330ecd65c", ) assert response.is_closed is True @@ -423,7 +423,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.firewalls.with_streaming_response.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "bb4b2611-3d72-467b-8602-280330ecd65c", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -578,7 +578,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: firewall = await async_client.gpu_droplets.firewalls.delete( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "bb4b2611-3d72-467b-8602-280330ecd65c", ) assert firewall is None @@ -586,7 +586,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.firewalls.with_raw_response.delete( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "bb4b2611-3d72-467b-8602-280330ecd65c", ) assert response.is_closed is True @@ -598,7 +598,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.firewalls.with_streaming_response.delete( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "bb4b2611-3d72-467b-8602-280330ecd65c", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/gpu_droplets/test_floating_ips.py b/tests/api_resources/gpu_droplets/test_floating_ips.py index c252a24a..3119bf28 100644 --- a/tests/api_resources/gpu_droplets/test_floating_ips.py +++ b/tests/api_resources/gpu_droplets/test_floating_ips.py @@ -102,7 +102,7 @@ def test_streaming_response_create_overload_2(self, client: Gradient) -> None: @parametrize def test_method_retrieve(self, client: Gradient) -> None: floating_ip = client.gpu_droplets.floating_ips.retrieve( - "192.168.1.1", + "45.55.96.47", ) assert_matches_type(FloatingIPRetrieveResponse, floating_ip, path=["response"]) @@ -110,7 +110,7 @@ def test_method_retrieve(self, client: Gradient) -> None: @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.gpu_droplets.floating_ips.with_raw_response.retrieve( - "192.168.1.1", + "45.55.96.47", ) assert response.is_closed is True @@ -122,7 +122,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.gpu_droplets.floating_ips.with_streaming_response.retrieve( - "192.168.1.1", + "45.55.96.47", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -181,7 +181,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: @parametrize def test_method_delete(self, client: Gradient) -> None: floating_ip = client.gpu_droplets.floating_ips.delete( - "192.168.1.1", + "45.55.96.47", ) assert floating_ip is None @@ -189,7 +189,7 @@ def test_method_delete(self, client: Gradient) -> None: @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.gpu_droplets.floating_ips.with_raw_response.delete( - "192.168.1.1", + "45.55.96.47", ) assert response.is_closed is True @@ -201,7 +201,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.gpu_droplets.floating_ips.with_streaming_response.delete( - "192.168.1.1", + "45.55.96.47", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -306,7 +306,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGra @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: floating_ip = await async_client.gpu_droplets.floating_ips.retrieve( - "192.168.1.1", + "45.55.96.47", ) assert_matches_type(FloatingIPRetrieveResponse, floating_ip, path=["response"]) @@ -314,7 +314,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.floating_ips.with_raw_response.retrieve( - "192.168.1.1", + "45.55.96.47", ) assert response.is_closed is True @@ -326,7 +326,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.floating_ips.with_streaming_response.retrieve( - "192.168.1.1", + "45.55.96.47", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -385,7 +385,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: floating_ip = await async_client.gpu_droplets.floating_ips.delete( - "192.168.1.1", + "45.55.96.47", ) assert floating_ip is None @@ -393,7 +393,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.floating_ips.with_raw_response.delete( - "192.168.1.1", + "45.55.96.47", ) assert response.is_closed is True @@ -405,7 +405,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.floating_ips.with_streaming_response.delete( - "192.168.1.1", + "45.55.96.47", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/gpu_droplets/test_images.py b/tests/api_resources/gpu_droplets/test_images.py index 8f81912d..4c4146e2 100644 --- a/tests/api_resources/gpu_droplets/test_images.py +++ b/tests/api_resources/gpu_droplets/test_images.py @@ -186,7 +186,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: @parametrize def test_method_delete(self, client: Gradient) -> None: image = client.gpu_droplets.images.delete( - 0, + 62137902, ) assert image is None @@ -194,7 +194,7 @@ def test_method_delete(self, client: Gradient) -> None: @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.gpu_droplets.images.with_raw_response.delete( - 0, + 62137902, ) assert response.is_closed is True @@ -206,7 +206,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.gpu_droplets.images.with_streaming_response.delete( - 0, + 62137902, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -386,7 +386,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: image = await async_client.gpu_droplets.images.delete( - 0, + 62137902, ) assert image is None @@ -394,7 +394,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.images.with_raw_response.delete( - 0, + 62137902, ) assert response.is_closed is True @@ -406,7 +406,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.images.with_streaming_response.delete( - 0, + 62137902, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/gpu_droplets/test_load_balancers.py b/tests/api_resources/gpu_droplets/test_load_balancers.py index 5db3c20b..363520e4 100644 --- a/tests/api_resources/gpu_droplets/test_load_balancers.py +++ b/tests/api_resources/gpu_droplets/test_load_balancers.py @@ -278,7 +278,7 @@ def test_streaming_response_create_overload_2(self, client: Gradient) -> None: @parametrize def test_method_retrieve(self, client: Gradient) -> None: load_balancer = client.gpu_droplets.load_balancers.retrieve( - "lb_id", + "4de7ac8b-495b-4884-9a69-1050c6793cd6", ) assert_matches_type(LoadBalancerRetrieveResponse, load_balancer, path=["response"]) @@ -286,7 +286,7 @@ def test_method_retrieve(self, client: Gradient) -> None: @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.gpu_droplets.load_balancers.with_raw_response.retrieve( - "lb_id", + "4de7ac8b-495b-4884-9a69-1050c6793cd6", ) assert response.is_closed is True @@ -298,7 +298,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.gpu_droplets.load_balancers.with_streaming_response.retrieve( - "lb_id", + "4de7ac8b-495b-4884-9a69-1050c6793cd6", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -649,7 +649,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: @parametrize def test_method_delete(self, client: Gradient) -> None: load_balancer = client.gpu_droplets.load_balancers.delete( - "lb_id", + "4de7ac8b-495b-4884-9a69-1050c6793cd6", ) assert load_balancer is None @@ -657,7 +657,7 @@ def test_method_delete(self, client: Gradient) -> None: @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.gpu_droplets.load_balancers.with_raw_response.delete( - "lb_id", + "4de7ac8b-495b-4884-9a69-1050c6793cd6", ) assert response.is_closed is True @@ -669,7 +669,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.gpu_droplets.load_balancers.with_streaming_response.delete( - "lb_id", + "4de7ac8b-495b-4884-9a69-1050c6793cd6", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -691,7 +691,7 @@ def test_path_params_delete(self, client: Gradient) -> None: @parametrize def test_method_delete_cache(self, client: Gradient) -> None: load_balancer = client.gpu_droplets.load_balancers.delete_cache( - "lb_id", + "4de7ac8b-495b-4884-9a69-1050c6793cd6", ) assert load_balancer is None @@ -699,7 +699,7 @@ def test_method_delete_cache(self, client: Gradient) -> None: @parametrize def test_raw_response_delete_cache(self, client: Gradient) -> None: response = client.gpu_droplets.load_balancers.with_raw_response.delete_cache( - "lb_id", + "4de7ac8b-495b-4884-9a69-1050c6793cd6", ) assert response.is_closed is True @@ -711,7 +711,7 @@ def test_raw_response_delete_cache(self, client: Gradient) -> None: @parametrize def test_streaming_response_delete_cache(self, client: Gradient) -> None: with client.gpu_droplets.load_balancers.with_streaming_response.delete_cache( - "lb_id", + "4de7ac8b-495b-4884-9a69-1050c6793cd6", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -991,7 +991,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGra @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: load_balancer = await async_client.gpu_droplets.load_balancers.retrieve( - "lb_id", + "4de7ac8b-495b-4884-9a69-1050c6793cd6", ) assert_matches_type(LoadBalancerRetrieveResponse, load_balancer, path=["response"]) @@ -999,7 +999,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.load_balancers.with_raw_response.retrieve( - "lb_id", + "4de7ac8b-495b-4884-9a69-1050c6793cd6", ) assert response.is_closed is True @@ -1011,7 +1011,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.load_balancers.with_streaming_response.retrieve( - "lb_id", + "4de7ac8b-495b-4884-9a69-1050c6793cd6", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1362,7 +1362,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: load_balancer = await async_client.gpu_droplets.load_balancers.delete( - "lb_id", + "4de7ac8b-495b-4884-9a69-1050c6793cd6", ) assert load_balancer is None @@ -1370,7 +1370,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.load_balancers.with_raw_response.delete( - "lb_id", + "4de7ac8b-495b-4884-9a69-1050c6793cd6", ) assert response.is_closed is True @@ -1382,7 +1382,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.load_balancers.with_streaming_response.delete( - "lb_id", + "4de7ac8b-495b-4884-9a69-1050c6793cd6", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1404,7 +1404,7 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_method_delete_cache(self, async_client: AsyncGradient) -> None: load_balancer = await async_client.gpu_droplets.load_balancers.delete_cache( - "lb_id", + "4de7ac8b-495b-4884-9a69-1050c6793cd6", ) assert load_balancer is None @@ -1412,7 +1412,7 @@ async def test_method_delete_cache(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_delete_cache(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.load_balancers.with_raw_response.delete_cache( - "lb_id", + "4de7ac8b-495b-4884-9a69-1050c6793cd6", ) assert response.is_closed is True @@ -1424,7 +1424,7 @@ async def test_raw_response_delete_cache(self, async_client: AsyncGradient) -> N @parametrize async def test_streaming_response_delete_cache(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.load_balancers.with_streaming_response.delete_cache( - "lb_id", + "4de7ac8b-495b-4884-9a69-1050c6793cd6", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/gpu_droplets/test_volumes.py b/tests/api_resources/gpu_droplets/test_volumes.py index f9b3778c..8243625d 100644 --- a/tests/api_resources/gpu_droplets/test_volumes.py +++ b/tests/api_resources/gpu_droplets/test_volumes.py @@ -135,7 +135,7 @@ def test_streaming_response_create_overload_2(self, client: Gradient) -> None: @parametrize def test_method_retrieve(self, client: Gradient) -> None: volume = client.gpu_droplets.volumes.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "7724db7c-e098-11e5-b522-000f53304e51", ) assert_matches_type(VolumeRetrieveResponse, volume, path=["response"]) @@ -143,7 +143,7 @@ def test_method_retrieve(self, client: Gradient) -> None: @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.gpu_droplets.volumes.with_raw_response.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "7724db7c-e098-11e5-b522-000f53304e51", ) assert response.is_closed is True @@ -155,7 +155,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.gpu_droplets.volumes.with_streaming_response.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "7724db7c-e098-11e5-b522-000f53304e51", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -216,7 +216,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: @parametrize def test_method_delete(self, client: Gradient) -> None: volume = client.gpu_droplets.volumes.delete( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "7724db7c-e098-11e5-b522-000f53304e51", ) assert volume is None @@ -224,7 +224,7 @@ def test_method_delete(self, client: Gradient) -> None: @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.gpu_droplets.volumes.with_raw_response.delete( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "7724db7c-e098-11e5-b522-000f53304e51", ) assert response.is_closed is True @@ -236,7 +236,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.gpu_droplets.volumes.with_streaming_response.delete( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "7724db7c-e098-11e5-b522-000f53304e51", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -411,7 +411,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGra @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: volume = await async_client.gpu_droplets.volumes.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "7724db7c-e098-11e5-b522-000f53304e51", ) assert_matches_type(VolumeRetrieveResponse, volume, path=["response"]) @@ -419,7 +419,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.volumes.with_raw_response.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "7724db7c-e098-11e5-b522-000f53304e51", ) assert response.is_closed is True @@ -431,7 +431,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.volumes.with_streaming_response.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "7724db7c-e098-11e5-b522-000f53304e51", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -492,7 +492,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: volume = await async_client.gpu_droplets.volumes.delete( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "7724db7c-e098-11e5-b522-000f53304e51", ) assert volume is None @@ -500,7 +500,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.volumes.with_raw_response.delete( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "7724db7c-e098-11e5-b522-000f53304e51", ) assert response.is_closed is True @@ -512,7 +512,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.volumes.with_streaming_response.delete( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "7724db7c-e098-11e5-b522-000f53304e51", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/gpu_droplets/volumes/test_snapshots.py b/tests/api_resources/gpu_droplets/volumes/test_snapshots.py index e3450001..ec157513 100644 --- a/tests/api_resources/gpu_droplets/volumes/test_snapshots.py +++ b/tests/api_resources/gpu_droplets/volumes/test_snapshots.py @@ -81,7 +81,7 @@ def test_path_params_create(self, client: Gradient) -> None: @parametrize def test_method_retrieve(self, client: Gradient) -> None: snapshot = client.gpu_droplets.volumes.snapshots.retrieve( - "snapshot_id", + "fbe805e8-866b-11e6-96bf-000f53315a41", ) assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) @@ -89,7 +89,7 @@ def test_method_retrieve(self, client: Gradient) -> None: @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.gpu_droplets.volumes.snapshots.with_raw_response.retrieve( - "snapshot_id", + "fbe805e8-866b-11e6-96bf-000f53315a41", ) assert response.is_closed is True @@ -101,7 +101,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.gpu_droplets.volumes.snapshots.with_streaming_response.retrieve( - "snapshot_id", + "fbe805e8-866b-11e6-96bf-000f53315a41", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -175,7 +175,7 @@ def test_path_params_list(self, client: Gradient) -> None: @parametrize def test_method_delete(self, client: Gradient) -> None: snapshot = client.gpu_droplets.volumes.snapshots.delete( - "snapshot_id", + "fbe805e8-866b-11e6-96bf-000f53315a41", ) assert snapshot is None @@ -183,7 +183,7 @@ def test_method_delete(self, client: Gradient) -> None: @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.gpu_droplets.volumes.snapshots.with_raw_response.delete( - "snapshot_id", + "fbe805e8-866b-11e6-96bf-000f53315a41", ) assert response.is_closed is True @@ -195,7 +195,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.gpu_droplets.volumes.snapshots.with_streaming_response.delete( - "snapshot_id", + "fbe805e8-866b-11e6-96bf-000f53315a41", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -279,7 +279,7 @@ async def test_path_params_create(self, async_client: AsyncGradient) -> None: @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: snapshot = await async_client.gpu_droplets.volumes.snapshots.retrieve( - "snapshot_id", + "fbe805e8-866b-11e6-96bf-000f53315a41", ) assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) @@ -287,7 +287,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.volumes.snapshots.with_raw_response.retrieve( - "snapshot_id", + "fbe805e8-866b-11e6-96bf-000f53315a41", ) assert response.is_closed is True @@ -299,7 +299,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.volumes.snapshots.with_streaming_response.retrieve( - "snapshot_id", + "fbe805e8-866b-11e6-96bf-000f53315a41", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -373,7 +373,7 @@ async def test_path_params_list(self, async_client: AsyncGradient) -> None: @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: snapshot = await async_client.gpu_droplets.volumes.snapshots.delete( - "snapshot_id", + "fbe805e8-866b-11e6-96bf-000f53315a41", ) assert snapshot is None @@ -381,7 +381,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.volumes.snapshots.with_raw_response.delete( - "snapshot_id", + "fbe805e8-866b-11e6-96bf-000f53315a41", ) assert response.is_closed is True @@ -393,7 +393,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.volumes.snapshots.with_streaming_response.delete( - "snapshot_id", + "fbe805e8-866b-11e6-96bf-000f53315a41", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/inference/test_api_keys.py b/tests/api_resources/inference/test_api_keys.py index d9745710..0bbfa00f 100644 --- a/tests/api_resources/inference/test_api_keys.py +++ b/tests/api_resources/inference/test_api_keys.py @@ -152,7 +152,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: @parametrize def test_method_delete(self, client: Gradient) -> None: api_key = client.inference.api_keys.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(APIKeyDeleteResponse, api_key, path=["response"]) @@ -160,7 +160,7 @@ def test_method_delete(self, client: Gradient) -> None: @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.inference.api_keys.with_raw_response.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -172,7 +172,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.inference.api_keys.with_streaming_response.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -194,7 +194,7 @@ def test_path_params_delete(self, client: Gradient) -> None: @parametrize def test_method_update_regenerate(self, client: Gradient) -> None: api_key = client.inference.api_keys.update_regenerate( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(APIKeyUpdateRegenerateResponse, api_key, path=["response"]) @@ -202,7 +202,7 @@ def test_method_update_regenerate(self, client: Gradient) -> None: @parametrize def test_raw_response_update_regenerate(self, client: Gradient) -> None: response = client.inference.api_keys.with_raw_response.update_regenerate( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -214,7 +214,7 @@ def test_raw_response_update_regenerate(self, client: Gradient) -> None: @parametrize def test_streaming_response_update_regenerate(self, client: Gradient) -> None: with client.inference.api_keys.with_streaming_response.update_regenerate( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -367,7 +367,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: api_key = await async_client.inference.api_keys.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(APIKeyDeleteResponse, api_key, path=["response"]) @@ -375,7 +375,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.inference.api_keys.with_raw_response.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -387,7 +387,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.inference.api_keys.with_streaming_response.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -409,7 +409,7 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_method_update_regenerate(self, async_client: AsyncGradient) -> None: api_key = await async_client.inference.api_keys.update_regenerate( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(APIKeyUpdateRegenerateResponse, api_key, path=["response"]) @@ -417,7 +417,7 @@ async def test_method_update_regenerate(self, async_client: AsyncGradient) -> No @parametrize async def test_raw_response_update_regenerate(self, async_client: AsyncGradient) -> None: response = await async_client.inference.api_keys.with_raw_response.update_regenerate( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -429,7 +429,7 @@ async def test_raw_response_update_regenerate(self, async_client: AsyncGradient) @parametrize async def test_streaming_response_update_regenerate(self, async_client: AsyncGradient) -> None: async with async_client.inference.api_keys.with_streaming_response.update_regenerate( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/knowledge_bases/test_indexing_jobs.py b/tests/api_resources/knowledge_bases/test_indexing_jobs.py index 8840edfe..3dffaa69 100644 --- a/tests/api_resources/knowledge_bases/test_indexing_jobs.py +++ b/tests/api_resources/knowledge_bases/test_indexing_jobs.py @@ -64,7 +64,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: @parametrize def test_method_retrieve(self, client: Gradient) -> None: indexing_job = client.knowledge_bases.indexing_jobs.retrieve( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(IndexingJobRetrieveResponse, indexing_job, path=["response"]) @@ -72,7 +72,7 @@ def test_method_retrieve(self, client: Gradient) -> None: @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.knowledge_bases.indexing_jobs.with_raw_response.retrieve( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -84,7 +84,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.knowledge_bases.indexing_jobs.with_streaming_response.retrieve( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -143,7 +143,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: @parametrize def test_method_retrieve_data_sources(self, client: Gradient) -> None: indexing_job = client.knowledge_bases.indexing_jobs.retrieve_data_sources( - "indexing_job_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(IndexingJobRetrieveDataSourcesResponse, indexing_job, path=["response"]) @@ -151,7 +151,7 @@ def test_method_retrieve_data_sources(self, client: Gradient) -> None: @parametrize def test_raw_response_retrieve_data_sources(self, client: Gradient) -> None: response = client.knowledge_bases.indexing_jobs.with_raw_response.retrieve_data_sources( - "indexing_job_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -163,7 +163,7 @@ def test_raw_response_retrieve_data_sources(self, client: Gradient) -> None: @parametrize def test_streaming_response_retrieve_data_sources(self, client: Gradient) -> None: with client.knowledge_bases.indexing_jobs.with_streaming_response.retrieve_data_sources( - "indexing_job_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -279,7 +279,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: indexing_job = await async_client.knowledge_bases.indexing_jobs.retrieve( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(IndexingJobRetrieveResponse, indexing_job, path=["response"]) @@ -287,7 +287,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.knowledge_bases.indexing_jobs.with_raw_response.retrieve( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -299,7 +299,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.knowledge_bases.indexing_jobs.with_streaming_response.retrieve( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -358,7 +358,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non @parametrize async def test_method_retrieve_data_sources(self, async_client: AsyncGradient) -> None: indexing_job = await async_client.knowledge_bases.indexing_jobs.retrieve_data_sources( - "indexing_job_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(IndexingJobRetrieveDataSourcesResponse, indexing_job, path=["response"]) @@ -366,7 +366,7 @@ async def test_method_retrieve_data_sources(self, async_client: AsyncGradient) - @parametrize async def test_raw_response_retrieve_data_sources(self, async_client: AsyncGradient) -> None: response = await async_client.knowledge_bases.indexing_jobs.with_raw_response.retrieve_data_sources( - "indexing_job_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -378,7 +378,7 @@ async def test_raw_response_retrieve_data_sources(self, async_client: AsyncGradi @parametrize async def test_streaming_response_retrieve_data_sources(self, async_client: AsyncGradient) -> None: async with async_client.knowledge_bases.indexing_jobs.with_streaming_response.retrieve_data_sources( - "indexing_job_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/models/providers/test_anthropic.py b/tests/api_resources/models/providers/test_anthropic.py index 60cb0c16..b0aeb37c 100644 --- a/tests/api_resources/models/providers/test_anthropic.py +++ b/tests/api_resources/models/providers/test_anthropic.py @@ -65,7 +65,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: @parametrize def test_method_retrieve(self, client: Gradient) -> None: anthropic = client.models.providers.anthropic.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(AnthropicRetrieveResponse, anthropic, path=["response"]) @@ -73,7 +73,7 @@ def test_method_retrieve(self, client: Gradient) -> None: @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.models.providers.anthropic.with_raw_response.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -85,7 +85,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.models.providers.anthropic.with_streaming_response.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -197,7 +197,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: @parametrize def test_method_delete(self, client: Gradient) -> None: anthropic = client.models.providers.anthropic.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(AnthropicDeleteResponse, anthropic, path=["response"]) @@ -205,7 +205,7 @@ def test_method_delete(self, client: Gradient) -> None: @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.models.providers.anthropic.with_raw_response.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -217,7 +217,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.models.providers.anthropic.with_streaming_response.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -334,7 +334,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: anthropic = await async_client.models.providers.anthropic.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(AnthropicRetrieveResponse, anthropic, path=["response"]) @@ -342,7 +342,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.models.providers.anthropic.with_raw_response.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -354,7 +354,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.models.providers.anthropic.with_streaming_response.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -466,7 +466,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: anthropic = await async_client.models.providers.anthropic.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(AnthropicDeleteResponse, anthropic, path=["response"]) @@ -474,7 +474,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.models.providers.anthropic.with_raw_response.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -486,7 +486,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.models.providers.anthropic.with_streaming_response.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/models/providers/test_openai.py b/tests/api_resources/models/providers/test_openai.py index 8f9c1f80..c5780e05 100644 --- a/tests/api_resources/models/providers/test_openai.py +++ b/tests/api_resources/models/providers/test_openai.py @@ -65,7 +65,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: @parametrize def test_method_retrieve(self, client: Gradient) -> None: openai = client.models.providers.openai.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(OpenAIRetrieveResponse, openai, path=["response"]) @@ -73,7 +73,7 @@ def test_method_retrieve(self, client: Gradient) -> None: @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.models.providers.openai.with_raw_response.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -85,7 +85,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.models.providers.openai.with_streaming_response.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -197,7 +197,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: @parametrize def test_method_delete(self, client: Gradient) -> None: openai = client.models.providers.openai.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(OpenAIDeleteResponse, openai, path=["response"]) @@ -205,7 +205,7 @@ def test_method_delete(self, client: Gradient) -> None: @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.models.providers.openai.with_raw_response.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -217,7 +217,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.models.providers.openai.with_streaming_response.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -334,7 +334,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: openai = await async_client.models.providers.openai.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(OpenAIRetrieveResponse, openai, path=["response"]) @@ -342,7 +342,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.models.providers.openai.with_raw_response.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -354,7 +354,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.models.providers.openai.with_streaming_response.retrieve( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -466,7 +466,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: openai = await async_client.models.providers.openai.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(OpenAIDeleteResponse, openai, path=["response"]) @@ -474,7 +474,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.models.providers.openai.with_raw_response.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -486,7 +486,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.models.providers.openai.with_streaming_response.delete( - "api_key_uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index 6d040d18..2069d2d8 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -74,7 +74,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: @parametrize def test_method_retrieve(self, client: Gradient) -> None: agent = client.agents.retrieve( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(AgentRetrieveResponse, agent, path=["response"]) @@ -82,7 +82,7 @@ def test_method_retrieve(self, client: Gradient) -> None: @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.agents.with_raw_response.retrieve( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -94,7 +94,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.agents.with_streaming_response.retrieve( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -221,7 +221,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: @parametrize def test_method_delete(self, client: Gradient) -> None: agent = client.agents.delete( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(AgentDeleteResponse, agent, path=["response"]) @@ -229,7 +229,7 @@ def test_method_delete(self, client: Gradient) -> None: @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.agents.with_raw_response.delete( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -241,7 +241,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.agents.with_streaming_response.delete( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -418,7 +418,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: agent = await async_client.agents.retrieve( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(AgentRetrieveResponse, agent, path=["response"]) @@ -426,7 +426,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.agents.with_raw_response.retrieve( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -438,7 +438,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.agents.with_streaming_response.retrieve( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -565,7 +565,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: agent = await async_client.agents.delete( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(AgentDeleteResponse, agent, path=["response"]) @@ -573,7 +573,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.agents.with_raw_response.delete( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -585,7 +585,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.agents.with_streaming_response.delete( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_gpu_droplets.py b/tests/api_resources/test_gpu_droplets.py index 0cb27fbb..7d50c037 100644 --- a/tests/api_resources/test_gpu_droplets.py +++ b/tests/api_resources/test_gpu_droplets.py @@ -161,7 +161,7 @@ def test_streaming_response_create_overload_2(self, client: Gradient) -> None: @parametrize def test_method_retrieve(self, client: Gradient) -> None: gpu_droplet = client.gpu_droplets.retrieve( - 1, + 3164444, ) assert_matches_type(GPUDropletRetrieveResponse, gpu_droplet, path=["response"]) @@ -169,7 +169,7 @@ def test_method_retrieve(self, client: Gradient) -> None: @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.gpu_droplets.with_raw_response.retrieve( - 1, + 3164444, ) assert response.is_closed is True @@ -181,7 +181,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.gpu_droplets.with_streaming_response.retrieve( - 1, + 3164444, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -235,7 +235,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: @parametrize def test_method_delete(self, client: Gradient) -> None: gpu_droplet = client.gpu_droplets.delete( - 1, + 3164444, ) assert gpu_droplet is None @@ -243,7 +243,7 @@ def test_method_delete(self, client: Gradient) -> None: @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.gpu_droplets.with_raw_response.delete( - 1, + 3164444, ) assert response.is_closed is True @@ -255,7 +255,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.gpu_droplets.with_streaming_response.delete( - 1, + 3164444, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -391,7 +391,7 @@ def test_streaming_response_list_kernels(self, client: Gradient) -> None: @parametrize def test_method_list_neighbors(self, client: Gradient) -> None: gpu_droplet = client.gpu_droplets.list_neighbors( - 1, + 3164444, ) assert_matches_type(GPUDropletListNeighborsResponse, gpu_droplet, path=["response"]) @@ -399,7 +399,7 @@ def test_method_list_neighbors(self, client: Gradient) -> None: @parametrize def test_raw_response_list_neighbors(self, client: Gradient) -> None: response = client.gpu_droplets.with_raw_response.list_neighbors( - 1, + 3164444, ) assert response.is_closed is True @@ -411,7 +411,7 @@ def test_raw_response_list_neighbors(self, client: Gradient) -> None: @parametrize def test_streaming_response_list_neighbors(self, client: Gradient) -> None: with client.gpu_droplets.with_streaming_response.list_neighbors( - 1, + 3164444, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -607,7 +607,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGra @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: gpu_droplet = await async_client.gpu_droplets.retrieve( - 1, + 3164444, ) assert_matches_type(GPUDropletRetrieveResponse, gpu_droplet, path=["response"]) @@ -615,7 +615,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.with_raw_response.retrieve( - 1, + 3164444, ) assert response.is_closed is True @@ -627,7 +627,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.with_streaming_response.retrieve( - 1, + 3164444, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -681,7 +681,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: gpu_droplet = await async_client.gpu_droplets.delete( - 1, + 3164444, ) assert gpu_droplet is None @@ -689,7 +689,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.with_raw_response.delete( - 1, + 3164444, ) assert response.is_closed is True @@ -701,7 +701,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.with_streaming_response.delete( - 1, + 3164444, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -837,7 +837,7 @@ async def test_streaming_response_list_kernels(self, async_client: AsyncGradient @parametrize async def test_method_list_neighbors(self, async_client: AsyncGradient) -> None: gpu_droplet = await async_client.gpu_droplets.list_neighbors( - 1, + 3164444, ) assert_matches_type(GPUDropletListNeighborsResponse, gpu_droplet, path=["response"]) @@ -845,7 +845,7 @@ async def test_method_list_neighbors(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_list_neighbors(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.with_raw_response.list_neighbors( - 1, + 3164444, ) assert response.is_closed is True @@ -857,7 +857,7 @@ async def test_raw_response_list_neighbors(self, async_client: AsyncGradient) -> @parametrize async def test_streaming_response_list_neighbors(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.with_streaming_response.list_neighbors( - 1, + 3164444, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_knowledge_bases.py b/tests/api_resources/test_knowledge_bases.py index 82698131..62965775 100644 --- a/tests/api_resources/test_knowledge_bases.py +++ b/tests/api_resources/test_knowledge_bases.py @@ -102,7 +102,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: @parametrize def test_method_retrieve(self, client: Gradient) -> None: knowledge_base = client.knowledge_bases.retrieve( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(KnowledgeBaseRetrieveResponse, knowledge_base, path=["response"]) @@ -110,7 +110,7 @@ def test_method_retrieve(self, client: Gradient) -> None: @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.knowledge_bases.with_raw_response.retrieve( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -122,7 +122,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.knowledge_bases.with_streaming_response.retrieve( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -237,7 +237,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: @parametrize def test_method_delete(self, client: Gradient) -> None: knowledge_base = client.knowledge_bases.delete( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(KnowledgeBaseDeleteResponse, knowledge_base, path=["response"]) @@ -245,7 +245,7 @@ def test_method_delete(self, client: Gradient) -> None: @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.knowledge_bases.with_raw_response.delete( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -257,7 +257,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.knowledge_bases.with_streaming_response.delete( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -360,7 +360,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: knowledge_base = await async_client.knowledge_bases.retrieve( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(KnowledgeBaseRetrieveResponse, knowledge_base, path=["response"]) @@ -368,7 +368,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.knowledge_bases.with_raw_response.retrieve( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -380,7 +380,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.knowledge_bases.with_streaming_response.retrieve( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -495,7 +495,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: knowledge_base = await async_client.knowledge_bases.delete( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert_matches_type(KnowledgeBaseDeleteResponse, knowledge_base, path=["response"]) @@ -503,7 +503,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.knowledge_bases.with_raw_response.delete( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) assert response.is_closed is True @@ -515,7 +515,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.knowledge_bases.with_streaming_response.delete( - "uuid", + '"123e4567-e89b-12d3-a456-426614174000"', ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/test_smoke_sdk.py b/tests/test_smoke_sdk.py new file mode 100644 index 00000000..41358ce2 --- /dev/null +++ b/tests/test_smoke_sdk.py @@ -0,0 +1,84 @@ +from __future__ import annotations + +import os + +import pytest + +from gradient import Gradient + +REQUIRED_ENV_VARS = ( + "DIGITALOCEAN_ACCESS_TOKEN", + "GRADIENT_MODEL_ACCESS_KEY", + "GRADIENT_AGENT_ACCESS_KEY", + "GRADIENT_AGENT_ENDPOINT", +) + + +@pytest.mark.smoke +def test_smoke_environment_and_client_state() -> None: + """Validate required env vars, client auto-loaded properties, and perform a minimal API call. + + This central test ensures environment configuration & client state are correct so other sync + smoke tests can focus purely on API behavior without repeating these assertions. + """ + missing = [k for k in REQUIRED_ENV_VARS if not os.getenv(k)] + if missing: + pytest.fail( + "Missing required environment variables for smoke tests: " + ", ".join(missing), + pytrace=False, + ) + + client = Gradient() + + # Property assertions (auto-loaded from environment) + assert client.access_token == os.environ["DIGITALOCEAN_ACCESS_TOKEN"], "access_token not loaded from env" + assert client.model_access_key == os.environ["GRADIENT_MODEL_ACCESS_KEY"], "model_access_key not loaded from env" + assert client.agent_access_key == os.environ["GRADIENT_AGENT_ACCESS_KEY"], "agent_access_key not loaded from env" + expected_endpoint = os.environ["GRADIENT_AGENT_ENDPOINT"] + normalized_expected = ( + expected_endpoint if expected_endpoint.startswith("https://") else f"https://{expected_endpoint}" + ) + assert client.agent_endpoint == normalized_expected, "agent_endpoint not derived correctly from env" + + +@pytest.mark.smoke +def test_smoke_agents_listing() -> None: + client = Gradient() + # Minimal API surface check (agents list) + agents_list = client.agents.list() + assert agents_list is not None + assert hasattr(agents_list, "agents") + + +@pytest.mark.smoke +def test_smoke_gpu_droplets_listing() -> None: + client = Gradient() + droplets_list = client.gpu_droplets.list(type="gpus") + assert droplets_list is not None + assert hasattr(droplets_list, "droplets") + + +@pytest.mark.smoke +def test_smoke_inference_completion() -> None: + inference_client = Gradient() + completion = inference_client.chat.completions.create( + model="llama3-8b-instruct", + messages=[{"role": "user", "content": "ping"}], + ) + # Basic structural checks + assert completion is not None + assert completion.choices, "Expected at least one choice in completion response" + assert completion.choices[0].message.content is not None + + +@pytest.mark.smoke +def test_smoke_agent_inference_chat() -> None: + agent_client = Gradient() + + # Model may be resolved implicitly; if an explicit model is required and missing this can be adapted + completion = agent_client.agents.chat.completions.create( + model="", # Intentionally blank per original example; adjust if backend requires non-empty + messages=[{"role": "user", "content": "ping"}], + ) + assert completion is not None + assert completion.choices diff --git a/tests/test_smoke_sdk_async.py b/tests/test_smoke_sdk_async.py new file mode 100644 index 00000000..e732ec73 --- /dev/null +++ b/tests/test_smoke_sdk_async.py @@ -0,0 +1,85 @@ +from __future__ import annotations + +import os + +import pytest + +from gradient import AsyncGradient + +REQUIRED_ENV_VARS = ( + "DIGITALOCEAN_ACCESS_TOKEN", + "GRADIENT_MODEL_ACCESS_KEY", + "GRADIENT_AGENT_ACCESS_KEY", + "GRADIENT_AGENT_ENDPOINT", +) + + +@pytest.mark.smoke +@pytest.mark.asyncio +async def test_async_smoke_environment_and_client_state() -> None: + """Validate required env vars, client auto-loaded properties, and perform a minimal API call. + + This central test ensures environment configuration & client state are correct so other async + smoke tests can focus purely on API behavior without repeating these assertions. + """ + missing = [k for k in REQUIRED_ENV_VARS if not os.getenv(k)] + if missing: + pytest.fail( + "Missing required environment variables for async smoke tests: " + ", ".join(missing), + pytrace=False, + ) + + client = AsyncGradient() + + # Property assertions (auto-loaded from environment) + assert client.access_token == os.environ["DIGITALOCEAN_ACCESS_TOKEN"], "access_token not loaded from env" + assert client.model_access_key == os.environ["GRADIENT_MODEL_ACCESS_KEY"], "model_access_key not loaded from env" + assert client.agent_access_key == os.environ["GRADIENT_AGENT_ACCESS_KEY"], "agent_access_key not loaded from env" + expected_endpoint = os.environ["GRADIENT_AGENT_ENDPOINT"] + normalized_expected = ( + expected_endpoint if expected_endpoint.startswith("https://") else f"https://{expected_endpoint}" + ) + assert client.agent_endpoint == normalized_expected, "agent_endpoint not derived correctly from env" + + +@pytest.mark.smoke +@pytest.mark.asyncio +async def test_async_smoke_agents_listing() -> None: + client = AsyncGradient() + agents_list = await client.agents.list() + assert agents_list is not None + assert hasattr(agents_list, "agents") + + +@pytest.mark.smoke +@pytest.mark.asyncio +async def test_async_smoke_gpu_droplets_listing() -> None: + client = AsyncGradient() + droplets_list = await client.gpu_droplets.list(type="gpus") + assert droplets_list is not None + assert hasattr(droplets_list, "droplets") + + +@pytest.mark.smoke +@pytest.mark.asyncio +async def test_async_smoke_inference_completion() -> None: + inference_client = AsyncGradient() + completion = await inference_client.chat.completions.create( + model="llama3-8b-instruct", + messages=[{"role": "user", "content": "ping"}], + ) + assert completion is not None + assert completion.choices + assert completion.choices[0].message.content is not None + + +@pytest.mark.smoke +@pytest.mark.asyncio +async def test_async_smoke_agent_inference_chat() -> None: + agent_client = AsyncGradient() + completion = await agent_client.agents.chat.completions.create( + model="", + messages=[{"role": "user", "content": "ping"}], + ) + assert completion is not None + assert completion.choices diff --git a/tests/test_transform.py b/tests/test_transform.py index db909f25..098015a9 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -8,7 +8,7 @@ import pytest -from gradient._types import NOT_GIVEN, Base64FileInput +from gradient._types import Base64FileInput, omit, not_given from gradient._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 e4cf6a8b5b37acf483be7301aa0a661a5db43a05 Mon Sep 17 00:00:00 2001 From: Ben Batha Date: Wed, 24 Sep 2025 13:42:53 -0400 Subject: [PATCH 20/96] chore: remove preview warning --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index 873e2693..30b7c75a 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,6 @@ # Gradient Python API library -### 🚧 Preview Status - -> Gradient SDK is currently in **preview**. It is reasonably stable and suitable for use, but **some features and APIs may still change** as development continues. -> Use with care in production environments and keep an eye on releases for updates or breaking changes. - [![PyPI version](https://img.shields.io/pypi/v/gradient.svg?label=pypi%20(stable))](https://pypi.org/project/gradient/) [![Docs](https://img.shields.io/badge/Docs-8A2BE2)](https://gradientai.digitalocean.com/getting-started/overview/) From d92383da134a32cb0ae6f5a1c3044ec4947deacc Mon Sep 17 00:00:00 2001 From: Ben Batha Date: Mon, 29 Sep 2025 12:24:00 -0400 Subject: [PATCH 21/96] chore: fix bash quoting --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3e8ddc4..219e8326 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: - name: Install Rye run: | curl -sSf https://rye.astral.sh/get | bash - echo "$HOME/.rye/shims" >> $GITHUB_PATH + echo "$HOME/.rye/shims" >> "$GITHUB_PATH" env: RYE_VERSION: "0.44.0" RYE_INSTALL_OPTION: "--yes" @@ -49,7 +49,7 @@ jobs: - name: Install Rye run: | curl -sSf https://rye.astral.sh/get | bash - echo "$HOME/.rye/shims" >> $GITHUB_PATH + echo "$HOME/.rye/shims" >> "$GITHUB_PATH" env: RYE_VERSION: "0.44.0" RYE_INSTALL_OPTION: "--yes" @@ -86,7 +86,7 @@ jobs: - name: Install Rye run: | curl -sSf https://rye.astral.sh/get | bash - echo "$HOME/.rye/shims" >> $GITHUB_PATH + echo "$HOME/.rye/shims" >> "$GITHUB_PATH" env: RYE_VERSION: "0.44.0" RYE_INSTALL_OPTION: "--yes" @@ -109,7 +109,7 @@ jobs: - name: Install Rye run: | curl -sSf https://rye.astral.sh/get | bash - echo "$HOME/.rye/shims" >> $GITHUB_PATH + echo "$HOME/.rye/shims" >> "$GITHUB_PATH" env: RYE_VERSION: "0.44.0" RYE_INSTALL_OPTION: "--yes" From 6673263dbdee2ae77eabd2f6d88cf61921f9e63c Mon Sep 17 00:00:00 2001 From: Ben Batha Date: Mon, 29 Sep 2025 12:24:19 -0400 Subject: [PATCH 22/96] chore: quote bash variables --- .github/workflows/publish-pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 79ee5b7d..cb2d6509 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -19,7 +19,7 @@ jobs: - name: Install Rye run: | curl -sSf https://rye.astral.sh/get | bash - echo "$HOME/.rye/shims" >> $GITHUB_PATH + echo "$HOME/.rye/shims" >> "$GITHUB_PATH" env: RYE_VERSION: '0.44.0' RYE_INSTALL_OPTION: '--yes' From 7056460cef8093329da4ed24f2e7bd286213e90d Mon Sep 17 00:00:00 2001 From: Ben Batha Date: Mon, 29 Sep 2025 12:28:26 -0400 Subject: [PATCH 23/96] chore: update actions versions --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 219e8326..ffd92fb9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,7 @@ jobs: - name: Get GitHub OIDC Token if: github.repository == 'stainless-sdks/gradient-python' id: github-oidc - uses: actions/github-script@v6 + uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); From e597aef60f9eaefb576af3e23416c4e03e549507 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 11:07:23 -0400 Subject: [PATCH 24/96] release: 3.1.0 (#45) --- .release-please-manifest.json | 2 +- .stats.yml | 8 +- CHANGELOG.md | 24 + api.md | 20 + pyproject.toml | 2 +- src/gradient/_client.py | 38 + src/gradient/_version.py | 2 +- src/gradient/resources/__init__.py | 14 + src/gradient/resources/images/__init__.py | 33 + src/gradient/resources/images/generations.py | 706 ++++++++++++++++++ src/gradient/resources/images/images.py | 102 +++ .../resources/knowledge_bases/data_sources.py | 94 +++ src/gradient/types/__init__.py | 3 + .../agents/chat/completion_create_params.py | 68 +- .../agents/chat/completion_create_response.py | 3 + .../types/chat/completion_create_params.py | 68 +- .../types/chat/completion_create_response.py | 3 + .../types/gpu_droplets/account/__init__.py | 1 + .../account/key_create_response.py | 33 +- .../gpu_droplets/account/key_list_response.py | 33 +- .../account/key_retrieve_response.py | 33 +- .../account/key_update_response.py | 33 +- .../types/gpu_droplets/account/ssh_keys.py | 35 + src/gradient/types/images/__init__.py | 6 + .../types/images/generation_create_params.py | 100 +++ .../images/generation_create_response.py | 63 ++ .../types/knowledge_bases/__init__.py | 6 + ...ata_source_create_presigned_urls_params.py | 21 + ...a_source_create_presigned_urls_response.py | 30 + src/gradient/types/shared/__init__.py | 3 + .../types/shared/chat_completion_chunk.py | 3 + .../types/shared/image_gen_completed_event.py | 55 ++ .../shared/image_gen_partial_image_event.py | 33 + .../types/shared/image_gen_stream_event.py | 14 + src/gradient/types/shared/size.py | 2 +- tests/api_resources/images/__init__.py | 1 + .../api_resources/images/test_generations.py | 240 ++++++ .../knowledge_bases/test_data_sources.py | 85 +++ 38 files changed, 1884 insertions(+), 136 deletions(-) create mode 100644 src/gradient/resources/images/__init__.py create mode 100644 src/gradient/resources/images/generations.py create mode 100644 src/gradient/resources/images/images.py create mode 100644 src/gradient/types/gpu_droplets/account/ssh_keys.py create mode 100644 src/gradient/types/images/__init__.py create mode 100644 src/gradient/types/images/generation_create_params.py create mode 100644 src/gradient/types/images/generation_create_response.py create mode 100644 src/gradient/types/knowledge_bases/data_source_create_presigned_urls_params.py create mode 100644 src/gradient/types/knowledge_bases/data_source_create_presigned_urls_response.py create mode 100644 src/gradient/types/shared/image_gen_completed_event.py create mode 100644 src/gradient/types/shared/image_gen_partial_image_event.py create mode 100644 src/gradient/types/shared/image_gen_stream_event.py create mode 100644 tests/api_resources/images/__init__.py create mode 100644 tests/api_resources/images/test_generations.py diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a1304a17..e0dc5001 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.0.2" + ".": "3.1.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index e30c19b7..13507cd5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 173 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-621c3ebf5011c5ca508f78fccbea17de4ca6b35bfe99578c1ae2265021578d6f.yml -openapi_spec_hash: e29d14e3e4679fcf22b3e760e49931b1 -config_hash: 3d425c415b7f7ab581418b43eb521cb3 +configured_endpoints: 175 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-40c154e2fdc4fef9ca1cf8329c29b7102bf324acfc9589571d6f3452d1ca579c.yml +openapi_spec_hash: 83a3d092965fde776b29b61f785459f9 +config_hash: dd3a0f16fb9e072bb63c570b14beccd2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 099062d4..0fed586c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## 3.1.0 (2025-10-03) + +Full Changelog: [v3.0.2...v3.1.0](https://github.com/digitalocean/gradient-python/compare/v3.0.2...v3.1.0) + +### Features + +* **api:** update via SDK Studio ([20f2512](https://github.com/digitalocean/gradient-python/commit/20f251223fbe35fbe170b07be41fa6fd2656eed7)) +* **api:** update via SDK Studio ([09bf61b](https://github.com/digitalocean/gradient-python/commit/09bf61b5c24b1299a84ea6e8d4df3b88118d9fc3)) +* **api:** update via SDK Studio ([76d29b6](https://github.com/digitalocean/gradient-python/commit/76d29b61ce039f3f270715135ab4d0f444a52b3c)) +* **api:** update via SDK Studio ([fa68fb4](https://github.com/digitalocean/gradient-python/commit/fa68fb43e3e175b3dacd62d459b5d8c38b07e367)) +* **api:** update via SDK Studio ([e23ac14](https://github.com/digitalocean/gradient-python/commit/e23ac14538e17e8d33c33335285389cf13eefe04)) +* **api:** update via SDK Studio ([a5f6aa6](https://github.com/digitalocean/gradient-python/commit/a5f6aa656021a9aaa6a2e82dfa251f87f0096de0)) +* **api:** update via SDK Studio ([b900d76](https://github.com/digitalocean/gradient-python/commit/b900d769ba4a290523f17d2d69de850366c961b6)) + + +### Chores + +* **client:** support model_access_key in image generations ([4b81c5c](https://github.com/digitalocean/gradient-python/commit/4b81c5cf4998707ca2b4eff25845f687e2002602)) +* **client:** support model_access_key in image generations for real ([c202e81](https://github.com/digitalocean/gradient-python/commit/c202e81d81732217a839a0c7c5e56178252362a1)) +* fix bash quoting ([d92383d](https://github.com/digitalocean/gradient-python/commit/d92383da134a32cb0ae6f5a1c3044ec4947deacc)) +* quote bash variables ([6673263](https://github.com/digitalocean/gradient-python/commit/6673263dbdee2ae77eabd2f6d88cf61921f9e63c)) +* remove preview warning ([e4cf6a8](https://github.com/digitalocean/gradient-python/commit/e4cf6a8b5b37acf483be7301aa0a661a5db43a05)) +* update actions versions ([7056460](https://github.com/digitalocean/gradient-python/commit/7056460cef8093329da4ed24f2e7bd286213e90d)) + ## 3.0.2 (2025-09-24) Full Changelog: [v3.0.1...v3.0.2](https://github.com/digitalocean/gradient-python/compare/v3.0.1...v3.0.2) diff --git a/api.md b/api.md index 7299b3c6..6dd6c18e 100644 --- a/api.md +++ b/api.md @@ -18,6 +18,9 @@ from gradient.types import ( GarbageCollection, GPUInfo, Image, + ImageGenCompletedEvent, + ImageGenPartialImageEvent, + ImageGenStreamEvent, Kernel, MetaProperties, NetworkV4, @@ -383,6 +386,20 @@ Methods: - client.chat.completions.create(\*\*params) -> CompletionCreateResponse +# Images + +## Generations + +Types: + +```python +from gradient.types.images import GenerationCreateResponse +``` + +Methods: + +- client.images.generations.create(\*\*params) -> GenerationCreateResponse + # GPUDroplets Types: @@ -757,6 +774,7 @@ Types: ```python from gradient.types.gpu_droplets.account import ( + SSHKeys, KeyCreateResponse, KeyRetrieveResponse, KeyUpdateResponse, @@ -834,6 +852,7 @@ from gradient.types.knowledge_bases import ( DataSourceCreateResponse, DataSourceListResponse, DataSourceDeleteResponse, + DataSourceCreatePresignedURLsResponse, ) ``` @@ -842,6 +861,7 @@ Methods: - client.knowledge_bases.data_sources.create(path_knowledge_base_uuid, \*\*params) -> DataSourceCreateResponse - client.knowledge_bases.data_sources.list(knowledge_base_uuid, \*\*params) -> DataSourceListResponse - client.knowledge_bases.data_sources.delete(data_source_uuid, \*, knowledge_base_uuid) -> DataSourceDeleteResponse +- client.knowledge_bases.data_sources.create_presigned_urls(\*\*params) -> DataSourceCreatePresignedURLsResponse ## IndexingJobs diff --git a/pyproject.toml b/pyproject.toml index 62741433..e2ea2e5c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gradient" -version = "3.0.2" +version = "3.1.0" description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gradient/_client.py b/src/gradient/_client.py index 338d343e..46d9b28b 100644 --- a/src/gradient/_client.py +++ b/src/gradient/_client.py @@ -35,6 +35,7 @@ from .resources import ( chat, agents, + images, models, regions, databases, @@ -49,6 +50,7 @@ AsyncGPUDropletsResource, ) from .resources.agents.agents import AgentsResource, AsyncAgentsResource + from .resources.images.images import ImagesResource, AsyncImagesResource from .resources.models.models import ModelsResource, AsyncModelsResource from .resources.databases.databases import DatabasesResource, AsyncDatabasesResource from .resources.inference.inference import InferenceResource, AsyncInferenceResource @@ -182,6 +184,12 @@ def chat(self) -> ChatResource: return ChatResource(self) + @cached_property + def images(self) -> ImagesResource: + from .resources.images import ImagesResource + + return ImagesResource(self) + @cached_property def gpu_droplets(self) -> GPUDropletsResource: from .resources.gpu_droplets import GPUDropletsResource @@ -471,6 +479,12 @@ def chat(self) -> AsyncChatResource: return AsyncChatResource(self) + @cached_property + def images(self) -> AsyncImagesResource: + from .resources.images import AsyncImagesResource + + return AsyncImagesResource(self) + @cached_property def gpu_droplets(self) -> AsyncGPUDropletsResource: from .resources.gpu_droplets import AsyncGPUDropletsResource @@ -665,6 +679,12 @@ def chat(self) -> chat.ChatResourceWithRawResponse: return ChatResourceWithRawResponse(self._client.chat) + @cached_property + def images(self) -> images.ImagesResourceWithRawResponse: + from .resources.images import ImagesResourceWithRawResponse + + return ImagesResourceWithRawResponse(self._client.images) + @cached_property def gpu_droplets(self) -> gpu_droplets.GPUDropletsResourceWithRawResponse: from .resources.gpu_droplets import GPUDropletsResourceWithRawResponse @@ -720,6 +740,12 @@ def chat(self) -> chat.AsyncChatResourceWithRawResponse: return AsyncChatResourceWithRawResponse(self._client.chat) + @cached_property + def images(self) -> images.AsyncImagesResourceWithRawResponse: + from .resources.images import AsyncImagesResourceWithRawResponse + + return AsyncImagesResourceWithRawResponse(self._client.images) + @cached_property def gpu_droplets(self) -> gpu_droplets.AsyncGPUDropletsResourceWithRawResponse: from .resources.gpu_droplets import AsyncGPUDropletsResourceWithRawResponse @@ -779,6 +805,12 @@ def chat(self) -> chat.ChatResourceWithStreamingResponse: return ChatResourceWithStreamingResponse(self._client.chat) + @cached_property + def images(self) -> images.ImagesResourceWithStreamingResponse: + from .resources.images import ImagesResourceWithStreamingResponse + + return ImagesResourceWithStreamingResponse(self._client.images) + @cached_property def gpu_droplets(self) -> gpu_droplets.GPUDropletsResourceWithStreamingResponse: from .resources.gpu_droplets import GPUDropletsResourceWithStreamingResponse @@ -838,6 +870,12 @@ def chat(self) -> chat.AsyncChatResourceWithStreamingResponse: return AsyncChatResourceWithStreamingResponse(self._client.chat) + @cached_property + def images(self) -> images.AsyncImagesResourceWithStreamingResponse: + from .resources.images import AsyncImagesResourceWithStreamingResponse + + return AsyncImagesResourceWithStreamingResponse(self._client.images) + @cached_property def gpu_droplets( self, diff --git a/src/gradient/_version.py b/src/gradient/_version.py index bd32dfe9..69cb2fcb 100644 --- a/src/gradient/_version.py +++ b/src/gradient/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gradient" -__version__ = "3.0.2" # x-release-please-version +__version__ = "3.1.0" # x-release-please-version diff --git a/src/gradient/resources/__init__.py b/src/gradient/resources/__init__.py index d5198560..fdc7d346 100644 --- a/src/gradient/resources/__init__.py +++ b/src/gradient/resources/__init__.py @@ -16,6 +16,14 @@ AgentsResourceWithStreamingResponse, AsyncAgentsResourceWithStreamingResponse, ) +from .images import ( + ImagesResource, + AsyncImagesResource, + ImagesResourceWithRawResponse, + AsyncImagesResourceWithRawResponse, + ImagesResourceWithStreamingResponse, + AsyncImagesResourceWithStreamingResponse, +) from .models import ( ModelsResource, AsyncModelsResource, @@ -78,6 +86,12 @@ "AsyncChatResourceWithRawResponse", "ChatResourceWithStreamingResponse", "AsyncChatResourceWithStreamingResponse", + "ImagesResource", + "AsyncImagesResource", + "ImagesResourceWithRawResponse", + "AsyncImagesResourceWithRawResponse", + "ImagesResourceWithStreamingResponse", + "AsyncImagesResourceWithStreamingResponse", "GPUDropletsResource", "AsyncGPUDropletsResource", "GPUDropletsResourceWithRawResponse", diff --git a/src/gradient/resources/images/__init__.py b/src/gradient/resources/images/__init__.py new file mode 100644 index 00000000..cf187f1d --- /dev/null +++ b/src/gradient/resources/images/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .images import ( + ImagesResource, + AsyncImagesResource, + ImagesResourceWithRawResponse, + AsyncImagesResourceWithRawResponse, + ImagesResourceWithStreamingResponse, + AsyncImagesResourceWithStreamingResponse, +) +from .generations import ( + GenerationsResource, + AsyncGenerationsResource, + GenerationsResourceWithRawResponse, + AsyncGenerationsResourceWithRawResponse, + GenerationsResourceWithStreamingResponse, + AsyncGenerationsResourceWithStreamingResponse, +) + +__all__ = [ + "GenerationsResource", + "AsyncGenerationsResource", + "GenerationsResourceWithRawResponse", + "AsyncGenerationsResourceWithRawResponse", + "GenerationsResourceWithStreamingResponse", + "AsyncGenerationsResourceWithStreamingResponse", + "ImagesResource", + "AsyncImagesResource", + "ImagesResourceWithRawResponse", + "AsyncImagesResourceWithRawResponse", + "ImagesResourceWithStreamingResponse", + "AsyncImagesResourceWithStreamingResponse", +] diff --git a/src/gradient/resources/images/generations.py b/src/gradient/resources/images/generations.py new file mode 100644 index 00000000..8a5cfdb0 --- /dev/null +++ b/src/gradient/resources/images/generations.py @@ -0,0 +1,706 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, overload + +import httpx + +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import required_args, maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._streaming import Stream, AsyncStream +from ..._base_client import make_request_options +from ...types.images import generation_create_params +from ...types.shared.image_gen_stream_event import ImageGenStreamEvent +from ...types.images.generation_create_response import GenerationCreateResponse + +__all__ = ["GenerationsResource", "AsyncGenerationsResource"] + + +class GenerationsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> GenerationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return GenerationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> GenerationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return GenerationsResourceWithStreamingResponse(self) + + @overload + def create( + self, + *, + prompt: str, + background: Optional[str] | Omit = omit, + model: str | Omit = omit, + moderation: Optional[str] | Omit = omit, + n: Optional[int] | Omit = omit, + output_compression: Optional[int] | Omit = omit, + output_format: Optional[str] | Omit = omit, + partial_images: Optional[int] | Omit = omit, + quality: Optional[str] | Omit = omit, + size: Optional[str] | Omit = omit, + stream: Optional[Literal[False]] | Omit = omit, + user: 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, + ) -> GenerationCreateResponse: + """ + Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest + image generation model with automatic prompt optimization and enhanced visual + capabilities. + + Args: + prompt: A text description of the desired image(s). GPT-IMAGE-1 supports up to 32,000 + characters and provides automatic prompt optimization for best results. + + background: + The background setting for the image generation. GPT-IMAGE-1 supports: + transparent, opaque, auto. + + model: The model to use for image generation. GPT-IMAGE-1 is the latest model offering + the best quality with automatic optimization and enhanced capabilities. + + moderation: The moderation setting for the image generation. GPT-IMAGE-1 supports: low, + auto. + + n: The number of images to generate. GPT-IMAGE-1 only supports n=1. + + output_compression: The output compression for the image generation. GPT-IMAGE-1 supports: 0-100. + + output_format: The output format for the image generation. GPT-IMAGE-1 supports: png, webp, + jpeg. + + partial_images: The number of partial image chunks to return during streaming generation. This + parameter is optional with a default of 0. When stream=true, this must be + greater than 0 to receive progressive updates of the image as it's being + generated. Higher values provide more frequent updates but may increase response + overhead. + + quality: The quality of the image that will be generated. GPT-IMAGE-1 supports: auto + (automatically select best quality), high, medium, low. + + size: The size of the generated images. GPT-IMAGE-1 supports: auto (automatically + select best size), 1536x1024 (landscape), 1024x1536 (portrait). + + stream: If set to true, partial image data will be streamed as the image is being + generated. When streaming, the response will be sent as server-sent events with + partial image chunks. When stream is true, partial_images must be greater + than 0. + + user: A unique identifier representing your end-user, which can help DigitalOcean to + monitor and detect abuse. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def create( + self, + *, + prompt: str, + stream: Literal[True], + background: Optional[str] | Omit = omit, + model: str | Omit = omit, + moderation: Optional[str] | Omit = omit, + n: Optional[int] | Omit = omit, + output_compression: Optional[int] | Omit = omit, + output_format: Optional[str] | Omit = omit, + partial_images: Optional[int] | Omit = omit, + quality: Optional[str] | Omit = omit, + size: Optional[str] | Omit = omit, + user: 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, + ) -> Stream[ImageGenStreamEvent]: + """ + Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest + image generation model with automatic prompt optimization and enhanced visual + capabilities. + + Args: + prompt: A text description of the desired image(s). GPT-IMAGE-1 supports up to 32,000 + characters and provides automatic prompt optimization for best results. + + stream: If set to true, partial image data will be streamed as the image is being + generated. When streaming, the response will be sent as server-sent events with + partial image chunks. When stream is true, partial_images must be greater + than 0. + + background: + The background setting for the image generation. GPT-IMAGE-1 supports: + transparent, opaque, auto. + + model: The model to use for image generation. GPT-IMAGE-1 is the latest model offering + the best quality with automatic optimization and enhanced capabilities. + + moderation: The moderation setting for the image generation. GPT-IMAGE-1 supports: low, + auto. + + n: The number of images to generate. GPT-IMAGE-1 only supports n=1. + + output_compression: The output compression for the image generation. GPT-IMAGE-1 supports: 0-100. + + output_format: The output format for the image generation. GPT-IMAGE-1 supports: png, webp, + jpeg. + + partial_images: The number of partial image chunks to return during streaming generation. This + parameter is optional with a default of 0. When stream=true, this must be + greater than 0 to receive progressive updates of the image as it's being + generated. Higher values provide more frequent updates but may increase response + overhead. + + quality: The quality of the image that will be generated. GPT-IMAGE-1 supports: auto + (automatically select best quality), high, medium, low. + + size: The size of the generated images. GPT-IMAGE-1 supports: auto (automatically + select best size), 1536x1024 (landscape), 1024x1536 (portrait). + + user: A unique identifier representing your end-user, which can help DigitalOcean to + monitor and detect abuse. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def create( + self, + *, + prompt: str, + stream: bool, + background: Optional[str] | Omit = omit, + model: str | Omit = omit, + moderation: Optional[str] | Omit = omit, + n: Optional[int] | Omit = omit, + output_compression: Optional[int] | Omit = omit, + output_format: Optional[str] | Omit = omit, + partial_images: Optional[int] | Omit = omit, + quality: Optional[str] | Omit = omit, + size: Optional[str] | Omit = omit, + user: 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, + ) -> GenerationCreateResponse | Stream[ImageGenStreamEvent]: + """ + Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest + image generation model with automatic prompt optimization and enhanced visual + capabilities. + + Args: + prompt: A text description of the desired image(s). GPT-IMAGE-1 supports up to 32,000 + characters and provides automatic prompt optimization for best results. + + stream: If set to true, partial image data will be streamed as the image is being + generated. When streaming, the response will be sent as server-sent events with + partial image chunks. When stream is true, partial_images must be greater + than 0. + + background: + The background setting for the image generation. GPT-IMAGE-1 supports: + transparent, opaque, auto. + + model: The model to use for image generation. GPT-IMAGE-1 is the latest model offering + the best quality with automatic optimization and enhanced capabilities. + + moderation: The moderation setting for the image generation. GPT-IMAGE-1 supports: low, + auto. + + n: The number of images to generate. GPT-IMAGE-1 only supports n=1. + + output_compression: The output compression for the image generation. GPT-IMAGE-1 supports: 0-100. + + output_format: The output format for the image generation. GPT-IMAGE-1 supports: png, webp, + jpeg. + + partial_images: The number of partial image chunks to return during streaming generation. This + parameter is optional with a default of 0. When stream=true, this must be + greater than 0 to receive progressive updates of the image as it's being + generated. Higher values provide more frequent updates but may increase response + overhead. + + quality: The quality of the image that will be generated. GPT-IMAGE-1 supports: auto + (automatically select best quality), high, medium, low. + + size: The size of the generated images. GPT-IMAGE-1 supports: auto (automatically + select best size), 1536x1024 (landscape), 1024x1536 (portrait). + + user: A unique identifier representing your end-user, which can help DigitalOcean to + monitor and detect abuse. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["prompt"], ["prompt", "stream"]) + def create( + self, + *, + prompt: str, + background: Optional[str] | Omit = omit, + model: str | Omit = omit, + moderation: Optional[str] | Omit = omit, + n: Optional[int] | Omit = omit, + output_compression: Optional[int] | Omit = omit, + output_format: Optional[str] | Omit = omit, + partial_images: Optional[int] | Omit = omit, + quality: Optional[str] | Omit = omit, + size: Optional[str] | Omit = omit, + stream: Optional[Literal[False]] | Literal[True] | Omit = omit, + user: 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, + ) -> GenerationCreateResponse | Stream[ImageGenStreamEvent]: + if not self._client.model_access_key: + raise TypeError( + "Could not resolve authentication method. Expected model_access_key to be set for chat completions." + ) + headers = extra_headers or {} + headers = { + "Authorization": f"Bearer {self._client.model_access_key}", + **headers, + } + + return self._post( + "/images/generations" + if self._client._base_url_overridden + else f"{self._client.inference_endpoint}/v1/images/generations", + body=maybe_transform( + { + "prompt": prompt, + "background": background, + "model": model, + "moderation": moderation, + "n": n, + "output_compression": output_compression, + "output_format": output_format, + "partial_images": partial_images, + "quality": quality, + "size": size, + "stream": stream, + "user": user, + }, + generation_create_params.GenerationCreateParamsStreaming + if stream + else generation_create_params.GenerationCreateParamsNonStreaming, + ), + options=make_request_options( + extra_headers=headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=GenerationCreateResponse, + stream=stream or False, + stream_cls=Stream[ImageGenStreamEvent], + ) + + +class AsyncGenerationsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncGenerationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return AsyncGenerationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncGenerationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return AsyncGenerationsResourceWithStreamingResponse(self) + + @overload + async def create( + self, + *, + prompt: str, + background: Optional[str] | Omit = omit, + model: str | Omit = omit, + moderation: Optional[str] | Omit = omit, + n: Optional[int] | Omit = omit, + output_compression: Optional[int] | Omit = omit, + output_format: Optional[str] | Omit = omit, + partial_images: Optional[int] | Omit = omit, + quality: Optional[str] | Omit = omit, + size: Optional[str] | Omit = omit, + stream: Optional[Literal[False]] | Omit = omit, + user: 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, + ) -> GenerationCreateResponse: + """ + Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest + image generation model with automatic prompt optimization and enhanced visual + capabilities. + + Args: + prompt: A text description of the desired image(s). GPT-IMAGE-1 supports up to 32,000 + characters and provides automatic prompt optimization for best results. + + background: + The background setting for the image generation. GPT-IMAGE-1 supports: + transparent, opaque, auto. + + model: The model to use for image generation. GPT-IMAGE-1 is the latest model offering + the best quality with automatic optimization and enhanced capabilities. + + moderation: The moderation setting for the image generation. GPT-IMAGE-1 supports: low, + auto. + + n: The number of images to generate. GPT-IMAGE-1 only supports n=1. + + output_compression: The output compression for the image generation. GPT-IMAGE-1 supports: 0-100. + + output_format: The output format for the image generation. GPT-IMAGE-1 supports: png, webp, + jpeg. + + partial_images: The number of partial image chunks to return during streaming generation. This + parameter is optional with a default of 0. When stream=true, this must be + greater than 0 to receive progressive updates of the image as it's being + generated. Higher values provide more frequent updates but may increase response + overhead. + + quality: The quality of the image that will be generated. GPT-IMAGE-1 supports: auto + (automatically select best quality), high, medium, low. + + size: The size of the generated images. GPT-IMAGE-1 supports: auto (automatically + select best size), 1536x1024 (landscape), 1024x1536 (portrait). + + stream: If set to true, partial image data will be streamed as the image is being + generated. When streaming, the response will be sent as server-sent events with + partial image chunks. When stream is true, partial_images must be greater + than 0. + + user: A unique identifier representing your end-user, which can help DigitalOcean to + monitor and detect abuse. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def create( + self, + *, + prompt: str, + stream: Literal[True], + background: Optional[str] | Omit = omit, + model: str | Omit = omit, + moderation: Optional[str] | Omit = omit, + n: Optional[int] | Omit = omit, + output_compression: Optional[int] | Omit = omit, + output_format: Optional[str] | Omit = omit, + partial_images: Optional[int] | Omit = omit, + quality: Optional[str] | Omit = omit, + size: Optional[str] | Omit = omit, + user: 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, + ) -> AsyncStream[ImageGenStreamEvent]: + """ + Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest + image generation model with automatic prompt optimization and enhanced visual + capabilities. + + Args: + prompt: A text description of the desired image(s). GPT-IMAGE-1 supports up to 32,000 + characters and provides automatic prompt optimization for best results. + + stream: If set to true, partial image data will be streamed as the image is being + generated. When streaming, the response will be sent as server-sent events with + partial image chunks. When stream is true, partial_images must be greater + than 0. + + background: + The background setting for the image generation. GPT-IMAGE-1 supports: + transparent, opaque, auto. + + model: The model to use for image generation. GPT-IMAGE-1 is the latest model offering + the best quality with automatic optimization and enhanced capabilities. + + moderation: The moderation setting for the image generation. GPT-IMAGE-1 supports: low, + auto. + + n: The number of images to generate. GPT-IMAGE-1 only supports n=1. + + output_compression: The output compression for the image generation. GPT-IMAGE-1 supports: 0-100. + + output_format: The output format for the image generation. GPT-IMAGE-1 supports: png, webp, + jpeg. + + partial_images: The number of partial image chunks to return during streaming generation. This + parameter is optional with a default of 0. When stream=true, this must be + greater than 0 to receive progressive updates of the image as it's being + generated. Higher values provide more frequent updates but may increase response + overhead. + + quality: The quality of the image that will be generated. GPT-IMAGE-1 supports: auto + (automatically select best quality), high, medium, low. + + size: The size of the generated images. GPT-IMAGE-1 supports: auto (automatically + select best size), 1536x1024 (landscape), 1024x1536 (portrait). + + user: A unique identifier representing your end-user, which can help DigitalOcean to + monitor and detect abuse. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def create( + self, + *, + prompt: str, + stream: bool, + background: Optional[str] | Omit = omit, + model: str | Omit = omit, + moderation: Optional[str] | Omit = omit, + n: Optional[int] | Omit = omit, + output_compression: Optional[int] | Omit = omit, + output_format: Optional[str] | Omit = omit, + partial_images: Optional[int] | Omit = omit, + quality: Optional[str] | Omit = omit, + size: Optional[str] | Omit = omit, + user: 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, + ) -> GenerationCreateResponse | AsyncStream[ImageGenStreamEvent]: + """ + Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest + image generation model with automatic prompt optimization and enhanced visual + capabilities. + + Args: + prompt: A text description of the desired image(s). GPT-IMAGE-1 supports up to 32,000 + characters and provides automatic prompt optimization for best results. + + stream: If set to true, partial image data will be streamed as the image is being + generated. When streaming, the response will be sent as server-sent events with + partial image chunks. When stream is true, partial_images must be greater + than 0. + + background: + The background setting for the image generation. GPT-IMAGE-1 supports: + transparent, opaque, auto. + + model: The model to use for image generation. GPT-IMAGE-1 is the latest model offering + the best quality with automatic optimization and enhanced capabilities. + + moderation: The moderation setting for the image generation. GPT-IMAGE-1 supports: low, + auto. + + n: The number of images to generate. GPT-IMAGE-1 only supports n=1. + + output_compression: The output compression for the image generation. GPT-IMAGE-1 supports: 0-100. + + output_format: The output format for the image generation. GPT-IMAGE-1 supports: png, webp, + jpeg. + + partial_images: The number of partial image chunks to return during streaming generation. This + parameter is optional with a default of 0. When stream=true, this must be + greater than 0 to receive progressive updates of the image as it's being + generated. Higher values provide more frequent updates but may increase response + overhead. + + quality: The quality of the image that will be generated. GPT-IMAGE-1 supports: auto + (automatically select best quality), high, medium, low. + + size: The size of the generated images. GPT-IMAGE-1 supports: auto (automatically + select best size), 1536x1024 (landscape), 1024x1536 (portrait). + + user: A unique identifier representing your end-user, which can help DigitalOcean to + monitor and detect abuse. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["prompt"], ["prompt", "stream"]) + async def create( + self, + *, + prompt: str, + background: Optional[str] | Omit = omit, + model: str | Omit = omit, + moderation: Optional[str] | Omit = omit, + n: Optional[int] | Omit = omit, + output_compression: Optional[int] | Omit = omit, + output_format: Optional[str] | Omit = omit, + partial_images: Optional[int] | Omit = omit, + quality: Optional[str] | Omit = omit, + size: Optional[str] | Omit = omit, + stream: Optional[Literal[False]] | Literal[True] | Omit = omit, + user: 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, + ) -> GenerationCreateResponse | AsyncStream[ImageGenStreamEvent]: + if not self._client.model_access_key: + raise TypeError( + "Could not resolve authentication method. Expected model_access_key to be set for chat completions." + ) + headers = extra_headers or {} + headers = { + "Authorization": f"Bearer {self._client.model_access_key}", + **headers, + } + + return await self._post( + "/images/generations" + if self._client._base_url_overridden + else f"{self._client.inference_endpoint}/v1/images/generations", + body=await async_maybe_transform( + { + "prompt": prompt, + "background": background, + "model": model, + "moderation": moderation, + "n": n, + "output_compression": output_compression, + "output_format": output_format, + "partial_images": partial_images, + "quality": quality, + "size": size, + "stream": stream, + "user": user, + }, + generation_create_params.GenerationCreateParamsStreaming + if stream + else generation_create_params.GenerationCreateParamsNonStreaming, + ), + options=make_request_options( + extra_headers=headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=GenerationCreateResponse, + stream=stream or False, + stream_cls=AsyncStream[ImageGenStreamEvent], + ) + + +class GenerationsResourceWithRawResponse: + def __init__(self, generations: GenerationsResource) -> None: + self._generations = generations + + self.create = to_raw_response_wrapper( + generations.create, + ) + + +class AsyncGenerationsResourceWithRawResponse: + def __init__(self, generations: AsyncGenerationsResource) -> None: + self._generations = generations + + self.create = async_to_raw_response_wrapper( + generations.create, + ) + + +class GenerationsResourceWithStreamingResponse: + def __init__(self, generations: GenerationsResource) -> None: + self._generations = generations + + self.create = to_streamed_response_wrapper( + generations.create, + ) + + +class AsyncGenerationsResourceWithStreamingResponse: + def __init__(self, generations: AsyncGenerationsResource) -> None: + self._generations = generations + + self.create = async_to_streamed_response_wrapper( + generations.create, + ) diff --git a/src/gradient/resources/images/images.py b/src/gradient/resources/images/images.py new file mode 100644 index 00000000..37e7290f --- /dev/null +++ b/src/gradient/resources/images/images.py @@ -0,0 +1,102 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from .generations import ( + GenerationsResource, + AsyncGenerationsResource, + GenerationsResourceWithRawResponse, + AsyncGenerationsResourceWithRawResponse, + GenerationsResourceWithStreamingResponse, + AsyncGenerationsResourceWithStreamingResponse, +) + +__all__ = ["ImagesResource", "AsyncImagesResource"] + + +class ImagesResource(SyncAPIResource): + @cached_property + def generations(self) -> GenerationsResource: + return GenerationsResource(self._client) + + @cached_property + def with_raw_response(self) -> ImagesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return ImagesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ImagesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return ImagesResourceWithStreamingResponse(self) + + +class AsyncImagesResource(AsyncAPIResource): + @cached_property + def generations(self) -> AsyncGenerationsResource: + return AsyncGenerationsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncImagesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return AsyncImagesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncImagesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return AsyncImagesResourceWithStreamingResponse(self) + + +class ImagesResourceWithRawResponse: + def __init__(self, images: ImagesResource) -> None: + self._images = images + + @cached_property + def generations(self) -> GenerationsResourceWithRawResponse: + return GenerationsResourceWithRawResponse(self._images.generations) + + +class AsyncImagesResourceWithRawResponse: + def __init__(self, images: AsyncImagesResource) -> None: + self._images = images + + @cached_property + def generations(self) -> AsyncGenerationsResourceWithRawResponse: + return AsyncGenerationsResourceWithRawResponse(self._images.generations) + + +class ImagesResourceWithStreamingResponse: + def __init__(self, images: ImagesResource) -> None: + self._images = images + + @cached_property + def generations(self) -> GenerationsResourceWithStreamingResponse: + return GenerationsResourceWithStreamingResponse(self._images.generations) + + +class AsyncImagesResourceWithStreamingResponse: + def __init__(self, images: AsyncImagesResource) -> None: + self._images = images + + @cached_property + def generations(self) -> AsyncGenerationsResourceWithStreamingResponse: + return AsyncGenerationsResourceWithStreamingResponse(self._images.generations) diff --git a/src/gradient/resources/knowledge_bases/data_sources.py b/src/gradient/resources/knowledge_bases/data_sources.py index 083ea45f..a00d93f5 100644 --- a/src/gradient/resources/knowledge_bases/data_sources.py +++ b/src/gradient/resources/knowledge_bases/data_sources.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing import Iterable + import httpx from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given @@ -18,6 +20,7 @@ from ...types.knowledge_bases import ( data_source_list_params, data_source_create_params, + data_source_create_presigned_urls_params, ) from ...types.knowledge_bases.aws_data_source_param import AwsDataSourceParam from ...types.knowledge_bases.data_source_list_response import DataSourceListResponse @@ -25,6 +28,7 @@ from ...types.knowledge_bases.data_source_delete_response import DataSourceDeleteResponse from ...types.knowledge_bases.api_spaces_data_source_param import APISpacesDataSourceParam from ...types.knowledge_bases.api_web_crawler_data_source_param import APIWebCrawlerDataSourceParam +from ...types.knowledge_bases.data_source_create_presigned_urls_response import DataSourceCreatePresignedURLsResponse __all__ = ["DataSourcesResource", "AsyncDataSourcesResource"] @@ -203,6 +207,45 @@ def delete( cast_to=DataSourceDeleteResponse, ) + def create_presigned_urls( + self, + *, + files: Iterable[data_source_create_presigned_urls_params.File] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> DataSourceCreatePresignedURLsResponse: + """ + To create presigned URLs for knowledge base data source file upload, send a POST + request to `/v2/gen-ai/knowledge_bases/data_sources/file_upload_presigned_urls`. + + Args: + files: A list of files to generate presigned URLs for. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/v2/gen-ai/knowledge_bases/data_sources/file_upload_presigned_urls" + if self._client._base_url_overridden + else "https://api.digitalocean.com/v2/gen-ai/knowledge_bases/data_sources/file_upload_presigned_urls", + body=maybe_transform( + {"files": files}, data_source_create_presigned_urls_params.DataSourceCreatePresignedURLsParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DataSourceCreatePresignedURLsResponse, + ) + class AsyncDataSourcesResource(AsyncAPIResource): @cached_property @@ -378,6 +421,45 @@ async def delete( cast_to=DataSourceDeleteResponse, ) + async def create_presigned_urls( + self, + *, + files: Iterable[data_source_create_presigned_urls_params.File] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> DataSourceCreatePresignedURLsResponse: + """ + To create presigned URLs for knowledge base data source file upload, send a POST + request to `/v2/gen-ai/knowledge_bases/data_sources/file_upload_presigned_urls`. + + Args: + files: A list of files to generate presigned URLs for. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/v2/gen-ai/knowledge_bases/data_sources/file_upload_presigned_urls" + if self._client._base_url_overridden + else "https://api.digitalocean.com/v2/gen-ai/knowledge_bases/data_sources/file_upload_presigned_urls", + body=await async_maybe_transform( + {"files": files}, data_source_create_presigned_urls_params.DataSourceCreatePresignedURLsParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DataSourceCreatePresignedURLsResponse, + ) + class DataSourcesResourceWithRawResponse: def __init__(self, data_sources: DataSourcesResource) -> None: @@ -392,6 +474,9 @@ def __init__(self, data_sources: DataSourcesResource) -> None: self.delete = to_raw_response_wrapper( data_sources.delete, ) + self.create_presigned_urls = to_raw_response_wrapper( + data_sources.create_presigned_urls, + ) class AsyncDataSourcesResourceWithRawResponse: @@ -407,6 +492,9 @@ def __init__(self, data_sources: AsyncDataSourcesResource) -> None: self.delete = async_to_raw_response_wrapper( data_sources.delete, ) + self.create_presigned_urls = async_to_raw_response_wrapper( + data_sources.create_presigned_urls, + ) class DataSourcesResourceWithStreamingResponse: @@ -422,6 +510,9 @@ def __init__(self, data_sources: DataSourcesResource) -> None: self.delete = to_streamed_response_wrapper( data_sources.delete, ) + self.create_presigned_urls = to_streamed_response_wrapper( + data_sources.create_presigned_urls, + ) class AsyncDataSourcesResourceWithStreamingResponse: @@ -437,3 +528,6 @@ def __init__(self, data_sources: AsyncDataSourcesResource) -> None: self.delete = async_to_streamed_response_wrapper( data_sources.delete, ) + self.create_presigned_urls = async_to_streamed_response_wrapper( + data_sources.create_presigned_urls, + ) diff --git a/src/gradient/types/__init__.py b/src/gradient/types/__init__.py index d28c4c1d..ad63485e 100644 --- a/src/gradient/types/__init__.py +++ b/src/gradient/types/__init__.py @@ -41,8 +41,11 @@ GarbageCollection as GarbageCollection, FirewallRuleTarget as FirewallRuleTarget, ChatCompletionChunk as ChatCompletionChunk, + ImageGenStreamEvent as ImageGenStreamEvent, SubscriptionTierBase as SubscriptionTierBase, + ImageGenCompletedEvent as ImageGenCompletedEvent, DropletNextBackupWindow as DropletNextBackupWindow, + ImageGenPartialImageEvent as ImageGenPartialImageEvent, ChatCompletionTokenLogprob as ChatCompletionTokenLogprob, ) from .api_agent import APIAgent as APIAgent diff --git a/src/gradient/types/agents/chat/completion_create_params.py b/src/gradient/types/agents/chat/completion_create_params.py index d8cf7bc1..0980132e 100644 --- a/src/gradient/types/agents/chat/completion_create_params.py +++ b/src/gradient/types/agents/chat/completion_create_params.py @@ -11,9 +11,17 @@ "CompletionCreateParamsBase", "Message", "MessageChatCompletionRequestSystemMessage", + "MessageChatCompletionRequestSystemMessageContentArrayOfContentPart", + "MessageChatCompletionRequestSystemMessageContentArrayOfContentPartUnionMember1", "MessageChatCompletionRequestDeveloperMessage", + "MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPart", + "MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartUnionMember1", "MessageChatCompletionRequestUserMessage", + "MessageChatCompletionRequestUserMessageContentArrayOfContentPart", + "MessageChatCompletionRequestUserMessageContentArrayOfContentPartUnionMember1", "MessageChatCompletionRequestAssistantMessage", + "MessageChatCompletionRequestAssistantMessageContentArrayOfContentPart", + "MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartUnionMember1", "MessageChatCompletionRequestAssistantMessageToolCall", "MessageChatCompletionRequestAssistantMessageToolCallFunction", "MessageChatCompletionRequestToolMessage", @@ -157,30 +165,82 @@ class CompletionCreateParamsBase(TypedDict, total=False): """ +class MessageChatCompletionRequestSystemMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): + text: Required[str] + """The text content""" + + type: Required[Literal["text"]] + """The type of content part""" + + +MessageChatCompletionRequestSystemMessageContentArrayOfContentPart: TypeAlias = Union[ + str, MessageChatCompletionRequestSystemMessageContentArrayOfContentPartUnionMember1 +] + + class MessageChatCompletionRequestSystemMessage(TypedDict, total=False): - content: Required[Union[str, SequenceNotStr[str]]] + content: Required[Union[str, SequenceNotStr[MessageChatCompletionRequestSystemMessageContentArrayOfContentPart]]] """The contents of the system message.""" role: Required[Literal["system"]] """The role of the messages author, in this case `system`.""" +class MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): + text: Required[str] + """The text content""" + + type: Required[Literal["text"]] + """The type of content part""" + + +MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPart: TypeAlias = Union[ + str, MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartUnionMember1 +] + + class MessageChatCompletionRequestDeveloperMessage(TypedDict, total=False): - content: Required[Union[str, SequenceNotStr[str]]] + content: Required[Union[str, SequenceNotStr[MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPart]]] """The contents of the developer message.""" role: Required[Literal["developer"]] """The role of the messages author, in this case `developer`.""" +class MessageChatCompletionRequestUserMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): + text: Required[str] + """The text content""" + + type: Required[Literal["text"]] + """The type of content part""" + + +MessageChatCompletionRequestUserMessageContentArrayOfContentPart: TypeAlias = Union[ + str, MessageChatCompletionRequestUserMessageContentArrayOfContentPartUnionMember1 +] + + class MessageChatCompletionRequestUserMessage(TypedDict, total=False): - content: Required[Union[str, SequenceNotStr[str]]] + content: Required[Union[str, SequenceNotStr[MessageChatCompletionRequestUserMessageContentArrayOfContentPart]]] """The contents of the user message.""" role: Required[Literal["user"]] """The role of the messages author, in this case `user`.""" +class MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): + text: Required[str] + """The text content""" + + type: Required[Literal["text"]] + """The type of content part""" + + +MessageChatCompletionRequestAssistantMessageContentArrayOfContentPart: TypeAlias = Union[ + str, MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartUnionMember1 +] + + class MessageChatCompletionRequestAssistantMessageToolCallFunction(TypedDict, total=False): arguments: Required[str] """ @@ -209,7 +269,7 @@ class MessageChatCompletionRequestAssistantMessage(TypedDict, total=False): role: Required[Literal["assistant"]] """The role of the messages author, in this case `assistant`.""" - content: Union[str, SequenceNotStr[str], None] + content: Union[str, SequenceNotStr[MessageChatCompletionRequestAssistantMessageContentArrayOfContentPart], None] """The contents of the assistant message.""" tool_calls: Iterable[MessageChatCompletionRequestAssistantMessageToolCall] diff --git a/src/gradient/types/agents/chat/completion_create_response.py b/src/gradient/types/agents/chat/completion_create_response.py index 4c839ded..f3dedb4e 100644 --- a/src/gradient/types/agents/chat/completion_create_response.py +++ b/src/gradient/types/agents/chat/completion_create_response.py @@ -53,6 +53,9 @@ class ChoiceMessage(BaseModel): content: Optional[str] = None """The contents of the message.""" + reasoning_content: Optional[str] = None + """The reasoning content generated by the model.""" + refusal: Optional[str] = None """The refusal message generated by the model.""" diff --git a/src/gradient/types/chat/completion_create_params.py b/src/gradient/types/chat/completion_create_params.py index 17f00242..7874d893 100644 --- a/src/gradient/types/chat/completion_create_params.py +++ b/src/gradient/types/chat/completion_create_params.py @@ -11,9 +11,17 @@ "CompletionCreateParamsBase", "Message", "MessageChatCompletionRequestSystemMessage", + "MessageChatCompletionRequestSystemMessageContentArrayOfContentPart", + "MessageChatCompletionRequestSystemMessageContentArrayOfContentPartUnionMember1", "MessageChatCompletionRequestDeveloperMessage", + "MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPart", + "MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartUnionMember1", "MessageChatCompletionRequestUserMessage", + "MessageChatCompletionRequestUserMessageContentArrayOfContentPart", + "MessageChatCompletionRequestUserMessageContentArrayOfContentPartUnionMember1", "MessageChatCompletionRequestAssistantMessage", + "MessageChatCompletionRequestAssistantMessageContentArrayOfContentPart", + "MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartUnionMember1", "MessageChatCompletionRequestAssistantMessageToolCall", "MessageChatCompletionRequestAssistantMessageToolCallFunction", "MessageChatCompletionRequestToolMessage", @@ -157,30 +165,82 @@ class CompletionCreateParamsBase(TypedDict, total=False): """ +class MessageChatCompletionRequestSystemMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): + text: Required[str] + """The text content""" + + type: Required[Literal["text"]] + """The type of content part""" + + +MessageChatCompletionRequestSystemMessageContentArrayOfContentPart: TypeAlias = Union[ + str, MessageChatCompletionRequestSystemMessageContentArrayOfContentPartUnionMember1 +] + + class MessageChatCompletionRequestSystemMessage(TypedDict, total=False): - content: Required[Union[str, SequenceNotStr[str]]] + content: Required[Union[str, SequenceNotStr[MessageChatCompletionRequestSystemMessageContentArrayOfContentPart]]] """The contents of the system message.""" role: Required[Literal["system"]] """The role of the messages author, in this case `system`.""" +class MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): + text: Required[str] + """The text content""" + + type: Required[Literal["text"]] + """The type of content part""" + + +MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPart: TypeAlias = Union[ + str, MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartUnionMember1 +] + + class MessageChatCompletionRequestDeveloperMessage(TypedDict, total=False): - content: Required[Union[str, SequenceNotStr[str]]] + content: Required[Union[str, SequenceNotStr[MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPart]]] """The contents of the developer message.""" role: Required[Literal["developer"]] """The role of the messages author, in this case `developer`.""" +class MessageChatCompletionRequestUserMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): + text: Required[str] + """The text content""" + + type: Required[Literal["text"]] + """The type of content part""" + + +MessageChatCompletionRequestUserMessageContentArrayOfContentPart: TypeAlias = Union[ + str, MessageChatCompletionRequestUserMessageContentArrayOfContentPartUnionMember1 +] + + class MessageChatCompletionRequestUserMessage(TypedDict, total=False): - content: Required[Union[str, SequenceNotStr[str]]] + content: Required[Union[str, SequenceNotStr[MessageChatCompletionRequestUserMessageContentArrayOfContentPart]]] """The contents of the user message.""" role: Required[Literal["user"]] """The role of the messages author, in this case `user`.""" +class MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): + text: Required[str] + """The text content""" + + type: Required[Literal["text"]] + """The type of content part""" + + +MessageChatCompletionRequestAssistantMessageContentArrayOfContentPart: TypeAlias = Union[ + str, MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartUnionMember1 +] + + class MessageChatCompletionRequestAssistantMessageToolCallFunction(TypedDict, total=False): arguments: Required[str] """ @@ -209,7 +269,7 @@ class MessageChatCompletionRequestAssistantMessage(TypedDict, total=False): role: Required[Literal["assistant"]] """The role of the messages author, in this case `assistant`.""" - content: Union[str, SequenceNotStr[str], None] + content: Union[str, SequenceNotStr[MessageChatCompletionRequestAssistantMessageContentArrayOfContentPart], None] """The contents of the assistant message.""" tool_calls: Iterable[MessageChatCompletionRequestAssistantMessageToolCall] diff --git a/src/gradient/types/chat/completion_create_response.py b/src/gradient/types/chat/completion_create_response.py index 73a09cf5..9e157aee 100644 --- a/src/gradient/types/chat/completion_create_response.py +++ b/src/gradient/types/chat/completion_create_response.py @@ -53,6 +53,9 @@ class ChoiceMessage(BaseModel): content: Optional[str] = None """The contents of the message.""" + reasoning_content: Optional[str] = None + """The reasoning content generated by the model.""" + refusal: Optional[str] = None """The refusal message generated by the model.""" diff --git a/src/gradient/types/gpu_droplets/account/__init__.py b/src/gradient/types/gpu_droplets/account/__init__.py index 4cd64974..2d8a05ae 100644 --- a/src/gradient/types/gpu_droplets/account/__init__.py +++ b/src/gradient/types/gpu_droplets/account/__init__.py @@ -2,6 +2,7 @@ from __future__ import annotations +from .ssh_keys import SSHKeys as SSHKeys from .key_list_params import KeyListParams as KeyListParams from .key_create_params import KeyCreateParams as KeyCreateParams from .key_list_response import KeyListResponse as KeyListResponse diff --git a/src/gradient/types/gpu_droplets/account/key_create_response.py b/src/gradient/types/gpu_droplets/account/key_create_response.py index 9fe566ed..5ce63269 100644 --- a/src/gradient/types/gpu_droplets/account/key_create_response.py +++ b/src/gradient/types/gpu_droplets/account/key_create_response.py @@ -2,38 +2,11 @@ from typing import Optional +from .ssh_keys import SSHKeys from ...._models import BaseModel -__all__ = ["KeyCreateResponse", "SSHKey"] - - -class SSHKey(BaseModel): - name: str - """ - A human-readable display name for this key, used to easily identify the SSH keys - when they are displayed. - """ - - public_key: str - """The entire public key string that was uploaded. - - Embedded into the root user's `authorized_keys` file if you include this key - during Droplet creation. - """ - - id: Optional[int] = None - """A unique identification number for this key. - - Can be used to embed a specific SSH key into a Droplet. - """ - - fingerprint: Optional[str] = None - """ - A unique identifier that differentiates this key from other keys using a format - that SSH recognizes. The fingerprint is created when the key is added to your - account. - """ +__all__ = ["KeyCreateResponse"] class KeyCreateResponse(BaseModel): - ssh_key: Optional[SSHKey] = None + ssh_key: Optional[SSHKeys] = None diff --git a/src/gradient/types/gpu_droplets/account/key_list_response.py b/src/gradient/types/gpu_droplets/account/key_list_response.py index be4c721c..1151043e 100644 --- a/src/gradient/types/gpu_droplets/account/key_list_response.py +++ b/src/gradient/types/gpu_droplets/account/key_list_response.py @@ -2,39 +2,12 @@ from typing import List, Optional +from .ssh_keys import SSHKeys from ...._models import BaseModel from ...shared.page_links import PageLinks from ...shared.meta_properties import MetaProperties -__all__ = ["KeyListResponse", "SSHKey"] - - -class SSHKey(BaseModel): - name: str - """ - A human-readable display name for this key, used to easily identify the SSH keys - when they are displayed. - """ - - public_key: str - """The entire public key string that was uploaded. - - Embedded into the root user's `authorized_keys` file if you include this key - during Droplet creation. - """ - - id: Optional[int] = None - """A unique identification number for this key. - - Can be used to embed a specific SSH key into a Droplet. - """ - - fingerprint: Optional[str] = None - """ - A unique identifier that differentiates this key from other keys using a format - that SSH recognizes. The fingerprint is created when the key is added to your - account. - """ +__all__ = ["KeyListResponse"] class KeyListResponse(BaseModel): @@ -43,4 +16,4 @@ class KeyListResponse(BaseModel): links: Optional[PageLinks] = None - ssh_keys: Optional[List[SSHKey]] = None + ssh_keys: Optional[List[SSHKeys]] = None diff --git a/src/gradient/types/gpu_droplets/account/key_retrieve_response.py b/src/gradient/types/gpu_droplets/account/key_retrieve_response.py index 7cd3215e..da6e94d1 100644 --- a/src/gradient/types/gpu_droplets/account/key_retrieve_response.py +++ b/src/gradient/types/gpu_droplets/account/key_retrieve_response.py @@ -2,38 +2,11 @@ from typing import Optional +from .ssh_keys import SSHKeys from ...._models import BaseModel -__all__ = ["KeyRetrieveResponse", "SSHKey"] - - -class SSHKey(BaseModel): - name: str - """ - A human-readable display name for this key, used to easily identify the SSH keys - when they are displayed. - """ - - public_key: str - """The entire public key string that was uploaded. - - Embedded into the root user's `authorized_keys` file if you include this key - during Droplet creation. - """ - - id: Optional[int] = None - """A unique identification number for this key. - - Can be used to embed a specific SSH key into a Droplet. - """ - - fingerprint: Optional[str] = None - """ - A unique identifier that differentiates this key from other keys using a format - that SSH recognizes. The fingerprint is created when the key is added to your - account. - """ +__all__ = ["KeyRetrieveResponse"] class KeyRetrieveResponse(BaseModel): - ssh_key: Optional[SSHKey] = None + ssh_key: Optional[SSHKeys] = None diff --git a/src/gradient/types/gpu_droplets/account/key_update_response.py b/src/gradient/types/gpu_droplets/account/key_update_response.py index 2821e44a..54b81426 100644 --- a/src/gradient/types/gpu_droplets/account/key_update_response.py +++ b/src/gradient/types/gpu_droplets/account/key_update_response.py @@ -2,38 +2,11 @@ from typing import Optional +from .ssh_keys import SSHKeys from ...._models import BaseModel -__all__ = ["KeyUpdateResponse", "SSHKey"] - - -class SSHKey(BaseModel): - name: str - """ - A human-readable display name for this key, used to easily identify the SSH keys - when they are displayed. - """ - - public_key: str - """The entire public key string that was uploaded. - - Embedded into the root user's `authorized_keys` file if you include this key - during Droplet creation. - """ - - id: Optional[int] = None - """A unique identification number for this key. - - Can be used to embed a specific SSH key into a Droplet. - """ - - fingerprint: Optional[str] = None - """ - A unique identifier that differentiates this key from other keys using a format - that SSH recognizes. The fingerprint is created when the key is added to your - account. - """ +__all__ = ["KeyUpdateResponse"] class KeyUpdateResponse(BaseModel): - ssh_key: Optional[SSHKey] = None + ssh_key: Optional[SSHKeys] = None diff --git a/src/gradient/types/gpu_droplets/account/ssh_keys.py b/src/gradient/types/gpu_droplets/account/ssh_keys.py new file mode 100644 index 00000000..8112c18a --- /dev/null +++ b/src/gradient/types/gpu_droplets/account/ssh_keys.py @@ -0,0 +1,35 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["SSHKeys"] + + +class SSHKeys(BaseModel): + name: str + """ + A human-readable display name for this key, used to easily identify the SSH keys + when they are displayed. + """ + + public_key: str + """The entire public key string that was uploaded. + + Embedded into the root user's `authorized_keys` file if you include this key + during Droplet creation. + """ + + id: Optional[int] = None + """A unique identification number for this key. + + Can be used to embed a specific SSH key into a Droplet. + """ + + fingerprint: Optional[str] = None + """ + A unique identifier that differentiates this key from other keys using a format + that SSH recognizes. The fingerprint is created when the key is added to your + account. + """ diff --git a/src/gradient/types/images/__init__.py b/src/gradient/types/images/__init__.py new file mode 100644 index 00000000..29634ec1 --- /dev/null +++ b/src/gradient/types/images/__init__.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .generation_create_params import GenerationCreateParams as GenerationCreateParams +from .generation_create_response import GenerationCreateResponse as GenerationCreateResponse diff --git a/src/gradient/types/images/generation_create_params.py b/src/gradient/types/images/generation_create_params.py new file mode 100644 index 00000000..ec8b672f --- /dev/null +++ b/src/gradient/types/images/generation_create_params.py @@ -0,0 +1,100 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["GenerationCreateParamsBase", "GenerationCreateParamsNonStreaming", "GenerationCreateParamsStreaming"] + + +class GenerationCreateParamsBase(TypedDict, total=False): + prompt: Required[str] + """A text description of the desired image(s). + + GPT-IMAGE-1 supports up to 32,000 characters and provides automatic prompt + optimization for best results. + """ + + background: Optional[str] + """The background setting for the image generation. + + GPT-IMAGE-1 supports: transparent, opaque, auto. + """ + + model: str + """The model to use for image generation. + + GPT-IMAGE-1 is the latest model offering the best quality with automatic + optimization and enhanced capabilities. + """ + + moderation: Optional[str] + """The moderation setting for the image generation. + + GPT-IMAGE-1 supports: low, auto. + """ + + n: Optional[int] + """The number of images to generate. GPT-IMAGE-1 only supports n=1.""" + + output_compression: Optional[int] + """The output compression for the image generation. GPT-IMAGE-1 supports: 0-100.""" + + output_format: Optional[str] + """The output format for the image generation. + + GPT-IMAGE-1 supports: png, webp, jpeg. + """ + + partial_images: Optional[int] + """The number of partial image chunks to return during streaming generation. + + This parameter is optional with a default of 0. When stream=true, this must be + greater than 0 to receive progressive updates of the image as it's being + generated. Higher values provide more frequent updates but may increase response + overhead. + """ + + quality: Optional[str] + """The quality of the image that will be generated. + + GPT-IMAGE-1 supports: auto (automatically select best quality), high, medium, + low. + """ + + size: Optional[str] + """The size of the generated images. + + GPT-IMAGE-1 supports: auto (automatically select best size), 1536x1024 + (landscape), 1024x1536 (portrait). + """ + + user: Optional[str] + """ + A unique identifier representing your end-user, which can help DigitalOcean to + monitor and detect abuse. + """ + + +class GenerationCreateParamsNonStreaming(GenerationCreateParamsBase, total=False): + stream: Optional[Literal[False]] + """ + If set to true, partial image data will be streamed as the image is being + generated. When streaming, the response will be sent as server-sent events with + partial image chunks. When stream is true, partial_images must be greater + than 0. + """ + + +class GenerationCreateParamsStreaming(GenerationCreateParamsBase): + stream: Required[Literal[True]] + """ + If set to true, partial image data will be streamed as the image is being + generated. When streaming, the response will be sent as server-sent events with + partial image chunks. When stream is true, partial_images must be greater + than 0. + """ + + +GenerationCreateParams = Union[GenerationCreateParamsNonStreaming, GenerationCreateParamsStreaming] diff --git a/src/gradient/types/images/generation_create_response.py b/src/gradient/types/images/generation_create_response.py new file mode 100644 index 00000000..32757c06 --- /dev/null +++ b/src/gradient/types/images/generation_create_response.py @@ -0,0 +1,63 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["GenerationCreateResponse", "Data", "Usage", "UsageInputTokensDetails"] + + +class Data(BaseModel): + b64_json: str + """The base64-encoded JSON of the generated image. + + GPT-IMAGE-1 returns images in b64_json format only. + """ + + revised_prompt: Optional[str] = None + """The optimized prompt that was used to generate the image. + + GPT-IMAGE-1 automatically optimizes prompts for best results. + """ + + +class UsageInputTokensDetails(BaseModel): + text_tokens: Optional[int] = None + """Number of text tokens in the input""" + + +class Usage(BaseModel): + input_tokens: int + """Number of tokens in the input prompt""" + + total_tokens: int + """Total number of tokens used (input + output)""" + + input_tokens_details: Optional[UsageInputTokensDetails] = None + """Detailed breakdown of input tokens""" + + output_tokens: Optional[int] = None + """Number of tokens in the generated output""" + + +class GenerationCreateResponse(BaseModel): + created: int + """The Unix timestamp (in seconds) of when the images were created""" + + data: List[Data] + """The list of generated images""" + + background: Optional[str] = None + """The background setting used for the image generation""" + + output_format: Optional[str] = None + """The output format of the generated image""" + + quality: Optional[str] = None + """The quality setting used for the image generation""" + + size: Optional[str] = None + """The size of the generated image""" + + usage: Optional[Usage] = None + """Usage statistics for the image generation request""" diff --git a/src/gradient/types/knowledge_bases/__init__.py b/src/gradient/types/knowledge_bases/__init__.py index b23053f2..cab865fa 100644 --- a/src/gradient/types/knowledge_bases/__init__.py +++ b/src/gradient/types/knowledge_bases/__init__.py @@ -24,6 +24,12 @@ from .api_web_crawler_data_source_param import APIWebCrawlerDataSourceParam as APIWebCrawlerDataSourceParam from .indexing_job_update_cancel_params import IndexingJobUpdateCancelParams as IndexingJobUpdateCancelParams from .indexing_job_update_cancel_response import IndexingJobUpdateCancelResponse as IndexingJobUpdateCancelResponse +from .data_source_create_presigned_urls_params import ( + DataSourceCreatePresignedURLsParams as DataSourceCreatePresignedURLsParams, +) +from .data_source_create_presigned_urls_response import ( + DataSourceCreatePresignedURLsResponse as DataSourceCreatePresignedURLsResponse, +) from .indexing_job_retrieve_data_sources_response import ( IndexingJobRetrieveDataSourcesResponse as IndexingJobRetrieveDataSourcesResponse, ) diff --git a/src/gradient/types/knowledge_bases/data_source_create_presigned_urls_params.py b/src/gradient/types/knowledge_bases/data_source_create_presigned_urls_params.py new file mode 100644 index 00000000..253cbce7 --- /dev/null +++ b/src/gradient/types/knowledge_bases/data_source_create_presigned_urls_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import TypedDict + +__all__ = ["DataSourceCreatePresignedURLsParams", "File"] + + +class DataSourceCreatePresignedURLsParams(TypedDict, total=False): + files: Iterable[File] + """A list of files to generate presigned URLs for.""" + + +class File(TypedDict, total=False): + file_name: str + """Local filename""" + + file_size: str + """The size of the file in bytes.""" diff --git a/src/gradient/types/knowledge_bases/data_source_create_presigned_urls_response.py b/src/gradient/types/knowledge_bases/data_source_create_presigned_urls_response.py new file mode 100644 index 00000000..c3d172d7 --- /dev/null +++ b/src/gradient/types/knowledge_bases/data_source_create_presigned_urls_response.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from ..._models import BaseModel + +__all__ = ["DataSourceCreatePresignedURLsResponse", "Upload"] + + +class Upload(BaseModel): + expires_at: Optional[datetime] = None + """The time the url expires at.""" + + object_key: Optional[str] = None + """The unique object key to store the file as.""" + + original_file_name: Optional[str] = None + """The original file name.""" + + presigned_url: Optional[str] = None + """The actual presigned URL the client can use to upload the file directly.""" + + +class DataSourceCreatePresignedURLsResponse(BaseModel): + request_id: Optional[str] = None + """The ID generated for the request for Presigned URLs.""" + + uploads: Optional[List[Upload]] = None + """A list of generated presigned URLs and object keys, one per file.""" diff --git a/src/gradient/types/shared/__init__.py b/src/gradient/types/shared/__init__.py index 6d90845f..4fb2986a 100644 --- a/src/gradient/types/shared/__init__.py +++ b/src/gradient/types/shared/__init__.py @@ -24,6 +24,9 @@ from .garbage_collection import GarbageCollection as GarbageCollection from .firewall_rule_target import FirewallRuleTarget as FirewallRuleTarget from .chat_completion_chunk import ChatCompletionChunk as ChatCompletionChunk +from .image_gen_stream_event import ImageGenStreamEvent as ImageGenStreamEvent from .subscription_tier_base import SubscriptionTierBase as SubscriptionTierBase +from .image_gen_completed_event import ImageGenCompletedEvent as ImageGenCompletedEvent from .droplet_next_backup_window import DropletNextBackupWindow as DropletNextBackupWindow from .chat_completion_token_logprob import ChatCompletionTokenLogprob as ChatCompletionTokenLogprob +from .image_gen_partial_image_event import ImageGenPartialImageEvent as ImageGenPartialImageEvent diff --git a/src/gradient/types/shared/chat_completion_chunk.py b/src/gradient/types/shared/chat_completion_chunk.py index 4dd587f9..e30e0604 100644 --- a/src/gradient/types/shared/chat_completion_chunk.py +++ b/src/gradient/types/shared/chat_completion_chunk.py @@ -47,6 +47,9 @@ class ChoiceDelta(BaseModel): content: Optional[str] = None """The contents of the chunk message.""" + reasoning_content: Optional[str] = None + """The reasoning content generated by the model.""" + refusal: Optional[str] = None """The refusal message generated by the model.""" diff --git a/src/gradient/types/shared/image_gen_completed_event.py b/src/gradient/types/shared/image_gen_completed_event.py new file mode 100644 index 00000000..cbb282e5 --- /dev/null +++ b/src/gradient/types/shared/image_gen_completed_event.py @@ -0,0 +1,55 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ImageGenCompletedEvent", "Usage", "UsageInputTokensDetails"] + + +class UsageInputTokensDetails(BaseModel): + image_tokens: int + """The number of image tokens in the input prompt.""" + + text_tokens: int + """The number of text tokens in the input prompt.""" + + +class Usage(BaseModel): + input_tokens: int + """The number of tokens (images and text) in the input prompt.""" + + input_tokens_details: UsageInputTokensDetails + """The input tokens detailed information for the image generation.""" + + output_tokens: int + """The number of image tokens in the output image.""" + + total_tokens: int + """The total number of tokens (images and text) used for the image generation.""" + + +class ImageGenCompletedEvent(BaseModel): + b64_json: str + """Base64-encoded image data, suitable for rendering as an image.""" + + background: Literal["transparent", "opaque", "auto"] + """The background setting for the generated image.""" + + created_at: int + """The Unix timestamp when the event was created.""" + + output_format: Literal["png", "webp", "jpeg"] + """The output format for the generated image.""" + + quality: Literal["low", "medium", "high", "auto"] + """The quality setting for the generated image.""" + + size: Literal["1024x1024", "1024x1536", "1536x1024", "auto"] + """The size of the generated image.""" + + type: Literal["image_generation.completed"] + """The type of the event. Always `image_generation.completed`.""" + + usage: Usage + """For `gpt-image-1` only, the token usage information for the image generation.""" diff --git a/src/gradient/types/shared/image_gen_partial_image_event.py b/src/gradient/types/shared/image_gen_partial_image_event.py new file mode 100644 index 00000000..4cc704b2 --- /dev/null +++ b/src/gradient/types/shared/image_gen_partial_image_event.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ImageGenPartialImageEvent"] + + +class ImageGenPartialImageEvent(BaseModel): + b64_json: str + """Base64-encoded partial image data, suitable for rendering as an image.""" + + background: Literal["transparent", "opaque", "auto"] + """The background setting for the requested image.""" + + created_at: int + """The Unix timestamp when the event was created.""" + + output_format: Literal["png", "webp", "jpeg"] + """The output format for the requested image.""" + + partial_image_index: int + """0-based index for the partial image (streaming).""" + + quality: Literal["low", "medium", "high", "auto"] + """The quality setting for the requested image.""" + + size: Literal["1024x1024", "1024x1536", "1536x1024", "auto"] + """The size of the requested image.""" + + type: Literal["image_generation.partial_image"] + """The type of the event. Always `image_generation.partial_image`.""" diff --git a/src/gradient/types/shared/image_gen_stream_event.py b/src/gradient/types/shared/image_gen_stream_event.py new file mode 100644 index 00000000..30e9571e --- /dev/null +++ b/src/gradient/types/shared/image_gen_stream_event.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ..._utils import PropertyInfo +from .image_gen_completed_event import ImageGenCompletedEvent +from .image_gen_partial_image_event import ImageGenPartialImageEvent + +__all__ = ["ImageGenStreamEvent"] + +ImageGenStreamEvent: TypeAlias = Annotated[ + Union[ImageGenPartialImageEvent, ImageGenCompletedEvent], PropertyInfo(discriminator="type") +] diff --git a/src/gradient/types/shared/size.py b/src/gradient/types/shared/size.py index 42b0b41f..73abb7dd 100644 --- a/src/gradient/types/shared/size.py +++ b/src/gradient/types/shared/size.py @@ -50,7 +50,7 @@ class Size(BaseModel): regions: List[str] """ An array containing the region slugs where this size is available for Droplet - creates. regions:read is required to view. + creates. """ slug: str diff --git a/tests/api_resources/images/__init__.py b/tests/api_resources/images/__init__.py new file mode 100644 index 00000000..fd8019a9 --- /dev/null +++ b/tests/api_resources/images/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/images/test_generations.py b/tests/api_resources/images/test_generations.py new file mode 100644 index 00000000..c9c67564 --- /dev/null +++ b/tests/api_resources/images/test_generations.py @@ -0,0 +1,240 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gradient import Gradient, AsyncGradient +from tests.utils import assert_matches_type +from gradient.types.images import GenerationCreateResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestGenerations: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_overload_1(self, client: Gradient) -> None: + generation = client.images.generations.create( + prompt="A cute baby sea otter floating on its back in calm blue water", + ) + assert_matches_type(GenerationCreateResponse, generation, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_with_all_params_overload_1(self, client: Gradient) -> None: + generation = client.images.generations.create( + prompt="A cute baby sea otter floating on its back in calm blue water", + background="auto", + model="openai-gpt-image-1", + moderation="auto", + n=1, + output_compression=100, + output_format="png", + partial_images=1, + quality="auto", + size="auto", + stream=False, + user="user-1234", + ) + assert_matches_type(GenerationCreateResponse, generation, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create_overload_1(self, client: Gradient) -> None: + response = client.images.generations.with_raw_response.create( + prompt="A cute baby sea otter floating on its back in calm blue water", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + generation = response.parse() + assert_matches_type(GenerationCreateResponse, generation, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create_overload_1(self, client: Gradient) -> None: + with client.images.generations.with_streaming_response.create( + prompt="A cute baby sea otter floating on its back in calm blue water", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + generation = response.parse() + assert_matches_type(GenerationCreateResponse, generation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_overload_2(self, client: Gradient) -> None: + generation_stream = client.images.generations.create( + prompt="A cute baby sea otter floating on its back in calm blue water", + stream=True, + ) + generation_stream.response.close() + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_with_all_params_overload_2(self, client: Gradient) -> None: + generation_stream = client.images.generations.create( + prompt="A cute baby sea otter floating on its back in calm blue water", + stream=True, + background="auto", + model="openai-gpt-image-1", + moderation="auto", + n=1, + output_compression=100, + output_format="png", + partial_images=1, + quality="auto", + size="auto", + user="user-1234", + ) + generation_stream.response.close() + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create_overload_2(self, client: Gradient) -> None: + response = client.images.generations.with_raw_response.create( + prompt="A cute baby sea otter floating on its back in calm blue water", + stream=True, + ) + + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + stream = response.parse() + stream.close() + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create_overload_2(self, client: Gradient) -> None: + with client.images.generations.with_streaming_response.create( + prompt="A cute baby sea otter floating on its back in calm blue water", + stream=True, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + stream = response.parse() + stream.close() + + assert cast(Any, response.is_closed) is True + + +class TestAsyncGenerations: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_overload_1(self, async_client: AsyncGradient) -> None: + generation = await async_client.images.generations.create( + prompt="A cute baby sea otter floating on its back in calm blue water", + ) + assert_matches_type(GenerationCreateResponse, generation, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGradient) -> None: + generation = await async_client.images.generations.create( + prompt="A cute baby sea otter floating on its back in calm blue water", + background="auto", + model="openai-gpt-image-1", + moderation="auto", + n=1, + output_compression=100, + output_format="png", + partial_images=1, + quality="auto", + size="auto", + stream=False, + user="user-1234", + ) + assert_matches_type(GenerationCreateResponse, generation, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create_overload_1(self, async_client: AsyncGradient) -> None: + response = await async_client.images.generations.with_raw_response.create( + prompt="A cute baby sea otter floating on its back in calm blue water", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + generation = await response.parse() + assert_matches_type(GenerationCreateResponse, generation, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create_overload_1(self, async_client: AsyncGradient) -> None: + async with async_client.images.generations.with_streaming_response.create( + prompt="A cute baby sea otter floating on its back in calm blue water", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + generation = await response.parse() + assert_matches_type(GenerationCreateResponse, generation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_overload_2(self, async_client: AsyncGradient) -> None: + generation_stream = await async_client.images.generations.create( + prompt="A cute baby sea otter floating on its back in calm blue water", + stream=True, + ) + await generation_stream.response.aclose() + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGradient) -> None: + generation_stream = await async_client.images.generations.create( + prompt="A cute baby sea otter floating on its back in calm blue water", + stream=True, + background="auto", + model="openai-gpt-image-1", + moderation="auto", + n=1, + output_compression=100, + output_format="png", + partial_images=1, + quality="auto", + size="auto", + user="user-1234", + ) + await generation_stream.response.aclose() + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) -> None: + response = await async_client.images.generations.with_raw_response.create( + prompt="A cute baby sea otter floating on its back in calm blue water", + stream=True, + ) + + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + stream = await response.parse() + await stream.close() + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create_overload_2(self, async_client: AsyncGradient) -> None: + async with async_client.images.generations.with_streaming_response.create( + prompt="A cute baby sea otter floating on its back in calm blue water", + stream=True, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + stream = await response.parse() + await stream.close() + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/knowledge_bases/test_data_sources.py b/tests/api_resources/knowledge_bases/test_data_sources.py index bd7158d2..4214f880 100644 --- a/tests/api_resources/knowledge_bases/test_data_sources.py +++ b/tests/api_resources/knowledge_bases/test_data_sources.py @@ -13,6 +13,7 @@ DataSourceListResponse, DataSourceCreateResponse, DataSourceDeleteResponse, + DataSourceCreatePresignedURLsResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -195,6 +196,47 @@ def test_path_params_delete(self, client: Gradient) -> None: knowledge_base_uuid='"123e4567-e89b-12d3-a456-426614174000"', ) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_presigned_urls(self, client: Gradient) -> None: + data_source = client.knowledge_bases.data_sources.create_presigned_urls() + assert_matches_type(DataSourceCreatePresignedURLsResponse, data_source, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_presigned_urls_with_all_params(self, client: Gradient) -> None: + data_source = client.knowledge_bases.data_sources.create_presigned_urls( + files=[ + { + "file_name": "example name", + "file_size": "file_size", + } + ], + ) + assert_matches_type(DataSourceCreatePresignedURLsResponse, data_source, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create_presigned_urls(self, client: Gradient) -> None: + response = client.knowledge_bases.data_sources.with_raw_response.create_presigned_urls() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + data_source = response.parse() + assert_matches_type(DataSourceCreatePresignedURLsResponse, data_source, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create_presigned_urls(self, client: Gradient) -> None: + with client.knowledge_bases.data_sources.with_streaming_response.create_presigned_urls() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + data_source = response.parse() + assert_matches_type(DataSourceCreatePresignedURLsResponse, data_source, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncDataSources: parametrize = pytest.mark.parametrize( @@ -374,3 +416,46 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: data_source_uuid="", knowledge_base_uuid='"123e4567-e89b-12d3-a456-426614174000"', ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_presigned_urls(self, async_client: AsyncGradient) -> None: + data_source = await async_client.knowledge_bases.data_sources.create_presigned_urls() + assert_matches_type(DataSourceCreatePresignedURLsResponse, data_source, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_presigned_urls_with_all_params(self, async_client: AsyncGradient) -> None: + data_source = await async_client.knowledge_bases.data_sources.create_presigned_urls( + files=[ + { + "file_name": "example name", + "file_size": "file_size", + } + ], + ) + assert_matches_type(DataSourceCreatePresignedURLsResponse, data_source, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create_presigned_urls(self, async_client: AsyncGradient) -> None: + response = await async_client.knowledge_bases.data_sources.with_raw_response.create_presigned_urls() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + data_source = await response.parse() + assert_matches_type(DataSourceCreatePresignedURLsResponse, data_source, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create_presigned_urls(self, async_client: AsyncGradient) -> None: + async with ( + async_client.knowledge_bases.data_sources.with_streaming_response.create_presigned_urls() + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + data_source = await response.parse() + assert_matches_type(DataSourceCreatePresignedURLsResponse, data_source, path=["response"]) + + assert cast(Any, response.is_closed) is True From a5abfd7e82e93d44f78948f80606446783c696d9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 17:14:13 -0400 Subject: [PATCH 25/96] release: 3.2.0 (#46) * Include images * feat(api): Images generations * fix next * release: 3.2.0 --------- Co-authored-by: Ben Batha Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: bkannappan Co-authored-by: Boopathy Kannappan <86243143+bkdoeng@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/gradient/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e0dc5001..1f73031b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.1.0" + ".": "3.2.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fed586c..ed2eb2db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 3.2.0 (2025-10-06) + +Full Changelog: [v3.1.0...v3.2.0](https://github.com/digitalocean/gradient-python/compare/v3.1.0...v3.2.0) + +### Features + +* **api:** Images generations ([37bf67a](https://github.com/digitalocean/gradient-python/commit/37bf67af6097a6396e8f96a64d9224312355ff0f)) + ## 3.1.0 (2025-10-03) Full Changelog: [v3.0.2...v3.1.0](https://github.com/digitalocean/gradient-python/compare/v3.0.2...v3.1.0) diff --git a/pyproject.toml b/pyproject.toml index e2ea2e5c..dade45c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gradient" -version = "3.1.0" +version = "3.2.0" description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gradient/_version.py b/src/gradient/_version.py index 69cb2fcb..6607400d 100644 --- a/src/gradient/_version.py +++ b/src/gradient/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gradient" -__version__ = "3.1.0" # x-release-please-version +__version__ = "3.2.0" # x-release-please-version From 1af16f303961f8ed66cc31521159c78e9e12554b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 15:27:28 -0400 Subject: [PATCH 26/96] release: 3.3.0 (#47) * feat(api): update via SDK Studio * lint fix * use correct return type name * feat(api): Images generations - openai * release: 3.3.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: bkannappan Co-authored-by: Robert Craigie Co-authored-by: Boopathy Kannappan <86243143+bkdoeng@users.noreply.github.com> --- .release-please-manifest.json | 2 +- .stats.yml | 2 +- CHANGELOG.md | 9 ++ api.md | 6 +- pyproject.toml | 2 +- src/gradient/_client.py | 2 +- src/gradient/_version.py | 2 +- .../{images/generations.py => images.py} | 123 +++++++++--------- src/gradient/resources/images/__init__.py | 33 ----- src/gradient/resources/images/images.py | 102 --------------- src/gradient/types/__init__.py | 2 + ...ate_params.py => image_generate_params.py} | 10 +- ...response.py => image_generate_response.py} | 6 +- src/gradient/types/images/__init__.py | 6 - tests/api_resources/images/__init__.py | 1 - .../test_generations.py => test_images.py} | 102 +++++++-------- 16 files changed, 138 insertions(+), 272 deletions(-) rename src/gradient/resources/{images/generations.py => images.py} (90%) delete mode 100644 src/gradient/resources/images/__init__.py delete mode 100644 src/gradient/resources/images/images.py rename src/gradient/types/{images/generation_create_params.py => image_generate_params.py} (86%) rename src/gradient/types/{images/generation_create_response.py => image_generate_response.py} (90%) delete mode 100644 src/gradient/types/images/__init__.py delete mode 100644 tests/api_resources/images/__init__.py rename tests/api_resources/{images/test_generations.py => test_images.py} (62%) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1f73031b..ff1c7af5 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.2.0" + ".": "3.3.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 13507cd5..60c46674 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-40c154e2fdc4fef9ca1cf8329c29b7102bf324acfc9589571d6f3452d1ca579c.yml openapi_spec_hash: 83a3d092965fde776b29b61f785459f9 -config_hash: dd3a0f16fb9e072bb63c570b14beccd2 +config_hash: 8497af1695ff361853c745dd869dc6b9 diff --git a/CHANGELOG.md b/CHANGELOG.md index ed2eb2db..1f6a3702 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 3.3.0 (2025-10-07) + +Full Changelog: [v3.2.0...v3.3.0](https://github.com/digitalocean/gradient-python/compare/v3.2.0...v3.3.0) + +### Features + +* **api:** Images generations - openai ([e5a309e](https://github.com/digitalocean/gradient-python/commit/e5a309e46bf05846c580f425e6fa23f323138a4d)) +* **api:** update via SDK Studio ([c2bf693](https://github.com/digitalocean/gradient-python/commit/c2bf693d233830dafdfc2aa7f74e2ced2e8d81a0)) + ## 3.2.0 (2025-10-06) Full Changelog: [v3.1.0...v3.2.0](https://github.com/digitalocean/gradient-python/compare/v3.1.0...v3.2.0) diff --git a/api.md b/api.md index 6dd6c18e..a2325441 100644 --- a/api.md +++ b/api.md @@ -388,17 +388,15 @@ Methods: # Images -## Generations - Types: ```python -from gradient.types.images import GenerationCreateResponse +from gradient.types import ImageGenerateResponse ``` Methods: -- client.images.generations.create(\*\*params) -> GenerationCreateResponse +- client.images.generate(\*\*params) -> ImageGenerateResponse # GPUDroplets diff --git a/pyproject.toml b/pyproject.toml index dade45c8..d2489702 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gradient" -version = "3.2.0" +version = "3.3.0" description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gradient/_client.py b/src/gradient/_client.py index 46d9b28b..4f6c3796 100644 --- a/src/gradient/_client.py +++ b/src/gradient/_client.py @@ -43,6 +43,7 @@ gpu_droplets, knowledge_bases, ) + from .resources.images import ImagesResource, AsyncImagesResource from .resources.regions import RegionsResource, AsyncRegionsResource from .resources.chat.chat import ChatResource, AsyncChatResource from .resources.gpu_droplets import ( @@ -50,7 +51,6 @@ AsyncGPUDropletsResource, ) from .resources.agents.agents import AgentsResource, AsyncAgentsResource - from .resources.images.images import ImagesResource, AsyncImagesResource from .resources.models.models import ModelsResource, AsyncModelsResource from .resources.databases.databases import DatabasesResource, AsyncDatabasesResource from .resources.inference.inference import InferenceResource, AsyncInferenceResource diff --git a/src/gradient/_version.py b/src/gradient/_version.py index 6607400d..f90aaf96 100644 --- a/src/gradient/_version.py +++ b/src/gradient/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gradient" -__version__ = "3.2.0" # x-release-please-version +__version__ = "3.3.0" # x-release-please-version diff --git a/src/gradient/resources/images/generations.py b/src/gradient/resources/images.py similarity index 90% rename from src/gradient/resources/images/generations.py rename to src/gradient/resources/images.py index 8a5cfdb0..14bbfeaa 100644 --- a/src/gradient/resources/images/generations.py +++ b/src/gradient/resources/images.py @@ -7,47 +7,47 @@ import httpx -from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import required_args, maybe_transform, async_maybe_transform -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( +from ..types import image_generate_params +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._utils import required_args, maybe_transform, async_maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._streaming import Stream, AsyncStream -from ..._base_client import make_request_options -from ...types.images import generation_create_params -from ...types.shared.image_gen_stream_event import ImageGenStreamEvent -from ...types.images.generation_create_response import GenerationCreateResponse +from .._streaming import Stream, AsyncStream +from .._base_client import make_request_options +from ..types.image_generate_response import ImageGenerateResponse +from ..types.shared.image_gen_stream_event import ImageGenStreamEvent -__all__ = ["GenerationsResource", "AsyncGenerationsResource"] +__all__ = ["ImagesResource", "AsyncImagesResource"] -class GenerationsResource(SyncAPIResource): +class ImagesResource(SyncAPIResource): @cached_property - def with_raw_response(self) -> GenerationsResourceWithRawResponse: + def with_raw_response(self) -> ImagesResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers """ - return GenerationsResourceWithRawResponse(self) + return ImagesResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> GenerationsResourceWithStreamingResponse: + def with_streaming_response(self) -> ImagesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response """ - return GenerationsResourceWithStreamingResponse(self) + return ImagesResourceWithStreamingResponse(self) @overload - def create( + def generate( self, *, prompt: str, @@ -68,7 +68,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> GenerationCreateResponse: + ) -> ImageGenerateResponse: """ Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest image generation model with automatic prompt optimization and enhanced visual @@ -126,7 +126,7 @@ def create( ... @overload - def create( + def generate( self, *, prompt: str, @@ -205,7 +205,7 @@ def create( ... @overload - def create( + def generate( self, *, prompt: str, @@ -226,7 +226,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> GenerationCreateResponse | Stream[ImageGenStreamEvent]: + ) -> ImageGenerateResponse | Stream[ImageGenStreamEvent]: """ Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest image generation model with automatic prompt optimization and enhanced visual @@ -284,7 +284,7 @@ def create( ... @required_args(["prompt"], ["prompt", "stream"]) - def create( + def generate( self, *, prompt: str, @@ -305,7 +305,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> GenerationCreateResponse | Stream[ImageGenStreamEvent]: + ) -> ImageGenerateResponse | Stream[ImageGenStreamEvent]: if not self._client.model_access_key: raise TypeError( "Could not resolve authentication method. Expected model_access_key to be set for chat completions." @@ -335,41 +335,41 @@ def create( "stream": stream, "user": user, }, - generation_create_params.GenerationCreateParamsStreaming + image_generate_params.ImageGenerateParamsStreaming if stream - else generation_create_params.GenerationCreateParamsNonStreaming, + else image_generate_params.ImageGenerateParamsNonStreaming, ), options=make_request_options( extra_headers=headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=GenerationCreateResponse, + cast_to=ImageGenerateResponse, stream=stream or False, stream_cls=Stream[ImageGenStreamEvent], ) -class AsyncGenerationsResource(AsyncAPIResource): +class AsyncImagesResource(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncGenerationsResourceWithRawResponse: + def with_raw_response(self) -> AsyncImagesResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers """ - return AsyncGenerationsResourceWithRawResponse(self) + return AsyncImagesResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncGenerationsResourceWithStreamingResponse: + def with_streaming_response(self) -> AsyncImagesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response """ - return AsyncGenerationsResourceWithStreamingResponse(self) + return AsyncImagesResourceWithStreamingResponse(self) @overload - async def create( + async def generate( self, *, prompt: str, @@ -390,7 +390,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> GenerationCreateResponse: + ) -> ImageGenerateResponse: """ Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest image generation model with automatic prompt optimization and enhanced visual @@ -448,7 +448,7 @@ async def create( ... @overload - async def create( + async def generate( self, *, prompt: str, @@ -527,7 +527,7 @@ async def create( ... @overload - async def create( + async def generate( self, *, prompt: str, @@ -548,7 +548,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> GenerationCreateResponse | AsyncStream[ImageGenStreamEvent]: + ) -> ImageGenerateResponse | AsyncStream[ImageGenStreamEvent]: """ Creates a high-quality image from a text prompt using GPT-IMAGE-1, the latest image generation model with automatic prompt optimization and enhanced visual @@ -606,7 +606,7 @@ async def create( ... @required_args(["prompt"], ["prompt", "stream"]) - async def create( + async def generate( self, *, prompt: str, @@ -627,7 +627,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> GenerationCreateResponse | AsyncStream[ImageGenStreamEvent]: + ) -> ImageGenerateResponse | AsyncStream[ImageGenStreamEvent]: if not self._client.model_access_key: raise TypeError( "Could not resolve authentication method. Expected model_access_key to be set for chat completions." @@ -637,7 +637,6 @@ async def create( "Authorization": f"Bearer {self._client.model_access_key}", **headers, } - return await self._post( "/images/generations" if self._client._base_url_overridden @@ -657,50 +656,50 @@ async def create( "stream": stream, "user": user, }, - generation_create_params.GenerationCreateParamsStreaming + image_generate_params.ImageGenerateParamsStreaming if stream - else generation_create_params.GenerationCreateParamsNonStreaming, + else image_generate_params.ImageGenerateParamsNonStreaming, ), options=make_request_options( extra_headers=headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=GenerationCreateResponse, + cast_to=ImageGenerateResponse, stream=stream or False, stream_cls=AsyncStream[ImageGenStreamEvent], ) -class GenerationsResourceWithRawResponse: - def __init__(self, generations: GenerationsResource) -> None: - self._generations = generations +class ImagesResourceWithRawResponse: + def __init__(self, images: ImagesResource) -> None: + self._images = images - self.create = to_raw_response_wrapper( - generations.create, + self.generate = to_raw_response_wrapper( + images.generate, ) -class AsyncGenerationsResourceWithRawResponse: - def __init__(self, generations: AsyncGenerationsResource) -> None: - self._generations = generations +class AsyncImagesResourceWithRawResponse: + def __init__(self, images: AsyncImagesResource) -> None: + self._images = images - self.create = async_to_raw_response_wrapper( - generations.create, + self.generate = async_to_raw_response_wrapper( + images.generate, ) -class GenerationsResourceWithStreamingResponse: - def __init__(self, generations: GenerationsResource) -> None: - self._generations = generations +class ImagesResourceWithStreamingResponse: + def __init__(self, images: ImagesResource) -> None: + self._images = images - self.create = to_streamed_response_wrapper( - generations.create, + self.generate = to_streamed_response_wrapper( + images.generate, ) -class AsyncGenerationsResourceWithStreamingResponse: - def __init__(self, generations: AsyncGenerationsResource) -> None: - self._generations = generations +class AsyncImagesResourceWithStreamingResponse: + def __init__(self, images: AsyncImagesResource) -> None: + self._images = images - self.create = async_to_streamed_response_wrapper( - generations.create, + self.generate = async_to_streamed_response_wrapper( + images.generate, ) diff --git a/src/gradient/resources/images/__init__.py b/src/gradient/resources/images/__init__.py deleted file mode 100644 index cf187f1d..00000000 --- a/src/gradient/resources/images/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .images import ( - ImagesResource, - AsyncImagesResource, - ImagesResourceWithRawResponse, - AsyncImagesResourceWithRawResponse, - ImagesResourceWithStreamingResponse, - AsyncImagesResourceWithStreamingResponse, -) -from .generations import ( - GenerationsResource, - AsyncGenerationsResource, - GenerationsResourceWithRawResponse, - AsyncGenerationsResourceWithRawResponse, - GenerationsResourceWithStreamingResponse, - AsyncGenerationsResourceWithStreamingResponse, -) - -__all__ = [ - "GenerationsResource", - "AsyncGenerationsResource", - "GenerationsResourceWithRawResponse", - "AsyncGenerationsResourceWithRawResponse", - "GenerationsResourceWithStreamingResponse", - "AsyncGenerationsResourceWithStreamingResponse", - "ImagesResource", - "AsyncImagesResource", - "ImagesResourceWithRawResponse", - "AsyncImagesResourceWithRawResponse", - "ImagesResourceWithStreamingResponse", - "AsyncImagesResourceWithStreamingResponse", -] diff --git a/src/gradient/resources/images/images.py b/src/gradient/resources/images/images.py deleted file mode 100644 index 37e7290f..00000000 --- a/src/gradient/resources/images/images.py +++ /dev/null @@ -1,102 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from .generations import ( - GenerationsResource, - AsyncGenerationsResource, - GenerationsResourceWithRawResponse, - AsyncGenerationsResourceWithRawResponse, - GenerationsResourceWithStreamingResponse, - AsyncGenerationsResourceWithStreamingResponse, -) - -__all__ = ["ImagesResource", "AsyncImagesResource"] - - -class ImagesResource(SyncAPIResource): - @cached_property - def generations(self) -> GenerationsResource: - return GenerationsResource(self._client) - - @cached_property - def with_raw_response(self) -> ImagesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers - """ - return ImagesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> ImagesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response - """ - return ImagesResourceWithStreamingResponse(self) - - -class AsyncImagesResource(AsyncAPIResource): - @cached_property - def generations(self) -> AsyncGenerationsResource: - return AsyncGenerationsResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncImagesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers - """ - return AsyncImagesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncImagesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response - """ - return AsyncImagesResourceWithStreamingResponse(self) - - -class ImagesResourceWithRawResponse: - def __init__(self, images: ImagesResource) -> None: - self._images = images - - @cached_property - def generations(self) -> GenerationsResourceWithRawResponse: - return GenerationsResourceWithRawResponse(self._images.generations) - - -class AsyncImagesResourceWithRawResponse: - def __init__(self, images: AsyncImagesResource) -> None: - self._images = images - - @cached_property - def generations(self) -> AsyncGenerationsResourceWithRawResponse: - return AsyncGenerationsResourceWithRawResponse(self._images.generations) - - -class ImagesResourceWithStreamingResponse: - def __init__(self, images: ImagesResource) -> None: - self._images = images - - @cached_property - def generations(self) -> GenerationsResourceWithStreamingResponse: - return GenerationsResourceWithStreamingResponse(self._images.generations) - - -class AsyncImagesResourceWithStreamingResponse: - def __init__(self, images: AsyncImagesResource) -> None: - self._images = images - - @cached_property - def generations(self) -> AsyncGenerationsResourceWithStreamingResponse: - return AsyncGenerationsResourceWithStreamingResponse(self._images.generations) diff --git a/src/gradient/types/__init__.py b/src/gradient/types/__init__.py index ad63485e..1299779c 100644 --- a/src/gradient/types/__init__.py +++ b/src/gradient/types/__init__.py @@ -68,10 +68,12 @@ from .agent_delete_response import AgentDeleteResponse as AgentDeleteResponse from .agent_update_response import AgentUpdateResponse as AgentUpdateResponse from .droplet_backup_policy import DropletBackupPolicy as DropletBackupPolicy +from .image_generate_params import ImageGenerateParams as ImageGenerateParams from .api_agent_api_key_info import APIAgentAPIKeyInfo as APIAgentAPIKeyInfo from .agent_retrieve_response import AgentRetrieveResponse as AgentRetrieveResponse from .api_openai_api_key_info import APIOpenAIAPIKeyInfo as APIOpenAIAPIKeyInfo from .gpu_droplet_list_params import GPUDropletListParams as GPUDropletListParams +from .image_generate_response import ImageGenerateResponse as ImageGenerateResponse from .api_deployment_visibility import APIDeploymentVisibility as APIDeploymentVisibility from .gpu_droplet_create_params import GPUDropletCreateParams as GPUDropletCreateParams from .gpu_droplet_list_response import GPUDropletListResponse as GPUDropletListResponse diff --git a/src/gradient/types/images/generation_create_params.py b/src/gradient/types/image_generate_params.py similarity index 86% rename from src/gradient/types/images/generation_create_params.py rename to src/gradient/types/image_generate_params.py index ec8b672f..42e6144a 100644 --- a/src/gradient/types/images/generation_create_params.py +++ b/src/gradient/types/image_generate_params.py @@ -5,10 +5,10 @@ from typing import Union, Optional from typing_extensions import Literal, Required, TypedDict -__all__ = ["GenerationCreateParamsBase", "GenerationCreateParamsNonStreaming", "GenerationCreateParamsStreaming"] +__all__ = ["ImageGenerateParamsBase", "ImageGenerateParamsNonStreaming", "ImageGenerateParamsStreaming"] -class GenerationCreateParamsBase(TypedDict, total=False): +class ImageGenerateParamsBase(TypedDict, total=False): prompt: Required[str] """A text description of the desired image(s). @@ -77,7 +77,7 @@ class GenerationCreateParamsBase(TypedDict, total=False): """ -class GenerationCreateParamsNonStreaming(GenerationCreateParamsBase, total=False): +class ImageGenerateParamsNonStreaming(ImageGenerateParamsBase, total=False): stream: Optional[Literal[False]] """ If set to true, partial image data will be streamed as the image is being @@ -87,7 +87,7 @@ class GenerationCreateParamsNonStreaming(GenerationCreateParamsBase, total=False """ -class GenerationCreateParamsStreaming(GenerationCreateParamsBase): +class ImageGenerateParamsStreaming(ImageGenerateParamsBase): stream: Required[Literal[True]] """ If set to true, partial image data will be streamed as the image is being @@ -97,4 +97,4 @@ class GenerationCreateParamsStreaming(GenerationCreateParamsBase): """ -GenerationCreateParams = Union[GenerationCreateParamsNonStreaming, GenerationCreateParamsStreaming] +ImageGenerateParams = Union[ImageGenerateParamsNonStreaming, ImageGenerateParamsStreaming] diff --git a/src/gradient/types/images/generation_create_response.py b/src/gradient/types/image_generate_response.py similarity index 90% rename from src/gradient/types/images/generation_create_response.py rename to src/gradient/types/image_generate_response.py index 32757c06..5f97697c 100644 --- a/src/gradient/types/images/generation_create_response.py +++ b/src/gradient/types/image_generate_response.py @@ -2,9 +2,9 @@ from typing import List, Optional -from ..._models import BaseModel +from .._models import BaseModel -__all__ = ["GenerationCreateResponse", "Data", "Usage", "UsageInputTokensDetails"] +__all__ = ["ImageGenerateResponse", "Data", "Usage", "UsageInputTokensDetails"] class Data(BaseModel): @@ -40,7 +40,7 @@ class Usage(BaseModel): """Number of tokens in the generated output""" -class GenerationCreateResponse(BaseModel): +class ImageGenerateResponse(BaseModel): created: int """The Unix timestamp (in seconds) of when the images were created""" diff --git a/src/gradient/types/images/__init__.py b/src/gradient/types/images/__init__.py deleted file mode 100644 index 29634ec1..00000000 --- a/src/gradient/types/images/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .generation_create_params import GenerationCreateParams as GenerationCreateParams -from .generation_create_response import GenerationCreateResponse as GenerationCreateResponse diff --git a/tests/api_resources/images/__init__.py b/tests/api_resources/images/__init__.py deleted file mode 100644 index fd8019a9..00000000 --- a/tests/api_resources/images/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/images/test_generations.py b/tests/api_resources/test_images.py similarity index 62% rename from tests/api_resources/images/test_generations.py rename to tests/api_resources/test_images.py index c9c67564..47428d02 100644 --- a/tests/api_resources/images/test_generations.py +++ b/tests/api_resources/test_images.py @@ -9,26 +9,26 @@ from gradient import Gradient, AsyncGradient from tests.utils import assert_matches_type -from gradient.types.images import GenerationCreateResponse +from gradient.types import ImageGenerateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -class TestGenerations: +class TestImages: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_method_create_overload_1(self, client: Gradient) -> None: - generation = client.images.generations.create( + def test_method_generate_overload_1(self, client: Gradient) -> None: + image = client.images.generate( prompt="A cute baby sea otter floating on its back in calm blue water", ) - assert_matches_type(GenerationCreateResponse, generation, path=["response"]) + assert_matches_type(ImageGenerateResponse, image, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_method_create_with_all_params_overload_1(self, client: Gradient) -> None: - generation = client.images.generations.create( + def test_method_generate_with_all_params_overload_1(self, client: Gradient) -> None: + image = client.images.generate( prompt="A cute baby sea otter floating on its back in calm blue water", background="auto", model="openai-gpt-image-1", @@ -42,47 +42,47 @@ def test_method_create_with_all_params_overload_1(self, client: Gradient) -> Non stream=False, user="user-1234", ) - assert_matches_type(GenerationCreateResponse, generation, path=["response"]) + assert_matches_type(ImageGenerateResponse, image, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_raw_response_create_overload_1(self, client: Gradient) -> None: - response = client.images.generations.with_raw_response.create( + def test_raw_response_generate_overload_1(self, client: Gradient) -> None: + response = client.images.with_raw_response.generate( prompt="A cute baby sea otter floating on its back in calm blue water", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - generation = response.parse() - assert_matches_type(GenerationCreateResponse, generation, path=["response"]) + image = response.parse() + assert_matches_type(ImageGenerateResponse, image, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_streaming_response_create_overload_1(self, client: Gradient) -> None: - with client.images.generations.with_streaming_response.create( + def test_streaming_response_generate_overload_1(self, client: Gradient) -> None: + with client.images.with_streaming_response.generate( prompt="A cute baby sea otter floating on its back in calm blue water", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - generation = response.parse() - assert_matches_type(GenerationCreateResponse, generation, path=["response"]) + image = response.parse() + assert_matches_type(ImageGenerateResponse, image, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_method_create_overload_2(self, client: Gradient) -> None: - generation_stream = client.images.generations.create( + def test_method_generate_overload_2(self, client: Gradient) -> None: + image_stream = client.images.generate( prompt="A cute baby sea otter floating on its back in calm blue water", stream=True, ) - generation_stream.response.close() + image_stream.response.close() @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_method_create_with_all_params_overload_2(self, client: Gradient) -> None: - generation_stream = client.images.generations.create( + def test_method_generate_with_all_params_overload_2(self, client: Gradient) -> None: + image_stream = client.images.generate( prompt="A cute baby sea otter floating on its back in calm blue water", stream=True, background="auto", @@ -96,12 +96,12 @@ def test_method_create_with_all_params_overload_2(self, client: Gradient) -> Non size="auto", user="user-1234", ) - generation_stream.response.close() + image_stream.response.close() @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_raw_response_create_overload_2(self, client: Gradient) -> None: - response = client.images.generations.with_raw_response.create( + def test_raw_response_generate_overload_2(self, client: Gradient) -> None: + response = client.images.with_raw_response.generate( prompt="A cute baby sea otter floating on its back in calm blue water", stream=True, ) @@ -112,8 +112,8 @@ def test_raw_response_create_overload_2(self, client: Gradient) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_streaming_response_create_overload_2(self, client: Gradient) -> None: - with client.images.generations.with_streaming_response.create( + def test_streaming_response_generate_overload_2(self, client: Gradient) -> None: + with client.images.with_streaming_response.generate( prompt="A cute baby sea otter floating on its back in calm blue water", stream=True, ) as response: @@ -126,23 +126,23 @@ def test_streaming_response_create_overload_2(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True -class TestAsyncGenerations: +class TestAsyncImages: parametrize = pytest.mark.parametrize( "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_method_create_overload_1(self, async_client: AsyncGradient) -> None: - generation = await async_client.images.generations.create( + async def test_method_generate_overload_1(self, async_client: AsyncGradient) -> None: + image = await async_client.images.generate( prompt="A cute baby sea otter floating on its back in calm blue water", ) - assert_matches_type(GenerationCreateResponse, generation, path=["response"]) + assert_matches_type(ImageGenerateResponse, image, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGradient) -> None: - generation = await async_client.images.generations.create( + async def test_method_generate_with_all_params_overload_1(self, async_client: AsyncGradient) -> None: + image = await async_client.images.generate( prompt="A cute baby sea otter floating on its back in calm blue water", background="auto", model="openai-gpt-image-1", @@ -156,47 +156,47 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn stream=False, user="user-1234", ) - assert_matches_type(GenerationCreateResponse, generation, path=["response"]) + assert_matches_type(ImageGenerateResponse, image, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_raw_response_create_overload_1(self, async_client: AsyncGradient) -> None: - response = await async_client.images.generations.with_raw_response.create( + async def test_raw_response_generate_overload_1(self, async_client: AsyncGradient) -> None: + response = await async_client.images.with_raw_response.generate( prompt="A cute baby sea otter floating on its back in calm blue water", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - generation = await response.parse() - assert_matches_type(GenerationCreateResponse, generation, path=["response"]) + image = await response.parse() + assert_matches_type(ImageGenerateResponse, image, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_streaming_response_create_overload_1(self, async_client: AsyncGradient) -> None: - async with async_client.images.generations.with_streaming_response.create( + async def test_streaming_response_generate_overload_1(self, async_client: AsyncGradient) -> None: + async with async_client.images.with_streaming_response.generate( prompt="A cute baby sea otter floating on its back in calm blue water", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - generation = await response.parse() - assert_matches_type(GenerationCreateResponse, generation, path=["response"]) + image = await response.parse() + assert_matches_type(ImageGenerateResponse, image, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_method_create_overload_2(self, async_client: AsyncGradient) -> None: - generation_stream = await async_client.images.generations.create( + async def test_method_generate_overload_2(self, async_client: AsyncGradient) -> None: + image_stream = await async_client.images.generate( prompt="A cute baby sea otter floating on its back in calm blue water", stream=True, ) - await generation_stream.response.aclose() + await image_stream.response.aclose() @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGradient) -> None: - generation_stream = await async_client.images.generations.create( + async def test_method_generate_with_all_params_overload_2(self, async_client: AsyncGradient) -> None: + image_stream = await async_client.images.generate( prompt="A cute baby sea otter floating on its back in calm blue water", stream=True, background="auto", @@ -210,12 +210,12 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn size="auto", user="user-1234", ) - await generation_stream.response.aclose() + await image_stream.response.aclose() @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) -> None: - response = await async_client.images.generations.with_raw_response.create( + async def test_raw_response_generate_overload_2(self, async_client: AsyncGradient) -> None: + response = await async_client.images.with_raw_response.generate( prompt="A cute baby sea otter floating on its back in calm blue water", stream=True, ) @@ -226,8 +226,8 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_streaming_response_create_overload_2(self, async_client: AsyncGradient) -> None: - async with async_client.images.generations.with_streaming_response.create( + async def test_streaming_response_generate_overload_2(self, async_client: AsyncGradient) -> None: + async with async_client.images.with_streaming_response.generate( prompt="A cute baby sea otter floating on its back in calm blue water", stream=True, ) as response: From 0dccc0c6309f15bf1869e33befb160a187a200d7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Oct 2025 16:32:47 -0400 Subject: [PATCH 27/96] release: 3.4.0 (#54) * feat(api): manual updates * release: 3.4.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- .stats.yml | 4 ++-- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/gradient/_version.py | 2 +- .../gpu_droplets/floating_ips/floating_ips.py | 12 ------------ .../types/agents/chat/completion_create_response.py | 2 +- .../types/chat/completion_create_response.py | 2 +- src/gradient/types/shared/chat_completion_chunk.py | 2 +- 9 files changed, 16 insertions(+), 20 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ff1c7af5..2437b419 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.3.0" + ".": "3.4.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 60c46674..3f41901a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-40c154e2fdc4fef9ca1cf8329c29b7102bf324acfc9589571d6f3452d1ca579c.yml -openapi_spec_hash: 83a3d092965fde776b29b61f785459f9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-d15c113822740c8a5cd0d054d186c524ea6e15a9e64e8d0662b5a5a667745aaa.yml +openapi_spec_hash: b56f95892c05800b022f39d77087037b config_hash: 8497af1695ff361853c745dd869dc6b9 diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f6a3702..c39b7324 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 3.4.0 (2025-10-09) + +Full Changelog: [v3.3.0...v3.4.0](https://github.com/digitalocean/gradient-python/compare/v3.3.0...v3.4.0) + +### Features + +* **api:** manual updates ([bbd7ddc](https://github.com/digitalocean/gradient-python/commit/bbd7ddccfb3d98f39e61948365b92202b3cc9e33)) + ## 3.3.0 (2025-10-07) Full Changelog: [v3.2.0...v3.3.0](https://github.com/digitalocean/gradient-python/compare/v3.2.0...v3.3.0) diff --git a/pyproject.toml b/pyproject.toml index d2489702..75cb7f7b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gradient" -version = "3.3.0" +version = "3.4.0" description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gradient/_version.py b/src/gradient/_version.py index f90aaf96..440935e9 100644 --- a/src/gradient/_version.py +++ b/src/gradient/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gradient" -__version__ = "3.3.0" # x-release-please-version +__version__ = "3.4.0" # x-release-please-version diff --git a/src/gradient/resources/gpu_droplets/floating_ips/floating_ips.py b/src/gradient/resources/gpu_droplets/floating_ips/floating_ips.py index 58b4bdb0..f55bfd41 100644 --- a/src/gradient/resources/gpu_droplets/floating_ips/floating_ips.py +++ b/src/gradient/resources/gpu_droplets/floating_ips/floating_ips.py @@ -79,9 +79,6 @@ def create( - To create a new floating IP reserved to a region, send a POST request to `/v2/floating_ips` with the `region` attribute. - **Note**: In addition to the standard rate limiting, only 12 floating IPs may be - created per 60 seconds. - Args: droplet_id: The ID of the Droplet that the floating IP will be assigned to. @@ -118,9 +115,6 @@ def create( - To create a new floating IP reserved to a region, send a POST request to `/v2/floating_ips` with the `region` attribute. - **Note**: In addition to the standard rate limiting, only 12 floating IPs may be - created per 60 seconds. - Args: region: The slug identifier for the region the floating IP will be reserved to. @@ -336,9 +330,6 @@ async def create( - To create a new floating IP reserved to a region, send a POST request to `/v2/floating_ips` with the `region` attribute. - **Note**: In addition to the standard rate limiting, only 12 floating IPs may be - created per 60 seconds. - Args: droplet_id: The ID of the Droplet that the floating IP will be assigned to. @@ -375,9 +366,6 @@ async def create( - To create a new floating IP reserved to a region, send a POST request to `/v2/floating_ips` with the `region` attribute. - **Note**: In addition to the standard rate limiting, only 12 floating IPs may be - created per 60 seconds. - Args: region: The slug identifier for the region the floating IP will be reserved to. diff --git a/src/gradient/types/agents/chat/completion_create_response.py b/src/gradient/types/agents/chat/completion_create_response.py index f3dedb4e..69b3d203 100644 --- a/src/gradient/types/agents/chat/completion_create_response.py +++ b/src/gradient/types/agents/chat/completion_create_response.py @@ -67,7 +67,7 @@ class ChoiceMessage(BaseModel): class Choice(BaseModel): - finish_reason: Literal["stop", "length", "tool_calls"] + finish_reason: Literal["stop", "length", "tool_calls", "content_filter"] """The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop diff --git a/src/gradient/types/chat/completion_create_response.py b/src/gradient/types/chat/completion_create_response.py index 9e157aee..151f6556 100644 --- a/src/gradient/types/chat/completion_create_response.py +++ b/src/gradient/types/chat/completion_create_response.py @@ -67,7 +67,7 @@ class ChoiceMessage(BaseModel): class Choice(BaseModel): - finish_reason: Literal["stop", "length", "tool_calls"] + finish_reason: Literal["stop", "length", "tool_calls", "content_filter"] """The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop diff --git a/src/gradient/types/shared/chat_completion_chunk.py b/src/gradient/types/shared/chat_completion_chunk.py index e30e0604..ff705bf4 100644 --- a/src/gradient/types/shared/chat_completion_chunk.py +++ b/src/gradient/types/shared/chat_completion_chunk.py @@ -71,7 +71,7 @@ class Choice(BaseModel): delta: ChoiceDelta """A chat completion delta generated by streamed model responses.""" - finish_reason: Optional[Literal["stop", "length", "tool_calls"]] = None + finish_reason: Optional[Literal["stop", "length", "tool_calls", "content_filter"]] = None """The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop From 292da2b06dd7645d9c685cb0415f936be5aeb928 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Oct 2025 14:47:48 -0400 Subject: [PATCH 28/96] release: 3.5.0 (#55) * chore(internal): detect missing future annotations with ruff * feat(api): update via SDK Studio (#74) * release: 3.5.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: Ben Batha --- .release-please-manifest.json | 2 +- .stats.yml | 6 ++-- CHANGELOG.md | 13 ++++++++ README.md | 13 ++++---- pyproject.toml | 6 +++- src/gradient/_base_client.py | 43 ++++++++++++++++++++++----- src/gradient/_client.py | 56 +++++++++++++++++++++++++++++++++++ src/gradient/_version.py | 2 +- tests/test_client.py | 16 ++++++---- 9 files changed, 129 insertions(+), 28 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2437b419..bf0d0361 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.4.0" + ".": "3.5.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 3f41901a..af483f0a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-d15c113822740c8a5cd0d054d186c524ea6e15a9e64e8d0662b5a5a667745aaa.yml -openapi_spec_hash: b56f95892c05800b022f39d77087037b -config_hash: 8497af1695ff361853c745dd869dc6b9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-cb3bf9b21459cad24410206c27a32fd31ef6cf86711700597549dbbd0d634002.yml +openapi_spec_hash: 6a9149a81ba15e7c5c5c1f4d77daad92 +config_hash: bad49c3bf949d5168ec3896bedff253a diff --git a/CHANGELOG.md b/CHANGELOG.md index c39b7324..d8e8b1d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 3.5.0 (2025-10-14) + +Full Changelog: [v3.4.0...v3.5.0](https://github.com/digitalocean/gradient-python/compare/v3.4.0...v3.5.0) + +### Features + +* **api:** update via SDK Studio ([#74](https://github.com/digitalocean/gradient-python/issues/74)) ([e1ab040](https://github.com/digitalocean/gradient-python/commit/e1ab0407e88f5394f5c299940a4b2fe72dbbf70e)) + + +### Chores + +* **internal:** detect missing future annotations with ruff ([0fb9f92](https://github.com/digitalocean/gradient-python/commit/0fb9f9254a0f72a721fa73823399e58eec723f1a)) + ## 3.4.0 (2025-10-09) Full Changelog: [v3.3.0...v3.4.0](https://github.com/digitalocean/gradient-python/compare/v3.3.0...v3.4.0) diff --git a/README.md b/README.md index 30b7c75a..c9186c03 100644 --- a/README.md +++ b/README.md @@ -44,12 +44,14 @@ client = Gradient( ), # This is the default and can be omitted ) inference_client = Gradient( - inference_key=os.environ.get( + model_access_key=os.environ.get( "GRADIENT_MODEL_ACCESS_KEY" ), # This is the default and can be omitted ) agent_client = Gradient( - agent_key=os.environ.get("GRADIENT_AGENT_ACCESS_KEY"), # This is the default and can be omitted + agent_access_key=os.environ.get( + "GRADIENT_AGENT_ACCESS_KEY" + ), # This is the default and can be omitted agent_endpoint="https://my-agent.agents.do-ai.run", ) @@ -103,11 +105,7 @@ import os import asyncio from gradient import AsyncGradient -client = AsyncGradient( - access_token=os.environ.get( - "DIGITALOCEAN_ACCESS_TOKEN" - ), # This is the default and can be omitted -) +client = AsyncGradient() async def main() -> None: @@ -149,7 +147,6 @@ from gradient import AsyncGradient async def main() -> None: async with AsyncGradient( - access_token="My Access Token", http_client=DefaultAioHttpClient(), ) as client: completion = await client.chat.completions.create( diff --git a/pyproject.toml b/pyproject.toml index 75cb7f7b..b9dbc5ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gradient" -version = "3.4.0" +version = "3.5.0" description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" @@ -211,6 +211,8 @@ select = [ "B", # remove unused imports "F401", + # check for missing future annotations + "FA102", # bare except statements "E722", # unused arguments @@ -233,6 +235,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" diff --git a/src/gradient/_base_client.py b/src/gradient/_base_client.py index 89146b71..c6d52884 100644 --- a/src/gradient/_base_client.py +++ b/src/gradient/_base_client.py @@ -548,14 +548,14 @@ def _build_request( # TODO: report this error to httpx return self._client.build_request( # pyright: ignore[reportUnknownMemberType] headers=headers, - timeout=self.timeout if isinstance(options.timeout, NotGiven) else options.timeout, + timeout=(self.timeout if isinstance(options.timeout, NotGiven) else options.timeout), method=options.method, url=prepared_url, # the `Query` type that we use is incompatible with qs' # `Params` type as it needs to be typed as `Mapping[str, object]` # 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, + params=(self.qs.stringify(cast(Mapping[str, Any], params)) if params else None), **kwargs, ) @@ -1067,7 +1067,12 @@ def request( ) def _sleep_for_retry( - self, *, retries_taken: int, max_retries: int, options: FinalRequestOptions, response: httpx.Response | None + self, + *, + retries_taken: int, + max_retries: int, + options: FinalRequestOptions, + response: httpx.Response | None, ) -> None: remaining_retries = max_retries - retries_taken if remaining_retries == 1: @@ -1248,7 +1253,11 @@ def post( stream_cls: type[_StreamT] | None = None, ) -> ResponseT | _StreamT: opts = FinalRequestOptions.construct( - method="post", url=path, json_data=body, files=to_httpx_files(files), **options + method="post", + url=path, + json_data=body, + files=to_httpx_files(files), + **options, ) return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) @@ -1273,7 +1282,11 @@ def put( options: RequestOptions = {}, ) -> ResponseT: opts = FinalRequestOptions.construct( - method="put", url=path, json_data=body, files=to_httpx_files(files), **options + method="put", + url=path, + json_data=body, + files=to_httpx_files(files), + **options, ) return self.request(cast_to, opts) @@ -1317,6 +1330,7 @@ def __init__(self, **kwargs: Any) -> None: 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 @@ -1603,7 +1617,12 @@ async def request( ) async def _sleep_for_retry( - self, *, retries_taken: int, max_retries: int, options: FinalRequestOptions, response: httpx.Response | None + self, + *, + retries_taken: int, + max_retries: int, + options: FinalRequestOptions, + response: httpx.Response | None, ) -> None: remaining_retries = max_retries - retries_taken if remaining_retries == 1: @@ -1772,7 +1791,11 @@ async def post( stream_cls: type[_AsyncStreamT] | None = None, ) -> ResponseT | _AsyncStreamT: opts = FinalRequestOptions.construct( - method="post", url=path, json_data=body, files=await async_to_httpx_files(files), **options + method="post", + url=path, + json_data=body, + files=await async_to_httpx_files(files), + **options, ) return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) @@ -1797,7 +1820,11 @@ async def put( options: RequestOptions = {}, ) -> ResponseT: opts = FinalRequestOptions.construct( - method="put", url=path, json_data=body, files=await async_to_httpx_files(files), **options + method="put", + url=path, + json_data=body, + files=await async_to_httpx_files(files), + **options, ) return await self.request(cast_to, opts) diff --git a/src/gradient/_client.py b/src/gradient/_client.py index 4f6c3796..77cc446e 100644 --- a/src/gradient/_client.py +++ b/src/gradient/_client.py @@ -242,11 +242,29 @@ def qs(self) -> Querystring: @property @override def auth_headers(self) -> dict[str, str]: + return {**self._model_access_key, **self._agent_access_key, **self._bearer_auth} + + @property + def _bearer_auth(self) -> dict[str, str]: access_token = self.access_token if access_token is None: return {} return {"Authorization": f"Bearer {access_token}"} + @property + def _model_access_key(self) -> dict[str, str]: + model_access_key = self.model_access_key + if model_access_key is None: + return {} + return {"Authorization": f"Bearer {model_access_key}"} + + @property + def _agent_access_key(self) -> dict[str, str]: + agent_access_key = self.agent_access_key + if agent_access_key is None: + return {} + return {"Authorization": f"Bearer {agent_access_key}"} + @property @override def default_headers(self) -> dict[str, str | Omit]: @@ -263,6 +281,16 @@ def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None: if isinstance(custom_headers.get("Authorization"), Omit): return + if self.model_access_key and headers.get("Authorization"): + return + if isinstance(custom_headers.get("Authorization"), Omit): + return + + if self.agent_access_key and headers.get("Authorization"): + return + if isinstance(custom_headers.get("Authorization"), Omit): + return + raise TypeError( '"Could not resolve authentication method. Expected access_token, agent_access_key, or model_access_key to be set. Or for the `Authorization` headers to be explicitly omitted"' ) @@ -537,11 +565,29 @@ def qs(self) -> Querystring: @property @override def auth_headers(self) -> dict[str, str]: + return {**self._model_access_key, **self._agent_access_key, **self._bearer_auth} + + @property + def _bearer_auth(self) -> dict[str, str]: access_token = self.access_token if access_token is None: return {} return {"Authorization": f"Bearer {access_token}"} + @property + def _model_access_key(self) -> dict[str, str]: + model_access_key = self.model_access_key + if model_access_key is None: + return {} + return {"Authorization": f"Bearer {model_access_key}"} + + @property + def _agent_access_key(self) -> dict[str, str]: + agent_access_key = self.agent_access_key + if agent_access_key is None: + return {} + return {"Authorization": f"Bearer {agent_access_key}"} + @property @override def default_headers(self) -> dict[str, str | Omit]: @@ -558,6 +604,16 @@ def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None: if isinstance(custom_headers.get("Authorization"), Omit): return + if self.model_access_key and headers.get("Authorization"): + return + if isinstance(custom_headers.get("Authorization"), Omit): + return + + if self.agent_access_key and headers.get("Authorization"): + return + if isinstance(custom_headers.get("Authorization"), Omit): + return + raise TypeError( '"Could not resolve authentication method. Expected access_token, agent_access_key, or model_access_key to be set. Or for the `Authorization` headers to be explicitly omitted"' ) diff --git a/src/gradient/_version.py b/src/gradient/_version.py index 440935e9..68c981bc 100644 --- a/src/gradient/_version.py +++ b/src/gradient/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gradient" -__version__ = "3.4.0" # x-release-please-version +__version__ = "3.5.0" # x-release-please-version diff --git a/tests/test_client.py b/tests/test_client.py index 98833ff2..ddf1c4db 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -414,12 +414,14 @@ def test_validate_headers(self) -> None: request = client._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("Authorization") == f"Bearer {access_token}" - with update_env(**{"DIGITALOCEAN_ACCESS_TOKEN": Omit()}): + with update_env( + **{"DIGITALOCEAN_ACCESS_TOKEN": Omit(), "MODEL_ACCESS_KEY": Omit(), "AGENT_ACCESS_KEY": Omit()} + ): client2 = Gradient( base_url=base_url, access_token=None, - model_access_key=model_access_key, - agent_access_key=agent_access_key, + model_access_key=None, + agent_access_key=None, _strict_response_validation=True, ) @@ -1429,12 +1431,14 @@ def test_validate_headers(self) -> None: request = client._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("Authorization") == f"Bearer {access_token}" - with update_env(**{"DIGITALOCEAN_ACCESS_TOKEN": Omit()}): + with update_env( + **{"DIGITALOCEAN_ACCESS_TOKEN": Omit(), "MODEL_ACCESS_KEY": Omit(), "AGENT_ACCESS_KEY": Omit()} + ): client2 = AsyncGradient( base_url=base_url, access_token=None, - model_access_key=model_access_key, - agent_access_key=agent_access_key, + model_access_key=None, + agent_access_key=None, _strict_response_validation=True, ) From 82345aec4d3366ef59593849e1fc3fef15c41f97 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 16 Oct 2025 13:42:55 -0400 Subject: [PATCH 29/96] release: 3.6.0 (#64) * feat(api): manual updates * fix: test setup needs all three access keys * fix: lints * release: 3.6.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: Ben Batha --- .release-please-manifest.json | 2 +- CHANGELOG.md | 14 ++++++++++++++ pyproject.toml | 2 +- src/gradient/_client.py | 20 ++++++++++++++++++++ src/gradient/_version.py | 2 +- tests/conftest.py | 4 +++- 6 files changed, 40 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bf0d0361..f391d416 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.5.0" + ".": "3.6.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d8e8b1d5..b8cc8f24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 3.6.0 (2025-10-16) + +Full Changelog: [v3.5.0...v3.6.0](https://github.com/digitalocean/gradient-python/compare/v3.5.0...v3.6.0) + +### Features + +* **api:** manual updates ([da88e9e](https://github.com/digitalocean/gradient-python/commit/da88e9eee0adc6152d0d8212305397483be0d686)) + + +### Bug Fixes + +* lints ([a1b1fc6](https://github.com/digitalocean/gradient-python/commit/a1b1fc6b7747c00d9bfc2b86c6262e9c123416dc)) +* test setup needs all three access keys ([01ac735](https://github.com/digitalocean/gradient-python/commit/01ac735fb965686699df82ec8763b18ceb660972)) + ## 3.5.0 (2025-10-14) Full Changelog: [v3.4.0...v3.5.0](https://github.com/digitalocean/gradient-python/compare/v3.4.0...v3.5.0) diff --git a/pyproject.toml b/pyproject.toml index b9dbc5ea..0eb040eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gradient" -version = "3.5.0" +version = "3.6.0" description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gradient/_client.py b/src/gradient/_client.py index 77cc446e..58bc42d9 100644 --- a/src/gradient/_client.py +++ b/src/gradient/_client.py @@ -291,6 +291,16 @@ def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None: if isinstance(custom_headers.get("Authorization"), Omit): return + if self.model_access_key and headers.get("Authorization"): + return + if isinstance(custom_headers.get("Authorization"), Omit): + return + + if self.agent_access_key and headers.get("Authorization"): + return + if isinstance(custom_headers.get("Authorization"), Omit): + return + raise TypeError( '"Could not resolve authentication method. Expected access_token, agent_access_key, or model_access_key to be set. Or for the `Authorization` headers to be explicitly omitted"' ) @@ -614,6 +624,16 @@ def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None: if isinstance(custom_headers.get("Authorization"), Omit): return + if self.model_access_key and headers.get("Authorization"): + return + if isinstance(custom_headers.get("Authorization"), Omit): + return + + if self.agent_access_key and headers.get("Authorization"): + return + if isinstance(custom_headers.get("Authorization"), Omit): + return + raise TypeError( '"Could not resolve authentication method. Expected access_token, agent_access_key, or model_access_key to be set. Or for the `Authorization` headers to be explicitly omitted"' ) diff --git a/src/gradient/_version.py b/src/gradient/_version.py index 68c981bc..0190d688 100644 --- a/src/gradient/_version.py +++ b/src/gradient/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gradient" -__version__ = "3.5.0" # x-release-please-version +__version__ = "3.6.0" # x-release-please-version diff --git a/tests/conftest.py b/tests/conftest.py index bc2aa92e..3915c92b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -14,7 +14,9 @@ from gradient._utils import is_dict if TYPE_CHECKING: - from _pytest.fixtures import FixtureRequest # pyright: ignore[reportPrivateImportUsage] + from _pytest.fixtures import ( + FixtureRequest, # pyright: ignore[reportPrivateImportUsage] + ) pytest.register_assert_rewrite("tests.utils") From 7a0515a2e998e21fa08119b2acab9779c895e6e0 Mon Sep 17 00:00:00 2001 From: Ashish Dabral Date: Tue, 21 Oct 2025 02:00:14 +0530 Subject: [PATCH 30/96] Migrate pytest.ini configuration to pyproject.toml Fixes #51 (#52) --- pyproject.toml | 5 ++++- pytest.ini | 5 ----- 2 files changed, 4 insertions(+), 6 deletions(-) delete mode 100644 pytest.ini diff --git a/pyproject.toml b/pyproject.toml index 0eb040eb..54be5413 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -117,11 +117,14 @@ replacement = '[\1](https://github.com/digitalocean/gradient-python/tree/main/\g [tool.pytest.ini_options] testpaths = ["tests"] -addopts = "--tb=short -n auto" +addopts = "--tb=short -n auto -m 'not smoke'" xfail_strict = true asyncio_mode = "auto" asyncio_default_fixture_loop_scope = "session" filterwarnings = ["error"] +markers = [ + "smoke: lightweight external integration smoke tests hitting live Gradient services", +] [tool.pyright] # this enables practically every flag given by pyright. diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 55e560ae..00000000 --- a/pytest.ini +++ /dev/null @@ -1,5 +0,0 @@ -[pytest] -markers = - smoke: lightweight external integration smoke tests hitting live Gradient services -addopts = -m "not smoke" -asyncio_mode = auto From dcef3d5ebb4ef903c0c91aa4008853bb978f5544 Mon Sep 17 00:00:00 2001 From: AKSHAT ANAND Date: Tue, 21 Oct 2025 03:19:09 +0530 Subject: [PATCH 31/96] feat: Add wait_until_ready() method for agent deployment polling (#56) Resolves #40 - Add wait_until_ready() method to AgentsResource and AsyncAgentsResource - Add AgentDeploymentError and AgentDeploymentTimeoutError exceptions - Add comprehensive test coverage for sync and async variants - Add example usage documentation Users can now call client.agents.wait_until_ready(agent_id) instead of writing custom polling loops to wait for agent deployment completion. The method polls the agent status every 5 seconds (configurable) until: - SUCCESS: Agent reaches STATUS_RUNNING (returns AgentRetrieveResponse) - FAILURE: Agent reaches STATUS_FAILED/STATUS_UNDEPLOYMENT_FAILED/STATUS_DELETED (raises AgentDeploymentError) - TIMEOUT: Agent doesn't reach STATUS_RUNNING within timeout period (raises AgentDeploymentTimeoutError) Default timeout is 300 seconds (5 minutes) and poll_interval is 5 seconds. Both sync and async implementations are provided. -------------------- Co-authored-by: Ben Batha --- examples/agent_wait_until_ready.py | 100 +++++++++++++ src/gradient/_exceptions.py | 18 +++ src/gradient/resources/agents/agents.py | 189 ++++++++++++++++++++++- tests/api_resources/test_agents.py | 191 ++++++++++++++++++++++++ 4 files changed, 497 insertions(+), 1 deletion(-) create mode 100644 examples/agent_wait_until_ready.py diff --git a/examples/agent_wait_until_ready.py b/examples/agent_wait_until_ready.py new file mode 100644 index 00000000..3ea7b4a3 --- /dev/null +++ b/examples/agent_wait_until_ready.py @@ -0,0 +1,100 @@ +""" +Example: Wait for Agent Deployment to Complete + +This example demonstrates how to use the wait_until_ready() method to wait for +an agent to finish deploying before using it. +""" + +from gradient import Gradient +from gradient._exceptions import AgentDeploymentError, AgentDeploymentTimeoutError + +# Initialize the Gradient client +client = Gradient() + +# Create a new agent +agent_response = client.agents.create( + name="My Agent", + instruction="You are a helpful assistant", + model_uuid="", + region="nyc1", +) + +agent_id = agent_response.agent.uuid if agent_response.agent else None + +if agent_id: + print(f"Agent created with ID: {agent_id}") + print("Waiting for agent to be ready...") + + try: + # Wait for the agent to be deployed and ready + # This will poll the agent status every 5 seconds (default) + # and wait up to 5 minutes (default timeout=300 seconds) + ready_agent = client.agents.wait_until_ready( + agent_id, + poll_interval=5.0, # Check every 5 seconds + timeout=300.0, # Wait up to 5 minutes + ) + + if ready_agent.agent and ready_agent.agent.deployment: + print(f"Agent is ready! Status: {ready_agent.agent.deployment.status}") + print(f"Agent URL: {ready_agent.agent.url}") + + # Now you can use the agent + # ... + + except AgentDeploymentError as e: + print(f"Agent deployment failed: {e}") + print(f"Failed status: {e.status}") + + except AgentDeploymentTimeoutError as e: + print(f"Agent deployment timed out: {e}") + print(f"Agent ID: {e.agent_id}") + + except Exception as e: + print(f"Unexpected error: {e}") + + +# Async example +from gradient import AsyncGradient + + +async def main() -> None: + async_client = AsyncGradient() + + # Create a new agent + agent_response = await async_client.agents.create( + name="My Async Agent", + instruction="You are a helpful assistant", + model_uuid="", + region="nyc1", + ) + + agent_id = agent_response.agent.uuid if agent_response.agent else None + + if agent_id: + print(f"Agent created with ID: {agent_id}") + print("Waiting for agent to be ready...") + + try: + # Wait for the agent to be deployed and ready (async) + ready_agent = await async_client.agents.wait_until_ready( + agent_id, + poll_interval=5.0, + timeout=300.0, + ) + + if ready_agent.agent and ready_agent.agent.deployment: + print(f"Agent is ready! Status: {ready_agent.agent.deployment.status}") + print(f"Agent URL: {ready_agent.agent.url}") + + except AgentDeploymentError as e: + print(f"Agent deployment failed: {e}") + print(f"Failed status: {e.status}") + + except AgentDeploymentTimeoutError as e: + print(f"Agent deployment timed out: {e}") + print(f"Agent ID: {e.agent_id}") + + +# Uncomment to run async example +# asyncio.run(main()) diff --git a/src/gradient/_exceptions.py b/src/gradient/_exceptions.py index 5db08573..0ced4aba 100644 --- a/src/gradient/_exceptions.py +++ b/src/gradient/_exceptions.py @@ -15,6 +15,8 @@ "UnprocessableEntityError", "RateLimitError", "InternalServerError", + "AgentDeploymentError", + "AgentDeploymentTimeoutError", ] @@ -106,3 +108,19 @@ class RateLimitError(APIStatusError): class InternalServerError(APIStatusError): pass + + +class AgentDeploymentError(GradientError): + """Raised when an agent deployment fails.""" + + def __init__(self, message: str, status: str) -> None: + super().__init__(message) + self.status = status + + +class AgentDeploymentTimeoutError(GradientError): + """Raised when waiting for an agent deployment times out.""" + + def __init__(self, message: str, agent_id: str) -> None: + super().__init__(message) + self.agent_id = agent_id diff --git a/src/gradient/resources/agents/agents.py b/src/gradient/resources/agents/agents.py index a4d32fca..686678ba 100644 --- a/src/gradient/resources/agents/agents.py +++ b/src/gradient/resources/agents/agents.py @@ -1,7 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from __future__ import annotations +import time + import httpx from .routes import ( @@ -612,6 +613,92 @@ def update_status( cast_to=AgentUpdateStatusResponse, ) + def wait_until_ready( + self, + uuid: str, + *, + timeout: float = 300.0, + poll_interval: float = 5.0, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + ) -> AgentRetrieveResponse: + """Wait for an agent to be ready (deployment status is STATUS_RUNNING). + + This method polls the agent status until it reaches STATUS_RUNNING or a terminal + error state. It handles timeout and deployment failures automatically. + + Args: + uuid: The unique identifier of the agent to wait for + + timeout: Maximum time to wait in seconds (default: 300 seconds / 5 minutes) + + poll_interval: Time to wait between status checks in seconds (default: 5 seconds) + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + Returns: + AgentRetrieveResponse: The agent response when it reaches STATUS_RUNNING + + Raises: + AgentDeploymentError: If the agent deployment fails (STATUS_FAILED, + STATUS_UNDEPLOYMENT_FAILED, or STATUS_DELETED) + AgentDeploymentTimeoutError: If the agent doesn't reach STATUS_RUNNING + within the timeout period + ValueError: If uuid is empty + """ + from ..._exceptions import AgentDeploymentError, AgentDeploymentTimeoutError + + if not uuid: + raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") + + start_time = time.time() + + while True: + agent_response = self.retrieve( + uuid, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + ) + + # Check if agent and deployment exist + if agent_response.agent and agent_response.agent.deployment: + status = agent_response.agent.deployment.status + + # Success case + if status == "STATUS_RUNNING": + return agent_response + + # Failure cases + if status in ("STATUS_FAILED", "STATUS_UNDEPLOYMENT_FAILED", "STATUS_DELETED"): + raise AgentDeploymentError( + f"Agent deployment failed with status: {status}", + status=status, + ) + + # Check timeout + elapsed_time = time.time() - start_time + if elapsed_time >= timeout: + current_status = ( + agent_response.agent.deployment.status + if agent_response.agent and agent_response.agent.deployment + else "UNKNOWN" + ) + raise AgentDeploymentTimeoutError( + f"Agent did not reach STATUS_RUNNING within {timeout} seconds. Current status: {current_status}", + agent_id=uuid, + ) + + # Wait before polling again + time.sleep(poll_interval) + class AsyncAgentsResource(AsyncAPIResource): @cached_property @@ -1108,6 +1195,94 @@ async def update_status( cast_to=AgentUpdateStatusResponse, ) + async def wait_until_ready( + self, + uuid: str, + *, + timeout: float = 300.0, + poll_interval: float = 5.0, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + ) -> AgentRetrieveResponse: + """Wait for an agent to be ready (deployment status is STATUS_RUNNING). + + This method polls the agent status until it reaches STATUS_RUNNING or a terminal + error state. It handles timeout and deployment failures automatically. + + Args: + uuid: The unique identifier of the agent to wait for + + timeout: Maximum time to wait in seconds (default: 300 seconds / 5 minutes) + + poll_interval: Time to wait between status checks in seconds (default: 5 seconds) + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + Returns: + AgentRetrieveResponse: The agent response when it reaches STATUS_RUNNING + + Raises: + AgentDeploymentError: If the agent deployment fails (STATUS_FAILED, + STATUS_UNDEPLOYMENT_FAILED, or STATUS_DELETED) + AgentDeploymentTimeoutError: If the agent doesn't reach STATUS_RUNNING + within the timeout period + ValueError: If uuid is empty + """ + import asyncio + + from ..._exceptions import AgentDeploymentError, AgentDeploymentTimeoutError + + if not uuid: + raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") + + start_time = time.time() + + while True: + agent_response = await self.retrieve( + uuid, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + ) + + # Check if agent and deployment exist + if agent_response.agent and agent_response.agent.deployment: + status = agent_response.agent.deployment.status + + # Success case + if status == "STATUS_RUNNING": + return agent_response + + # Failure cases + if status in ("STATUS_FAILED", "STATUS_UNDEPLOYMENT_FAILED", "STATUS_DELETED"): + raise AgentDeploymentError( + f"Agent deployment failed with status: {status}", + status=status, + ) + + # Check timeout + elapsed_time = time.time() - start_time + if elapsed_time >= timeout: + current_status = ( + agent_response.agent.deployment.status + if agent_response.agent and agent_response.agent.deployment + else "UNKNOWN" + ) + raise AgentDeploymentTimeoutError( + f"Agent did not reach STATUS_RUNNING within {timeout} seconds. Current status: {current_status}", + agent_id=uuid, + ) + + # Wait before polling again + await asyncio.sleep(poll_interval) + class AgentsResourceWithRawResponse: def __init__(self, agents: AgentsResource) -> None: @@ -1134,6 +1309,9 @@ def __init__(self, agents: AgentsResource) -> None: self.update_status = to_raw_response_wrapper( agents.update_status, ) + self.wait_until_ready = to_raw_response_wrapper( + agents.wait_until_ready, + ) @cached_property def api_keys(self) -> APIKeysResourceWithRawResponse: @@ -1201,6 +1379,9 @@ def __init__(self, agents: AsyncAgentsResource) -> None: self.update_status = async_to_raw_response_wrapper( agents.update_status, ) + self.wait_until_ready = async_to_raw_response_wrapper( + agents.wait_until_ready, + ) @cached_property def api_keys(self) -> AsyncAPIKeysResourceWithRawResponse: @@ -1268,6 +1449,9 @@ def __init__(self, agents: AgentsResource) -> None: self.update_status = to_streamed_response_wrapper( agents.update_status, ) + self.wait_until_ready = to_streamed_response_wrapper( + agents.wait_until_ready, + ) @cached_property def api_keys(self) -> APIKeysResourceWithStreamingResponse: @@ -1335,6 +1519,9 @@ def __init__(self, agents: AsyncAgentsResource) -> None: self.update_status = async_to_streamed_response_wrapper( agents.update_status, ) + self.wait_until_ready = async_to_streamed_response_wrapper( + agents.wait_until_ready, + ) @cached_property def api_keys(self) -> AsyncAPIKeysResourceWithStreamingResponse: diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index 2069d2d8..5777c3ea 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -5,6 +5,7 @@ import os from typing import Any, cast +import httpx import pytest from gradient import Gradient, AsyncGradient @@ -363,6 +364,104 @@ def test_path_params_update_status(self, client: Gradient) -> None: path_uuid="", ) + @parametrize + def test_method_wait_until_ready(self, client: Gradient, respx_mock: Any) -> None: + """Test successful wait_until_ready when agent becomes ready.""" + agent_uuid = "test-agent-id" + + # Create side effect that returns different responses + call_count = [0] + def get_response(_: httpx.Request) -> httpx.Response: + call_count[0] += 1 + if call_count[0] == 1: + # First call: deploying + return httpx.Response( + 200, + json={ + "agent": { + "uuid": agent_uuid, + "deployment": {"status": "STATUS_DEPLOYING"}, + } + }, + ) + else: + # Subsequent calls: running + return httpx.Response( + 200, + json={ + "agent": { + "uuid": agent_uuid, + "deployment": {"status": "STATUS_RUNNING"}, + } + }, + ) + + respx_mock.get(f"/v2/gen-ai/agents/{agent_uuid}").mock(side_effect=get_response) + + agent = client.agents.wait_until_ready(agent_uuid, poll_interval=0.1, timeout=10.0) + assert_matches_type(AgentRetrieveResponse, agent, path=["response"]) + assert agent.agent is not None + assert agent.agent.deployment is not None + assert agent.agent.deployment.status == "STATUS_RUNNING" + + @parametrize + def test_wait_until_ready_timeout(self, client: Gradient, respx_mock: Any) -> None: + """Test that wait_until_ready raises timeout error.""" + from gradient._exceptions import AgentDeploymentTimeoutError + + agent_uuid = "test-agent-id" + + # Mock always returns deploying + respx_mock.get(f"/v2/gen-ai/agents/{agent_uuid}").mock( + return_value=httpx.Response( + 200, + json={ + "agent": { + "uuid": agent_uuid, + "deployment": {"status": "STATUS_DEPLOYING"}, + } + }, + ) + ) + + with pytest.raises(AgentDeploymentTimeoutError) as exc_info: + client.agents.wait_until_ready(agent_uuid, poll_interval=0.1, timeout=0.5) + + assert "did not reach STATUS_RUNNING within" in str(exc_info.value) + assert exc_info.value.agent_id == agent_uuid + + @parametrize + def test_wait_until_ready_deployment_failed(self, client: Gradient, respx_mock: Any) -> None: + """Test that wait_until_ready raises error on deployment failure.""" + from gradient._exceptions import AgentDeploymentError + + agent_uuid = "test-agent-id" + + # Mock returns failed status + respx_mock.get(f"/v2/gen-ai/agents/{agent_uuid}").mock( + return_value=httpx.Response( + 200, + json={ + "agent": { + "uuid": agent_uuid, + "deployment": {"status": "STATUS_FAILED"}, + } + }, + ) + ) + + with pytest.raises(AgentDeploymentError) as exc_info: + client.agents.wait_until_ready(agent_uuid, poll_interval=0.1, timeout=10.0) + + assert "deployment failed with status: STATUS_FAILED" in str(exc_info.value) + assert exc_info.value.status == "STATUS_FAILED" + + @parametrize + def test_wait_until_ready_empty_uuid(self, client: Gradient) -> None: + """Test that wait_until_ready validates empty uuid.""" + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid`"): + client.agents.wait_until_ready("") + class TestAsyncAgents: parametrize = pytest.mark.parametrize( @@ -706,3 +805,95 @@ async def test_path_params_update_status(self, async_client: AsyncGradient) -> N await async_client.agents.with_raw_response.update_status( path_uuid="", ) + + @parametrize + async def test_method_wait_until_ready(self, async_client: AsyncGradient, respx_mock: Any) -> None: + """Test successful async wait_until_ready when agent becomes ready.""" + agent_uuid = "test-agent-id" + + # Create side effect that returns different responses + call_count = [0] + def get_response(_: httpx.Request) -> httpx.Response: + call_count[0] += 1 + if call_count[0] == 1: + # First call: deploying + return httpx.Response( + 200, + json={ + "agent": { + "uuid": agent_uuid, + "deployment": {"status": "STATUS_DEPLOYING"}, + } + }, + ) + else: + # Subsequent calls: running + return httpx.Response( + 200, + json={ + "agent": { + "uuid": agent_uuid, + "deployment": {"status": "STATUS_RUNNING"}, + } + }, + ) + + respx_mock.get(f"/v2/gen-ai/agents/{agent_uuid}").mock(side_effect=get_response) + + agent = await async_client.agents.wait_until_ready(agent_uuid, poll_interval=0.1, timeout=10.0) + assert_matches_type(AgentRetrieveResponse, agent, path=["response"]) + assert agent.agent is not None + assert agent.agent.deployment is not None + assert agent.agent.deployment.status == "STATUS_RUNNING" + + @parametrize + async def test_wait_until_ready_timeout(self, async_client: AsyncGradient, respx_mock: Any) -> None: + """Test that async wait_until_ready raises timeout error.""" + from gradient._exceptions import AgentDeploymentTimeoutError + + agent_uuid = "test-agent-id" + + # Mock always returns deploying + respx_mock.get(f"/v2/gen-ai/agents/{agent_uuid}").mock( + return_value=httpx.Response( + 200, + json={ + "agent": { + "uuid": agent_uuid, + "deployment": {"status": "STATUS_DEPLOYING"}, + } + }, + ) + ) + + with pytest.raises(AgentDeploymentTimeoutError) as exc_info: + await async_client.agents.wait_until_ready(agent_uuid, poll_interval=0.1, timeout=0.5) + + assert "did not reach STATUS_RUNNING within" in str(exc_info.value) + assert exc_info.value.agent_id == agent_uuid + + @parametrize + async def test_wait_until_ready_deployment_failed(self, async_client: AsyncGradient, respx_mock: Any) -> None: + """Test that async wait_until_ready raises error on deployment failure.""" + from gradient._exceptions import AgentDeploymentError + + agent_uuid = "test-agent-id" + + # Mock returns failed status + respx_mock.get(f"/v2/gen-ai/agents/{agent_uuid}").mock( + return_value=httpx.Response( + 200, + json={ + "agent": { + "uuid": agent_uuid, + "deployment": {"status": "STATUS_FAILED"}, + } + }, + ) + ) + + with pytest.raises(AgentDeploymentError) as exc_info: + await async_client.agents.wait_until_ready(agent_uuid, poll_interval=0.1, timeout=10.0) + + assert "deployment failed with status: STATUS_FAILED" in str(exc_info.value) + assert exc_info.value.status == "STATUS_FAILED" From 911c72f9fedac26de2c463704aee8cf87cbfa19a Mon Sep 17 00:00:00 2001 From: Navaneeth K Date: Thu, 23 Oct 2025 21:44:04 +0530 Subject: [PATCH 32/96] Add wait_for_database helper function to poll for Knowledge Base database creation (#48) --- examples/wait_for_knowledge_base.py | 64 ++++++ pyproject.toml | 1 - .../resources/knowledge_bases/__init__.py | 4 + .../knowledge_bases/knowledge_bases.py | 183 ++++++++++++++++- tests/api_resources/test_knowledge_bases.py | 192 ++++++++++++++++++ tests/test_client.py | 8 +- tests/test_files.py | 10 +- 7 files changed, 451 insertions(+), 11 deletions(-) create mode 100644 examples/wait_for_knowledge_base.py diff --git a/examples/wait_for_knowledge_base.py b/examples/wait_for_knowledge_base.py new file mode 100644 index 00000000..739ff80e --- /dev/null +++ b/examples/wait_for_knowledge_base.py @@ -0,0 +1,64 @@ +""" +Example demonstrating how to use the wait_for_database helper function. + +This example shows how to: +1. Create a knowledge base +2. Wait for its database to be ready +3. Handle errors and timeouts appropriately +""" + +import os + +from gradient import Gradient +from gradient.resources.knowledge_bases import KnowledgeBaseTimeoutError, KnowledgeBaseDatabaseError + + +def main() -> None: + """Create a knowledge base and wait for its database to be ready.""" + # Initialize the Gradient client + # Note: DIGITALOCEAN_ACCESS_TOKEN must be set in your environment + client = Gradient( + access_token=os.environ.get("DIGITALOCEAN_ACCESS_TOKEN"), + ) + + # Create a knowledge base + # Replace these values with your actual configuration + kb_response = client.knowledge_bases.create( + name="My Knowledge Base", + region="nyc1", # Choose your preferred region + embedding_model_uuid="your-embedding-model-uuid", # Use your embedding model UUID + ) + + if not kb_response.knowledge_base or not kb_response.knowledge_base.uuid: + print("Failed to create knowledge base") + return + + kb_uuid = kb_response.knowledge_base.uuid + print(f"Created knowledge base: {kb_uuid}") + + try: + # Wait for the database to be ready + # Default: 10 minute timeout, 5 second poll interval + print("Waiting for database to be ready...") + result = client.knowledge_bases.wait_for_database(kb_uuid) + print(f"Database status: {result.database_status}") # "ONLINE" + print("Knowledge base is ready!") + + # Alternative: Custom timeout and poll interval + # result = client.knowledge_bases.wait_for_database( + # kb_uuid, + # timeout=900.0, # 15 minutes + # poll_interval=10.0 # Check every 10 seconds + # ) + + except KnowledgeBaseDatabaseError as e: + # Database entered a failed state (DECOMMISSIONED or UNHEALTHY) + print(f"Database failed: {e}") + + except KnowledgeBaseTimeoutError as e: + # Database did not become ready within the timeout period + print(f"Timeout: {e}") + + +if __name__ == "__main__": + main() diff --git a/pyproject.toml b/pyproject.toml index 54be5413..0e83a25b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -253,5 +253,4 @@ known-first-party = ["gradient", "tests"] [tool.ruff.lint.per-file-ignores] "bin/**.py" = ["T201", "T203"] "scripts/**.py" = ["T201", "T203"] -"tests/**.py" = ["T201", "T203"] "examples/**.py" = ["T201", "T203"] diff --git a/src/gradient/resources/knowledge_bases/__init__.py b/src/gradient/resources/knowledge_bases/__init__.py index 80d04328..353dc05c 100644 --- a/src/gradient/resources/knowledge_bases/__init__.py +++ b/src/gradient/resources/knowledge_bases/__init__.py @@ -18,6 +18,8 @@ ) from .knowledge_bases import ( KnowledgeBasesResource, + KnowledgeBaseTimeoutError, + KnowledgeBaseDatabaseError, AsyncKnowledgeBasesResource, KnowledgeBasesResourceWithRawResponse, AsyncKnowledgeBasesResourceWithRawResponse, @@ -40,6 +42,8 @@ "AsyncIndexingJobsResourceWithStreamingResponse", "KnowledgeBasesResource", "AsyncKnowledgeBasesResource", + "KnowledgeBaseDatabaseError", + "KnowledgeBaseTimeoutError", "KnowledgeBasesResourceWithRawResponse", "AsyncKnowledgeBasesResourceWithRawResponse", "KnowledgeBasesResourceWithStreamingResponse", diff --git a/src/gradient/resources/knowledge_bases/knowledge_bases.py b/src/gradient/resources/knowledge_bases/knowledge_bases.py index 00fa0659..4325148c 100644 --- a/src/gradient/resources/knowledge_bases/knowledge_bases.py +++ b/src/gradient/resources/knowledge_bases/knowledge_bases.py @@ -2,6 +2,8 @@ from __future__ import annotations +import time +import asyncio from typing import Iterable import httpx @@ -40,7 +42,24 @@ from ...types.knowledge_base_update_response import KnowledgeBaseUpdateResponse from ...types.knowledge_base_retrieve_response import KnowledgeBaseRetrieveResponse -__all__ = ["KnowledgeBasesResource", "AsyncKnowledgeBasesResource"] +__all__ = [ + "KnowledgeBasesResource", + "AsyncKnowledgeBasesResource", + "KnowledgeBaseDatabaseError", + "KnowledgeBaseTimeoutError", +] + + +class KnowledgeBaseDatabaseError(Exception): + """Raised when a knowledge base database enters a failed state.""" + + pass + + +class KnowledgeBaseTimeoutError(Exception): + """Raised when waiting for a knowledge base database times out.""" + + pass class KnowledgeBasesResource(SyncAPIResource): @@ -330,6 +349,81 @@ def delete( cast_to=KnowledgeBaseDeleteResponse, ) + def wait_for_database( + self, + uuid: str, + *, + timeout: float = 600.0, + poll_interval: float = 5.0, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + ) -> KnowledgeBaseRetrieveResponse: + """ + Poll the knowledge base until the database status is ONLINE or a failed state is reached. + + This helper function repeatedly calls retrieve() to check the database_status field. + It will wait for the database to become ONLINE, or raise an exception if it enters + a failed state (DECOMMISSIONED or UNHEALTHY) or if the timeout is exceeded. + + Args: + uuid: The knowledge base UUID to poll + + timeout: Maximum time to wait in seconds (default: 600 seconds / 10 minutes) + + poll_interval: Time to wait between polls in seconds (default: 5 seconds) + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + Returns: + The final KnowledgeBaseRetrieveResponse when the database status is ONLINE + + Raises: + KnowledgeBaseDatabaseError: If the database enters a failed state (DECOMMISSIONED, UNHEALTHY) + + KnowledgeBaseTimeoutError: If the timeout is exceeded before the database becomes ONLINE + """ + if not uuid: + raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") + + start_time = time.time() + failed_states = {"DECOMMISSIONED", "UNHEALTHY"} + + while True: + elapsed = time.time() - start_time + if elapsed >= timeout: + raise KnowledgeBaseTimeoutError( + f"Timeout waiting for knowledge base database to become ready. " + f"Database did not reach ONLINE status within {timeout} seconds." + ) + + response = self.retrieve( + uuid, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + ) + + status = response.database_status + + if status == "ONLINE": + return response + + if status in failed_states: + raise KnowledgeBaseDatabaseError(f"Knowledge base database entered failed state: {status}") + + # Sleep before next poll, but don't exceed timeout + remaining_time = timeout - elapsed + sleep_time = min(poll_interval, remaining_time) + if sleep_time > 0: + time.sleep(sleep_time) + class AsyncKnowledgeBasesResource(AsyncAPIResource): @cached_property @@ -618,6 +712,81 @@ async def delete( cast_to=KnowledgeBaseDeleteResponse, ) + async def wait_for_database( + self, + uuid: str, + *, + timeout: float = 600.0, + poll_interval: float = 5.0, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + ) -> KnowledgeBaseRetrieveResponse: + """ + Poll the knowledge base until the database status is ONLINE or a failed state is reached. + + This helper function repeatedly calls retrieve() to check the database_status field. + It will wait for the database to become ONLINE, or raise an exception if it enters + a failed state (DECOMMISSIONED or UNHEALTHY) or if the timeout is exceeded. + + Args: + uuid: The knowledge base UUID to poll + + timeout: Maximum time to wait in seconds (default: 600 seconds / 10 minutes) + + poll_interval: Time to wait between polls in seconds (default: 5 seconds) + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + Returns: + The final KnowledgeBaseRetrieveResponse when the database status is ONLINE + + Raises: + KnowledgeBaseDatabaseError: If the database enters a failed state (DECOMMISSIONED, UNHEALTHY) + + KnowledgeBaseTimeoutError: If the timeout is exceeded before the database becomes ONLINE + """ + if not uuid: + raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") + + start_time = time.time() + failed_states = {"DECOMMISSIONED", "UNHEALTHY"} + + while True: + elapsed = time.time() - start_time + if elapsed >= timeout: + raise KnowledgeBaseTimeoutError( + f"Timeout waiting for knowledge base database to become ready. " + f"Database did not reach ONLINE status within {timeout} seconds." + ) + + response = await self.retrieve( + uuid, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + ) + + status = response.database_status + + if status == "ONLINE": + return response + + if status in failed_states: + raise KnowledgeBaseDatabaseError(f"Knowledge base database entered failed state: {status}") + + # Sleep before next poll, but don't exceed timeout + remaining_time = timeout - elapsed + sleep_time = min(poll_interval, remaining_time) + if sleep_time > 0: + await asyncio.sleep(sleep_time) + class KnowledgeBasesResourceWithRawResponse: def __init__(self, knowledge_bases: KnowledgeBasesResource) -> None: @@ -638,6 +807,9 @@ def __init__(self, knowledge_bases: KnowledgeBasesResource) -> None: self.delete = to_raw_response_wrapper( knowledge_bases.delete, ) + self.wait_for_database = to_raw_response_wrapper( + knowledge_bases.wait_for_database, + ) @cached_property def data_sources(self) -> DataSourcesResourceWithRawResponse: @@ -667,6 +839,9 @@ def __init__(self, knowledge_bases: AsyncKnowledgeBasesResource) -> None: self.delete = async_to_raw_response_wrapper( knowledge_bases.delete, ) + self.wait_for_database = async_to_raw_response_wrapper( + knowledge_bases.wait_for_database, + ) @cached_property def data_sources(self) -> AsyncDataSourcesResourceWithRawResponse: @@ -696,6 +871,9 @@ def __init__(self, knowledge_bases: KnowledgeBasesResource) -> None: self.delete = to_streamed_response_wrapper( knowledge_bases.delete, ) + self.wait_for_database = to_streamed_response_wrapper( + knowledge_bases.wait_for_database, + ) @cached_property def data_sources(self) -> DataSourcesResourceWithStreamingResponse: @@ -725,6 +903,9 @@ def __init__(self, knowledge_bases: AsyncKnowledgeBasesResource) -> None: self.delete = async_to_streamed_response_wrapper( knowledge_bases.delete, ) + self.wait_for_database = async_to_streamed_response_wrapper( + knowledge_bases.wait_for_database, + ) @cached_property def data_sources(self) -> AsyncDataSourcesResourceWithStreamingResponse: diff --git a/tests/api_resources/test_knowledge_bases.py b/tests/api_resources/test_knowledge_bases.py index 62965775..a42277e4 100644 --- a/tests/api_resources/test_knowledge_bases.py +++ b/tests/api_resources/test_knowledge_bases.py @@ -275,6 +275,102 @@ def test_path_params_delete(self, client: Gradient) -> None: "", ) + @parametrize + def test_method_wait_for_database_success(self, client: Gradient) -> None: + """Test wait_for_database with successful database status transition.""" + from unittest.mock import Mock + + call_count = [0] + + def mock_retrieve(uuid: str, **kwargs: object) -> Mock: # noqa: ARG001 + call_count[0] += 1 + response = Mock() + # Simulate CREATING -> ONLINE transition + response.database_status = "CREATING" if call_count[0] == 1 else "ONLINE" + return response + + client.knowledge_bases.retrieve = mock_retrieve # type: ignore[method-assign] + + result = client.knowledge_bases.wait_for_database( + "test-uuid", + timeout=10.0, + poll_interval=0.1, + ) + + assert result.database_status == "ONLINE" + assert call_count[0] == 2 + + @parametrize + def test_method_wait_for_database_failed_state(self, client: Gradient) -> None: + """Test wait_for_database with failed database status.""" + from unittest.mock import Mock + + from gradient.resources.knowledge_bases import KnowledgeBaseDatabaseError + + def mock_retrieve(uuid: str, **kwargs: object) -> Mock: # noqa: ARG001 + response = Mock() + response.database_status = "UNHEALTHY" + return response + + client.knowledge_bases.retrieve = mock_retrieve # type: ignore[method-assign] + + with pytest.raises(KnowledgeBaseDatabaseError, match="UNHEALTHY"): + client.knowledge_bases.wait_for_database( + "test-uuid", + timeout=10.0, + poll_interval=0.1, + ) + + @parametrize + def test_method_wait_for_database_timeout(self, client: Gradient) -> None: + """Test wait_for_database with timeout.""" + from unittest.mock import Mock + + from gradient.resources.knowledge_bases import KnowledgeBaseTimeoutError + + def mock_retrieve(uuid: str, **kwargs: object) -> Mock: # noqa: ARG001 + response = Mock() + response.database_status = "CREATING" + return response + + client.knowledge_bases.retrieve = mock_retrieve # type: ignore[method-assign] + + with pytest.raises(KnowledgeBaseTimeoutError): + client.knowledge_bases.wait_for_database( + "test-uuid", + timeout=0.3, + poll_interval=0.1, + ) + + @parametrize + def test_method_wait_for_database_decommissioned(self, client: Gradient) -> None: + """Test wait_for_database with DECOMMISSIONED status.""" + from unittest.mock import Mock + + from gradient.resources.knowledge_bases import KnowledgeBaseDatabaseError + + def mock_retrieve(uuid: str, **kwargs: object) -> Mock: # noqa: ARG001 + response = Mock() + response.database_status = "DECOMMISSIONED" + return response + + client.knowledge_bases.retrieve = mock_retrieve # type: ignore[method-assign] + + with pytest.raises(KnowledgeBaseDatabaseError, match="DECOMMISSIONED"): + client.knowledge_bases.wait_for_database( + "test-uuid", + timeout=10.0, + poll_interval=0.1, + ) + + @parametrize + def test_path_params_wait_for_database(self, client: Gradient) -> None: + """Test wait_for_database validates uuid parameter.""" + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + client.knowledge_bases.wait_for_database( + "", + ) + class TestAsyncKnowledgeBases: parametrize = pytest.mark.parametrize( @@ -532,3 +628,99 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: await async_client.knowledge_bases.with_raw_response.delete( "", ) + + @parametrize + async def test_method_wait_for_database_success(self, async_client: AsyncGradient) -> None: + """Test async wait_for_database with successful database status transition.""" + from unittest.mock import Mock + + call_count = [0] + + async def mock_retrieve(uuid: str, **kwargs: object) -> Mock: # noqa: ARG001 + call_count[0] += 1 + response = Mock() + # Simulate CREATING -> ONLINE transition + response.database_status = "CREATING" if call_count[0] == 1 else "ONLINE" + return response + + async_client.knowledge_bases.retrieve = mock_retrieve # type: ignore[method-assign] + + result = await async_client.knowledge_bases.wait_for_database( + "test-uuid", + timeout=10.0, + poll_interval=0.1, + ) + + assert result.database_status == "ONLINE" + assert call_count[0] == 2 + + @parametrize + async def test_method_wait_for_database_failed_state(self, async_client: AsyncGradient) -> None: + """Test async wait_for_database with failed database status.""" + from unittest.mock import Mock + + from gradient.resources.knowledge_bases import KnowledgeBaseDatabaseError + + async def mock_retrieve(uuid: str, **kwargs: object) -> Mock: # noqa: ARG001 + response = Mock() + response.database_status = "UNHEALTHY" + return response + + async_client.knowledge_bases.retrieve = mock_retrieve # type: ignore[method-assign] + + with pytest.raises(KnowledgeBaseDatabaseError, match="UNHEALTHY"): + await async_client.knowledge_bases.wait_for_database( + "test-uuid", + timeout=10.0, + poll_interval=0.1, + ) + + @parametrize + async def test_method_wait_for_database_timeout(self, async_client: AsyncGradient) -> None: + """Test async wait_for_database with timeout.""" + from unittest.mock import Mock + + from gradient.resources.knowledge_bases import KnowledgeBaseTimeoutError + + async def mock_retrieve(uuid: str, **kwargs: object) -> Mock: # noqa: ARG001 + response = Mock() + response.database_status = "CREATING" + return response + + async_client.knowledge_bases.retrieve = mock_retrieve # type: ignore[method-assign] + + with pytest.raises(KnowledgeBaseTimeoutError): + await async_client.knowledge_bases.wait_for_database( + "test-uuid", + timeout=0.3, + poll_interval=0.1, + ) + + @parametrize + async def test_method_wait_for_database_decommissioned(self, async_client: AsyncGradient) -> None: + """Test async wait_for_database with DECOMMISSIONED status.""" + from unittest.mock import Mock + + from gradient.resources.knowledge_bases import KnowledgeBaseDatabaseError + + async def mock_retrieve(uuid: str, **kwargs: object) -> Mock: # noqa: ARG001 + response = Mock() + response.database_status = "DECOMMISSIONED" + return response + + async_client.knowledge_bases.retrieve = mock_retrieve # type: ignore[method-assign] + + with pytest.raises(KnowledgeBaseDatabaseError, match="DECOMMISSIONED"): + await async_client.knowledge_bases.wait_for_database( + "test-uuid", + timeout=10.0, + poll_interval=0.1, + ) + + @parametrize + async def test_path_params_wait_for_database(self, async_client: AsyncGradient) -> None: + """Test async wait_for_database validates uuid parameter.""" + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + await async_client.knowledge_bases.wait_for_database( + "", + ) diff --git a/tests/test_client.py b/tests/test_client.py index ddf1c4db..846c0bb6 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -287,9 +287,9 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic add_leak(leaks, diff) if leaks: for leak in leaks: - print("MEMORY LEAK:", leak) + print("MEMORY LEAK:", leak) # noqa: T201 for frame in leak.traceback: - print(frame) + print(frame) # noqa: T201 raise AssertionError() def test_request_timeout(self) -> None: @@ -1304,9 +1304,9 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic add_leak(leaks, diff) if leaks: for leak in leaks: - print("MEMORY LEAK:", leak) + print("MEMORY LEAK:", leak) # noqa: T201 for frame in leak.traceback: - print(frame) + print(frame) # noqa: T201 raise AssertionError() async def test_request_timeout(self) -> None: diff --git a/tests/test_files.py b/tests/test_files.py index 4d9f4066..54210e83 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -11,34 +11,34 @@ def test_pathlib_includes_file_name() -> None: result = to_httpx_files({"file": readme_path}) - print(result) + print(result) # noqa: T201 assert result == IsDict({"file": IsTuple("README.md", IsBytes())}) def test_tuple_input() -> None: result = to_httpx_files([("file", readme_path)]) - print(result) + print(result) # noqa: T201 assert result == IsList(IsTuple("file", IsTuple("README.md", IsBytes()))) @pytest.mark.asyncio async def test_async_pathlib_includes_file_name() -> None: result = await async_to_httpx_files({"file": readme_path}) - print(result) + print(result) # noqa: T201 assert result == IsDict({"file": IsTuple("README.md", IsBytes())}) @pytest.mark.asyncio async def test_async_supports_anyio_path() -> None: result = await async_to_httpx_files({"file": anyio.Path(readme_path)}) - print(result) + print(result) # noqa: T201 assert result == IsDict({"file": IsTuple("README.md", IsBytes())}) @pytest.mark.asyncio async def test_async_tuple_input() -> None: result = await async_to_httpx_files([("file", readme_path)]) - print(result) + print(result) # noqa: T201 assert result == IsList(IsTuple("file", IsTuple("README.md", IsBytes()))) From 9edc2a60f5aa49749e151477615bbecb3a79e92b Mon Sep 17 00:00:00 2001 From: AREEB PASHA <64038736+areeb1501@users.noreply.github.com> Date: Mon, 27 Oct 2025 20:03:21 +0400 Subject: [PATCH 33/96] =?UTF-8?q?feat:=20add=20wait=5Ffor=5Fcompletion=20m?= =?UTF-8?q?ethod=20to=20IndexingJobs=20resource=20with=20sy=E2=80=A6=20(#4?= =?UTF-8?q?9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/agent_wait_until_ready.py | 28 +- examples/knowledge_base_indexing_wait.py | 197 ++++++++++++++ src/gradient/__init__.py | 8 + src/gradient/_exceptions.py | 28 ++ .../knowledge_bases/indexing_jobs.py | 224 ++++++++++++++++ .../knowledge_bases/test_indexing_jobs.py | 247 +++++++++++++++++- tests/api_resources/test_agents.py | 46 ++-- 7 files changed, 741 insertions(+), 37 deletions(-) create mode 100644 examples/knowledge_base_indexing_wait.py diff --git a/examples/agent_wait_until_ready.py b/examples/agent_wait_until_ready.py index 3ea7b4a3..df8c8cc6 100644 --- a/examples/agent_wait_until_ready.py +++ b/examples/agent_wait_until_ready.py @@ -24,7 +24,7 @@ if agent_id: print(f"Agent created with ID: {agent_id}") print("Waiting for agent to be ready...") - + try: # Wait for the agent to be deployed and ready # This will poll the agent status every 5 seconds (default) @@ -32,24 +32,24 @@ ready_agent = client.agents.wait_until_ready( agent_id, poll_interval=5.0, # Check every 5 seconds - timeout=300.0, # Wait up to 5 minutes + timeout=300.0, # Wait up to 5 minutes ) - + if ready_agent.agent and ready_agent.agent.deployment: print(f"Agent is ready! Status: {ready_agent.agent.deployment.status}") print(f"Agent URL: {ready_agent.agent.url}") - + # Now you can use the agent # ... - + except AgentDeploymentError as e: print(f"Agent deployment failed: {e}") print(f"Failed status: {e.status}") - + except AgentDeploymentTimeoutError as e: print(f"Agent deployment timed out: {e}") print(f"Agent ID: {e.agent_id}") - + except Exception as e: print(f"Unexpected error: {e}") @@ -60,7 +60,7 @@ async def main() -> None: async_client = AsyncGradient() - + # Create a new agent agent_response = await async_client.agents.create( name="My Async Agent", @@ -68,13 +68,13 @@ async def main() -> None: model_uuid="", region="nyc1", ) - + agent_id = agent_response.agent.uuid if agent_response.agent else None - + if agent_id: print(f"Agent created with ID: {agent_id}") print("Waiting for agent to be ready...") - + try: # Wait for the agent to be deployed and ready (async) ready_agent = await async_client.agents.wait_until_ready( @@ -82,15 +82,15 @@ async def main() -> None: poll_interval=5.0, timeout=300.0, ) - + if ready_agent.agent and ready_agent.agent.deployment: print(f"Agent is ready! Status: {ready_agent.agent.deployment.status}") print(f"Agent URL: {ready_agent.agent.url}") - + except AgentDeploymentError as e: print(f"Agent deployment failed: {e}") print(f"Failed status: {e.status}") - + except AgentDeploymentTimeoutError as e: print(f"Agent deployment timed out: {e}") print(f"Agent ID: {e.agent_id}") diff --git a/examples/knowledge_base_indexing_wait.py b/examples/knowledge_base_indexing_wait.py new file mode 100644 index 00000000..1171fea3 --- /dev/null +++ b/examples/knowledge_base_indexing_wait.py @@ -0,0 +1,197 @@ +#!/usr/bin/env python3 +""" +Example: Waiting for Knowledge Base Indexing Job Completion + +This example demonstrates how to use the wait_for_completion() method +to automatically wait for a knowledge base indexing job to finish, +without needing to write manual polling loops. +""" + +import os + +from gradient import Gradient, IndexingJobError, IndexingJobTimeoutError + + +def main() -> None: + # Initialize the Gradient client + client = Gradient() + + # Example 1: Basic usage - wait for indexing job to complete + print("Example 1: Basic usage") + print("-" * 50) + + # Create an indexing job (replace with your actual knowledge base UUID) + knowledge_base_uuid = os.getenv("KNOWLEDGE_BASE_UUID", "your-kb-uuid-here") + + print(f"Creating indexing job for knowledge base: {knowledge_base_uuid}") + indexing_job = client.knowledge_bases.indexing_jobs.create( + knowledge_base_uuid=knowledge_base_uuid, + ) + + job_uuid = indexing_job.job.uuid if indexing_job.job else None + if not job_uuid: + print("Error: Could not create indexing job") + return + + print(f"Indexing job created with UUID: {job_uuid}") + print("Waiting for indexing job to complete...") + + try: + # Wait for the job to complete (polls every 5 seconds by default) + completed_job = client.knowledge_bases.indexing_jobs.wait_for_completion(job_uuid) + + print("\n✅ Indexing job completed successfully!") + if completed_job.job: + print(f"Phase: {completed_job.job.phase}") + print(f"Total items indexed: {completed_job.job.total_items_indexed}") + print(f"Total items failed: {completed_job.job.total_items_failed}") + print(f"Total datasources: {completed_job.job.total_datasources}") + print(f"Completed datasources: {completed_job.job.completed_datasources}") + + except IndexingJobTimeoutError as e: + print(f"\n⏱️ Timeout: {e}") + except IndexingJobError as e: + print(f"\n❌ Error: {e}") + except Exception as e: + print(f"\n❌ Unexpected error: {e}") + + +def example_with_custom_polling() -> None: + """Example with custom polling interval and timeout""" + print("\n\nExample 2: Custom polling interval and timeout") + print("-" * 50) + + client = Gradient() + knowledge_base_uuid = os.getenv("KNOWLEDGE_BASE_UUID", "your-kb-uuid-here") + + print(f"Creating indexing job for knowledge base: {knowledge_base_uuid}") + indexing_job = client.knowledge_bases.indexing_jobs.create( + knowledge_base_uuid=knowledge_base_uuid, + ) + + job_uuid = indexing_job.job.uuid if indexing_job.job else None + if not job_uuid: + print("Error: Could not create indexing job") + return + + print(f"Indexing job created with UUID: {job_uuid}") + print("Waiting for indexing job to complete (polling every 10 seconds, 5 minute timeout)...") + + try: + # Wait with custom poll interval (10 seconds) and timeout (5 minutes = 300 seconds) + completed_job = client.knowledge_bases.indexing_jobs.wait_for_completion( + job_uuid, + poll_interval=10, # Poll every 10 seconds + timeout=300, # Timeout after 5 minutes + ) + + print("\n✅ Indexing job completed successfully!") + if completed_job.job: + print(f"Phase: {completed_job.job.phase}") + + except IndexingJobTimeoutError: + print("\n⏱️ Job did not complete within 5 minutes") + # You can still check the current status + current_status = client.knowledge_bases.indexing_jobs.retrieve(job_uuid) + if current_status.job: + print(f"Current phase: {current_status.job.phase}") + print( + f"Completed datasources: {current_status.job.completed_datasources}/{current_status.job.total_datasources}" + ) + except IndexingJobError as e: + print(f"\n❌ Job failed: {e}") + + +def example_manual_polling() -> None: + """Example of the old manual polling approach (for comparison)""" + print("\n\nExample 3: Manual polling (old approach)") + print("-" * 50) + + client = Gradient() + knowledge_base_uuid = os.getenv("KNOWLEDGE_BASE_UUID", "your-kb-uuid-here") + + indexing_job = client.knowledge_bases.indexing_jobs.create( + knowledge_base_uuid=knowledge_base_uuid, + ) + + job_uuid = indexing_job.job.uuid if indexing_job.job else None + if not job_uuid: + print("Error: Could not create indexing job") + return + + print(f"Indexing job created with UUID: {job_uuid}") + print("Manual polling (old approach)...") + + import time + + while True: + indexing_job_status = client.knowledge_bases.indexing_jobs.retrieve(job_uuid) + + if indexing_job_status.job and indexing_job_status.job.phase: + phase = indexing_job_status.job.phase + print(f"Current phase: {phase}") + + if phase in ["BATCH_JOB_PHASE_UNKNOWN", "BATCH_JOB_PHASE_PENDING", "BATCH_JOB_PHASE_RUNNING"]: + time.sleep(5) + continue + elif phase == "BATCH_JOB_PHASE_SUCCEEDED": + print("✅ Job completed successfully!") + break + else: + print(f"❌ Job ended with phase: {phase}") + break + + +async def example_async() -> None: + """Example using async/await""" + print("\n\nExample 4: Async usage") + print("-" * 50) + + from gradient import AsyncGradient + + client = AsyncGradient() + knowledge_base_uuid = os.getenv("KNOWLEDGE_BASE_UUID", "your-kb-uuid-here") + + print(f"Creating indexing job for knowledge base: {knowledge_base_uuid}") + indexing_job = await client.knowledge_bases.indexing_jobs.create( + knowledge_base_uuid=knowledge_base_uuid, + ) + + job_uuid = indexing_job.job.uuid if indexing_job.job else None + if not job_uuid: + print("Error: Could not create indexing job") + return + + print(f"Indexing job created with UUID: {job_uuid}") + print("Waiting for indexing job to complete (async)...") + + try: + completed_job = await client.knowledge_bases.indexing_jobs.wait_for_completion( + job_uuid, + poll_interval=5, + timeout=600, # 10 minute timeout + ) + + print("\n✅ Indexing job completed successfully!") + if completed_job.job: + print(f"Phase: {completed_job.job.phase}") + + except IndexingJobTimeoutError as e: + print(f"\n⏱️ Timeout: {e}") + except IndexingJobError as e: + print(f"\n❌ Error: {e}") + finally: + await client.close() + + +if __name__ == "__main__": + # Run the basic example + main() + + # Uncomment to run other examples: + # example_with_custom_polling() + # example_manual_polling() + + # For async example, you would need to run: + # import asyncio + # asyncio.run(example_async()) diff --git a/src/gradient/__init__.py b/src/gradient/__init__.py index a67cd2a7..864f1484 100644 --- a/src/gradient/__init__.py +++ b/src/gradient/__init__.py @@ -29,12 +29,16 @@ RateLimitError, APITimeoutError, BadRequestError, + IndexingJobError, APIConnectionError, AuthenticationError, InternalServerError, + AgentDeploymentError, PermissionDeniedError, + IndexingJobTimeoutError, UnprocessableEntityError, APIResponseValidationError, + AgentDeploymentTimeoutError, ) from ._base_client import DefaultHttpxClient, DefaultAioHttpClient, DefaultAsyncHttpxClient from ._utils._logs import setup_logging as _setup_logging @@ -65,6 +69,10 @@ "UnprocessableEntityError", "RateLimitError", "InternalServerError", + "IndexingJobError", + "IndexingJobTimeoutError", + "AgentDeploymentError", + "AgentDeploymentTimeoutError", "Timeout", "RequestOptions", "Client", diff --git a/src/gradient/_exceptions.py b/src/gradient/_exceptions.py index 0ced4aba..f0c6671d 100644 --- a/src/gradient/_exceptions.py +++ b/src/gradient/_exceptions.py @@ -15,6 +15,8 @@ "UnprocessableEntityError", "RateLimitError", "InternalServerError", + "IndexingJobError", + "IndexingJobTimeoutError", "AgentDeploymentError", "AgentDeploymentTimeoutError", ] @@ -110,6 +112,32 @@ class InternalServerError(APIStatusError): pass +class IndexingJobError(GradientError): + """Raised when an indexing job fails, encounters an error, or is cancelled.""" + + uuid: str + phase: str + + def __init__(self, message: str, *, uuid: str, phase: str) -> None: + super().__init__(message) + self.uuid = uuid + self.phase = phase + + +class IndexingJobTimeoutError(GradientError): + """Raised when polling for an indexing job times out.""" + + uuid: str + phase: str + timeout: float + + def __init__(self, message: str, *, uuid: str, phase: str, timeout: float) -> None: + super().__init__(message) + self.uuid = uuid + self.phase = phase + self.timeout = timeout + + class AgentDeploymentError(GradientError): """Raised when an agent deployment fails.""" diff --git a/src/gradient/resources/knowledge_bases/indexing_jobs.py b/src/gradient/resources/knowledge_bases/indexing_jobs.py index 95898c2a..647ab308 100644 --- a/src/gradient/resources/knowledge_bases/indexing_jobs.py +++ b/src/gradient/resources/knowledge_bases/indexing_jobs.py @@ -2,6 +2,9 @@ from __future__ import annotations +import time +import asyncio + import httpx from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given @@ -14,6 +17,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) +from ..._exceptions import IndexingJobError, IndexingJobTimeoutError from ..._base_client import make_request_options from ...types.knowledge_bases import ( indexing_job_list_params, @@ -259,6 +263,110 @@ def update_cancel( cast_to=IndexingJobUpdateCancelResponse, ) + def wait_for_completion( + self, + uuid: str, + *, + poll_interval: float = 5, + timeout: float | None = None, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + request_timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> IndexingJobRetrieveResponse: + """ + Wait for an indexing job to complete by polling its status. + + This method polls the indexing job status at regular intervals until it reaches + a terminal state (succeeded, failed, error, or cancelled). It raises an exception + if the job fails or times out. + + Args: + uuid: The UUID of the indexing job to wait for. + + poll_interval: Time in seconds between status checks (default: 5 seconds). + + timeout: Maximum time in seconds to wait for completion. If None, waits indefinitely. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + request_timeout: Override the client-level default timeout for this request, in seconds + + Returns: + The final IndexingJobRetrieveResponse when the job completes successfully. + + Raises: + IndexingJobTimeoutError: If the job doesn't complete within the specified timeout. + IndexingJobError: If the job fails, errors, or is cancelled. + """ + if not uuid: + raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") + + start_time = time.time() + + while True: + response = self.retrieve( + uuid, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=request_timeout, + ) + + # Check if job is in a terminal state + if response.job and response.job.phase: + phase = response.job.phase + + # Success state + if phase == "BATCH_JOB_PHASE_SUCCEEDED": + return response + + # Failure states + if phase == "BATCH_JOB_PHASE_FAILED": + raise IndexingJobError( + f"Indexing job {uuid} failed. " + f"Total items indexed: {response.job.total_items_indexed}, " + f"Total items failed: {response.job.total_items_failed}", + uuid=uuid, + phase=phase, + ) + + if phase == "BATCH_JOB_PHASE_ERROR": + raise IndexingJobError( + f"Indexing job {uuid} encountered an error", + uuid=uuid, + phase=phase, + ) + + if phase == "BATCH_JOB_PHASE_CANCELLED": + raise IndexingJobError( + f"Indexing job {uuid} was cancelled", + uuid=uuid, + phase=phase, + ) + + # Still in progress (UNKNOWN, PENDING, or RUNNING) + # Check timeout + if timeout is not None: + elapsed = time.time() - start_time + if elapsed >= timeout: + raise IndexingJobTimeoutError( + f"Indexing job {uuid} did not complete within {timeout} seconds. " + f"Current phase: {phase}", + uuid=uuid, + phase=phase, + timeout=timeout, + ) + + # Wait before next poll + time.sleep(poll_interval) + class AsyncIndexingJobsResource(AsyncAPIResource): @cached_property @@ -490,6 +598,110 @@ async def update_cancel( cast_to=IndexingJobUpdateCancelResponse, ) + async def wait_for_completion( + self, + uuid: str, + *, + poll_interval: float = 5, + timeout: float | None = None, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + request_timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> IndexingJobRetrieveResponse: + """ + Wait for an indexing job to complete by polling its status. + + This method polls the indexing job status at regular intervals until it reaches + a terminal state (succeeded, failed, error, or cancelled). It raises an exception + if the job fails or times out. + + Args: + uuid: The UUID of the indexing job to wait for. + + poll_interval: Time in seconds between status checks (default: 5 seconds). + + timeout: Maximum time in seconds to wait for completion. If None, waits indefinitely. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + request_timeout: Override the client-level default timeout for this request, in seconds + + Returns: + The final IndexingJobRetrieveResponse when the job completes successfully. + + Raises: + IndexingJobTimeoutError: If the job doesn't complete within the specified timeout. + IndexingJobError: If the job fails, errors, or is cancelled. + """ + if not uuid: + raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") + + start_time = time.time() + + while True: + response = await self.retrieve( + uuid, + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=request_timeout, + ) + + # Check if job is in a terminal state + if response.job and response.job.phase: + phase = response.job.phase + + # Success state + if phase == "BATCH_JOB_PHASE_SUCCEEDED": + return response + + # Failure states + if phase == "BATCH_JOB_PHASE_FAILED": + raise IndexingJobError( + f"Indexing job {uuid} failed. " + f"Total items indexed: {response.job.total_items_indexed}, " + f"Total items failed: {response.job.total_items_failed}", + uuid=uuid, + phase=phase, + ) + + if phase == "BATCH_JOB_PHASE_ERROR": + raise IndexingJobError( + f"Indexing job {uuid} encountered an error", + uuid=uuid, + phase=phase, + ) + + if phase == "BATCH_JOB_PHASE_CANCELLED": + raise IndexingJobError( + f"Indexing job {uuid} was cancelled", + uuid=uuid, + phase=phase, + ) + + # Still in progress (UNKNOWN, PENDING, or RUNNING) + # Check timeout + if timeout is not None: + elapsed = time.time() - start_time + if elapsed >= timeout: + raise IndexingJobTimeoutError( + f"Indexing job {uuid} did not complete within {timeout} seconds. " + f"Current phase: {phase}", + uuid=uuid, + phase=phase, + timeout=timeout, + ) + + # Wait before next poll + await asyncio.sleep(poll_interval) + class IndexingJobsResourceWithRawResponse: def __init__(self, indexing_jobs: IndexingJobsResource) -> None: @@ -510,6 +722,9 @@ def __init__(self, indexing_jobs: IndexingJobsResource) -> None: self.update_cancel = to_raw_response_wrapper( indexing_jobs.update_cancel, ) + self.wait_for_completion = to_raw_response_wrapper( + indexing_jobs.wait_for_completion, + ) class AsyncIndexingJobsResourceWithRawResponse: @@ -531,6 +746,9 @@ def __init__(self, indexing_jobs: AsyncIndexingJobsResource) -> None: self.update_cancel = async_to_raw_response_wrapper( indexing_jobs.update_cancel, ) + self.wait_for_completion = async_to_raw_response_wrapper( + indexing_jobs.wait_for_completion, + ) class IndexingJobsResourceWithStreamingResponse: @@ -552,6 +770,9 @@ def __init__(self, indexing_jobs: IndexingJobsResource) -> None: self.update_cancel = to_streamed_response_wrapper( indexing_jobs.update_cancel, ) + self.wait_for_completion = to_streamed_response_wrapper( + indexing_jobs.wait_for_completion, + ) class AsyncIndexingJobsResourceWithStreamingResponse: @@ -573,3 +794,6 @@ def __init__(self, indexing_jobs: AsyncIndexingJobsResource) -> None: self.update_cancel = async_to_streamed_response_wrapper( indexing_jobs.update_cancel, ) + self.wait_for_completion = async_to_streamed_response_wrapper( + indexing_jobs.wait_for_completion, + ) diff --git a/tests/api_resources/knowledge_bases/test_indexing_jobs.py b/tests/api_resources/knowledge_bases/test_indexing_jobs.py index 3dffaa69..88c551c8 100644 --- a/tests/api_resources/knowledge_bases/test_indexing_jobs.py +++ b/tests/api_resources/knowledge_bases/test_indexing_jobs.py @@ -5,9 +5,10 @@ import os from typing import Any, cast +import httpx import pytest -from gradient import Gradient, AsyncGradient +from gradient import Gradient, AsyncGradient, IndexingJobError, IndexingJobTimeoutError from tests.utils import assert_matches_type from gradient.types.knowledge_bases import ( IndexingJobListResponse, @@ -232,6 +233,125 @@ def test_path_params_update_cancel(self, client: Gradient) -> None: path_uuid="", ) + @parametrize + def test_wait_for_completion_raises_indexing_job_error_on_failed(self, client: Gradient, respx_mock: Any) -> None: + """Test that IndexingJobError is raised when job phase is FAILED""" + job_uuid = "test-job-uuid" + respx_mock.get(f"{base_url}/v2/gen-ai/indexing_jobs/{job_uuid}").mock( + return_value=httpx.Response( + 200, + json={ + "job": { + "uuid": job_uuid, + "phase": "BATCH_JOB_PHASE_FAILED", + "total_items_indexed": "10", + "total_items_failed": "5", + } + }, + ) + ) + + with pytest.raises(IndexingJobError) as exc_info: + client.knowledge_bases.indexing_jobs.wait_for_completion(job_uuid) + + assert exc_info.value.uuid == job_uuid + assert exc_info.value.phase == "BATCH_JOB_PHASE_FAILED" + assert "failed" in str(exc_info.value).lower() + + @parametrize + def test_wait_for_completion_raises_indexing_job_error_on_error(self, client: Gradient, respx_mock: Any) -> None: + """Test that IndexingJobError is raised when job phase is ERROR""" + job_uuid = "test-job-uuid" + respx_mock.get(f"{base_url}/v2/gen-ai/indexing_jobs/{job_uuid}").mock( + return_value=httpx.Response( + 200, + json={ + "job": { + "uuid": job_uuid, + "phase": "BATCH_JOB_PHASE_ERROR", + } + }, + ) + ) + + with pytest.raises(IndexingJobError) as exc_info: + client.knowledge_bases.indexing_jobs.wait_for_completion(job_uuid) + + assert exc_info.value.uuid == job_uuid + assert exc_info.value.phase == "BATCH_JOB_PHASE_ERROR" + assert "error" in str(exc_info.value).lower() + + @parametrize + def test_wait_for_completion_raises_indexing_job_error_on_cancelled( + self, client: Gradient, respx_mock: Any + ) -> None: + """Test that IndexingJobError is raised when job phase is CANCELLED""" + job_uuid = "test-job-uuid" + respx_mock.get(f"{base_url}/v2/gen-ai/indexing_jobs/{job_uuid}").mock( + return_value=httpx.Response( + 200, + json={ + "job": { + "uuid": job_uuid, + "phase": "BATCH_JOB_PHASE_CANCELLED", + } + }, + ) + ) + + with pytest.raises(IndexingJobError) as exc_info: + client.knowledge_bases.indexing_jobs.wait_for_completion(job_uuid) + + assert exc_info.value.uuid == job_uuid + assert exc_info.value.phase == "BATCH_JOB_PHASE_CANCELLED" + assert "cancelled" in str(exc_info.value).lower() + + @parametrize + def test_wait_for_completion_raises_timeout_error(self, client: Gradient, respx_mock: Any) -> None: + """Test that IndexingJobTimeoutError is raised on timeout""" + job_uuid = "test-job-uuid" + respx_mock.get(f"{base_url}/v2/gen-ai/indexing_jobs/{job_uuid}").mock( + return_value=httpx.Response( + 200, + json={ + "job": { + "uuid": job_uuid, + "phase": "BATCH_JOB_PHASE_RUNNING", + } + }, + ) + ) + + with pytest.raises(IndexingJobTimeoutError) as exc_info: + client.knowledge_bases.indexing_jobs.wait_for_completion(job_uuid, poll_interval=0.1, timeout=0.2) + + assert exc_info.value.uuid == job_uuid + assert exc_info.value.phase == "BATCH_JOB_PHASE_RUNNING" + assert exc_info.value.timeout == 0.2 + + @parametrize + def test_wait_for_completion_succeeds(self, client: Gradient, respx_mock: Any) -> None: + """Test that wait_for_completion returns successfully when job succeeds""" + job_uuid = "test-job-uuid" + respx_mock.get(f"{base_url}/v2/gen-ai/indexing_jobs/{job_uuid}").mock( + return_value=httpx.Response( + 200, + json={ + "job": { + "uuid": job_uuid, + "phase": "BATCH_JOB_PHASE_SUCCEEDED", + "total_items_indexed": "100", + "total_items_failed": "0", + } + }, + ) + ) + + result = client.knowledge_bases.indexing_jobs.wait_for_completion(job_uuid) + assert_matches_type(IndexingJobRetrieveResponse, result, path=["response"]) + assert result.job is not None + assert result.job.phase == "BATCH_JOB_PHASE_SUCCEEDED" + class TestAsyncIndexingJobs: parametrize = pytest.mark.parametrize( @@ -446,3 +566,128 @@ async def test_path_params_update_cancel(self, async_client: AsyncGradient) -> N await async_client.knowledge_bases.indexing_jobs.with_raw_response.update_cancel( path_uuid="", ) + + @parametrize + async def test_wait_for_completion_raises_indexing_job_error_on_failed( + self, async_client: AsyncGradient, respx_mock: Any + ) -> None: + """Test that IndexingJobError is raised when job phase is FAILED""" + job_uuid = "test-job-uuid" + respx_mock.get(f"{base_url}/v2/gen-ai/indexing_jobs/{job_uuid}").mock( + return_value=httpx.Response( + 200, + json={ + "job": { + "uuid": job_uuid, + "phase": "BATCH_JOB_PHASE_FAILED", + "total_items_indexed": "10", + "total_items_failed": "5", + } + }, + ) + ) + + with pytest.raises(IndexingJobError) as exc_info: + await async_client.knowledge_bases.indexing_jobs.wait_for_completion(job_uuid) + + assert exc_info.value.uuid == job_uuid + assert exc_info.value.phase == "BATCH_JOB_PHASE_FAILED" + assert "failed" in str(exc_info.value).lower() + + @parametrize + async def test_wait_for_completion_raises_indexing_job_error_on_error( + self, async_client: AsyncGradient, respx_mock: Any + ) -> None: + """Test that IndexingJobError is raised when job phase is ERROR""" + job_uuid = "test-job-uuid" + respx_mock.get(f"{base_url}/v2/gen-ai/indexing_jobs/{job_uuid}").mock( + return_value=httpx.Response( + 200, + json={ + "job": { + "uuid": job_uuid, + "phase": "BATCH_JOB_PHASE_ERROR", + } + }, + ) + ) + + with pytest.raises(IndexingJobError) as exc_info: + await async_client.knowledge_bases.indexing_jobs.wait_for_completion(job_uuid) + + assert exc_info.value.uuid == job_uuid + assert exc_info.value.phase == "BATCH_JOB_PHASE_ERROR" + assert "error" in str(exc_info.value).lower() + + @parametrize + async def test_wait_for_completion_raises_indexing_job_error_on_cancelled( + self, async_client: AsyncGradient, respx_mock: Any + ) -> None: + """Test that IndexingJobError is raised when job phase is CANCELLED""" + job_uuid = "test-job-uuid" + respx_mock.get(f"{base_url}/v2/gen-ai/indexing_jobs/{job_uuid}").mock( + return_value=httpx.Response( + 200, + json={ + "job": { + "uuid": job_uuid, + "phase": "BATCH_JOB_PHASE_CANCELLED", + } + }, + ) + ) + + with pytest.raises(IndexingJobError) as exc_info: + await async_client.knowledge_bases.indexing_jobs.wait_for_completion(job_uuid) + + assert exc_info.value.uuid == job_uuid + assert exc_info.value.phase == "BATCH_JOB_PHASE_CANCELLED" + assert "cancelled" in str(exc_info.value).lower() + + @parametrize + async def test_wait_for_completion_raises_timeout_error(self, async_client: AsyncGradient, respx_mock: Any) -> None: + """Test that IndexingJobTimeoutError is raised on timeout""" + job_uuid = "test-job-uuid" + respx_mock.get(f"{base_url}/v2/gen-ai/indexing_jobs/{job_uuid}").mock( + return_value=httpx.Response( + 200, + json={ + "job": { + "uuid": job_uuid, + "phase": "BATCH_JOB_PHASE_RUNNING", + } + }, + ) + ) + + with pytest.raises(IndexingJobTimeoutError) as exc_info: + await async_client.knowledge_bases.indexing_jobs.wait_for_completion( + job_uuid, poll_interval=0.1, timeout=0.2 + ) + + assert exc_info.value.uuid == job_uuid + assert exc_info.value.phase == "BATCH_JOB_PHASE_RUNNING" + assert exc_info.value.timeout == 0.2 + + @parametrize + async def test_wait_for_completion_succeeds(self, async_client: AsyncGradient, respx_mock: Any) -> None: + """Test that wait_for_completion returns successfully when job succeeds""" + job_uuid = "test-job-uuid" + respx_mock.get(f"{base_url}/v2/gen-ai/indexing_jobs/{job_uuid}").mock( + return_value=httpx.Response( + 200, + json={ + "job": { + "uuid": job_uuid, + "phase": "BATCH_JOB_PHASE_SUCCEEDED", + "total_items_indexed": "100", + "total_items_failed": "0", + } + }, + ) + ) + + result = await async_client.knowledge_bases.indexing_jobs.wait_for_completion(job_uuid) + assert_matches_type(IndexingJobRetrieveResponse, result, path=["response"]) + assert result.job is not None + assert result.job.phase == "BATCH_JOB_PHASE_SUCCEEDED" diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index 5777c3ea..1ba3e093 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -368,9 +368,10 @@ def test_path_params_update_status(self, client: Gradient) -> None: def test_method_wait_until_ready(self, client: Gradient, respx_mock: Any) -> None: """Test successful wait_until_ready when agent becomes ready.""" agent_uuid = "test-agent-id" - + # Create side effect that returns different responses call_count = [0] + def get_response(_: httpx.Request) -> httpx.Response: call_count[0] += 1 if call_count[0] == 1: @@ -395,9 +396,9 @@ def get_response(_: httpx.Request) -> httpx.Response: } }, ) - + respx_mock.get(f"/v2/gen-ai/agents/{agent_uuid}").mock(side_effect=get_response) - + agent = client.agents.wait_until_ready(agent_uuid, poll_interval=0.1, timeout=10.0) assert_matches_type(AgentRetrieveResponse, agent, path=["response"]) assert agent.agent is not None @@ -408,9 +409,9 @@ def get_response(_: httpx.Request) -> httpx.Response: def test_wait_until_ready_timeout(self, client: Gradient, respx_mock: Any) -> None: """Test that wait_until_ready raises timeout error.""" from gradient._exceptions import AgentDeploymentTimeoutError - + agent_uuid = "test-agent-id" - + # Mock always returns deploying respx_mock.get(f"/v2/gen-ai/agents/{agent_uuid}").mock( return_value=httpx.Response( @@ -423,10 +424,10 @@ def test_wait_until_ready_timeout(self, client: Gradient, respx_mock: Any) -> No }, ) ) - + with pytest.raises(AgentDeploymentTimeoutError) as exc_info: client.agents.wait_until_ready(agent_uuid, poll_interval=0.1, timeout=0.5) - + assert "did not reach STATUS_RUNNING within" in str(exc_info.value) assert exc_info.value.agent_id == agent_uuid @@ -434,9 +435,9 @@ def test_wait_until_ready_timeout(self, client: Gradient, respx_mock: Any) -> No def test_wait_until_ready_deployment_failed(self, client: Gradient, respx_mock: Any) -> None: """Test that wait_until_ready raises error on deployment failure.""" from gradient._exceptions import AgentDeploymentError - + agent_uuid = "test-agent-id" - + # Mock returns failed status respx_mock.get(f"/v2/gen-ai/agents/{agent_uuid}").mock( return_value=httpx.Response( @@ -449,10 +450,10 @@ def test_wait_until_ready_deployment_failed(self, client: Gradient, respx_mock: }, ) ) - + with pytest.raises(AgentDeploymentError) as exc_info: client.agents.wait_until_ready(agent_uuid, poll_interval=0.1, timeout=10.0) - + assert "deployment failed with status: STATUS_FAILED" in str(exc_info.value) assert exc_info.value.status == "STATUS_FAILED" @@ -810,9 +811,10 @@ async def test_path_params_update_status(self, async_client: AsyncGradient) -> N async def test_method_wait_until_ready(self, async_client: AsyncGradient, respx_mock: Any) -> None: """Test successful async wait_until_ready when agent becomes ready.""" agent_uuid = "test-agent-id" - + # Create side effect that returns different responses call_count = [0] + def get_response(_: httpx.Request) -> httpx.Response: call_count[0] += 1 if call_count[0] == 1: @@ -837,9 +839,9 @@ def get_response(_: httpx.Request) -> httpx.Response: } }, ) - + respx_mock.get(f"/v2/gen-ai/agents/{agent_uuid}").mock(side_effect=get_response) - + agent = await async_client.agents.wait_until_ready(agent_uuid, poll_interval=0.1, timeout=10.0) assert_matches_type(AgentRetrieveResponse, agent, path=["response"]) assert agent.agent is not None @@ -850,9 +852,9 @@ def get_response(_: httpx.Request) -> httpx.Response: async def test_wait_until_ready_timeout(self, async_client: AsyncGradient, respx_mock: Any) -> None: """Test that async wait_until_ready raises timeout error.""" from gradient._exceptions import AgentDeploymentTimeoutError - + agent_uuid = "test-agent-id" - + # Mock always returns deploying respx_mock.get(f"/v2/gen-ai/agents/{agent_uuid}").mock( return_value=httpx.Response( @@ -865,10 +867,10 @@ async def test_wait_until_ready_timeout(self, async_client: AsyncGradient, respx }, ) ) - + with pytest.raises(AgentDeploymentTimeoutError) as exc_info: await async_client.agents.wait_until_ready(agent_uuid, poll_interval=0.1, timeout=0.5) - + assert "did not reach STATUS_RUNNING within" in str(exc_info.value) assert exc_info.value.agent_id == agent_uuid @@ -876,9 +878,9 @@ async def test_wait_until_ready_timeout(self, async_client: AsyncGradient, respx async def test_wait_until_ready_deployment_failed(self, async_client: AsyncGradient, respx_mock: Any) -> None: """Test that async wait_until_ready raises error on deployment failure.""" from gradient._exceptions import AgentDeploymentError - + agent_uuid = "test-agent-id" - + # Mock returns failed status respx_mock.get(f"/v2/gen-ai/agents/{agent_uuid}").mock( return_value=httpx.Response( @@ -891,9 +893,9 @@ async def test_wait_until_ready_deployment_failed(self, async_client: AsyncGradi }, ) ) - + with pytest.raises(AgentDeploymentError) as exc_info: await async_client.agents.wait_until_ready(agent_uuid, poll_interval=0.1, timeout=10.0) - + assert "deployment failed with status: STATUS_FAILED" in str(exc_info.value) assert exc_info.value.status == "STATUS_FAILED" From 76392b565f0e6e1091e62a6d50d284be367a1837 Mon Sep 17 00:00:00 2001 From: Dhia Shams Date: Mon, 27 Oct 2025 21:33:27 +0530 Subject: [PATCH 34/96] Expose agent deployment exceptions via public API and fix example import (#72) --- examples/agent_wait_until_ready.py | 3 +-- src/gradient/__init__.py | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/agent_wait_until_ready.py b/examples/agent_wait_until_ready.py index df8c8cc6..6d14494c 100644 --- a/examples/agent_wait_until_ready.py +++ b/examples/agent_wait_until_ready.py @@ -5,8 +5,7 @@ an agent to finish deploying before using it. """ -from gradient import Gradient -from gradient._exceptions import AgentDeploymentError, AgentDeploymentTimeoutError +from gradient import Gradient, AgentDeploymentError, AgentDeploymentTimeoutError # Initialize the Gradient client client = Gradient() diff --git a/src/gradient/__init__.py b/src/gradient/__init__.py index 864f1484..c5733e7e 100644 --- a/src/gradient/__init__.py +++ b/src/gradient/__init__.py @@ -61,6 +61,8 @@ "APITimeoutError", "APIConnectionError", "APIResponseValidationError", + "AgentDeploymentError", + "AgentDeploymentTimeoutError", "BadRequestError", "AuthenticationError", "PermissionDeniedError", From bcb91a1ad2ed0e2a3de13e60239e2e34fb0abad5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Nov 2025 12:54:50 -0500 Subject: [PATCH 35/96] release: 3.7.0 (#65) * chore: bump `httpx-aiohttp` version to 0.1.9 * fix(client): close streams without requiring full consumption * feat(api): add inference errors * chore(internal/tests): avoid race condition with implicit client cleanup * feat(api): include indexing jobs * chore(internal): grammar fix (it's -> its) * chore(package): drop Python 3.8 support * fix: compat with Python 3.14 * fix(compat): update signatures of `model_dump` and `model_dump_json` for Pydantic v1 * chore: merge issues in test_client.py (#87) * release: 3.7.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: Ben Batha --- .release-please-manifest.json | 2 +- .stats.yml | 8 +- CHANGELOG.md | 27 + README.md | 4 +- api.md | 57 ++ pyproject.toml | 9 +- requirements-dev.lock | 2 +- requirements.lock | 2 +- src/gradient/_client.py | 108 ++- src/gradient/_models.py | 52 +- src/gradient/_streaming.py | 10 +- src/gradient/_utils/_sync.py | 34 +- src/gradient/_utils/_utils.py | 2 +- src/gradient/_version.py | 2 +- src/gradient/resources/__init__.py | 14 + src/gradient/resources/agents/agents.py | 30 + .../agents/evaluation_metrics/__init__.py | 14 + .../evaluation_metrics/evaluation_metrics.py | 32 + .../evaluation_metrics/scheduled_indexing.py | 377 +++++++++ .../knowledge_bases/indexing_jobs.py | 91 +- .../knowledge_bases/knowledge_bases.py | 306 +++++-- src/gradient/resources/nfs/__init__.py | 33 + src/gradient/resources/nfs/nfs.py | 780 ++++++++++++++++++ src/gradient/resources/nfs/snapshots.py | 418 ++++++++++ src/gradient/types/__init__.py | 12 + src/gradient/types/agent_create_params.py | 5 + src/gradient/types/agent_list_response.py | 3 + src/gradient/types/agent_update_params.py | 9 + .../agents/evaluation_metrics/__init__.py | 4 + .../scheduled_indexing_create_params.py | 22 + .../scheduled_indexing_create_response.py | 48 ++ .../scheduled_indexing_delete_response.py | 48 ++ .../scheduled_indexing_retrieve_response.py | 48 ++ src/gradient/types/api_agent.py | 40 + .../types/knowledge_base_create_params.py | 16 +- ...wledge_base_list_indexing_jobs_response.py | 21 + .../types/knowledge_bases/__init__.py | 3 + .../api_indexed_data_source.py | 1 + .../types/knowledge_bases/api_indexing_job.py | 15 +- .../api_knowledge_base_data_source.py | 12 +- .../api_web_crawler_data_source.py | 5 +- .../api_web_crawler_data_source_param.py | 5 + ...dexing_job_retrieve_signed_url_response.py | 12 + src/gradient/types/nf_create_params.py | 23 + src/gradient/types/nf_create_response.py | 45 + src/gradient/types/nf_delete_params.py | 12 + .../types/nf_initiate_action_params.py | 47 ++ .../types/nf_initiate_action_response.py | 33 + src/gradient/types/nf_list_params.py | 12 + src/gradient/types/nf_list_response.py | 45 + src/gradient/types/nf_retrieve_params.py | 12 + src/gradient/types/nf_retrieve_response.py | 45 + src/gradient/types/nfs/__init__.py | 9 + .../types/nfs/snapshot_delete_params.py | 12 + .../types/nfs/snapshot_list_params.py | 18 + .../types/nfs/snapshot_list_response.py | 36 + .../types/nfs/snapshot_retrieve_params.py | 12 + .../types/nfs/snapshot_retrieve_response.py | 37 + .../test_scheduled_indexing.py | 274 ++++++ .../knowledge_bases/test_data_sources.py | 2 + .../knowledge_bases/test_indexing_jobs.py | 85 ++ tests/api_resources/nfs/__init__.py | 1 + tests/api_resources/nfs/test_snapshots.py | 297 +++++++ tests/api_resources/test_agents.py | 8 + tests/api_resources/test_knowledge_bases.py | 95 +++ tests/api_resources/test_nfs.py | 611 ++++++++++++++ tests/test_client.py | 702 ++++++++++------ tests/test_models.py | 8 +- tests/test_smoke_sdk_async.py | 80 +- 69 files changed, 4874 insertions(+), 430 deletions(-) create mode 100644 src/gradient/resources/agents/evaluation_metrics/scheduled_indexing.py create mode 100644 src/gradient/resources/nfs/__init__.py create mode 100644 src/gradient/resources/nfs/nfs.py create mode 100644 src/gradient/resources/nfs/snapshots.py create mode 100644 src/gradient/types/agents/evaluation_metrics/scheduled_indexing_create_params.py create mode 100644 src/gradient/types/agents/evaluation_metrics/scheduled_indexing_create_response.py create mode 100644 src/gradient/types/agents/evaluation_metrics/scheduled_indexing_delete_response.py create mode 100644 src/gradient/types/agents/evaluation_metrics/scheduled_indexing_retrieve_response.py create mode 100644 src/gradient/types/knowledge_base_list_indexing_jobs_response.py create mode 100644 src/gradient/types/knowledge_bases/indexing_job_retrieve_signed_url_response.py create mode 100644 src/gradient/types/nf_create_params.py create mode 100644 src/gradient/types/nf_create_response.py create mode 100644 src/gradient/types/nf_delete_params.py create mode 100644 src/gradient/types/nf_initiate_action_params.py create mode 100644 src/gradient/types/nf_initiate_action_response.py create mode 100644 src/gradient/types/nf_list_params.py create mode 100644 src/gradient/types/nf_list_response.py create mode 100644 src/gradient/types/nf_retrieve_params.py create mode 100644 src/gradient/types/nf_retrieve_response.py create mode 100644 src/gradient/types/nfs/__init__.py create mode 100644 src/gradient/types/nfs/snapshot_delete_params.py create mode 100644 src/gradient/types/nfs/snapshot_list_params.py create mode 100644 src/gradient/types/nfs/snapshot_list_response.py create mode 100644 src/gradient/types/nfs/snapshot_retrieve_params.py create mode 100644 src/gradient/types/nfs/snapshot_retrieve_response.py create mode 100644 tests/api_resources/agents/evaluation_metrics/test_scheduled_indexing.py create mode 100644 tests/api_resources/nfs/__init__.py create mode 100644 tests/api_resources/nfs/test_snapshots.py create mode 100644 tests/api_resources/test_nfs.py diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f391d416..27d2fbbc 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.6.0" + ".": "3.7.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index af483f0a..425463f6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 175 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-cb3bf9b21459cad24410206c27a32fd31ef6cf86711700597549dbbd0d634002.yml -openapi_spec_hash: 6a9149a81ba15e7c5c5c1f4d77daad92 -config_hash: bad49c3bf949d5168ec3896bedff253a +configured_endpoints: 188 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-f07d74847e620dfa26d8df40ea4680814af9bba381b3a57a7b6ed76ad49d85f8.yml +openapi_spec_hash: e3553dc2abf2afd4368b736bcc32a289 +config_hash: b712366a70c9d33e22d40eb601ca972f diff --git a/CHANGELOG.md b/CHANGELOG.md index b8cc8f24..27493281 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,32 @@ # Changelog +## 3.7.0 (2025-11-19) + +Full Changelog: [v3.6.0...v3.7.0](https://github.com/digitalocean/gradient-python/compare/v3.6.0...v3.7.0) + +### Features + +* add wait_for_completion method to IndexingJobs resource with sy… ([#49](https://github.com/digitalocean/gradient-python/issues/49)) ([9edc2a6](https://github.com/digitalocean/gradient-python/commit/9edc2a60f5aa49749e151477615bbecb3a79e92b)) +* Add wait_until_ready() method for agent deployment polling ([#56](https://github.com/digitalocean/gradient-python/issues/56)) ([dcef3d5](https://github.com/digitalocean/gradient-python/commit/dcef3d5ebb4ef903c0c91aa4008853bb978f5544)) +* **api:** add inference errors ([d61d495](https://github.com/digitalocean/gradient-python/commit/d61d4955f596d9ac1bebc9387a6573989e823022)) +* **api:** include indexing jobs ([d249d06](https://github.com/digitalocean/gradient-python/commit/d249d0606e26d585eb2b7859948a796ea7860f53)) + + +### Bug Fixes + +* **client:** close streams without requiring full consumption ([33fe04b](https://github.com/digitalocean/gradient-python/commit/33fe04b2e4ab71094ee13e7b83d4c04867e7d485)) +* compat with Python 3.14 ([add7b21](https://github.com/digitalocean/gradient-python/commit/add7b21b9fbb8987641d5520da638647fe27b159)) +* **compat:** update signatures of `model_dump` and `model_dump_json` for Pydantic v1 ([c945870](https://github.com/digitalocean/gradient-python/commit/c945870a31840d553cb1e3a75314f1c884a56060)) + + +### Chores + +* bump `httpx-aiohttp` version to 0.1.9 ([db39cc6](https://github.com/digitalocean/gradient-python/commit/db39cc63fb126ac81edfe2cb991493d10a2d0936)) +* **internal/tests:** avoid race condition with implicit client cleanup ([e0202bb](https://github.com/digitalocean/gradient-python/commit/e0202bb915613872095f7f223a49c4480e50be98)) +* **internal:** grammar fix (it's -> its) ([c6ffb3b](https://github.com/digitalocean/gradient-python/commit/c6ffb3becbcb99e36992934fac20d67a6a3b967c)) +* merge issues in test_client.py ([#87](https://github.com/digitalocean/gradient-python/issues/87)) ([62fc025](https://github.com/digitalocean/gradient-python/commit/62fc02512e941c6af18b11c19df8828cca31159d)) +* **package:** drop Python 3.8 support ([825b1e4](https://github.com/digitalocean/gradient-python/commit/825b1e4f8b257fc103c0d45743133bbc81ca3e10)) + ## 3.6.0 (2025-10-16) Full Changelog: [v3.5.0...v3.6.0](https://github.com/digitalocean/gradient-python/compare/v3.5.0...v3.6.0) diff --git a/README.md b/README.md index c9186c03..a3029a83 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![PyPI version](https://img.shields.io/pypi/v/gradient.svg?label=pypi%20(stable))](https://pypi.org/project/gradient/) [![Docs](https://img.shields.io/badge/Docs-8A2BE2)](https://gradientai.digitalocean.com/getting-started/overview/) -The Gradient Python library provides convenient access to the Gradient REST API from any Python 3.8+ +The Gradient Python library provides convenient access to the Gradient REST API from any Python 3.9+ application. The library includes type definitions for all request params and response fields, and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx). @@ -528,7 +528,7 @@ print(gradient.__version__) ## Requirements -Python 3.8 or higher. +Python 3.9 or higher. ## Contributing diff --git a/api.md b/api.md index a2325441..49135772 100644 --- a/api.md +++ b/api.md @@ -243,6 +243,24 @@ Methods: - client.agents.evaluation_metrics.oauth2.dropbox.create_tokens(\*\*params) -> DropboxCreateTokensResponse +### ScheduledIndexing + +Types: + +```python +from gradient.types.agents.evaluation_metrics import ( + ScheduledIndexingCreateResponse, + ScheduledIndexingRetrieveResponse, + ScheduledIndexingDeleteResponse, +) +``` + +Methods: + +- client.agents.evaluation_metrics.scheduled_indexing.create(\*\*params) -> ScheduledIndexingCreateResponse +- client.agents.evaluation_metrics.scheduled_indexing.retrieve(knowledge_base_uuid) -> ScheduledIndexingRetrieveResponse +- client.agents.evaluation_metrics.scheduled_indexing.delete(uuid) -> ScheduledIndexingDeleteResponse + ## EvaluationRuns Types: @@ -825,6 +843,7 @@ from gradient.types import ( KnowledgeBaseUpdateResponse, KnowledgeBaseListResponse, KnowledgeBaseDeleteResponse, + KnowledgeBaseListIndexingJobsResponse, ) ``` @@ -835,6 +854,7 @@ Methods: - client.knowledge_bases.update(path_uuid, \*\*params) -> KnowledgeBaseUpdateResponse - client.knowledge_bases.list(\*\*params) -> KnowledgeBaseListResponse - client.knowledge_bases.delete(uuid) -> KnowledgeBaseDeleteResponse +- client.knowledge_bases.list_indexing_jobs(knowledge_base_uuid) -> KnowledgeBaseListIndexingJobsResponse ## DataSources @@ -873,6 +893,7 @@ from gradient.types.knowledge_bases import ( IndexingJobRetrieveResponse, IndexingJobListResponse, IndexingJobRetrieveDataSourcesResponse, + IndexingJobRetrieveSignedURLResponse, IndexingJobUpdateCancelResponse, ) ``` @@ -883,6 +904,7 @@ Methods: - client.knowledge_bases.indexing_jobs.retrieve(uuid) -> IndexingJobRetrieveResponse - client.knowledge_bases.indexing_jobs.list(\*\*params) -> IndexingJobListResponse - client.knowledge_bases.indexing_jobs.retrieve_data_sources(indexing_job_uuid) -> IndexingJobRetrieveDataSourcesResponse +- client.knowledge_bases.indexing_jobs.retrieve_signed_url(indexing_job_uuid) -> IndexingJobRetrieveSignedURLResponse - client.knowledge_bases.indexing_jobs.update_cancel(path_uuid, \*\*params) -> IndexingJobUpdateCancelResponse # Models @@ -982,3 +1004,38 @@ Methods: - client.databases.schema_registry.config.update(database_cluster_uuid, \*\*params) -> ConfigUpdateResponse - client.databases.schema_registry.config.retrieve_subject(subject_name, \*, database_cluster_uuid) -> ConfigRetrieveSubjectResponse - client.databases.schema_registry.config.update_subject(subject_name, \*, database_cluster_uuid, \*\*params) -> ConfigUpdateSubjectResponse + +# Nfs + +Types: + +```python +from gradient.types import ( + NfCreateResponse, + NfRetrieveResponse, + NfListResponse, + NfInitiateActionResponse, +) +``` + +Methods: + +- client.nfs.create(\*\*params) -> NfCreateResponse +- client.nfs.retrieve(nfs_id, \*\*params) -> NfRetrieveResponse +- client.nfs.list(\*\*params) -> NfListResponse +- client.nfs.delete(nfs_id, \*\*params) -> None +- client.nfs.initiate_action(nfs_id, \*\*params) -> NfInitiateActionResponse + +## Snapshots + +Types: + +```python +from gradient.types.nfs import SnapshotRetrieveResponse, SnapshotListResponse +``` + +Methods: + +- client.nfs.snapshots.retrieve(nfs_snapshot_id, \*\*params) -> SnapshotRetrieveResponse +- client.nfs.snapshots.list(\*\*params) -> SnapshotListResponse +- client.nfs.snapshots.delete(nfs_snapshot_id, \*\*params) -> None diff --git a/pyproject.toml b/pyproject.toml index 0e83a25b..3832f578 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gradient" -version = "3.6.0" +version = "3.7.0" description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" @@ -13,11 +13,10 @@ dependencies = [ "distro>=1.7.0, <2", "sniffio", ] -requires-python = ">= 3.8" +requires-python = ">= 3.9" classifiers = [ "Typing :: Typed", "Intended Audience :: Developers", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -37,7 +36,7 @@ Homepage = "https://github.com/digitalocean/gradient-python" Repository = "https://github.com/digitalocean/gradient-python" [project.optional-dependencies] -aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"] +aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"] [tool.rye] managed = true @@ -131,7 +130,7 @@ markers = [ # there are a couple of flags that are still disabled by # default in strict mode as they are experimental and niche. typeCheckingMode = "strict" -pythonVersion = "3.8" +pythonVersion = "3.9" exclude = [ "_dev", diff --git a/requirements-dev.lock b/requirements-dev.lock index 896c8c3a..e5307af8 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -56,7 +56,7 @@ httpx==0.28.1 # via gradient # via httpx-aiohttp # via respx -httpx-aiohttp==0.1.8 +httpx-aiohttp==0.1.9 # via gradient idna==3.4 # via anyio diff --git a/requirements.lock b/requirements.lock index 1fce47a6..8c60e6c5 100644 --- a/requirements.lock +++ b/requirements.lock @@ -43,7 +43,7 @@ httpcore==1.0.9 httpx==0.28.1 # via gradient # via httpx-aiohttp -httpx-aiohttp==0.1.8 +httpx-aiohttp==0.1.9 # via gradient idna==3.4 # via anyio diff --git a/src/gradient/_client.py b/src/gradient/_client.py index 58bc42d9..f7891ddf 100644 --- a/src/gradient/_client.py +++ b/src/gradient/_client.py @@ -33,6 +33,7 @@ if TYPE_CHECKING: from .resources import ( + nfs, chat, agents, images, @@ -44,6 +45,7 @@ knowledge_bases, ) from .resources.images import ImagesResource, AsyncImagesResource + from .resources.nfs.nfs import NfsResource, AsyncNfsResource from .resources.regions import RegionsResource, AsyncRegionsResource from .resources.chat.chat import ChatResource, AsyncChatResource from .resources.gpu_droplets import ( @@ -135,7 +137,10 @@ def __init__( self._agent_endpoint = agent_endpoint if inference_endpoint is None: - inference_endpoint = os.environ.get("GRADIENT_INFERENCE_ENDPOINT") or "https://inference.do-ai.run" + inference_endpoint = ( + os.environ.get("GRADIENT_INFERENCE_ENDPOINT") + or "https://inference.do-ai.run" + ) self.inference_endpoint = inference_endpoint if base_url is None: @@ -226,6 +231,12 @@ def databases(self) -> DatabasesResource: return DatabasesResource(self) + @cached_property + def nfs(self) -> NfsResource: + from .resources.nfs import NfsResource + + return NfsResource(self) + @cached_property def with_raw_response(self) -> GradientWithRawResponse: return GradientWithRawResponse(self) @@ -276,7 +287,9 @@ def default_headers(self) -> dict[str, str | Omit]: @override def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None: - if (self.access_token or self.agent_access_key or self.model_access_key) and headers.get("Authorization"): + if ( + self.access_token or self.agent_access_key or self.model_access_key + ) and headers.get("Authorization"): return if isinstance(custom_headers.get("Authorization"), Omit): return @@ -329,10 +342,14 @@ def copy( Create a new client instance re-using the same options given to the current client with optional overriding. """ if default_headers is not None and set_default_headers is not None: - raise ValueError("The `default_headers` and `set_default_headers` arguments are mutually exclusive") + raise ValueError( + "The `default_headers` and `set_default_headers` arguments are mutually exclusive" + ) if default_query is not None and set_default_query is not None: - raise ValueError("The `default_query` and `set_default_query` arguments are mutually exclusive") + raise ValueError( + "The `default_query` and `set_default_query` arguments are mutually exclusive" + ) headers = self._custom_headers if default_headers is not None: @@ -382,10 +399,14 @@ def _make_status_error( return _exceptions.BadRequestError(err_msg, response=response, body=body) if response.status_code == 401: - return _exceptions.AuthenticationError(err_msg, response=response, body=body) + return _exceptions.AuthenticationError( + err_msg, response=response, body=body + ) if response.status_code == 403: - return _exceptions.PermissionDeniedError(err_msg, response=response, body=body) + return _exceptions.PermissionDeniedError( + err_msg, response=response, body=body + ) if response.status_code == 404: return _exceptions.NotFoundError(err_msg, response=response, body=body) @@ -394,13 +415,17 @@ def _make_status_error( return _exceptions.ConflictError(err_msg, response=response, body=body) if response.status_code == 422: - return _exceptions.UnprocessableEntityError(err_msg, response=response, body=body) + return _exceptions.UnprocessableEntityError( + err_msg, response=response, body=body + ) if response.status_code == 429: return _exceptions.RateLimitError(err_msg, response=response, body=body) if response.status_code >= 500: - return _exceptions.InternalServerError(err_msg, response=response, body=body) + return _exceptions.InternalServerError( + err_msg, response=response, body=body + ) return APIStatusError(err_msg, response=response, body=body) @@ -468,7 +493,10 @@ def __init__( self._agent_endpoint = agent_endpoint if inference_endpoint is None: - inference_endpoint = os.environ.get("GRADIENT_INFERENCE_ENDPOINT") or "https://inference.do-ai.run" + inference_endpoint = ( + os.environ.get("GRADIENT_INFERENCE_ENDPOINT") + or "https://inference.do-ai.run" + ) self.inference_endpoint = inference_endpoint if base_url is None: @@ -559,6 +587,12 @@ def databases(self) -> AsyncDatabasesResource: return AsyncDatabasesResource(self) + @cached_property + def nfs(self) -> AsyncNfsResource: + from .resources.nfs import AsyncNfsResource + + return AsyncNfsResource(self) + @cached_property def with_raw_response(self) -> AsyncGradientWithRawResponse: return AsyncGradientWithRawResponse(self) @@ -609,7 +643,9 @@ def default_headers(self) -> dict[str, str | Omit]: @override def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None: - if (self.access_token or self.agent_access_key or self.model_access_key) and headers.get("Authorization"): + if ( + self.access_token or self.agent_access_key or self.model_access_key + ) and headers.get("Authorization"): return if isinstance(custom_headers.get("Authorization"), Omit): return @@ -662,10 +698,14 @@ def copy( Create a new client instance re-using the same options given to the current client with optional overriding. """ if default_headers is not None and set_default_headers is not None: - raise ValueError("The `default_headers` and `set_default_headers` arguments are mutually exclusive") + raise ValueError( + "The `default_headers` and `set_default_headers` arguments are mutually exclusive" + ) if default_query is not None and set_default_query is not None: - raise ValueError("The `default_query` and `set_default_query` arguments are mutually exclusive") + raise ValueError( + "The `default_query` and `set_default_query` arguments are mutually exclusive" + ) headers = self._custom_headers if default_headers is not None: @@ -715,10 +755,14 @@ def _make_status_error( return _exceptions.BadRequestError(err_msg, response=response, body=body) if response.status_code == 401: - return _exceptions.AuthenticationError(err_msg, response=response, body=body) + return _exceptions.AuthenticationError( + err_msg, response=response, body=body + ) if response.status_code == 403: - return _exceptions.PermissionDeniedError(err_msg, response=response, body=body) + return _exceptions.PermissionDeniedError( + err_msg, response=response, body=body + ) if response.status_code == 404: return _exceptions.NotFoundError(err_msg, response=response, body=body) @@ -727,13 +771,17 @@ def _make_status_error( return _exceptions.ConflictError(err_msg, response=response, body=body) if response.status_code == 422: - return _exceptions.UnprocessableEntityError(err_msg, response=response, body=body) + return _exceptions.UnprocessableEntityError( + err_msg, response=response, body=body + ) if response.status_code == 429: return _exceptions.RateLimitError(err_msg, response=response, body=body) if response.status_code >= 500: - return _exceptions.InternalServerError(err_msg, response=response, body=body) + return _exceptions.InternalServerError( + err_msg, response=response, body=body + ) return APIStatusError(err_msg, response=response, body=body) @@ -797,6 +845,12 @@ def databases(self) -> databases.DatabasesResourceWithRawResponse: return DatabasesResourceWithRawResponse(self._client.databases) + @cached_property + def nfs(self) -> nfs.NfsResourceWithRawResponse: + from .resources.nfs import NfsResourceWithRawResponse + + return NfsResourceWithRawResponse(self._client.nfs) + class AsyncGradientWithRawResponse: _client: AsyncGradient @@ -862,6 +916,12 @@ def databases(self) -> databases.AsyncDatabasesResourceWithRawResponse: return AsyncDatabasesResourceWithRawResponse(self._client.databases) + @cached_property + def nfs(self) -> nfs.AsyncNfsResourceWithRawResponse: + from .resources.nfs import AsyncNfsResourceWithRawResponse + + return AsyncNfsResourceWithRawResponse(self._client.nfs) + class GradientWithStreamedResponse: _client: Gradient @@ -927,6 +987,12 @@ def databases(self) -> databases.DatabasesResourceWithStreamingResponse: return DatabasesResourceWithStreamingResponse(self._client.databases) + @cached_property + def nfs(self) -> nfs.NfsResourceWithStreamingResponse: + from .resources.nfs import NfsResourceWithStreamingResponse + + return NfsResourceWithStreamingResponse(self._client.nfs) + class AsyncGradientWithStreamedResponse: _client: AsyncGradient @@ -976,7 +1042,9 @@ def knowledge_bases( AsyncKnowledgeBasesResourceWithStreamingResponse, ) - return AsyncKnowledgeBasesResourceWithStreamingResponse(self._client.knowledge_bases) + return AsyncKnowledgeBasesResourceWithStreamingResponse( + self._client.knowledge_bases + ) @cached_property def models(self) -> models.AsyncModelsResourceWithStreamingResponse: @@ -996,6 +1064,12 @@ def databases(self) -> databases.AsyncDatabasesResourceWithStreamingResponse: return AsyncDatabasesResourceWithStreamingResponse(self._client.databases) + @cached_property + def nfs(self) -> nfs.AsyncNfsResourceWithStreamingResponse: + from .resources.nfs import AsyncNfsResourceWithStreamingResponse + + return AsyncNfsResourceWithStreamingResponse(self._client.nfs) + Client = Gradient diff --git a/src/gradient/_models.py b/src/gradient/_models.py index 6a3cd1d2..ca9500b2 100644 --- a/src/gradient/_models.py +++ b/src/gradient/_models.py @@ -2,6 +2,7 @@ import os import inspect +import weakref from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast from datetime import date, datetime from typing_extensions import ( @@ -256,15 +257,16 @@ def model_dump( mode: Literal["json", "python"] | str = "python", include: IncEx | None = None, exclude: IncEx | None = None, + context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, + exclude_computed_fields: bool = False, round_trip: bool = False, warnings: bool | Literal["none", "warn", "error"] = True, - context: dict[str, Any] | None = None, - serialize_as_any: bool = False, fallback: Callable[[Any], Any] | None = None, + serialize_as_any: bool = False, ) -> dict[str, Any]: """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump @@ -272,16 +274,24 @@ def model_dump( Args: mode: The mode in which `to_python` should run. - If mode is 'json', the dictionary will only contain JSON serializable types. - If mode is 'python', the dictionary may contain any Python objects. - include: A list of fields to include in the output. - exclude: A list of fields to exclude from the output. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. by_alias: Whether to use the field's alias in the dictionary key if defined. - exclude_unset: Whether to exclude fields that are unset or None from the output. - exclude_defaults: Whether to exclude fields that are set to their default value from the output. - exclude_none: Whether to exclude fields that have a value of `None` from the output. - round_trip: Whether to enable serialization and deserialization round-trip support. - warnings: Whether to log warnings when invalid fields are encountered. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + exclude_computed_fields: Whether to exclude computed fields. + While this can be useful for round-tripping, it is usually recommended to use the dedicated + `round_trip` parameter instead. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. Returns: A dictionary representation of the model. @@ -298,6 +308,8 @@ def model_dump( 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") + if exclude_computed_fields != False: + raise ValueError("exclude_computed_fields is only supported in Pydantic v2") dumped = super().dict( # pyright: ignore[reportDeprecated] include=include, exclude=exclude, @@ -314,15 +326,17 @@ def model_dump_json( self, *, indent: int | None = None, + ensure_ascii: bool = False, include: IncEx | None = None, exclude: IncEx | None = None, + context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, + exclude_computed_fields: 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: @@ -354,6 +368,10 @@ def model_dump_json( 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") + if ensure_ascii != False: + raise ValueError("ensure_ascii is only supported in Pydantic v2") + if exclude_computed_fields != False: + raise ValueError("exclude_computed_fields is only supported in Pydantic v2") return super().json( # type: ignore[reportDeprecated] indent=indent, include=include, @@ -573,6 +591,9 @@ class CachedDiscriminatorType(Protocol): __discriminator__: DiscriminatorDetails +DISCRIMINATOR_CACHE: weakref.WeakKeyDictionary[type, DiscriminatorDetails] = weakref.WeakKeyDictionary() + + class DiscriminatorDetails: field_name: str """The name of the discriminator field in the variant class, e.g. @@ -615,8 +636,9 @@ def __init__( def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, ...]) -> DiscriminatorDetails | None: - if isinstance(union, CachedDiscriminatorType): - return union.__discriminator__ + cached = DISCRIMINATOR_CACHE.get(union) + if cached is not None: + return cached discriminator_field_name: str | None = None @@ -669,7 +691,7 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, discriminator_field=discriminator_field_name, discriminator_alias=discriminator_alias, ) - cast(CachedDiscriminatorType, union).__discriminator__ = details + DISCRIMINATOR_CACHE.setdefault(union, details) return details diff --git a/src/gradient/_streaming.py b/src/gradient/_streaming.py index eb9be89d..df2a5870 100644 --- a/src/gradient/_streaming.py +++ b/src/gradient/_streaming.py @@ -76,9 +76,8 @@ def __stream__(self) -> Iterator[_T]: yield process_data(data=data, 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 @@ -158,9 +157,8 @@ async def __stream__(self) -> AsyncIterator[_T]: yield process_data(data=data, 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 diff --git a/src/gradient/_utils/_sync.py b/src/gradient/_utils/_sync.py index ad7ec71b..f6027c18 100644 --- a/src/gradient/_utils/_sync.py +++ b/src/gradient/_utils/_sync.py @@ -1,10 +1,8 @@ from __future__ import annotations -import sys import asyncio import functools -import contextvars -from typing import Any, TypeVar, Callable, Awaitable +from typing import TypeVar, Callable, Awaitable from typing_extensions import ParamSpec import anyio @@ -15,34 +13,11 @@ T_ParamSpec = ParamSpec("T_ParamSpec") -if sys.version_info >= (3, 9): - _asyncio_to_thread = asyncio.to_thread -else: - # backport of https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread - # for Python 3.8 support - async def _asyncio_to_thread( - func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs - ) -> Any: - """Asynchronously run function *func* in a separate thread. - - Any *args and **kwargs supplied for this function are directly passed - to *func*. Also, the current :class:`contextvars.Context` is propagated, - allowing context variables from the main thread to be accessed in the - separate thread. - - Returns a coroutine that can be awaited to get the eventual result of *func*. - """ - loop = asyncio.events.get_running_loop() - ctx = contextvars.copy_context() - func_call = functools.partial(ctx.run, func, *args, **kwargs) - return await loop.run_in_executor(None, func_call) - - async def to_thread( func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs ) -> T_Retval: if sniffio.current_async_library() == "asyncio": - return await _asyncio_to_thread(func, *args, **kwargs) + return await asyncio.to_thread(func, *args, **kwargs) return await anyio.to_thread.run_sync( functools.partial(func, *args, **kwargs), @@ -53,10 +28,7 @@ async def to_thread( def asyncify(function: Callable[T_ParamSpec, T_Retval]) -> Callable[T_ParamSpec, Awaitable[T_Retval]]: """ Take a blocking function and create an async one that receives the same - positional and keyword arguments. For python version 3.9 and above, it uses - asyncio.to_thread to run the function in a separate thread. For python version - 3.8, it uses locally defined copy of the asyncio.to_thread function which was - introduced in python 3.9. + positional and keyword arguments. Usage: diff --git a/src/gradient/_utils/_utils.py b/src/gradient/_utils/_utils.py index 50d59269..eec7f4a1 100644 --- a/src/gradient/_utils/_utils.py +++ b/src/gradient/_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 diff --git a/src/gradient/_version.py b/src/gradient/_version.py index 0190d688..6e29a000 100644 --- a/src/gradient/_version.py +++ b/src/gradient/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gradient" -__version__ = "3.6.0" # x-release-please-version +__version__ = "3.7.0" # x-release-please-version diff --git a/src/gradient/resources/__init__.py b/src/gradient/resources/__init__.py index fdc7d346..a797b18f 100644 --- a/src/gradient/resources/__init__.py +++ b/src/gradient/resources/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .nfs import ( + NfsResource, + AsyncNfsResource, + NfsResourceWithRawResponse, + AsyncNfsResourceWithRawResponse, + NfsResourceWithStreamingResponse, + AsyncNfsResourceWithStreamingResponse, +) from .chat import ( ChatResource, AsyncChatResource, @@ -128,4 +136,10 @@ "AsyncDatabasesResourceWithRawResponse", "DatabasesResourceWithStreamingResponse", "AsyncDatabasesResourceWithStreamingResponse", + "NfsResource", + "AsyncNfsResource", + "NfsResourceWithRawResponse", + "AsyncNfsResourceWithRawResponse", + "NfsResourceWithStreamingResponse", + "AsyncNfsResourceWithStreamingResponse", ] diff --git a/src/gradient/resources/agents/agents.py b/src/gradient/resources/agents/agents.py index 686678ba..33a59788 100644 --- a/src/gradient/resources/agents/agents.py +++ b/src/gradient/resources/agents/agents.py @@ -185,12 +185,14 @@ def create( description: str | Omit = omit, instruction: str | Omit = omit, knowledge_base_uuid: SequenceNotStr[str] | Omit = omit, + model_provider_key_uuid: str | Omit = omit, model_uuid: str | Omit = omit, name: str | Omit = omit, openai_key_uuid: str | Omit = omit, project_id: str | Omit = omit, region: str | Omit = omit, tags: SequenceNotStr[str] | Omit = omit, + workspace_uuid: 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, @@ -227,6 +229,8 @@ def create( tags: Agent tag to organize related resources + workspace_uuid: Identifier for the workspace + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -245,12 +249,14 @@ def create( "description": description, "instruction": instruction, "knowledge_base_uuid": knowledge_base_uuid, + "model_provider_key_uuid": model_provider_key_uuid, "model_uuid": model_uuid, "name": name, "openai_key_uuid": openai_key_uuid, "project_id": project_id, "region": region, "tags": tags, + "workspace_uuid": workspace_uuid, }, agent_create_params.AgentCreateParams, ), @@ -302,12 +308,14 @@ def update( path_uuid: str, *, agent_log_insights_enabled: bool | Omit = omit, + allowed_domains: SequenceNotStr[str] | Omit = omit, anthropic_key_uuid: str | Omit = omit, conversation_logs_enabled: bool | Omit = omit, description: str | Omit = omit, instruction: str | Omit = omit, k: int | Omit = omit, max_tokens: int | Omit = omit, + model_provider_key_uuid: str | Omit = omit, model_uuid: str | Omit = omit, name: str | Omit = omit, openai_key_uuid: str | Omit = omit, @@ -331,6 +339,9 @@ def update( response body is a JSON object containing the agent. Args: + allowed_domains: Optional list of allowed domains for the chatbot - Must use fully qualified + domain name (FQDN) such as https://example.com + anthropic_key_uuid: Optional anthropic key uuid for use with anthropic models conversation_logs_enabled: Optional update of conversation logs enabled @@ -348,6 +359,8 @@ def update( or output, set as a number between 1 and 512. This determines the length of each response. + model_provider_key_uuid: Optional Model Provider uuid for use with provider models + model_uuid: Identifier for the foundation model. name: Agent name @@ -391,12 +404,14 @@ def update( body=maybe_transform( { "agent_log_insights_enabled": agent_log_insights_enabled, + "allowed_domains": allowed_domains, "anthropic_key_uuid": anthropic_key_uuid, "conversation_logs_enabled": conversation_logs_enabled, "description": description, "instruction": instruction, "k": k, "max_tokens": max_tokens, + "model_provider_key_uuid": model_provider_key_uuid, "model_uuid": model_uuid, "name": name, "openai_key_uuid": openai_key_uuid, @@ -767,12 +782,14 @@ async def create( description: str | Omit = omit, instruction: str | Omit = omit, knowledge_base_uuid: SequenceNotStr[str] | Omit = omit, + model_provider_key_uuid: str | Omit = omit, model_uuid: str | Omit = omit, name: str | Omit = omit, openai_key_uuid: str | Omit = omit, project_id: str | Omit = omit, region: str | Omit = omit, tags: SequenceNotStr[str] | Omit = omit, + workspace_uuid: 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, @@ -809,6 +826,8 @@ async def create( tags: Agent tag to organize related resources + workspace_uuid: Identifier for the workspace + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -827,12 +846,14 @@ async def create( "description": description, "instruction": instruction, "knowledge_base_uuid": knowledge_base_uuid, + "model_provider_key_uuid": model_provider_key_uuid, "model_uuid": model_uuid, "name": name, "openai_key_uuid": openai_key_uuid, "project_id": project_id, "region": region, "tags": tags, + "workspace_uuid": workspace_uuid, }, agent_create_params.AgentCreateParams, ), @@ -884,12 +905,14 @@ async def update( path_uuid: str, *, agent_log_insights_enabled: bool | Omit = omit, + allowed_domains: SequenceNotStr[str] | Omit = omit, anthropic_key_uuid: str | Omit = omit, conversation_logs_enabled: bool | Omit = omit, description: str | Omit = omit, instruction: str | Omit = omit, k: int | Omit = omit, max_tokens: int | Omit = omit, + model_provider_key_uuid: str | Omit = omit, model_uuid: str | Omit = omit, name: str | Omit = omit, openai_key_uuid: str | Omit = omit, @@ -913,6 +936,9 @@ async def update( response body is a JSON object containing the agent. Args: + allowed_domains: Optional list of allowed domains for the chatbot - Must use fully qualified + domain name (FQDN) such as https://example.com + anthropic_key_uuid: Optional anthropic key uuid for use with anthropic models conversation_logs_enabled: Optional update of conversation logs enabled @@ -930,6 +956,8 @@ async def update( or output, set as a number between 1 and 512. This determines the length of each response. + model_provider_key_uuid: Optional Model Provider uuid for use with provider models + model_uuid: Identifier for the foundation model. name: Agent name @@ -973,12 +1001,14 @@ async def update( body=await async_maybe_transform( { "agent_log_insights_enabled": agent_log_insights_enabled, + "allowed_domains": allowed_domains, "anthropic_key_uuid": anthropic_key_uuid, "conversation_logs_enabled": conversation_logs_enabled, "description": description, "instruction": instruction, "k": k, "max_tokens": max_tokens, + "model_provider_key_uuid": model_provider_key_uuid, "model_uuid": model_uuid, "name": name, "openai_key_uuid": openai_key_uuid, diff --git a/src/gradient/resources/agents/evaluation_metrics/__init__.py b/src/gradient/resources/agents/evaluation_metrics/__init__.py index 31e2f93b..515a221b 100644 --- a/src/gradient/resources/agents/evaluation_metrics/__init__.py +++ b/src/gradient/resources/agents/evaluation_metrics/__init__.py @@ -48,6 +48,14 @@ EvaluationMetricsResourceWithStreamingResponse, AsyncEvaluationMetricsResourceWithStreamingResponse, ) +from .scheduled_indexing import ( + ScheduledIndexingResource, + AsyncScheduledIndexingResource, + ScheduledIndexingResourceWithRawResponse, + AsyncScheduledIndexingResourceWithRawResponse, + ScheduledIndexingResourceWithStreamingResponse, + AsyncScheduledIndexingResourceWithStreamingResponse, +) __all__ = [ "WorkspacesResource", @@ -80,6 +88,12 @@ "AsyncOauth2ResourceWithRawResponse", "Oauth2ResourceWithStreamingResponse", "AsyncOauth2ResourceWithStreamingResponse", + "ScheduledIndexingResource", + "AsyncScheduledIndexingResource", + "ScheduledIndexingResourceWithRawResponse", + "AsyncScheduledIndexingResourceWithRawResponse", + "ScheduledIndexingResourceWithStreamingResponse", + "AsyncScheduledIndexingResourceWithStreamingResponse", "EvaluationMetricsResource", "AsyncEvaluationMetricsResource", "EvaluationMetricsResourceWithRawResponse", diff --git a/src/gradient/resources/agents/evaluation_metrics/evaluation_metrics.py b/src/gradient/resources/agents/evaluation_metrics/evaluation_metrics.py index 43c1aa9b..14ea4d55 100644 --- a/src/gradient/resources/agents/evaluation_metrics/evaluation_metrics.py +++ b/src/gradient/resources/agents/evaluation_metrics/evaluation_metrics.py @@ -40,6 +40,14 @@ ) from ...._base_client import make_request_options from ....types.agents import evaluation_metric_list_regions_params +from .scheduled_indexing import ( + ScheduledIndexingResource, + AsyncScheduledIndexingResource, + ScheduledIndexingResourceWithRawResponse, + AsyncScheduledIndexingResourceWithRawResponse, + ScheduledIndexingResourceWithStreamingResponse, + AsyncScheduledIndexingResourceWithStreamingResponse, +) from .anthropic.anthropic import ( AnthropicResource, AsyncAnthropicResource, @@ -83,6 +91,10 @@ def openai(self) -> OpenAIResource: def oauth2(self) -> Oauth2Resource: return Oauth2Resource(self._client) + @cached_property + def scheduled_indexing(self) -> ScheduledIndexingResource: + return ScheduledIndexingResource(self._client) + @cached_property def with_raw_response(self) -> EvaluationMetricsResourceWithRawResponse: """ @@ -196,6 +208,10 @@ def openai(self) -> AsyncOpenAIResource: def oauth2(self) -> AsyncOauth2Resource: return AsyncOauth2Resource(self._client) + @cached_property + def scheduled_indexing(self) -> AsyncScheduledIndexingResource: + return AsyncScheduledIndexingResource(self._client) + @cached_property def with_raw_response(self) -> AsyncEvaluationMetricsResourceWithRawResponse: """ @@ -319,6 +335,10 @@ def openai(self) -> OpenAIResourceWithRawResponse: def oauth2(self) -> Oauth2ResourceWithRawResponse: return Oauth2ResourceWithRawResponse(self._evaluation_metrics.oauth2) + @cached_property + def scheduled_indexing(self) -> ScheduledIndexingResourceWithRawResponse: + return ScheduledIndexingResourceWithRawResponse(self._evaluation_metrics.scheduled_indexing) + class AsyncEvaluationMetricsResourceWithRawResponse: def __init__(self, evaluation_metrics: AsyncEvaluationMetricsResource) -> None: @@ -351,6 +371,10 @@ def openai(self) -> AsyncOpenAIResourceWithRawResponse: def oauth2(self) -> AsyncOauth2ResourceWithRawResponse: return AsyncOauth2ResourceWithRawResponse(self._evaluation_metrics.oauth2) + @cached_property + def scheduled_indexing(self) -> AsyncScheduledIndexingResourceWithRawResponse: + return AsyncScheduledIndexingResourceWithRawResponse(self._evaluation_metrics.scheduled_indexing) + class EvaluationMetricsResourceWithStreamingResponse: def __init__(self, evaluation_metrics: EvaluationMetricsResource) -> None: @@ -383,6 +407,10 @@ def openai(self) -> OpenAIResourceWithStreamingResponse: def oauth2(self) -> Oauth2ResourceWithStreamingResponse: return Oauth2ResourceWithStreamingResponse(self._evaluation_metrics.oauth2) + @cached_property + def scheduled_indexing(self) -> ScheduledIndexingResourceWithStreamingResponse: + return ScheduledIndexingResourceWithStreamingResponse(self._evaluation_metrics.scheduled_indexing) + class AsyncEvaluationMetricsResourceWithStreamingResponse: def __init__(self, evaluation_metrics: AsyncEvaluationMetricsResource) -> None: @@ -414,3 +442,7 @@ def openai(self) -> AsyncOpenAIResourceWithStreamingResponse: @cached_property def oauth2(self) -> AsyncOauth2ResourceWithStreamingResponse: return AsyncOauth2ResourceWithStreamingResponse(self._evaluation_metrics.oauth2) + + @cached_property + def scheduled_indexing(self) -> AsyncScheduledIndexingResourceWithStreamingResponse: + return AsyncScheduledIndexingResourceWithStreamingResponse(self._evaluation_metrics.scheduled_indexing) diff --git a/src/gradient/resources/agents/evaluation_metrics/scheduled_indexing.py b/src/gradient/resources/agents/evaluation_metrics/scheduled_indexing.py new file mode 100644 index 00000000..e346f7ae --- /dev/null +++ b/src/gradient/resources/agents/evaluation_metrics/scheduled_indexing.py @@ -0,0 +1,377 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable + +import httpx + +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 +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._base_client import make_request_options +from ....types.agents.evaluation_metrics import scheduled_indexing_create_params +from ....types.agents.evaluation_metrics.scheduled_indexing_create_response import ScheduledIndexingCreateResponse +from ....types.agents.evaluation_metrics.scheduled_indexing_delete_response import ScheduledIndexingDeleteResponse +from ....types.agents.evaluation_metrics.scheduled_indexing_retrieve_response import ScheduledIndexingRetrieveResponse + +__all__ = ["ScheduledIndexingResource", "AsyncScheduledIndexingResource"] + + +class ScheduledIndexingResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ScheduledIndexingResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return ScheduledIndexingResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ScheduledIndexingResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return ScheduledIndexingResourceWithStreamingResponse(self) + + def create( + self, + *, + days: Iterable[int] | Omit = omit, + knowledge_base_uuid: str | Omit = omit, + time: 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, + ) -> ScheduledIndexingCreateResponse: + """ + To create scheduled indexing for a knowledge base, send a POST request to + `/v2/gen-ai/scheduled-indexing`. + + Args: + days: Days for execution (day is represented same as in a cron expression, e.g. Monday + begins with 1 ) + + knowledge_base_uuid: Knowledge base uuid for which the schedule is created + + time: Time of execution (HH:MM) UTC + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/v2/gen-ai/scheduled-indexing" + if self._client._base_url_overridden + else "https://api.digitalocean.com/v2/gen-ai/scheduled-indexing", + body=maybe_transform( + { + "days": days, + "knowledge_base_uuid": knowledge_base_uuid, + "time": time, + }, + scheduled_indexing_create_params.ScheduledIndexingCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScheduledIndexingCreateResponse, + ) + + def retrieve( + self, + knowledge_base_uuid: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScheduledIndexingRetrieveResponse: + """ + Get Scheduled Indexing for knowledge base using knoweldge base uuid, send a GET + request to `/v2/gen-ai/scheduled-indexing/knowledge-base/{knowledge_base_uuid}`. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not knowledge_base_uuid: + raise ValueError( + f"Expected a non-empty value for `knowledge_base_uuid` but received {knowledge_base_uuid!r}" + ) + return self._get( + f"/v2/gen-ai/scheduled-indexing/knowledge-base/{knowledge_base_uuid}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/gen-ai/scheduled-indexing/knowledge-base/{knowledge_base_uuid}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScheduledIndexingRetrieveResponse, + ) + + def delete( + self, + uuid: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScheduledIndexingDeleteResponse: + """ + Delete Scheduled Indexing for knowledge base, send a DELETE request to + `/v2/gen-ai/scheduled-indexing/{uuid}`. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not uuid: + raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") + return self._delete( + f"/v2/gen-ai/scheduled-indexing/{uuid}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/gen-ai/scheduled-indexing/{uuid}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScheduledIndexingDeleteResponse, + ) + + +class AsyncScheduledIndexingResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncScheduledIndexingResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return AsyncScheduledIndexingResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncScheduledIndexingResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return AsyncScheduledIndexingResourceWithStreamingResponse(self) + + async def create( + self, + *, + days: Iterable[int] | Omit = omit, + knowledge_base_uuid: str | Omit = omit, + time: 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, + ) -> ScheduledIndexingCreateResponse: + """ + To create scheduled indexing for a knowledge base, send a POST request to + `/v2/gen-ai/scheduled-indexing`. + + Args: + days: Days for execution (day is represented same as in a cron expression, e.g. Monday + begins with 1 ) + + knowledge_base_uuid: Knowledge base uuid for which the schedule is created + + time: Time of execution (HH:MM) UTC + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/v2/gen-ai/scheduled-indexing" + if self._client._base_url_overridden + else "https://api.digitalocean.com/v2/gen-ai/scheduled-indexing", + body=await async_maybe_transform( + { + "days": days, + "knowledge_base_uuid": knowledge_base_uuid, + "time": time, + }, + scheduled_indexing_create_params.ScheduledIndexingCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScheduledIndexingCreateResponse, + ) + + async def retrieve( + self, + knowledge_base_uuid: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScheduledIndexingRetrieveResponse: + """ + Get Scheduled Indexing for knowledge base using knoweldge base uuid, send a GET + request to `/v2/gen-ai/scheduled-indexing/knowledge-base/{knowledge_base_uuid}`. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not knowledge_base_uuid: + raise ValueError( + f"Expected a non-empty value for `knowledge_base_uuid` but received {knowledge_base_uuid!r}" + ) + return await self._get( + f"/v2/gen-ai/scheduled-indexing/knowledge-base/{knowledge_base_uuid}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/gen-ai/scheduled-indexing/knowledge-base/{knowledge_base_uuid}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScheduledIndexingRetrieveResponse, + ) + + async def delete( + self, + uuid: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> ScheduledIndexingDeleteResponse: + """ + Delete Scheduled Indexing for knowledge base, send a DELETE request to + `/v2/gen-ai/scheduled-indexing/{uuid}`. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not uuid: + raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") + return await self._delete( + f"/v2/gen-ai/scheduled-indexing/{uuid}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/gen-ai/scheduled-indexing/{uuid}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScheduledIndexingDeleteResponse, + ) + + +class ScheduledIndexingResourceWithRawResponse: + def __init__(self, scheduled_indexing: ScheduledIndexingResource) -> None: + self._scheduled_indexing = scheduled_indexing + + self.create = to_raw_response_wrapper( + scheduled_indexing.create, + ) + self.retrieve = to_raw_response_wrapper( + scheduled_indexing.retrieve, + ) + self.delete = to_raw_response_wrapper( + scheduled_indexing.delete, + ) + + +class AsyncScheduledIndexingResourceWithRawResponse: + def __init__(self, scheduled_indexing: AsyncScheduledIndexingResource) -> None: + self._scheduled_indexing = scheduled_indexing + + self.create = async_to_raw_response_wrapper( + scheduled_indexing.create, + ) + self.retrieve = async_to_raw_response_wrapper( + scheduled_indexing.retrieve, + ) + self.delete = async_to_raw_response_wrapper( + scheduled_indexing.delete, + ) + + +class ScheduledIndexingResourceWithStreamingResponse: + def __init__(self, scheduled_indexing: ScheduledIndexingResource) -> None: + self._scheduled_indexing = scheduled_indexing + + self.create = to_streamed_response_wrapper( + scheduled_indexing.create, + ) + self.retrieve = to_streamed_response_wrapper( + scheduled_indexing.retrieve, + ) + self.delete = to_streamed_response_wrapper( + scheduled_indexing.delete, + ) + + +class AsyncScheduledIndexingResourceWithStreamingResponse: + def __init__(self, scheduled_indexing: AsyncScheduledIndexingResource) -> None: + self._scheduled_indexing = scheduled_indexing + + self.create = async_to_streamed_response_wrapper( + scheduled_indexing.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + scheduled_indexing.retrieve, + ) + self.delete = async_to_streamed_response_wrapper( + scheduled_indexing.delete, + ) diff --git a/src/gradient/resources/knowledge_bases/indexing_jobs.py b/src/gradient/resources/knowledge_bases/indexing_jobs.py index 647ab308..7936c73c 100644 --- a/src/gradient/resources/knowledge_bases/indexing_jobs.py +++ b/src/gradient/resources/knowledge_bases/indexing_jobs.py @@ -28,6 +28,7 @@ from ...types.knowledge_bases.indexing_job_create_response import IndexingJobCreateResponse from ...types.knowledge_bases.indexing_job_retrieve_response import IndexingJobRetrieveResponse from ...types.knowledge_bases.indexing_job_update_cancel_response import IndexingJobUpdateCancelResponse +from ...types.knowledge_bases.indexing_job_retrieve_signed_url_response import IndexingJobRetrieveSignedURLResponse from ...types.knowledge_bases.indexing_job_retrieve_data_sources_response import IndexingJobRetrieveDataSourcesResponse __all__ = ["IndexingJobsResource", "AsyncIndexingJobsResource"] @@ -221,6 +222,42 @@ def retrieve_data_sources( cast_to=IndexingJobRetrieveDataSourcesResponse, ) + def retrieve_signed_url( + self, + indexing_job_uuid: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> IndexingJobRetrieveSignedURLResponse: + """ + To get a signed URL for indexing job details, send a GET request to + `/v2/gen-ai/indexing_jobs/{uuid}/details_signed_url`. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not indexing_job_uuid: + raise ValueError(f"Expected a non-empty value for `indexing_job_uuid` but received {indexing_job_uuid!r}") + return self._get( + f"/v2/gen-ai/indexing_jobs/{indexing_job_uuid}/details_signed_url" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/gen-ai/indexing_jobs/{indexing_job_uuid}/details_signed_url", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=IndexingJobRetrieveSignedURLResponse, + ) + def update_cancel( self, path_uuid: str, @@ -357,8 +394,7 @@ def wait_for_completion( elapsed = time.time() - start_time if elapsed >= timeout: raise IndexingJobTimeoutError( - f"Indexing job {uuid} did not complete within {timeout} seconds. " - f"Current phase: {phase}", + f"Indexing job {uuid} did not complete within {timeout} seconds. Current phase: {phase}", uuid=uuid, phase=phase, timeout=timeout, @@ -556,6 +592,42 @@ async def retrieve_data_sources( cast_to=IndexingJobRetrieveDataSourcesResponse, ) + async def retrieve_signed_url( + self, + indexing_job_uuid: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> IndexingJobRetrieveSignedURLResponse: + """ + To get a signed URL for indexing job details, send a GET request to + `/v2/gen-ai/indexing_jobs/{uuid}/details_signed_url`. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not indexing_job_uuid: + raise ValueError(f"Expected a non-empty value for `indexing_job_uuid` but received {indexing_job_uuid!r}") + return await self._get( + f"/v2/gen-ai/indexing_jobs/{indexing_job_uuid}/details_signed_url" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/gen-ai/indexing_jobs/{indexing_job_uuid}/details_signed_url", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=IndexingJobRetrieveSignedURLResponse, + ) + async def update_cancel( self, path_uuid: str, @@ -692,8 +764,7 @@ async def wait_for_completion( elapsed = time.time() - start_time if elapsed >= timeout: raise IndexingJobTimeoutError( - f"Indexing job {uuid} did not complete within {timeout} seconds. " - f"Current phase: {phase}", + f"Indexing job {uuid} did not complete within {timeout} seconds. Current phase: {phase}", uuid=uuid, phase=phase, timeout=timeout, @@ -719,6 +790,9 @@ def __init__(self, indexing_jobs: IndexingJobsResource) -> None: self.retrieve_data_sources = to_raw_response_wrapper( indexing_jobs.retrieve_data_sources, ) + self.retrieve_signed_url = to_raw_response_wrapper( + indexing_jobs.retrieve_signed_url, + ) self.update_cancel = to_raw_response_wrapper( indexing_jobs.update_cancel, ) @@ -743,6 +817,9 @@ def __init__(self, indexing_jobs: AsyncIndexingJobsResource) -> None: self.retrieve_data_sources = async_to_raw_response_wrapper( indexing_jobs.retrieve_data_sources, ) + self.retrieve_signed_url = async_to_raw_response_wrapper( + indexing_jobs.retrieve_signed_url, + ) self.update_cancel = async_to_raw_response_wrapper( indexing_jobs.update_cancel, ) @@ -767,6 +844,9 @@ def __init__(self, indexing_jobs: IndexingJobsResource) -> None: self.retrieve_data_sources = to_streamed_response_wrapper( indexing_jobs.retrieve_data_sources, ) + self.retrieve_signed_url = to_streamed_response_wrapper( + indexing_jobs.retrieve_signed_url, + ) self.update_cancel = to_streamed_response_wrapper( indexing_jobs.update_cancel, ) @@ -791,6 +871,9 @@ def __init__(self, indexing_jobs: AsyncIndexingJobsResource) -> None: self.retrieve_data_sources = async_to_streamed_response_wrapper( indexing_jobs.retrieve_data_sources, ) + self.retrieve_signed_url = async_to_streamed_response_wrapper( + indexing_jobs.retrieve_signed_url, + ) self.update_cancel = async_to_streamed_response_wrapper( indexing_jobs.update_cancel, ) diff --git a/src/gradient/resources/knowledge_bases/knowledge_bases.py b/src/gradient/resources/knowledge_bases/knowledge_bases.py index 4325148c..2378f7f4 100644 --- a/src/gradient/resources/knowledge_bases/knowledge_bases.py +++ b/src/gradient/resources/knowledge_bases/knowledge_bases.py @@ -8,8 +8,21 @@ import httpx -from ...types import knowledge_base_list_params, knowledge_base_create_params, knowledge_base_update_params -from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given +from ...types import ( + knowledge_base_list_params, + knowledge_base_create_params, + knowledge_base_update_params, +) +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 @@ -41,6 +54,9 @@ from ...types.knowledge_base_delete_response import KnowledgeBaseDeleteResponse from ...types.knowledge_base_update_response import KnowledgeBaseUpdateResponse from ...types.knowledge_base_retrieve_response import KnowledgeBaseRetrieveResponse +from ...types.knowledge_base_list_indexing_jobs_response import ( + KnowledgeBaseListIndexingJobsResponse, +) __all__ = [ "KnowledgeBasesResource", @@ -142,9 +158,11 @@ def create( timeout: Override the client-level default timeout for this request, in seconds """ return self._post( - "/v2/gen-ai/knowledge_bases" - if self._client._base_url_overridden - else "https://api.digitalocean.com/v2/gen-ai/knowledge_bases", + ( + "/v2/gen-ai/knowledge_bases" + if self._client._base_url_overridden + else "https://api.digitalocean.com/v2/gen-ai/knowledge_bases" + ), body=maybe_transform( { "database_id": database_id, @@ -159,7 +177,10 @@ def create( knowledge_base_create_params.KnowledgeBaseCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, ), cast_to=KnowledgeBaseCreateResponse, ) @@ -189,13 +210,20 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not uuid: - raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") + raise ValueError( + f"Expected a non-empty value for `uuid` but received {uuid!r}" + ) return self._get( - f"/v2/gen-ai/knowledge_bases/{uuid}" - if self._client._base_url_overridden - else f"https://api.digitalocean.com/v2/gen-ai/knowledge_bases/{uuid}", + ( + f"/v2/gen-ai/knowledge_bases/{uuid}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/gen-ai/knowledge_bases/{uuid}" + ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, ), cast_to=KnowledgeBaseRetrieveResponse, ) @@ -243,11 +271,15 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ if not path_uuid: - raise ValueError(f"Expected a non-empty value for `path_uuid` but received {path_uuid!r}") + raise ValueError( + f"Expected a non-empty value for `path_uuid` but received {path_uuid!r}" + ) return self._put( - f"/v2/gen-ai/knowledge_bases/{path_uuid}" - if self._client._base_url_overridden - else f"https://api.digitalocean.com/v2/gen-ai/knowledge_bases/{path_uuid}", + ( + f"/v2/gen-ai/knowledge_bases/{path_uuid}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/gen-ai/knowledge_bases/{path_uuid}" + ), body=maybe_transform( { "database_id": database_id, @@ -260,7 +292,10 @@ def update( knowledge_base_update_params.KnowledgeBaseUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, ), cast_to=KnowledgeBaseUpdateResponse, ) @@ -294,9 +329,11 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ return self._get( - "/v2/gen-ai/knowledge_bases" - if self._client._base_url_overridden - else "https://api.digitalocean.com/v2/gen-ai/knowledge_bases", + ( + "/v2/gen-ai/knowledge_bases" + if self._client._base_url_overridden + else "https://api.digitalocean.com/v2/gen-ai/knowledge_bases" + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -338,13 +375,20 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ if not uuid: - raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") + raise ValueError( + f"Expected a non-empty value for `uuid` but received {uuid!r}" + ) return self._delete( - f"/v2/gen-ai/knowledge_bases/{uuid}" - if self._client._base_url_overridden - else f"https://api.digitalocean.com/v2/gen-ai/knowledge_bases/{uuid}", + ( + f"/v2/gen-ai/knowledge_bases/{uuid}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/gen-ai/knowledge_bases/{uuid}" + ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, ), cast_to=KnowledgeBaseDeleteResponse, ) @@ -390,7 +434,9 @@ def wait_for_database( KnowledgeBaseTimeoutError: If the timeout is exceeded before the database becomes ONLINE """ if not uuid: - raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") + raise ValueError( + f"Expected a non-empty value for `uuid` but received {uuid!r}" + ) start_time = time.time() failed_states = {"DECOMMISSIONED", "UNHEALTHY"} @@ -416,7 +462,9 @@ def wait_for_database( return response if status in failed_states: - raise KnowledgeBaseDatabaseError(f"Knowledge base database entered failed state: {status}") + raise KnowledgeBaseDatabaseError( + f"Knowledge base database entered failed state: {status}" + ) # Sleep before next poll, but don't exceed timeout remaining_time = timeout - elapsed @@ -424,6 +472,49 @@ def wait_for_database( if sleep_time > 0: time.sleep(sleep_time) + def list_indexing_jobs( + self, + knowledge_base_uuid: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> KnowledgeBaseListIndexingJobsResponse: + """ + To list latest 15 indexing jobs for a knowledge base, send a GET request to + `/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/indexing_jobs`. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not knowledge_base_uuid: + raise ValueError( + f"Expected a non-empty value for `knowledge_base_uuid` but received {knowledge_base_uuid!r}" + ) + return self._get( + ( + f"/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/indexing_jobs" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/indexing_jobs" + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + cast_to=KnowledgeBaseListIndexingJobsResponse, + ) + class AsyncKnowledgeBasesResource(AsyncAPIResource): @cached_property @@ -445,7 +536,9 @@ def with_raw_response(self) -> AsyncKnowledgeBasesResourceWithRawResponse: return AsyncKnowledgeBasesResourceWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncKnowledgeBasesResourceWithStreamingResponse: + def with_streaming_response( + self, + ) -> AsyncKnowledgeBasesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. @@ -505,9 +598,11 @@ async def create( timeout: Override the client-level default timeout for this request, in seconds """ return await self._post( - "/v2/gen-ai/knowledge_bases" - if self._client._base_url_overridden - else "https://api.digitalocean.com/v2/gen-ai/knowledge_bases", + ( + "/v2/gen-ai/knowledge_bases" + if self._client._base_url_overridden + else "https://api.digitalocean.com/v2/gen-ai/knowledge_bases" + ), body=await async_maybe_transform( { "database_id": database_id, @@ -522,7 +617,10 @@ async def create( knowledge_base_create_params.KnowledgeBaseCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, ), cast_to=KnowledgeBaseCreateResponse, ) @@ -552,13 +650,20 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not uuid: - raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") + raise ValueError( + f"Expected a non-empty value for `uuid` but received {uuid!r}" + ) return await self._get( - f"/v2/gen-ai/knowledge_bases/{uuid}" - if self._client._base_url_overridden - else f"https://api.digitalocean.com/v2/gen-ai/knowledge_bases/{uuid}", + ( + f"/v2/gen-ai/knowledge_bases/{uuid}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/gen-ai/knowledge_bases/{uuid}" + ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, ), cast_to=KnowledgeBaseRetrieveResponse, ) @@ -606,11 +711,15 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ if not path_uuid: - raise ValueError(f"Expected a non-empty value for `path_uuid` but received {path_uuid!r}") + raise ValueError( + f"Expected a non-empty value for `path_uuid` but received {path_uuid!r}" + ) return await self._put( - f"/v2/gen-ai/knowledge_bases/{path_uuid}" - if self._client._base_url_overridden - else f"https://api.digitalocean.com/v2/gen-ai/knowledge_bases/{path_uuid}", + ( + f"/v2/gen-ai/knowledge_bases/{path_uuid}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/gen-ai/knowledge_bases/{path_uuid}" + ), body=await async_maybe_transform( { "database_id": database_id, @@ -623,7 +732,10 @@ async def update( knowledge_base_update_params.KnowledgeBaseUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, ), cast_to=KnowledgeBaseUpdateResponse, ) @@ -657,9 +769,11 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ return await self._get( - "/v2/gen-ai/knowledge_bases" - if self._client._base_url_overridden - else "https://api.digitalocean.com/v2/gen-ai/knowledge_bases", + ( + "/v2/gen-ai/knowledge_bases" + if self._client._base_url_overridden + else "https://api.digitalocean.com/v2/gen-ai/knowledge_bases" + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -701,13 +815,20 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ if not uuid: - raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") + raise ValueError( + f"Expected a non-empty value for `uuid` but received {uuid!r}" + ) return await self._delete( - f"/v2/gen-ai/knowledge_bases/{uuid}" - if self._client._base_url_overridden - else f"https://api.digitalocean.com/v2/gen-ai/knowledge_bases/{uuid}", + ( + f"/v2/gen-ai/knowledge_bases/{uuid}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/gen-ai/knowledge_bases/{uuid}" + ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, ), cast_to=KnowledgeBaseDeleteResponse, ) @@ -753,7 +874,9 @@ async def wait_for_database( KnowledgeBaseTimeoutError: If the timeout is exceeded before the database becomes ONLINE """ if not uuid: - raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") + raise ValueError( + f"Expected a non-empty value for `uuid` but received {uuid!r}" + ) start_time = time.time() failed_states = {"DECOMMISSIONED", "UNHEALTHY"} @@ -779,7 +902,9 @@ async def wait_for_database( return response if status in failed_states: - raise KnowledgeBaseDatabaseError(f"Knowledge base database entered failed state: {status}") + raise KnowledgeBaseDatabaseError( + f"Knowledge base database entered failed state: {status}" + ) # Sleep before next poll, but don't exceed timeout remaining_time = timeout - elapsed @@ -787,6 +912,49 @@ async def wait_for_database( if sleep_time > 0: await asyncio.sleep(sleep_time) + async def list_indexing_jobs( + self, + knowledge_base_uuid: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> KnowledgeBaseListIndexingJobsResponse: + """ + To list latest 15 indexing jobs for a knowledge base, send a GET request to + `/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/indexing_jobs`. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not knowledge_base_uuid: + raise ValueError( + f"Expected a non-empty value for `knowledge_base_uuid` but received {knowledge_base_uuid!r}" + ) + return await self._get( + ( + f"/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/indexing_jobs" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/indexing_jobs" + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + ), + cast_to=KnowledgeBaseListIndexingJobsResponse, + ) + class KnowledgeBasesResourceWithRawResponse: def __init__(self, knowledge_bases: KnowledgeBasesResource) -> None: @@ -810,6 +978,9 @@ def __init__(self, knowledge_bases: KnowledgeBasesResource) -> None: self.wait_for_database = to_raw_response_wrapper( knowledge_bases.wait_for_database, ) + self.list_indexing_jobs = to_raw_response_wrapper( + knowledge_bases.list_indexing_jobs, + ) @cached_property def data_sources(self) -> DataSourcesResourceWithRawResponse: @@ -842,14 +1013,21 @@ def __init__(self, knowledge_bases: AsyncKnowledgeBasesResource) -> None: self.wait_for_database = async_to_raw_response_wrapper( knowledge_bases.wait_for_database, ) + self.list_indexing_jobs = async_to_raw_response_wrapper( + knowledge_bases.list_indexing_jobs, + ) @cached_property def data_sources(self) -> AsyncDataSourcesResourceWithRawResponse: - return AsyncDataSourcesResourceWithRawResponse(self._knowledge_bases.data_sources) + return AsyncDataSourcesResourceWithRawResponse( + self._knowledge_bases.data_sources + ) @cached_property def indexing_jobs(self) -> AsyncIndexingJobsResourceWithRawResponse: - return AsyncIndexingJobsResourceWithRawResponse(self._knowledge_bases.indexing_jobs) + return AsyncIndexingJobsResourceWithRawResponse( + self._knowledge_bases.indexing_jobs + ) class KnowledgeBasesResourceWithStreamingResponse: @@ -874,14 +1052,21 @@ def __init__(self, knowledge_bases: KnowledgeBasesResource) -> None: self.wait_for_database = to_streamed_response_wrapper( knowledge_bases.wait_for_database, ) + self.list_indexing_jobs = to_streamed_response_wrapper( + knowledge_bases.list_indexing_jobs, + ) @cached_property def data_sources(self) -> DataSourcesResourceWithStreamingResponse: - return DataSourcesResourceWithStreamingResponse(self._knowledge_bases.data_sources) + return DataSourcesResourceWithStreamingResponse( + self._knowledge_bases.data_sources + ) @cached_property def indexing_jobs(self) -> IndexingJobsResourceWithStreamingResponse: - return IndexingJobsResourceWithStreamingResponse(self._knowledge_bases.indexing_jobs) + return IndexingJobsResourceWithStreamingResponse( + self._knowledge_bases.indexing_jobs + ) class AsyncKnowledgeBasesResourceWithStreamingResponse: @@ -906,11 +1091,18 @@ def __init__(self, knowledge_bases: AsyncKnowledgeBasesResource) -> None: self.wait_for_database = async_to_streamed_response_wrapper( knowledge_bases.wait_for_database, ) + self.list_indexing_jobs = async_to_streamed_response_wrapper( + knowledge_bases.list_indexing_jobs, + ) @cached_property def data_sources(self) -> AsyncDataSourcesResourceWithStreamingResponse: - return AsyncDataSourcesResourceWithStreamingResponse(self._knowledge_bases.data_sources) + return AsyncDataSourcesResourceWithStreamingResponse( + self._knowledge_bases.data_sources + ) @cached_property def indexing_jobs(self) -> AsyncIndexingJobsResourceWithStreamingResponse: - return AsyncIndexingJobsResourceWithStreamingResponse(self._knowledge_bases.indexing_jobs) + return AsyncIndexingJobsResourceWithStreamingResponse( + self._knowledge_bases.indexing_jobs + ) diff --git a/src/gradient/resources/nfs/__init__.py b/src/gradient/resources/nfs/__init__.py new file mode 100644 index 00000000..28f843c0 --- /dev/null +++ b/src/gradient/resources/nfs/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .nfs import ( + NfsResource, + AsyncNfsResource, + NfsResourceWithRawResponse, + AsyncNfsResourceWithRawResponse, + NfsResourceWithStreamingResponse, + AsyncNfsResourceWithStreamingResponse, +) +from .snapshots import ( + SnapshotsResource, + AsyncSnapshotsResource, + SnapshotsResourceWithRawResponse, + AsyncSnapshotsResourceWithRawResponse, + SnapshotsResourceWithStreamingResponse, + AsyncSnapshotsResourceWithStreamingResponse, +) + +__all__ = [ + "SnapshotsResource", + "AsyncSnapshotsResource", + "SnapshotsResourceWithRawResponse", + "AsyncSnapshotsResourceWithRawResponse", + "SnapshotsResourceWithStreamingResponse", + "AsyncSnapshotsResourceWithStreamingResponse", + "NfsResource", + "AsyncNfsResource", + "NfsResourceWithRawResponse", + "AsyncNfsResourceWithRawResponse", + "NfsResourceWithStreamingResponse", + "AsyncNfsResourceWithStreamingResponse", +] diff --git a/src/gradient/resources/nfs/nfs.py b/src/gradient/resources/nfs/nfs.py new file mode 100644 index 00000000..1510bb69 --- /dev/null +++ b/src/gradient/resources/nfs/nfs.py @@ -0,0 +1,780 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, overload + +import httpx + +from ...types import nf_list_params, nf_create_params, nf_delete_params, nf_retrieve_params, nf_initiate_action_params +from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given +from ..._utils import required_args, maybe_transform, async_maybe_transform +from ..._compat import cached_property +from .snapshots import ( + SnapshotsResource, + AsyncSnapshotsResource, + SnapshotsResourceWithRawResponse, + AsyncSnapshotsResourceWithRawResponse, + SnapshotsResourceWithStreamingResponse, + AsyncSnapshotsResourceWithStreamingResponse, +) +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.nf_list_response import NfListResponse +from ...types.nf_create_response import NfCreateResponse +from ...types.nf_retrieve_response import NfRetrieveResponse +from ...types.nf_initiate_action_response import NfInitiateActionResponse + +__all__ = ["NfsResource", "AsyncNfsResource"] + + +class NfsResource(SyncAPIResource): + @cached_property + def snapshots(self) -> SnapshotsResource: + return SnapshotsResource(self._client) + + @cached_property + def with_raw_response(self) -> NfsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return NfsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> NfsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return NfsResourceWithStreamingResponse(self) + + def create( + self, + *, + name: str, + region: str, + size_gib: int, + vpc_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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NfCreateResponse: + """ + To create a new NFS share, send a POST request to `/v2/nfs`. + + Args: + name: The human-readable name of the share. + + region: The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides. + + size_gib: The desired/provisioned size of the share in GiB (Gibibytes). Must be >= 50. + + vpc_ids: List of VPC IDs that should be able to access the share. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/v2/nfs" if self._client._base_url_overridden else "https://api.digitalocean.com/v2/nfs", + body=maybe_transform( + { + "name": name, + "region": region, + "size_gib": size_gib, + "vpc_ids": vpc_ids, + }, + nf_create_params.NfCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NfCreateResponse, + ) + + def retrieve( + self, + nfs_id: str, + *, + region: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NfRetrieveResponse: + """ + To get an NFS share, send a GET request to `/v2/nfs/{nfs_id}?region=${region}`. + + A successful request will return the NFS share. + + Args: + region: The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not nfs_id: + raise ValueError(f"Expected a non-empty value for `nfs_id` but received {nfs_id!r}") + return self._get( + f"/v2/nfs/{nfs_id}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/nfs/{nfs_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"region": region}, nf_retrieve_params.NfRetrieveParams), + ), + cast_to=NfRetrieveResponse, + ) + + def list( + self, + *, + region: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NfListResponse: + """ + To list NFS shares, send a GET request to `/v2/nfs?region=${region}`. + + A successful request will return all NFS shares belonging to the authenticated + user. + + Args: + region: The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/v2/nfs" if self._client._base_url_overridden else "https://api.digitalocean.com/v2/nfs", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"region": region}, nf_list_params.NfListParams), + ), + cast_to=NfListResponse, + ) + + def delete( + self, + nfs_id: str, + *, + region: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> None: + """ + To delete an NFS share, send a DELETE request to + `/v2/nfs/{nfs_id}?region=${region}`. + + A successful request will return a `204 No Content` status code. + + Args: + region: The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not nfs_id: + raise ValueError(f"Expected a non-empty value for `nfs_id` but received {nfs_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return self._delete( + f"/v2/nfs/{nfs_id}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/nfs/{nfs_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"region": region}, nf_delete_params.NfDeleteParams), + ), + cast_to=NoneType, + ) + + @overload + def initiate_action( + self, + nfs_id: str, + *, + region: str, + type: Literal["resize", "snapshot"], + params: nf_initiate_action_params.NfsActionResizeParams | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NfInitiateActionResponse: + """ + To execute an action (such as resize) on a specified NFS share, send a POST + request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the + `type` attribute to on of the supported action types: + + | Action | Details | + | ----------------------- | -------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + + Args: + region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. + + type: The type of action to initiate for the NFS share (such as resize or snapshot). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def initiate_action( + self, + nfs_id: str, + *, + region: str, + type: Literal["resize", "snapshot"], + params: nf_initiate_action_params.NfsActionSnapshotParams | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NfInitiateActionResponse: + """ + To execute an action (such as resize) on a specified NFS share, send a POST + request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the + `type` attribute to on of the supported action types: + + | Action | Details | + | ----------------------- | -------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + + Args: + region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. + + type: The type of action to initiate for the NFS share (such as resize or snapshot). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["region", "type"]) + def initiate_action( + self, + nfs_id: str, + *, + region: str, + type: Literal["resize", "snapshot"], + params: nf_initiate_action_params.NfsActionResizeParams + | nf_initiate_action_params.NfsActionSnapshotParams + | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NfInitiateActionResponse: + if not nfs_id: + raise ValueError(f"Expected a non-empty value for `nfs_id` but received {nfs_id!r}") + return self._post( + f"/v2/nfs/{nfs_id}/actions" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/nfs/{nfs_id}/actions", + body=maybe_transform( + { + "region": region, + "type": type, + "params": params, + }, + nf_initiate_action_params.NfInitiateActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NfInitiateActionResponse, + ) + + +class AsyncNfsResource(AsyncAPIResource): + @cached_property + def snapshots(self) -> AsyncSnapshotsResource: + return AsyncSnapshotsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncNfsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return AsyncNfsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncNfsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return AsyncNfsResourceWithStreamingResponse(self) + + async def create( + self, + *, + name: str, + region: str, + size_gib: int, + vpc_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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NfCreateResponse: + """ + To create a new NFS share, send a POST request to `/v2/nfs`. + + Args: + name: The human-readable name of the share. + + region: The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides. + + size_gib: The desired/provisioned size of the share in GiB (Gibibytes). Must be >= 50. + + vpc_ids: List of VPC IDs that should be able to access the share. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/v2/nfs" if self._client._base_url_overridden else "https://api.digitalocean.com/v2/nfs", + body=await async_maybe_transform( + { + "name": name, + "region": region, + "size_gib": size_gib, + "vpc_ids": vpc_ids, + }, + nf_create_params.NfCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NfCreateResponse, + ) + + async def retrieve( + self, + nfs_id: str, + *, + region: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NfRetrieveResponse: + """ + To get an NFS share, send a GET request to `/v2/nfs/{nfs_id}?region=${region}`. + + A successful request will return the NFS share. + + Args: + region: The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not nfs_id: + raise ValueError(f"Expected a non-empty value for `nfs_id` but received {nfs_id!r}") + return await self._get( + f"/v2/nfs/{nfs_id}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/nfs/{nfs_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"region": region}, nf_retrieve_params.NfRetrieveParams), + ), + cast_to=NfRetrieveResponse, + ) + + async def list( + self, + *, + region: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NfListResponse: + """ + To list NFS shares, send a GET request to `/v2/nfs?region=${region}`. + + A successful request will return all NFS shares belonging to the authenticated + user. + + Args: + region: The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/v2/nfs" if self._client._base_url_overridden else "https://api.digitalocean.com/v2/nfs", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"region": region}, nf_list_params.NfListParams), + ), + cast_to=NfListResponse, + ) + + async def delete( + self, + nfs_id: str, + *, + region: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> None: + """ + To delete an NFS share, send a DELETE request to + `/v2/nfs/{nfs_id}?region=${region}`. + + A successful request will return a `204 No Content` status code. + + Args: + region: The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not nfs_id: + raise ValueError(f"Expected a non-empty value for `nfs_id` but received {nfs_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return await self._delete( + f"/v2/nfs/{nfs_id}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/nfs/{nfs_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"region": region}, nf_delete_params.NfDeleteParams), + ), + cast_to=NoneType, + ) + + @overload + async def initiate_action( + self, + nfs_id: str, + *, + region: str, + type: Literal["resize", "snapshot"], + params: nf_initiate_action_params.NfsActionResizeParams | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NfInitiateActionResponse: + """ + To execute an action (such as resize) on a specified NFS share, send a POST + request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the + `type` attribute to on of the supported action types: + + | Action | Details | + | ----------------------- | -------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + + Args: + region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. + + type: The type of action to initiate for the NFS share (such as resize or snapshot). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def initiate_action( + self, + nfs_id: str, + *, + region: str, + type: Literal["resize", "snapshot"], + params: nf_initiate_action_params.NfsActionSnapshotParams | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NfInitiateActionResponse: + """ + To execute an action (such as resize) on a specified NFS share, send a POST + request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the + `type` attribute to on of the supported action types: + + | Action | Details | + | ----------------------- | -------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + + Args: + region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. + + type: The type of action to initiate for the NFS share (such as resize or snapshot). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["region", "type"]) + async def initiate_action( + self, + nfs_id: str, + *, + region: str, + type: Literal["resize", "snapshot"], + params: nf_initiate_action_params.NfsActionResizeParams + | nf_initiate_action_params.NfsActionSnapshotParams + | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NfInitiateActionResponse: + if not nfs_id: + raise ValueError(f"Expected a non-empty value for `nfs_id` but received {nfs_id!r}") + return await self._post( + f"/v2/nfs/{nfs_id}/actions" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/nfs/{nfs_id}/actions", + body=await async_maybe_transform( + { + "region": region, + "type": type, + "params": params, + }, + nf_initiate_action_params.NfInitiateActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NfInitiateActionResponse, + ) + + +class NfsResourceWithRawResponse: + def __init__(self, nfs: NfsResource) -> None: + self._nfs = nfs + + self.create = to_raw_response_wrapper( + nfs.create, + ) + self.retrieve = to_raw_response_wrapper( + nfs.retrieve, + ) + self.list = to_raw_response_wrapper( + nfs.list, + ) + self.delete = to_raw_response_wrapper( + nfs.delete, + ) + self.initiate_action = to_raw_response_wrapper( + nfs.initiate_action, + ) + + @cached_property + def snapshots(self) -> SnapshotsResourceWithRawResponse: + return SnapshotsResourceWithRawResponse(self._nfs.snapshots) + + +class AsyncNfsResourceWithRawResponse: + def __init__(self, nfs: AsyncNfsResource) -> None: + self._nfs = nfs + + self.create = async_to_raw_response_wrapper( + nfs.create, + ) + self.retrieve = async_to_raw_response_wrapper( + nfs.retrieve, + ) + self.list = async_to_raw_response_wrapper( + nfs.list, + ) + self.delete = async_to_raw_response_wrapper( + nfs.delete, + ) + self.initiate_action = async_to_raw_response_wrapper( + nfs.initiate_action, + ) + + @cached_property + def snapshots(self) -> AsyncSnapshotsResourceWithRawResponse: + return AsyncSnapshotsResourceWithRawResponse(self._nfs.snapshots) + + +class NfsResourceWithStreamingResponse: + def __init__(self, nfs: NfsResource) -> None: + self._nfs = nfs + + self.create = to_streamed_response_wrapper( + nfs.create, + ) + self.retrieve = to_streamed_response_wrapper( + nfs.retrieve, + ) + self.list = to_streamed_response_wrapper( + nfs.list, + ) + self.delete = to_streamed_response_wrapper( + nfs.delete, + ) + self.initiate_action = to_streamed_response_wrapper( + nfs.initiate_action, + ) + + @cached_property + def snapshots(self) -> SnapshotsResourceWithStreamingResponse: + return SnapshotsResourceWithStreamingResponse(self._nfs.snapshots) + + +class AsyncNfsResourceWithStreamingResponse: + def __init__(self, nfs: AsyncNfsResource) -> None: + self._nfs = nfs + + self.create = async_to_streamed_response_wrapper( + nfs.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + nfs.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + nfs.list, + ) + self.delete = async_to_streamed_response_wrapper( + nfs.delete, + ) + self.initiate_action = async_to_streamed_response_wrapper( + nfs.initiate_action, + ) + + @cached_property + def snapshots(self) -> AsyncSnapshotsResourceWithStreamingResponse: + return AsyncSnapshotsResourceWithStreamingResponse(self._nfs.snapshots) diff --git a/src/gradient/resources/nfs/snapshots.py b/src/gradient/resources/nfs/snapshots.py new file mode 100644 index 00000000..65b56e03 --- /dev/null +++ b/src/gradient/resources/nfs/snapshots.py @@ -0,0 +1,418 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +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 +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...types.nfs import snapshot_list_params, snapshot_delete_params, snapshot_retrieve_params +from ..._base_client import make_request_options +from ...types.nfs.snapshot_list_response import SnapshotListResponse +from ...types.nfs.snapshot_retrieve_response import SnapshotRetrieveResponse + +__all__ = ["SnapshotsResource", "AsyncSnapshotsResource"] + + +class SnapshotsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> SnapshotsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return SnapshotsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> SnapshotsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return SnapshotsResourceWithStreamingResponse(self) + + def retrieve( + self, + nfs_snapshot_id: str, + *, + region: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SnapshotRetrieveResponse: + """ + To get an NFS snapshot, send a GET request to + `/v2/nfs/snapshots/{nfs_snapshot_id}?region=${region}`. + + A successful request will return the NFS snapshot. + + Args: + region: The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not nfs_snapshot_id: + raise ValueError(f"Expected a non-empty value for `nfs_snapshot_id` but received {nfs_snapshot_id!r}") + return self._get( + f"/v2/nfs/snapshots/{nfs_snapshot_id}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/nfs/snapshots/{nfs_snapshot_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"region": region}, snapshot_retrieve_params.SnapshotRetrieveParams), + ), + cast_to=SnapshotRetrieveResponse, + ) + + def list( + self, + *, + region: str, + share_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, + ) -> SnapshotListResponse: + """ + To list all NFS snapshots, send a GET request to + `/v2/nfs/snapshots?region=${region}&share_id={share_id}`. + + A successful request will return all NFS snapshots belonging to the + authenticated user in the specified region. + + Optionally, you can filter snapshots by a specific NFS share by including the + `share_id` query parameter. + + Args: + region: The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides. + + share_id: The unique ID of an NFS share. If provided, only snapshots of this specific + share will be returned. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/v2/nfs/snapshots" + if self._client._base_url_overridden + else "https://api.digitalocean.com/v2/nfs/snapshots", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "region": region, + "share_id": share_id, + }, + snapshot_list_params.SnapshotListParams, + ), + ), + cast_to=SnapshotListResponse, + ) + + def delete( + self, + nfs_snapshot_id: str, + *, + region: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> None: + """ + To delete an NFS snapshot, send a DELETE request to + `/v2/nfs/snapshots/{nfs_snapshot_id}?region=${region}`. + + A successful request will return a `204 No Content` status code. + + Args: + region: The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not nfs_snapshot_id: + raise ValueError(f"Expected a non-empty value for `nfs_snapshot_id` but received {nfs_snapshot_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return self._delete( + f"/v2/nfs/snapshots/{nfs_snapshot_id}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/nfs/snapshots/{nfs_snapshot_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"region": region}, snapshot_delete_params.SnapshotDeleteParams), + ), + cast_to=NoneType, + ) + + +class AsyncSnapshotsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncSnapshotsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return AsyncSnapshotsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncSnapshotsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return AsyncSnapshotsResourceWithStreamingResponse(self) + + async def retrieve( + self, + nfs_snapshot_id: str, + *, + region: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SnapshotRetrieveResponse: + """ + To get an NFS snapshot, send a GET request to + `/v2/nfs/snapshots/{nfs_snapshot_id}?region=${region}`. + + A successful request will return the NFS snapshot. + + Args: + region: The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not nfs_snapshot_id: + raise ValueError(f"Expected a non-empty value for `nfs_snapshot_id` but received {nfs_snapshot_id!r}") + return await self._get( + f"/v2/nfs/snapshots/{nfs_snapshot_id}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/nfs/snapshots/{nfs_snapshot_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"region": region}, snapshot_retrieve_params.SnapshotRetrieveParams), + ), + cast_to=SnapshotRetrieveResponse, + ) + + async def list( + self, + *, + region: str, + share_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, + ) -> SnapshotListResponse: + """ + To list all NFS snapshots, send a GET request to + `/v2/nfs/snapshots?region=${region}&share_id={share_id}`. + + A successful request will return all NFS snapshots belonging to the + authenticated user in the specified region. + + Optionally, you can filter snapshots by a specific NFS share by including the + `share_id` query parameter. + + Args: + region: The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides. + + share_id: The unique ID of an NFS share. If provided, only snapshots of this specific + share will be returned. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/v2/nfs/snapshots" + if self._client._base_url_overridden + else "https://api.digitalocean.com/v2/nfs/snapshots", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "region": region, + "share_id": share_id, + }, + snapshot_list_params.SnapshotListParams, + ), + ), + cast_to=SnapshotListResponse, + ) + + async def delete( + self, + nfs_snapshot_id: str, + *, + region: 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, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> None: + """ + To delete an NFS snapshot, send a DELETE request to + `/v2/nfs/snapshots/{nfs_snapshot_id}?region=${region}`. + + A successful request will return a `204 No Content` status code. + + Args: + region: The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not nfs_snapshot_id: + raise ValueError(f"Expected a non-empty value for `nfs_snapshot_id` but received {nfs_snapshot_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return await self._delete( + f"/v2/nfs/snapshots/{nfs_snapshot_id}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/nfs/snapshots/{nfs_snapshot_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"region": region}, snapshot_delete_params.SnapshotDeleteParams), + ), + cast_to=NoneType, + ) + + +class SnapshotsResourceWithRawResponse: + def __init__(self, snapshots: SnapshotsResource) -> None: + self._snapshots = snapshots + + self.retrieve = to_raw_response_wrapper( + snapshots.retrieve, + ) + self.list = to_raw_response_wrapper( + snapshots.list, + ) + self.delete = to_raw_response_wrapper( + snapshots.delete, + ) + + +class AsyncSnapshotsResourceWithRawResponse: + def __init__(self, snapshots: AsyncSnapshotsResource) -> None: + self._snapshots = snapshots + + self.retrieve = async_to_raw_response_wrapper( + snapshots.retrieve, + ) + self.list = async_to_raw_response_wrapper( + snapshots.list, + ) + self.delete = async_to_raw_response_wrapper( + snapshots.delete, + ) + + +class SnapshotsResourceWithStreamingResponse: + def __init__(self, snapshots: SnapshotsResource) -> None: + self._snapshots = snapshots + + self.retrieve = to_streamed_response_wrapper( + snapshots.retrieve, + ) + self.list = to_streamed_response_wrapper( + snapshots.list, + ) + self.delete = to_streamed_response_wrapper( + snapshots.delete, + ) + + +class AsyncSnapshotsResourceWithStreamingResponse: + def __init__(self, snapshots: AsyncSnapshotsResource) -> None: + self._snapshots = snapshots + + self.retrieve = async_to_streamed_response_wrapper( + snapshots.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + snapshots.list, + ) + self.delete = async_to_streamed_response_wrapper( + snapshots.delete, + ) diff --git a/src/gradient/types/__init__.py b/src/gradient/types/__init__.py index 1299779c..58d45641 100644 --- a/src/gradient/types/__init__.py +++ b/src/gradient/types/__init__.py @@ -52,17 +52,24 @@ from .api_model import APIModel as APIModel from .api_agreement import APIAgreement as APIAgreement from .api_workspace import APIWorkspace as APIWorkspace +from .nf_list_params import NfListParams as NfListParams from .api_agent_model import APIAgentModel as APIAgentModel +from .nf_create_params import NfCreateParams as NfCreateParams +from .nf_delete_params import NfDeleteParams as NfDeleteParams +from .nf_list_response import NfListResponse as NfListResponse from .agent_list_params import AgentListParams as AgentListParams from .api_model_version import APIModelVersion as APIModelVersion from .model_list_params import ModelListParams as ModelListParams from .api_knowledge_base import APIKnowledgeBase as APIKnowledgeBase +from .nf_create_response import NfCreateResponse as NfCreateResponse +from .nf_retrieve_params import NfRetrieveParams as NfRetrieveParams from .region_list_params import RegionListParams as RegionListParams from .agent_create_params import AgentCreateParams as AgentCreateParams from .agent_list_response import AgentListResponse as AgentListResponse from .agent_update_params import AgentUpdateParams as AgentUpdateParams from .model_list_response import ModelListResponse as ModelListResponse from .api_retrieval_method import APIRetrievalMethod as APIRetrievalMethod +from .nf_retrieve_response import NfRetrieveResponse as NfRetrieveResponse from .region_list_response import RegionListResponse as RegionListResponse from .agent_create_response import AgentCreateResponse as AgentCreateResponse from .agent_delete_response import AgentDeleteResponse as AgentDeleteResponse @@ -77,6 +84,7 @@ from .api_deployment_visibility import APIDeploymentVisibility as APIDeploymentVisibility from .gpu_droplet_create_params import GPUDropletCreateParams as GPUDropletCreateParams from .gpu_droplet_list_response import GPUDropletListResponse as GPUDropletListResponse +from .nf_initiate_action_params import NfInitiateActionParams as NfInitiateActionParams from .agent_update_status_params import ( AgentUpdateStatusParams as AgentUpdateStatusParams, ) @@ -91,6 +99,7 @@ from .gpu_droplet_create_response import ( GPUDropletCreateResponse as GPUDropletCreateResponse, ) +from .nf_initiate_action_response import NfInitiateActionResponse as NfInitiateActionResponse from .agent_update_status_response import ( AgentUpdateStatusResponse as AgentUpdateStatusResponse, ) @@ -153,6 +162,9 @@ agent_list_response, # type: ignore # noqa: F401 agent_move_response, # type: ignore # noqa: F401 ) +from .knowledge_base_list_indexing_jobs_response import ( + KnowledgeBaseListIndexingJobsResponse as KnowledgeBaseListIndexingJobsResponse, +) # Rebuild cyclical models only after all modules are imported. # This ensures that, when building the deferred (due to cyclical references) model schema, diff --git a/src/gradient/types/agent_create_params.py b/src/gradient/types/agent_create_params.py index db84a258..343c5d70 100644 --- a/src/gradient/types/agent_create_params.py +++ b/src/gradient/types/agent_create_params.py @@ -28,6 +28,8 @@ class AgentCreateParams(TypedDict, total=False): knowledge_base_uuid: SequenceNotStr[str] """Ids of the knowledge base(s) to attach to the agent""" + model_provider_key_uuid: str + model_uuid: str """Identifier for the foundation model.""" @@ -45,3 +47,6 @@ class AgentCreateParams(TypedDict, total=False): tags: SequenceNotStr[str] """Agent tag to organize related resources""" + + workspace_uuid: str + """Identifier for the workspace""" diff --git a/src/gradient/types/agent_list_response.py b/src/gradient/types/agent_list_response.py index 7a64c66e..c461f152 100644 --- a/src/gradient/types/agent_list_response.py +++ b/src/gradient/types/agent_list_response.py @@ -24,6 +24,8 @@ class AgentChatbot(BaseModel): + allowed_domains: Optional[List[str]] = None + button_background_color: Optional[str] = None logo: Optional[str] = None @@ -61,6 +63,7 @@ class AgentDeployment(BaseModel): "STATUS_UNDEPLOYING", "STATUS_UNDEPLOYMENT_FAILED", "STATUS_DELETED", + "STATUS_BUILDING", ] ] = None diff --git a/src/gradient/types/agent_update_params.py b/src/gradient/types/agent_update_params.py index 75c30cba..5026beaa 100644 --- a/src/gradient/types/agent_update_params.py +++ b/src/gradient/types/agent_update_params.py @@ -14,6 +14,12 @@ class AgentUpdateParams(TypedDict, total=False): agent_log_insights_enabled: bool + allowed_domains: SequenceNotStr[str] + """ + Optional list of allowed domains for the chatbot - Must use fully qualified + domain name (FQDN) such as https://example.com + """ + anthropic_key_uuid: str """Optional anthropic key uuid for use with anthropic models""" @@ -41,6 +47,9 @@ class AgentUpdateParams(TypedDict, total=False): response. """ + model_provider_key_uuid: str + """Optional Model Provider uuid for use with provider models""" + model_uuid: str """Identifier for the foundation model.""" diff --git a/src/gradient/types/agents/evaluation_metrics/__init__.py b/src/gradient/types/agents/evaluation_metrics/__init__.py index 01ce5ed2..ade2b376 100644 --- a/src/gradient/types/agents/evaluation_metrics/__init__.py +++ b/src/gradient/types/agents/evaluation_metrics/__init__.py @@ -18,6 +18,10 @@ from .oauth2_generate_url_params import Oauth2GenerateURLParams as Oauth2GenerateURLParams from .workspace_retrieve_response import WorkspaceRetrieveResponse as WorkspaceRetrieveResponse from .oauth2_generate_url_response import Oauth2GenerateURLResponse as Oauth2GenerateURLResponse +from .scheduled_indexing_create_params import ScheduledIndexingCreateParams as ScheduledIndexingCreateParams +from .scheduled_indexing_create_response import ScheduledIndexingCreateResponse as ScheduledIndexingCreateResponse +from .scheduled_indexing_delete_response import ScheduledIndexingDeleteResponse as ScheduledIndexingDeleteResponse +from .scheduled_indexing_retrieve_response import ScheduledIndexingRetrieveResponse as ScheduledIndexingRetrieveResponse from .workspace_list_evaluation_test_cases_response import ( WorkspaceListEvaluationTestCasesResponse as WorkspaceListEvaluationTestCasesResponse, ) diff --git a/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_create_params.py b/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_create_params.py new file mode 100644 index 00000000..209766b4 --- /dev/null +++ b/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_create_params.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import TypedDict + +__all__ = ["ScheduledIndexingCreateParams"] + + +class ScheduledIndexingCreateParams(TypedDict, total=False): + days: Iterable[int] + """Days for execution (day is represented same as in a cron expression, e.g. + + Monday begins with 1 ) + """ + + knowledge_base_uuid: str + """Knowledge base uuid for which the schedule is created""" + + time: str + """Time of execution (HH:MM) UTC""" diff --git a/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_create_response.py b/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_create_response.py new file mode 100644 index 00000000..c306c5b1 --- /dev/null +++ b/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_create_response.py @@ -0,0 +1,48 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from ...._models import BaseModel + +__all__ = ["ScheduledIndexingCreateResponse", "IndexingInfo"] + + +class IndexingInfo(BaseModel): + created_at: Optional[datetime] = None + """Created at timestamp""" + + days: Optional[List[int]] = None + """Days for execution (day is represented same as in a cron expression, e.g. + + Monday begins with 1 ) + """ + + deleted_at: Optional[datetime] = None + """Deleted at timestamp (if soft deleted)""" + + is_active: Optional[bool] = None + """Whether the schedule is currently active""" + + knowledge_base_uuid: Optional[str] = None + """Knowledge base uuid associated with this schedule""" + + last_ran_at: Optional[datetime] = None + """Last time the schedule was executed""" + + next_run_at: Optional[datetime] = None + """Next scheduled run""" + + time: Optional[str] = None + """Scheduled time of execution (HH:MM:SS format)""" + + updated_at: Optional[datetime] = None + """Updated at timestamp""" + + uuid: Optional[str] = None + """Unique identifier for the scheduled indexing entry""" + + +class ScheduledIndexingCreateResponse(BaseModel): + indexing_info: Optional[IndexingInfo] = None + """Metadata for scheduled indexing entries""" diff --git a/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_delete_response.py b/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_delete_response.py new file mode 100644 index 00000000..febf3759 --- /dev/null +++ b/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_delete_response.py @@ -0,0 +1,48 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from ...._models import BaseModel + +__all__ = ["ScheduledIndexingDeleteResponse", "IndexingInfo"] + + +class IndexingInfo(BaseModel): + created_at: Optional[datetime] = None + """Created at timestamp""" + + days: Optional[List[int]] = None + """Days for execution (day is represented same as in a cron expression, e.g. + + Monday begins with 1 ) + """ + + deleted_at: Optional[datetime] = None + """Deleted at timestamp (if soft deleted)""" + + is_active: Optional[bool] = None + """Whether the schedule is currently active""" + + knowledge_base_uuid: Optional[str] = None + """Knowledge base uuid associated with this schedule""" + + last_ran_at: Optional[datetime] = None + """Last time the schedule was executed""" + + next_run_at: Optional[datetime] = None + """Next scheduled run""" + + time: Optional[str] = None + """Scheduled time of execution (HH:MM:SS format)""" + + updated_at: Optional[datetime] = None + """Updated at timestamp""" + + uuid: Optional[str] = None + """Unique identifier for the scheduled indexing entry""" + + +class ScheduledIndexingDeleteResponse(BaseModel): + indexing_info: Optional[IndexingInfo] = None + """Metadata for scheduled indexing entries""" diff --git a/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_retrieve_response.py b/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_retrieve_response.py new file mode 100644 index 00000000..1776c83d --- /dev/null +++ b/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_retrieve_response.py @@ -0,0 +1,48 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from ...._models import BaseModel + +__all__ = ["ScheduledIndexingRetrieveResponse", "IndexingInfo"] + + +class IndexingInfo(BaseModel): + created_at: Optional[datetime] = None + """Created at timestamp""" + + days: Optional[List[int]] = None + """Days for execution (day is represented same as in a cron expression, e.g. + + Monday begins with 1 ) + """ + + deleted_at: Optional[datetime] = None + """Deleted at timestamp (if soft deleted)""" + + is_active: Optional[bool] = None + """Whether the schedule is currently active""" + + knowledge_base_uuid: Optional[str] = None + """Knowledge base uuid associated with this schedule""" + + last_ran_at: Optional[datetime] = None + """Last time the schedule was executed""" + + next_run_at: Optional[datetime] = None + """Next scheduled run""" + + time: Optional[str] = None + """Scheduled time of execution (HH:MM:SS format)""" + + updated_at: Optional[datetime] = None + """Updated at timestamp""" + + uuid: Optional[str] = None + """Unique identifier for the scheduled indexing entry""" + + +class ScheduledIndexingRetrieveResponse(BaseModel): + indexing_info: Optional[IndexingInfo] = None + """Metadata for scheduled indexing entries""" diff --git a/src/gradient/types/api_agent.py b/src/gradient/types/api_agent.py index abfbe828..f52e44c8 100644 --- a/src/gradient/types/api_agent.py +++ b/src/gradient/types/api_agent.py @@ -6,6 +6,8 @@ from datetime import datetime from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel from .api_agent_model import APIAgentModel from .api_knowledge_base import APIKnowledgeBase @@ -24,6 +26,7 @@ "Function", "Guardrail", "LoggingConfig", + "ModelProviderKey", "Template", "TemplateGuardrail", ] @@ -35,6 +38,8 @@ class APIKey(BaseModel): class Chatbot(BaseModel): + allowed_domains: Optional[List[str]] = None + button_background_color: Optional[str] = None logo: Optional[str] = None @@ -72,6 +77,7 @@ class Deployment(BaseModel): "STATUS_UNDEPLOYING", "STATUS_UNDEPLOYMENT_FAILED", "STATUS_DELETED", + "STATUS_BUILDING", ] ] = None @@ -186,6 +192,33 @@ class LoggingConfig(BaseModel): """Name of the log stream""" +class ModelProviderKey(BaseModel): + api_key_uuid: Optional[str] = None + """API key ID""" + + created_at: Optional[datetime] = None + """Key creation date""" + + created_by: Optional[str] = None + """Created by user id from DO""" + + deleted_at: Optional[datetime] = None + """Key deleted date""" + + models: Optional[List[APIAgentModel]] = None + """Models supported by the openAI api key""" + + name: Optional[str] = None + """Name of the key""" + + provider: Optional[Literal["MODEL_PROVIDER_DIGITALOCEAN", "MODEL_PROVIDER_ANTHROPIC", "MODEL_PROVIDER_OPENAI"]] = ( + None + ) + + updated_at: Optional[datetime] = None + """Key last updated date""" + + class TemplateGuardrail(BaseModel): priority: Optional[int] = None """Priority of the guardrail""" @@ -311,6 +344,8 @@ class APIAgent(BaseModel): model: Optional[APIAgentModel] = None """Description of a Model""" + api_model_provider_key: Optional[ModelProviderKey] = FieldInfo(alias="model_provider_key", default=None) + name: Optional[str] = None """Agent name""" @@ -372,6 +407,11 @@ class APIAgent(BaseModel): version_hash: Optional[str] = None """The latest version of the agent""" + vpc_egress_ips: Optional[List[str]] = None + """VPC Egress IPs""" + + vpc_uuid: Optional[str] = None + workspace: Optional["APIWorkspace"] = None diff --git a/src/gradient/types/knowledge_base_create_params.py b/src/gradient/types/knowledge_base_create_params.py index e40bd598..4dc42098 100644 --- a/src/gradient/types/knowledge_base_create_params.py +++ b/src/gradient/types/knowledge_base_create_params.py @@ -11,7 +11,7 @@ from .knowledge_bases.api_file_upload_data_source_param import APIFileUploadDataSourceParam from .knowledge_bases.api_web_crawler_data_source_param import APIWebCrawlerDataSourceParam -__all__ = ["KnowledgeBaseCreateParams", "Datasource", "DatasourceDropboxDataSource"] +__all__ = ["KnowledgeBaseCreateParams", "Datasource", "DatasourceDropboxDataSource", "DatasourceGoogleDriveDataSource"] class KnowledgeBaseCreateParams(TypedDict, total=False): @@ -63,6 +63,17 @@ class DatasourceDropboxDataSource(TypedDict, total=False): """ +class DatasourceGoogleDriveDataSource(TypedDict, total=False): + folder_id: str + + refresh_token: str + """Refresh token. + + you can obrain a refresh token by following the oauth2 flow. see + /v2/gen-ai/oauth2/google/tokens for reference. + """ + + class Datasource(TypedDict, total=False): aws_data_source: AwsDataSourceParam """AWS S3 Data Source""" @@ -79,6 +90,9 @@ class Datasource(TypedDict, total=False): file_upload_data_source: APIFileUploadDataSourceParam """File to upload as data source for knowledge base.""" + google_drive_data_source: DatasourceGoogleDriveDataSource + """Google Drive Data Source""" + item_path: str spaces_data_source: APISpacesDataSourceParam diff --git a/src/gradient/types/knowledge_base_list_indexing_jobs_response.py b/src/gradient/types/knowledge_base_list_indexing_jobs_response.py new file mode 100644 index 00000000..d88f83fc --- /dev/null +++ b/src/gradient/types/knowledge_base_list_indexing_jobs_response.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .._models import BaseModel +from .shared.api_meta import APIMeta +from .shared.api_links import APILinks +from .knowledge_bases.api_indexing_job import APIIndexingJob + +__all__ = ["KnowledgeBaseListIndexingJobsResponse"] + + +class KnowledgeBaseListIndexingJobsResponse(BaseModel): + jobs: Optional[List[APIIndexingJob]] = None + """The indexing jobs""" + + links: Optional[APILinks] = None + """Links to other pages""" + + meta: Optional[APIMeta] = None + """Meta information about the data set""" diff --git a/src/gradient/types/knowledge_bases/__init__.py b/src/gradient/types/knowledge_bases/__init__.py index cab865fa..a8ce2cc7 100644 --- a/src/gradient/types/knowledge_bases/__init__.py +++ b/src/gradient/types/knowledge_bases/__init__.py @@ -27,6 +27,9 @@ from .data_source_create_presigned_urls_params import ( DataSourceCreatePresignedURLsParams as DataSourceCreatePresignedURLsParams, ) +from .indexing_job_retrieve_signed_url_response import ( + IndexingJobRetrieveSignedURLResponse as IndexingJobRetrieveSignedURLResponse, +) from .data_source_create_presigned_urls_response import ( DataSourceCreatePresignedURLsResponse as DataSourceCreatePresignedURLsResponse, ) diff --git a/src/gradient/types/knowledge_bases/api_indexed_data_source.py b/src/gradient/types/knowledge_bases/api_indexed_data_source.py index 151b29de..3f011582 100644 --- a/src/gradient/types/knowledge_bases/api_indexed_data_source.py +++ b/src/gradient/types/knowledge_bases/api_indexed_data_source.py @@ -48,6 +48,7 @@ class APIIndexedDataSource(BaseModel): "DATA_SOURCE_STATUS_PARTIALLY_UPDATED", "DATA_SOURCE_STATUS_NOT_UPDATED", "DATA_SOURCE_STATUS_FAILED", + "DATA_SOURCE_STATUS_CANCELLED", ] ] = None diff --git a/src/gradient/types/knowledge_bases/api_indexing_job.py b/src/gradient/types/knowledge_bases/api_indexing_job.py index 312e465c..93124cf8 100644 --- a/src/gradient/types/knowledge_bases/api_indexing_job.py +++ b/src/gradient/types/knowledge_bases/api_indexing_job.py @@ -5,6 +5,7 @@ from typing_extensions import Literal from ..._models import BaseModel +from .api_indexed_data_source import APIIndexedDataSource __all__ = ["APIIndexingJob"] @@ -16,10 +17,16 @@ class APIIndexingJob(BaseModel): created_at: Optional[datetime] = None """Creation date / time""" + data_source_jobs: Optional[List[APIIndexedDataSource]] = None + """Details on Data Sources included in the Indexing Job""" + data_source_uuids: Optional[List[str]] = None finished_at: Optional[datetime] = None + is_report_available: Optional[bool] = None + """Boolean value to determine if the indexing job details are available""" + knowledge_base_uuid: Optional[str] = None """Knowledge base id""" @@ -50,7 +57,7 @@ class APIIndexingJob(BaseModel): ] = None tokens: Optional[int] = None - """Number of tokens""" + """Number of tokens [This field is deprecated]""" total_datasources: Optional[int] = None """Number of datasources being indexed""" @@ -61,9 +68,15 @@ class APIIndexingJob(BaseModel): total_items_indexed: Optional[str] = None """Total Items Indexed""" + total_items_removed: Optional[str] = None + """Total Items Removed""" + total_items_skipped: Optional[str] = None """Total Items Skipped""" + total_tokens: Optional[str] = None + """Total Tokens Consumed By the Indexing Job""" + updated_at: Optional[datetime] = None """Last modified""" diff --git a/src/gradient/types/knowledge_bases/api_knowledge_base_data_source.py b/src/gradient/types/knowledge_bases/api_knowledge_base_data_source.py index ed370eb5..223797c7 100644 --- a/src/gradient/types/knowledge_bases/api_knowledge_base_data_source.py +++ b/src/gradient/types/knowledge_bases/api_knowledge_base_data_source.py @@ -10,7 +10,7 @@ from .api_file_upload_data_source import APIFileUploadDataSource from .api_web_crawler_data_source import APIWebCrawlerDataSource -__all__ = ["APIKnowledgeBaseDataSource", "AwsDataSource", "DropboxDataSource"] +__all__ = ["APIKnowledgeBaseDataSource", "AwsDataSource", "DropboxDataSource", "GoogleDriveDataSource"] class AwsDataSource(BaseModel): @@ -27,6 +27,13 @@ class DropboxDataSource(BaseModel): folder: Optional[str] = None +class GoogleDriveDataSource(BaseModel): + folder_id: Optional[str] = None + + folder_name: Optional[str] = None + """Name of the selected folder if available""" + + class APIKnowledgeBaseDataSource(BaseModel): aws_data_source: Optional[AwsDataSource] = None """AWS S3 Data Source for Display""" @@ -43,6 +50,9 @@ class APIKnowledgeBaseDataSource(BaseModel): file_upload_data_source: Optional[APIFileUploadDataSource] = None """File to upload as data source for knowledge base.""" + google_drive_data_source: Optional[GoogleDriveDataSource] = None + """Google Drive Data Source for Display""" + item_path: Optional[str] = None """Path of folder or object in bucket - Deprecated, moved to data_source_details""" diff --git a/src/gradient/types/knowledge_bases/api_web_crawler_data_source.py b/src/gradient/types/knowledge_bases/api_web_crawler_data_source.py index 4690c607..63c9111a 100644 --- a/src/gradient/types/knowledge_bases/api_web_crawler_data_source.py +++ b/src/gradient/types/knowledge_bases/api_web_crawler_data_source.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from typing_extensions import Literal from ..._models import BaseModel @@ -24,3 +24,6 @@ class APIWebCrawlerDataSource(BaseModel): embed_media: Optional[bool] = None """Whether to ingest and index media (images, etc.) on web pages.""" + + exclude_tags: Optional[List[str]] = None + """Declaring which tags to exclude in web pages while webcrawling""" diff --git a/src/gradient/types/knowledge_bases/api_web_crawler_data_source_param.py b/src/gradient/types/knowledge_bases/api_web_crawler_data_source_param.py index 2345ed3a..17988e73 100644 --- a/src/gradient/types/knowledge_bases/api_web_crawler_data_source_param.py +++ b/src/gradient/types/knowledge_bases/api_web_crawler_data_source_param.py @@ -4,6 +4,8 @@ from typing_extensions import Literal, TypedDict +from ..._types import SequenceNotStr + __all__ = ["APIWebCrawlerDataSourceParam"] @@ -23,3 +25,6 @@ class APIWebCrawlerDataSourceParam(TypedDict, total=False): embed_media: bool """Whether to ingest and index media (images, etc.) on web pages.""" + + exclude_tags: SequenceNotStr[str] + """Declaring which tags to exclude in web pages while webcrawling""" diff --git a/src/gradient/types/knowledge_bases/indexing_job_retrieve_signed_url_response.py b/src/gradient/types/knowledge_bases/indexing_job_retrieve_signed_url_response.py new file mode 100644 index 00000000..2ef60e45 --- /dev/null +++ b/src/gradient/types/knowledge_bases/indexing_job_retrieve_signed_url_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["IndexingJobRetrieveSignedURLResponse"] + + +class IndexingJobRetrieveSignedURLResponse(BaseModel): + signed_url: Optional[str] = None + """The signed url for downloading the indexing job details""" diff --git a/src/gradient/types/nf_create_params.py b/src/gradient/types/nf_create_params.py new file mode 100644 index 00000000..327beb2e --- /dev/null +++ b/src/gradient/types/nf_create_params.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .._types import SequenceNotStr + +__all__ = ["NfCreateParams"] + + +class NfCreateParams(TypedDict, total=False): + name: Required[str] + """The human-readable name of the share.""" + + region: Required[str] + """The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides.""" + + size_gib: Required[int] + """The desired/provisioned size of the share in GiB (Gibibytes). Must be >= 50.""" + + vpc_ids: Required[SequenceNotStr[str]] + """List of VPC IDs that should be able to access the share.""" diff --git a/src/gradient/types/nf_create_response.py b/src/gradient/types/nf_create_response.py new file mode 100644 index 00000000..5016d776 --- /dev/null +++ b/src/gradient/types/nf_create_response.py @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["NfCreateResponse", "Share"] + + +class Share(BaseModel): + id: str + """The unique identifier of the NFS share.""" + + created_at: datetime + """Timestamp for when the NFS share was created.""" + + name: str + """The human-readable name of the share.""" + + region: str + """The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides.""" + + size_gib: int + """The desired/provisioned size of the share in GiB (Gibibytes). Must be >= 50.""" + + status: Literal["CREATING", "ACTIVE", "FAILED", "DELETED"] + """The current status of the share.""" + + host: Optional[str] = None + """The host IP of the NFS server that will be accessible from the associated VPC""" + + mount_path: Optional[str] = None + """ + Path at which the share will be available, to be mounted at a target of the + user's choice within the client + """ + + vpc_ids: Optional[List[str]] = None + """List of VPC IDs that should be able to access the share.""" + + +class NfCreateResponse(BaseModel): + share: Optional[Share] = None diff --git a/src/gradient/types/nf_delete_params.py b/src/gradient/types/nf_delete_params.py new file mode 100644 index 00000000..a11474e5 --- /dev/null +++ b/src/gradient/types/nf_delete_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["NfDeleteParams"] + + +class NfDeleteParams(TypedDict, total=False): + region: Required[str] + """The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides.""" diff --git a/src/gradient/types/nf_initiate_action_params.py b/src/gradient/types/nf_initiate_action_params.py new file mode 100644 index 00000000..a187f56d --- /dev/null +++ b/src/gradient/types/nf_initiate_action_params.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +__all__ = [ + "NfInitiateActionParams", + "NfsActionResize", + "NfsActionResizeParams", + "NfsActionSnapshot", + "NfsActionSnapshotParams", +] + + +class NfsActionResize(TypedDict, total=False): + region: Required[str] + """The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides.""" + + type: Required[Literal["resize", "snapshot"]] + """The type of action to initiate for the NFS share (such as resize or snapshot).""" + + params: NfsActionResizeParams + + +class NfsActionResizeParams(TypedDict, total=False): + size_gib: Required[int] + """The new size for the NFS share.""" + + +class NfsActionSnapshot(TypedDict, total=False): + region: Required[str] + """The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides.""" + + type: Required[Literal["resize", "snapshot"]] + """The type of action to initiate for the NFS share (such as resize or snapshot).""" + + params: NfsActionSnapshotParams + + +class NfsActionSnapshotParams(TypedDict, total=False): + name: Required[str] + """Snapshot name of the NFS share""" + + +NfInitiateActionParams: TypeAlias = Union[NfsActionResize, NfsActionSnapshot] diff --git a/src/gradient/types/nf_initiate_action_response.py b/src/gradient/types/nf_initiate_action_response.py new file mode 100644 index 00000000..9f38a4b2 --- /dev/null +++ b/src/gradient/types/nf_initiate_action_response.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["NfInitiateActionResponse", "Action"] + + +class Action(BaseModel): + region_slug: str + """The DigitalOcean region slug where the resource is located.""" + + resource_id: str + """The unique identifier of the resource on which the action is being performed.""" + + resource_type: Literal["network_file_share", "network_file_share_snapshot"] + """The type of resource on which the action is being performed.""" + + started_at: datetime + """The timestamp when the action was started.""" + + status: Literal["in-progress", "completed", "errored"] + """The current status of the action.""" + + type: str + """The type of action being performed.""" + + +class NfInitiateActionResponse(BaseModel): + action: Action + """The action that was submitted.""" diff --git a/src/gradient/types/nf_list_params.py b/src/gradient/types/nf_list_params.py new file mode 100644 index 00000000..bc53c284 --- /dev/null +++ b/src/gradient/types/nf_list_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["NfListParams"] + + +class NfListParams(TypedDict, total=False): + region: Required[str] + """The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides.""" diff --git a/src/gradient/types/nf_list_response.py b/src/gradient/types/nf_list_response.py new file mode 100644 index 00000000..c5af118b --- /dev/null +++ b/src/gradient/types/nf_list_response.py @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["NfListResponse", "Share"] + + +class Share(BaseModel): + id: str + """The unique identifier of the NFS share.""" + + created_at: datetime + """Timestamp for when the NFS share was created.""" + + name: str + """The human-readable name of the share.""" + + region: str + """The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides.""" + + size_gib: int + """The desired/provisioned size of the share in GiB (Gibibytes). Must be >= 50.""" + + status: Literal["CREATING", "ACTIVE", "FAILED", "DELETED"] + """The current status of the share.""" + + host: Optional[str] = None + """The host IP of the NFS server that will be accessible from the associated VPC""" + + mount_path: Optional[str] = None + """ + Path at which the share will be available, to be mounted at a target of the + user's choice within the client + """ + + vpc_ids: Optional[List[str]] = None + """List of VPC IDs that should be able to access the share.""" + + +class NfListResponse(BaseModel): + shares: Optional[List[Share]] = None diff --git a/src/gradient/types/nf_retrieve_params.py b/src/gradient/types/nf_retrieve_params.py new file mode 100644 index 00000000..292053d9 --- /dev/null +++ b/src/gradient/types/nf_retrieve_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["NfRetrieveParams"] + + +class NfRetrieveParams(TypedDict, total=False): + region: Required[str] + """The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides.""" diff --git a/src/gradient/types/nf_retrieve_response.py b/src/gradient/types/nf_retrieve_response.py new file mode 100644 index 00000000..897f07f0 --- /dev/null +++ b/src/gradient/types/nf_retrieve_response.py @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["NfRetrieveResponse", "Share"] + + +class Share(BaseModel): + id: str + """The unique identifier of the NFS share.""" + + created_at: datetime + """Timestamp for when the NFS share was created.""" + + name: str + """The human-readable name of the share.""" + + region: str + """The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides.""" + + size_gib: int + """The desired/provisioned size of the share in GiB (Gibibytes). Must be >= 50.""" + + status: Literal["CREATING", "ACTIVE", "FAILED", "DELETED"] + """The current status of the share.""" + + host: Optional[str] = None + """The host IP of the NFS server that will be accessible from the associated VPC""" + + mount_path: Optional[str] = None + """ + Path at which the share will be available, to be mounted at a target of the + user's choice within the client + """ + + vpc_ids: Optional[List[str]] = None + """List of VPC IDs that should be able to access the share.""" + + +class NfRetrieveResponse(BaseModel): + share: Optional[Share] = None diff --git a/src/gradient/types/nfs/__init__.py b/src/gradient/types/nfs/__init__.py new file mode 100644 index 00000000..41777980 --- /dev/null +++ b/src/gradient/types/nfs/__init__.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .snapshot_list_params import SnapshotListParams as SnapshotListParams +from .snapshot_delete_params import SnapshotDeleteParams as SnapshotDeleteParams +from .snapshot_list_response import SnapshotListResponse as SnapshotListResponse +from .snapshot_retrieve_params import SnapshotRetrieveParams as SnapshotRetrieveParams +from .snapshot_retrieve_response import SnapshotRetrieveResponse as SnapshotRetrieveResponse diff --git a/src/gradient/types/nfs/snapshot_delete_params.py b/src/gradient/types/nfs/snapshot_delete_params.py new file mode 100644 index 00000000..1b26149e --- /dev/null +++ b/src/gradient/types/nfs/snapshot_delete_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["SnapshotDeleteParams"] + + +class SnapshotDeleteParams(TypedDict, total=False): + region: Required[str] + """The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides.""" diff --git a/src/gradient/types/nfs/snapshot_list_params.py b/src/gradient/types/nfs/snapshot_list_params.py new file mode 100644 index 00000000..8c4c6946 --- /dev/null +++ b/src/gradient/types/nfs/snapshot_list_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["SnapshotListParams"] + + +class SnapshotListParams(TypedDict, total=False): + region: Required[str] + """The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides.""" + + share_id: str + """The unique ID of an NFS share. + + If provided, only snapshots of this specific share will be returned. + """ diff --git a/src/gradient/types/nfs/snapshot_list_response.py b/src/gradient/types/nfs/snapshot_list_response.py new file mode 100644 index 00000000..8a6864dc --- /dev/null +++ b/src/gradient/types/nfs/snapshot_list_response.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["SnapshotListResponse", "Snapshot"] + + +class Snapshot(BaseModel): + id: str + """The unique identifier of the snapshot.""" + + created_at: datetime + """The timestamp when the snapshot was created.""" + + name: str + """The human-readable name of the snapshot.""" + + region: str + """The DigitalOcean region slug where the snapshot is located.""" + + share_id: str + """The unique identifier of the share from which this snapshot was created.""" + + size_gib: int + """The size of the snapshot in GiB.""" + + status: Literal["UNKNOWN", "CREATING", "ACTIVE", "FAILED", "DELETED"] + """The current status of the snapshot.""" + + +class SnapshotListResponse(BaseModel): + snapshots: Optional[List[Snapshot]] = None diff --git a/src/gradient/types/nfs/snapshot_retrieve_params.py b/src/gradient/types/nfs/snapshot_retrieve_params.py new file mode 100644 index 00000000..d1e1f8e8 --- /dev/null +++ b/src/gradient/types/nfs/snapshot_retrieve_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["SnapshotRetrieveParams"] + + +class SnapshotRetrieveParams(TypedDict, total=False): + region: Required[str] + """The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides.""" diff --git a/src/gradient/types/nfs/snapshot_retrieve_response.py b/src/gradient/types/nfs/snapshot_retrieve_response.py new file mode 100644 index 00000000..2d54d523 --- /dev/null +++ b/src/gradient/types/nfs/snapshot_retrieve_response.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["SnapshotRetrieveResponse", "Snapshot"] + + +class Snapshot(BaseModel): + id: str + """The unique identifier of the snapshot.""" + + created_at: datetime + """The timestamp when the snapshot was created.""" + + name: str + """The human-readable name of the snapshot.""" + + region: str + """The DigitalOcean region slug where the snapshot is located.""" + + share_id: str + """The unique identifier of the share from which this snapshot was created.""" + + size_gib: int + """The size of the snapshot in GiB.""" + + status: Literal["UNKNOWN", "CREATING", "ACTIVE", "FAILED", "DELETED"] + """The current status of the snapshot.""" + + +class SnapshotRetrieveResponse(BaseModel): + snapshot: Optional[Snapshot] = None + """Represents an NFS snapshot.""" diff --git a/tests/api_resources/agents/evaluation_metrics/test_scheduled_indexing.py b/tests/api_resources/agents/evaluation_metrics/test_scheduled_indexing.py new file mode 100644 index 00000000..388e06c9 --- /dev/null +++ b/tests/api_resources/agents/evaluation_metrics/test_scheduled_indexing.py @@ -0,0 +1,274 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gradient import Gradient, AsyncGradient +from tests.utils import assert_matches_type +from gradient.types.agents.evaluation_metrics import ( + ScheduledIndexingCreateResponse, + ScheduledIndexingDeleteResponse, + ScheduledIndexingRetrieveResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestScheduledIndexing: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create(self, client: Gradient) -> None: + scheduled_indexing = client.agents.evaluation_metrics.scheduled_indexing.create() + assert_matches_type(ScheduledIndexingCreateResponse, scheduled_indexing, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Gradient) -> None: + scheduled_indexing = client.agents.evaluation_metrics.scheduled_indexing.create( + days=[123], + knowledge_base_uuid="123e4567-e89b-12d3-a456-426614174000", + time="example string", + ) + assert_matches_type(ScheduledIndexingCreateResponse, scheduled_indexing, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create(self, client: Gradient) -> None: + response = client.agents.evaluation_metrics.scheduled_indexing.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scheduled_indexing = response.parse() + assert_matches_type(ScheduledIndexingCreateResponse, scheduled_indexing, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create(self, client: Gradient) -> None: + with client.agents.evaluation_metrics.scheduled_indexing.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scheduled_indexing = response.parse() + assert_matches_type(ScheduledIndexingCreateResponse, scheduled_indexing, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve(self, client: Gradient) -> None: + scheduled_indexing = client.agents.evaluation_metrics.scheduled_indexing.retrieve( + '"123e4567-e89b-12d3-a456-426614174000"', + ) + assert_matches_type(ScheduledIndexingRetrieveResponse, scheduled_indexing, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_retrieve(self, client: Gradient) -> None: + response = client.agents.evaluation_metrics.scheduled_indexing.with_raw_response.retrieve( + '"123e4567-e89b-12d3-a456-426614174000"', + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scheduled_indexing = response.parse() + assert_matches_type(ScheduledIndexingRetrieveResponse, scheduled_indexing, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_retrieve(self, client: Gradient) -> None: + with client.agents.evaluation_metrics.scheduled_indexing.with_streaming_response.retrieve( + '"123e4567-e89b-12d3-a456-426614174000"', + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scheduled_indexing = response.parse() + assert_matches_type(ScheduledIndexingRetrieveResponse, scheduled_indexing, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_path_params_retrieve(self, client: Gradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `knowledge_base_uuid` but received ''"): + client.agents.evaluation_metrics.scheduled_indexing.with_raw_response.retrieve( + "", + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete(self, client: Gradient) -> None: + scheduled_indexing = client.agents.evaluation_metrics.scheduled_indexing.delete( + '"123e4567-e89b-12d3-a456-426614174000"', + ) + assert_matches_type(ScheduledIndexingDeleteResponse, scheduled_indexing, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_delete(self, client: Gradient) -> None: + response = client.agents.evaluation_metrics.scheduled_indexing.with_raw_response.delete( + '"123e4567-e89b-12d3-a456-426614174000"', + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scheduled_indexing = response.parse() + assert_matches_type(ScheduledIndexingDeleteResponse, scheduled_indexing, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_delete(self, client: Gradient) -> None: + with client.agents.evaluation_metrics.scheduled_indexing.with_streaming_response.delete( + '"123e4567-e89b-12d3-a456-426614174000"', + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scheduled_indexing = response.parse() + assert_matches_type(ScheduledIndexingDeleteResponse, scheduled_indexing, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_path_params_delete(self, client: Gradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + client.agents.evaluation_metrics.scheduled_indexing.with_raw_response.delete( + "", + ) + + +class TestAsyncScheduledIndexing: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create(self, async_client: AsyncGradient) -> None: + scheduled_indexing = await async_client.agents.evaluation_metrics.scheduled_indexing.create() + assert_matches_type(ScheduledIndexingCreateResponse, scheduled_indexing, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: + scheduled_indexing = await async_client.agents.evaluation_metrics.scheduled_indexing.create( + days=[123], + knowledge_base_uuid="123e4567-e89b-12d3-a456-426614174000", + time="example string", + ) + assert_matches_type(ScheduledIndexingCreateResponse, scheduled_indexing, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create(self, async_client: AsyncGradient) -> None: + response = await async_client.agents.evaluation_metrics.scheduled_indexing.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scheduled_indexing = await response.parse() + assert_matches_type(ScheduledIndexingCreateResponse, scheduled_indexing, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: + async with ( + async_client.agents.evaluation_metrics.scheduled_indexing.with_streaming_response.create() + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scheduled_indexing = await response.parse() + assert_matches_type(ScheduledIndexingCreateResponse, scheduled_indexing, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve(self, async_client: AsyncGradient) -> None: + scheduled_indexing = await async_client.agents.evaluation_metrics.scheduled_indexing.retrieve( + '"123e4567-e89b-12d3-a456-426614174000"', + ) + assert_matches_type(ScheduledIndexingRetrieveResponse, scheduled_indexing, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: + response = await async_client.agents.evaluation_metrics.scheduled_indexing.with_raw_response.retrieve( + '"123e4567-e89b-12d3-a456-426614174000"', + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scheduled_indexing = await response.parse() + assert_matches_type(ScheduledIndexingRetrieveResponse, scheduled_indexing, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: + async with async_client.agents.evaluation_metrics.scheduled_indexing.with_streaming_response.retrieve( + '"123e4567-e89b-12d3-a456-426614174000"', + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scheduled_indexing = await response.parse() + assert_matches_type(ScheduledIndexingRetrieveResponse, scheduled_indexing, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `knowledge_base_uuid` but received ''"): + await async_client.agents.evaluation_metrics.scheduled_indexing.with_raw_response.retrieve( + "", + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete(self, async_client: AsyncGradient) -> None: + scheduled_indexing = await async_client.agents.evaluation_metrics.scheduled_indexing.delete( + '"123e4567-e89b-12d3-a456-426614174000"', + ) + assert_matches_type(ScheduledIndexingDeleteResponse, scheduled_indexing, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: + response = await async_client.agents.evaluation_metrics.scheduled_indexing.with_raw_response.delete( + '"123e4567-e89b-12d3-a456-426614174000"', + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scheduled_indexing = await response.parse() + assert_matches_type(ScheduledIndexingDeleteResponse, scheduled_indexing, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: + async with async_client.agents.evaluation_metrics.scheduled_indexing.with_streaming_response.delete( + '"123e4567-e89b-12d3-a456-426614174000"', + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scheduled_indexing = await response.parse() + assert_matches_type(ScheduledIndexingDeleteResponse, scheduled_indexing, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_path_params_delete(self, async_client: AsyncGradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): + await async_client.agents.evaluation_metrics.scheduled_indexing.with_raw_response.delete( + "", + ) diff --git a/tests/api_resources/knowledge_bases/test_data_sources.py b/tests/api_resources/knowledge_bases/test_data_sources.py index 4214f880..ca721d93 100644 --- a/tests/api_resources/knowledge_bases/test_data_sources.py +++ b/tests/api_resources/knowledge_bases/test_data_sources.py @@ -52,6 +52,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: "base_url": "example string", "crawling_option": "UNKNOWN", "embed_media": True, + "exclude_tags": ["example string"], }, ) assert_matches_type(DataSourceCreateResponse, data_source, path=["response"]) @@ -273,6 +274,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) "base_url": "example string", "crawling_option": "UNKNOWN", "embed_media": True, + "exclude_tags": ["example string"], }, ) assert_matches_type(DataSourceCreateResponse, data_source, path=["response"]) diff --git a/tests/api_resources/knowledge_bases/test_indexing_jobs.py b/tests/api_resources/knowledge_bases/test_indexing_jobs.py index 88c551c8..231aceff 100644 --- a/tests/api_resources/knowledge_bases/test_indexing_jobs.py +++ b/tests/api_resources/knowledge_bases/test_indexing_jobs.py @@ -15,6 +15,7 @@ IndexingJobCreateResponse, IndexingJobRetrieveResponse, IndexingJobUpdateCancelResponse, + IndexingJobRetrieveSignedURLResponse, IndexingJobRetrieveDataSourcesResponse, ) @@ -182,6 +183,48 @@ def test_path_params_retrieve_data_sources(self, client: Gradient) -> None: "", ) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve_signed_url(self, client: Gradient) -> None: + indexing_job = client.knowledge_bases.indexing_jobs.retrieve_signed_url( + '"123e4567-e89b-12d3-a456-426614174000"', + ) + assert_matches_type(IndexingJobRetrieveSignedURLResponse, indexing_job, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_retrieve_signed_url(self, client: Gradient) -> None: + response = client.knowledge_bases.indexing_jobs.with_raw_response.retrieve_signed_url( + '"123e4567-e89b-12d3-a456-426614174000"', + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + indexing_job = response.parse() + assert_matches_type(IndexingJobRetrieveSignedURLResponse, indexing_job, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_retrieve_signed_url(self, client: Gradient) -> None: + with client.knowledge_bases.indexing_jobs.with_streaming_response.retrieve_signed_url( + '"123e4567-e89b-12d3-a456-426614174000"', + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + indexing_job = response.parse() + assert_matches_type(IndexingJobRetrieveSignedURLResponse, indexing_job, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_path_params_retrieve_signed_url(self, client: Gradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `indexing_job_uuid` but received ''"): + client.knowledge_bases.indexing_jobs.with_raw_response.retrieve_signed_url( + "", + ) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_update_cancel(self, client: Gradient) -> None: @@ -516,6 +559,48 @@ async def test_path_params_retrieve_data_sources(self, async_client: AsyncGradie "", ) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve_signed_url(self, async_client: AsyncGradient) -> None: + indexing_job = await async_client.knowledge_bases.indexing_jobs.retrieve_signed_url( + '"123e4567-e89b-12d3-a456-426614174000"', + ) + assert_matches_type(IndexingJobRetrieveSignedURLResponse, indexing_job, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_retrieve_signed_url(self, async_client: AsyncGradient) -> None: + response = await async_client.knowledge_bases.indexing_jobs.with_raw_response.retrieve_signed_url( + '"123e4567-e89b-12d3-a456-426614174000"', + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + indexing_job = await response.parse() + assert_matches_type(IndexingJobRetrieveSignedURLResponse, indexing_job, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_retrieve_signed_url(self, async_client: AsyncGradient) -> None: + async with async_client.knowledge_bases.indexing_jobs.with_streaming_response.retrieve_signed_url( + '"123e4567-e89b-12d3-a456-426614174000"', + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + indexing_job = await response.parse() + assert_matches_type(IndexingJobRetrieveSignedURLResponse, indexing_job, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_path_params_retrieve_signed_url(self, async_client: AsyncGradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `indexing_job_uuid` but received ''"): + await async_client.knowledge_bases.indexing_jobs.with_raw_response.retrieve_signed_url( + "", + ) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_update_cancel(self, async_client: AsyncGradient) -> None: diff --git a/tests/api_resources/nfs/__init__.py b/tests/api_resources/nfs/__init__.py new file mode 100644 index 00000000..fd8019a9 --- /dev/null +++ b/tests/api_resources/nfs/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/nfs/test_snapshots.py b/tests/api_resources/nfs/test_snapshots.py new file mode 100644 index 00000000..e17265f3 --- /dev/null +++ b/tests/api_resources/nfs/test_snapshots.py @@ -0,0 +1,297 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gradient import Gradient, AsyncGradient +from tests.utils import assert_matches_type +from gradient.types.nfs import ( + SnapshotListResponse, + SnapshotRetrieveResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestSnapshots: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve(self, client: Gradient) -> None: + snapshot = client.nfs.snapshots.retrieve( + nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) + assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_retrieve(self, client: Gradient) -> None: + response = client.nfs.snapshots.with_raw_response.retrieve( + nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + snapshot = response.parse() + assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_retrieve(self, client: Gradient) -> None: + with client.nfs.snapshots.with_streaming_response.retrieve( + nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + snapshot = response.parse() + assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_path_params_retrieve(self, client: Gradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_snapshot_id` but received ''"): + client.nfs.snapshots.with_raw_response.retrieve( + nfs_snapshot_id="", + region="region", + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list(self, client: Gradient) -> None: + snapshot = client.nfs.snapshots.list( + region="region", + ) + assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_with_all_params(self, client: Gradient) -> None: + snapshot = client.nfs.snapshots.list( + region="region", + share_id="share_id", + ) + assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_list(self, client: Gradient) -> None: + response = client.nfs.snapshots.with_raw_response.list( + region="region", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + snapshot = response.parse() + assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_list(self, client: Gradient) -> None: + with client.nfs.snapshots.with_streaming_response.list( + region="region", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + snapshot = response.parse() + assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete(self, client: Gradient) -> None: + snapshot = client.nfs.snapshots.delete( + nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) + assert snapshot is None + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_delete(self, client: Gradient) -> None: + response = client.nfs.snapshots.with_raw_response.delete( + nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + snapshot = response.parse() + assert snapshot is None + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_delete(self, client: Gradient) -> None: + with client.nfs.snapshots.with_streaming_response.delete( + nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + snapshot = response.parse() + assert snapshot is None + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_path_params_delete(self, client: Gradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_snapshot_id` but received ''"): + client.nfs.snapshots.with_raw_response.delete( + nfs_snapshot_id="", + region="region", + ) + + +class TestAsyncSnapshots: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve(self, async_client: AsyncGradient) -> None: + snapshot = await async_client.nfs.snapshots.retrieve( + nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) + assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: + response = await async_client.nfs.snapshots.with_raw_response.retrieve( + nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + snapshot = await response.parse() + assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: + async with async_client.nfs.snapshots.with_streaming_response.retrieve( + nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + snapshot = await response.parse() + assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_snapshot_id` but received ''"): + await async_client.nfs.snapshots.with_raw_response.retrieve( + nfs_snapshot_id="", + region="region", + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list(self, async_client: AsyncGradient) -> None: + snapshot = await async_client.nfs.snapshots.list( + region="region", + ) + assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: + snapshot = await async_client.nfs.snapshots.list( + region="region", + share_id="share_id", + ) + assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_list(self, async_client: AsyncGradient) -> None: + response = await async_client.nfs.snapshots.with_raw_response.list( + region="region", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + snapshot = await response.parse() + assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: + async with async_client.nfs.snapshots.with_streaming_response.list( + region="region", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + snapshot = await response.parse() + assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete(self, async_client: AsyncGradient) -> None: + snapshot = await async_client.nfs.snapshots.delete( + nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) + assert snapshot is None + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: + response = await async_client.nfs.snapshots.with_raw_response.delete( + nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + snapshot = await response.parse() + assert snapshot is None + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: + async with async_client.nfs.snapshots.with_streaming_response.delete( + nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + snapshot = await response.parse() + assert snapshot is None + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_path_params_delete(self, async_client: AsyncGradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_snapshot_id` but received ''"): + await async_client.nfs.snapshots.with_raw_response.delete( + nfs_snapshot_id="", + region="region", + ) diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index 1ba3e093..c9e59e32 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -40,12 +40,14 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: description='"My Agent Description"', instruction='"You are an agent who thinks deeply about the world"', knowledge_base_uuid=["example string"], + model_provider_key_uuid='"12345678-1234-1234-1234-123456789012"', model_uuid='"12345678-1234-1234-1234-123456789012"', name='"My Agent"', openai_key_uuid='"12345678-1234-1234-1234-123456789012"', project_id='"12345678-1234-1234-1234-123456789012"', region='"tor1"', tags=["example string"], + workspace_uuid="123e4567-e89b-12d3-a456-426614174000", ) assert_matches_type(AgentCreateResponse, agent, path=["response"]) @@ -127,12 +129,14 @@ def test_method_update_with_all_params(self, client: Gradient) -> None: agent = client.agents.update( path_uuid='"123e4567-e89b-12d3-a456-426614174000"', agent_log_insights_enabled=True, + allowed_domains=["example string"], anthropic_key_uuid='"12345678-1234-1234-1234-123456789012"', conversation_logs_enabled=True, description='"My Agent Description"', instruction='"You are an agent who thinks deeply about the world"', k=5, max_tokens=100, + model_provider_key_uuid='"12345678-1234-1234-1234-123456789012"', model_uuid='"12345678-1234-1234-1234-123456789012"', name='"My New Agent Name"', openai_key_uuid='"12345678-1234-1234-1234-123456789012"', @@ -483,12 +487,14 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) description='"My Agent Description"', instruction='"You are an agent who thinks deeply about the world"', knowledge_base_uuid=["example string"], + model_provider_key_uuid='"12345678-1234-1234-1234-123456789012"', model_uuid='"12345678-1234-1234-1234-123456789012"', name='"My Agent"', openai_key_uuid='"12345678-1234-1234-1234-123456789012"', project_id='"12345678-1234-1234-1234-123456789012"', region='"tor1"', tags=["example string"], + workspace_uuid="123e4567-e89b-12d3-a456-426614174000", ) assert_matches_type(AgentCreateResponse, agent, path=["response"]) @@ -570,12 +576,14 @@ async def test_method_update_with_all_params(self, async_client: AsyncGradient) agent = await async_client.agents.update( path_uuid='"123e4567-e89b-12d3-a456-426614174000"', agent_log_insights_enabled=True, + allowed_domains=["example string"], anthropic_key_uuid='"12345678-1234-1234-1234-123456789012"', conversation_logs_enabled=True, description='"My Agent Description"', instruction='"You are an agent who thinks deeply about the world"', k=5, max_tokens=100, + model_provider_key_uuid='"12345678-1234-1234-1234-123456789012"', model_uuid='"12345678-1234-1234-1234-123456789012"', name='"My New Agent Name"', openai_key_uuid='"12345678-1234-1234-1234-123456789012"', diff --git a/tests/api_resources/test_knowledge_bases.py b/tests/api_resources/test_knowledge_bases.py index a42277e4..632951b4 100644 --- a/tests/api_resources/test_knowledge_bases.py +++ b/tests/api_resources/test_knowledge_bases.py @@ -15,6 +15,7 @@ KnowledgeBaseDeleteResponse, KnowledgeBaseUpdateResponse, KnowledgeBaseRetrieveResponse, + KnowledgeBaseListIndexingJobsResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -54,6 +55,10 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: "size_in_bytes": "12345", "stored_object_key": "example string", }, + "google_drive_data_source": { + "folder_id": "123e4567-e89b-12d3-a456-426614174000", + "refresh_token": "example string", + }, "item_path": "example string", "spaces_data_source": { "bucket_name": "example name", @@ -64,6 +69,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: "base_url": "example string", "crawling_option": "UNKNOWN", "embed_media": True, + "exclude_tags": ["example string"], }, } ], @@ -371,6 +377,48 @@ def test_path_params_wait_for_database(self, client: Gradient) -> None: "", ) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_indexing_jobs(self, client: Gradient) -> None: + knowledge_base = client.knowledge_bases.list_indexing_jobs( + '"123e4567-e89b-12d3-a456-426614174000"', + ) + assert_matches_type(KnowledgeBaseListIndexingJobsResponse, knowledge_base, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_list_indexing_jobs(self, client: Gradient) -> None: + response = client.knowledge_bases.with_raw_response.list_indexing_jobs( + '"123e4567-e89b-12d3-a456-426614174000"', + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + knowledge_base = response.parse() + assert_matches_type(KnowledgeBaseListIndexingJobsResponse, knowledge_base, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_list_indexing_jobs(self, client: Gradient) -> None: + with client.knowledge_bases.with_streaming_response.list_indexing_jobs( + '"123e4567-e89b-12d3-a456-426614174000"', + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + knowledge_base = response.parse() + assert_matches_type(KnowledgeBaseListIndexingJobsResponse, knowledge_base, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_path_params_list_indexing_jobs(self, client: Gradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `knowledge_base_uuid` but received ''"): + client.knowledge_bases.with_raw_response.list_indexing_jobs( + "", + ) + class TestAsyncKnowledgeBases: parametrize = pytest.mark.parametrize( @@ -408,6 +456,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) "size_in_bytes": "12345", "stored_object_key": "example string", }, + "google_drive_data_source": { + "folder_id": "123e4567-e89b-12d3-a456-426614174000", + "refresh_token": "example string", + }, "item_path": "example string", "spaces_data_source": { "bucket_name": "example name", @@ -418,6 +470,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) "base_url": "example string", "crawling_option": "UNKNOWN", "embed_media": True, + "exclude_tags": ["example string"], }, } ], @@ -724,3 +777,45 @@ async def test_path_params_wait_for_database(self, async_client: AsyncGradient) await async_client.knowledge_bases.wait_for_database( "", ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_indexing_jobs(self, async_client: AsyncGradient) -> None: + knowledge_base = await async_client.knowledge_bases.list_indexing_jobs( + '"123e4567-e89b-12d3-a456-426614174000"', + ) + assert_matches_type(KnowledgeBaseListIndexingJobsResponse, knowledge_base, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_list_indexing_jobs(self, async_client: AsyncGradient) -> None: + response = await async_client.knowledge_bases.with_raw_response.list_indexing_jobs( + '"123e4567-e89b-12d3-a456-426614174000"', + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + knowledge_base = await response.parse() + assert_matches_type(KnowledgeBaseListIndexingJobsResponse, knowledge_base, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_list_indexing_jobs(self, async_client: AsyncGradient) -> None: + async with async_client.knowledge_bases.with_streaming_response.list_indexing_jobs( + '"123e4567-e89b-12d3-a456-426614174000"', + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + knowledge_base = await response.parse() + assert_matches_type(KnowledgeBaseListIndexingJobsResponse, knowledge_base, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_path_params_list_indexing_jobs(self, async_client: AsyncGradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `knowledge_base_uuid` but received ''"): + await async_client.knowledge_bases.with_raw_response.list_indexing_jobs( + "", + ) diff --git a/tests/api_resources/test_nfs.py b/tests/api_resources/test_nfs.py new file mode 100644 index 00000000..f2749330 --- /dev/null +++ b/tests/api_resources/test_nfs.py @@ -0,0 +1,611 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gradient import Gradient, AsyncGradient +from tests.utils import assert_matches_type +from gradient.types import ( + NfListResponse, + NfCreateResponse, + NfRetrieveResponse, + NfInitiateActionResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestNfs: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create(self, client: Gradient) -> None: + nf = client.nfs.create( + name="sammy-share-drive", + region="atl1", + size_gib=1024, + vpc_ids=["796c6fe3-2a1d-4da2-9f3e-38239827dc91"], + ) + assert_matches_type(NfCreateResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create(self, client: Gradient) -> None: + response = client.nfs.with_raw_response.create( + name="sammy-share-drive", + region="atl1", + size_gib=1024, + vpc_ids=["796c6fe3-2a1d-4da2-9f3e-38239827dc91"], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + nf = response.parse() + assert_matches_type(NfCreateResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create(self, client: Gradient) -> None: + with client.nfs.with_streaming_response.create( + name="sammy-share-drive", + region="atl1", + size_gib=1024, + vpc_ids=["796c6fe3-2a1d-4da2-9f3e-38239827dc91"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + nf = response.parse() + assert_matches_type(NfCreateResponse, nf, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_retrieve(self, client: Gradient) -> None: + nf = client.nfs.retrieve( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) + assert_matches_type(NfRetrieveResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_retrieve(self, client: Gradient) -> None: + response = client.nfs.with_raw_response.retrieve( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + nf = response.parse() + assert_matches_type(NfRetrieveResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_retrieve(self, client: Gradient) -> None: + with client.nfs.with_streaming_response.retrieve( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + nf = response.parse() + assert_matches_type(NfRetrieveResponse, nf, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_path_params_retrieve(self, client: Gradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): + client.nfs.with_raw_response.retrieve( + nfs_id="", + region="region", + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list(self, client: Gradient) -> None: + nf = client.nfs.list( + region="region", + ) + assert_matches_type(NfListResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_list(self, client: Gradient) -> None: + response = client.nfs.with_raw_response.list( + region="region", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + nf = response.parse() + assert_matches_type(NfListResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_list(self, client: Gradient) -> None: + with client.nfs.with_streaming_response.list( + region="region", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + nf = response.parse() + assert_matches_type(NfListResponse, nf, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_delete(self, client: Gradient) -> None: + nf = client.nfs.delete( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) + assert nf is None + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_delete(self, client: Gradient) -> None: + response = client.nfs.with_raw_response.delete( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + nf = response.parse() + assert nf is None + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_delete(self, client: Gradient) -> None: + with client.nfs.with_streaming_response.delete( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + nf = response.parse() + assert nf is None + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_path_params_delete(self, client: Gradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): + client.nfs.with_raw_response.delete( + nfs_id="", + region="region", + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_initiate_action_overload_1(self, client: Gradient) -> None: + nf = client.nfs.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_initiate_action_with_all_params_overload_1(self, client: Gradient) -> None: + nf = client.nfs.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + params={"size_gib": 2048}, + ) + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_initiate_action_overload_1(self, client: Gradient) -> None: + response = client.nfs.with_raw_response.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + nf = response.parse() + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_initiate_action_overload_1(self, client: Gradient) -> None: + with client.nfs.with_streaming_response.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + nf = response.parse() + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_path_params_initiate_action_overload_1(self, client: Gradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): + client.nfs.with_raw_response.initiate_action( + nfs_id="", + region="atl1", + type="resize", + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_initiate_action_overload_2(self, client: Gradient) -> None: + nf = client.nfs.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_initiate_action_with_all_params_overload_2(self, client: Gradient) -> None: + nf = client.nfs.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + params={"name": "daily-backup"}, + ) + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_initiate_action_overload_2(self, client: Gradient) -> None: + response = client.nfs.with_raw_response.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + nf = response.parse() + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_initiate_action_overload_2(self, client: Gradient) -> None: + with client.nfs.with_streaming_response.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + nf = response.parse() + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_path_params_initiate_action_overload_2(self, client: Gradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): + client.nfs.with_raw_response.initiate_action( + nfs_id="", + region="atl1", + type="resize", + ) + + +class TestAsyncNfs: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create(self, async_client: AsyncGradient) -> None: + nf = await async_client.nfs.create( + name="sammy-share-drive", + region="atl1", + size_gib=1024, + vpc_ids=["796c6fe3-2a1d-4da2-9f3e-38239827dc91"], + ) + assert_matches_type(NfCreateResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create(self, async_client: AsyncGradient) -> None: + response = await async_client.nfs.with_raw_response.create( + name="sammy-share-drive", + region="atl1", + size_gib=1024, + vpc_ids=["796c6fe3-2a1d-4da2-9f3e-38239827dc91"], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + nf = await response.parse() + assert_matches_type(NfCreateResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: + async with async_client.nfs.with_streaming_response.create( + name="sammy-share-drive", + region="atl1", + size_gib=1024, + vpc_ids=["796c6fe3-2a1d-4da2-9f3e-38239827dc91"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + nf = await response.parse() + assert_matches_type(NfCreateResponse, nf, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_retrieve(self, async_client: AsyncGradient) -> None: + nf = await async_client.nfs.retrieve( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) + assert_matches_type(NfRetrieveResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: + response = await async_client.nfs.with_raw_response.retrieve( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + nf = await response.parse() + assert_matches_type(NfRetrieveResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: + async with async_client.nfs.with_streaming_response.retrieve( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + nf = await response.parse() + assert_matches_type(NfRetrieveResponse, nf, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): + await async_client.nfs.with_raw_response.retrieve( + nfs_id="", + region="region", + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list(self, async_client: AsyncGradient) -> None: + nf = await async_client.nfs.list( + region="region", + ) + assert_matches_type(NfListResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_list(self, async_client: AsyncGradient) -> None: + response = await async_client.nfs.with_raw_response.list( + region="region", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + nf = await response.parse() + assert_matches_type(NfListResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: + async with async_client.nfs.with_streaming_response.list( + region="region", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + nf = await response.parse() + assert_matches_type(NfListResponse, nf, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_delete(self, async_client: AsyncGradient) -> None: + nf = await async_client.nfs.delete( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) + assert nf is None + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: + response = await async_client.nfs.with_raw_response.delete( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + nf = await response.parse() + assert nf is None + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: + async with async_client.nfs.with_streaming_response.delete( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="region", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + nf = await response.parse() + assert nf is None + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_path_params_delete(self, async_client: AsyncGradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): + await async_client.nfs.with_raw_response.delete( + nfs_id="", + region="region", + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_initiate_action_overload_1(self, async_client: AsyncGradient) -> None: + nf = await async_client.nfs.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_initiate_action_with_all_params_overload_1(self, async_client: AsyncGradient) -> None: + nf = await async_client.nfs.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + params={"size_gib": 2048}, + ) + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_initiate_action_overload_1(self, async_client: AsyncGradient) -> None: + response = await async_client.nfs.with_raw_response.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + nf = await response.parse() + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_initiate_action_overload_1(self, async_client: AsyncGradient) -> None: + async with async_client.nfs.with_streaming_response.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + nf = await response.parse() + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_path_params_initiate_action_overload_1(self, async_client: AsyncGradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): + await async_client.nfs.with_raw_response.initiate_action( + nfs_id="", + region="atl1", + type="resize", + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_initiate_action_overload_2(self, async_client: AsyncGradient) -> None: + nf = await async_client.nfs.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_initiate_action_with_all_params_overload_2(self, async_client: AsyncGradient) -> None: + nf = await async_client.nfs.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + params={"name": "daily-backup"}, + ) + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_initiate_action_overload_2(self, async_client: AsyncGradient) -> None: + response = await async_client.nfs.with_raw_response.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + nf = await response.parse() + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_initiate_action_overload_2(self, async_client: AsyncGradient) -> None: + async with async_client.nfs.with_streaming_response.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + nf = await response.parse() + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_path_params_initiate_action_overload_2(self, async_client: AsyncGradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): + await async_client.nfs.with_raw_response.initiate_action( + nfs_id="", + region="atl1", + type="resize", + ) diff --git a/tests/test_client.py b/tests/test_client.py index 846c0bb6..c2406d77 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -59,32 +59,30 @@ def _low_retry_timeout(*_args: Any, **_kwargs: Any) -> float: def _get_open_connections(client: Gradient | AsyncGradient) -> int: transport = client._client._transport - assert isinstance(transport, httpx.HTTPTransport) or isinstance(transport, httpx.AsyncHTTPTransport) + assert isinstance(transport, httpx.HTTPTransport) or isinstance( + transport, httpx.AsyncHTTPTransport + ) pool = transport._pool return len(pool._requests) class TestGradient: - client = Gradient( - base_url=base_url, - access_token=access_token, - model_access_key=model_access_key, - agent_access_key=agent_access_key, - _strict_response_validation=True, - ) - @pytest.mark.respx(base_url=base_url) - def test_raw_response(self, respx_mock: MockRouter) -> None: - respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + def test_raw_response(self, respx_mock: MockRouter, client: Gradient) -> 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: Gradient + ) -> None: respx_mock.post("/foo").mock( return_value=httpx.Response( 200, @@ -93,42 +91,48 @@ def test_raw_response_for_binary(self, respx_mock: MockRouter) -> None: ) ) - 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: Gradient) -> None: + copied = client.copy() + assert id(copied) != id(client) - copied = self.client.copy(access_token="another My Access Token") + copied = client.copy(access_token="another My Access Token") assert copied.access_token == "another My Access Token" - assert self.client.access_token == "My Access Token" + assert client.access_token == "My Access Token" - copied = self.client.copy(model_access_key="another My Model Access Key") + copied = client.copy(model_access_key="another My Model Access Key") assert copied.model_access_key == "another My Model Access Key" - assert self.client.model_access_key == "My Model Access Key" + assert client.model_access_key == "My Model Access Key" - copied = self.client.copy(agent_access_key="another My Agent Access Key") + copied = client.copy(agent_access_key="another My Agent Access Key") assert copied.agent_access_key == "another My Agent Access Key" - assert self.client.agent_access_key == "My Agent Access Key" + assert client.agent_access_key == "My Agent Access Key" def test_copy_default_options(self) -> None: + client = Gradient( + base_url=base_url, + access_token=access_token, + model_access_key=model_access_key, + agent_access_key=agent_access_key, + ) # 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 = Gradient( @@ -168,6 +172,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 = Gradient( @@ -210,13 +215,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: Gradient) -> 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(): @@ -224,18 +231,26 @@ def test_copy_signature(self) -> None: continue copy_param = copy_signature.parameters.get(name) - assert copy_param is not None, f"copy() signature is missing the {name} param" + 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: + client = Gradient( + base_url=base_url, + access_token=access_token, + model_access_key=model_access_key, + agent_access_key=agent_access_key, + ) 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,7 +269,9 @@ def build_request(options: FinalRequestOptions) -> None: tracemalloc.stop() - def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.StatisticDiff) -> None: + def add_leak( + leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.StatisticDiff + ) -> None: if diff.count == 0: # Avoid false positives by considering only leaks (i.e. allocations that persist). return @@ -292,12 +309,12 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic print(frame) # noqa: T201 raise AssertionError() - def test_request_timeout(self) -> None: - request = self.client._build_request(FinalRequestOptions(method="get", url="/foo")) + def test_request_timeout(self, client: Gradient) -> 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( + request = client._build_request( FinalRequestOptions(method="get", url="/foo", timeout=httpx.Timeout(100.0)) ) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -317,6 +334,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: @@ -329,10 +348,14 @@ def test_http_client_timeout_option(self) -> None: http_client=http_client, ) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + request = client._build_request( + FinalRequestOptions(method="get", url="/foo") + ) 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 = Gradient( @@ -344,10 +367,14 @@ def test_http_client_timeout_option(self) -> None: http_client=http_client, ) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + request = client._build_request( + FinalRequestOptions(method="get", url="/foo") + ) 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 = Gradient( @@ -359,10 +386,14 @@ def test_http_client_timeout_option(self) -> None: http_client=http_client, ) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + request = client._build_request( + FinalRequestOptions(method="get", url="/foo") + ) 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: @@ -376,7 +407,7 @@ async def test_invalid_http_client(self) -> None: ) def test_default_headers_option(self) -> None: - client = Gradient( + test_client = Gradient( base_url=base_url, access_token=access_token, model_access_key=model_access_key, @@ -384,11 +415,13 @@ def test_default_headers_option(self) -> None: _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 = Gradient( + test_client2 = Gradient( base_url=base_url, access_token=access_token, model_access_key=model_access_key, @@ -399,10 +432,15 @@ 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 = Gradient( base_url=base_url, @@ -415,7 +453,11 @@ def test_validate_headers(self) -> None: assert request.headers.get("Authorization") == f"Bearer {access_token}" with update_env( - **{"DIGITALOCEAN_ACCESS_TOKEN": Omit(), "MODEL_ACCESS_KEY": Omit(), "AGENT_ACCESS_KEY": Omit()} + **{ + "DIGITALOCEAN_ACCESS_TOKEN": Omit(), + "MODEL_ACCESS_KEY": Omit(), + "AGENT_ACCESS_KEY": Omit(), + } ): client2 = Gradient( base_url=base_url, @@ -432,7 +474,9 @@ def test_validate_headers(self) -> None: client2._build_request(FinalRequestOptions(method="get", url="/foo")) request2 = client2._build_request( - FinalRequestOptions(method="get", url="/foo", headers={"Authorization": Omit()}) + FinalRequestOptions( + method="get", url="/foo", headers={"Authorization": Omit()} + ) ) assert request2.headers.get("Authorization") is None @@ -459,8 +503,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: Gradient) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -471,7 +517,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", @@ -482,7 +528,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", @@ -493,8 +539,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: Gradient) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -504,7 +550,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", @@ -515,8 +561,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: Gradient) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -529,7 +575,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", @@ -543,7 +589,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", @@ -561,7 +607,9 @@ def test_multipart_repeating_array(self, client: Gradient) -> None: FinalRequestOptions.construct( method="post", url="/foo", - headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, + headers={ + "Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82" + }, json_data={"array": ["foo", "bar"]}, files=[("foo.txt", b"hello world")], ) @@ -586,21 +634,27 @@ def test_multipart_repeating_array(self, client: Gradient) -> 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: Gradient + ) -> None: class Model1(BaseModel): name: str class Model2(BaseModel): foo: str - respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + 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: Gradient + ) -> None: """Union of objects with the same field name using a different type""" class Model1(BaseModel): @@ -609,20 +663,24 @@ class Model1(BaseModel): class Model2(BaseModel): foo: str - respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + 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: Gradient + ) -> None: """ Response that sets Content-Type to something other than application/json but returns json data """ @@ -638,7 +696,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 @@ -656,6 +714,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(GRADIENT_BASE_URL="http://localhost:5000/from/env"): client = Gradient( @@ -696,6 +756,7 @@ def test_base_url_trailing_slash(self, client: Gradient) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + client.close() @pytest.mark.parametrize( "client", @@ -727,6 +788,7 @@ def test_base_url_no_trailing_slash(self, client: Gradient) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + client.close() @pytest.mark.parametrize( "client", @@ -758,47 +820,48 @@ def test_absolute_request_url(self, client: Gradient) -> None: ), ) assert request.url == "https://myapi.com/foo" + client.close() def test_copied_client_does_not_close_http(self) -> None: - client = Gradient( + test_client = Gradient( base_url=base_url, access_token=access_token, - model_access_key=model_access_key, - agent_access_key=agent_access_key, _strict_response_validation=True, ) - assert not client.is_closed() + 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 = Gradient( + test_client = Gradient( base_url=base_url, access_token=access_token, - model_access_key=model_access_key, - agent_access_key=agent_access_key, _strict_response_validation=True, ) - with client as c2: - assert c2 is client + 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: Gradient + ) -> None: class Model(BaseModel): foo: str - respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": {"invalid": True}})) + 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) @@ -814,13 +877,17 @@ def test_client_max_retries_validation(self) -> None: ) @pytest.mark.respx(base_url=base_url) - def test_default_stream_cls(self, respx_mock: MockRouter) -> None: + def test_default_stream_cls(self, respx_mock: MockRouter, client: Gradient) -> None: class Model(BaseModel): name: str - respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + respx_mock.post("/foo").mock( + return_value=httpx.Response(200, json={"foo": "bar"}) + ) - stream = self.client.post("/foo", cast_to=Model, stream=True, stream_cls=Stream[Model]) + stream = client.post( + "/foo", cast_to=Model, stream=True, stream_cls=Stream[Model] + ) assert isinstance(stream, Stream) stream.response.close() @@ -829,7 +896,9 @@ def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None: class Model(BaseModel): name: str - respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format")) + respx_mock.get("/foo").mock( + return_value=httpx.Response(200, text="my-custom-format") + ) strict_client = Gradient( base_url=base_url, @@ -842,17 +911,18 @@ class Model(BaseModel): with pytest.raises(APIResponseValidationError): strict_client.get("/foo", cast_to=Model) - client = Gradient( + non_strict_client = Gradient( base_url=base_url, access_token=access_token, - model_access_key=model_access_key, - agent_access_key=agent_access_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", [ @@ -875,7 +945,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: + def test_parse_retry_after_header( + self, remaining_retries: int, retry_after: str, timeout: float + ) -> None: client = Gradient( base_url=base_url, access_token=access_token, @@ -886,13 +958,21 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str 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) - assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] + calculated = client._calculate_retry_timeout( + remaining_retries, options, headers + ) + assert calculated == pytest.approx(timeout, rel=0.5 * 0.875) # type: ignore[misc] - @mock.patch("gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch( + "gradient._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, client: Gradient) -> None: - respx_mock.post("/chat/completions").mock(side_effect=httpx.TimeoutException("Test timeout error")) + def test_retrying_timeout_errors_doesnt_leak( + self, respx_mock: MockRouter, client: Gradient + ) -> None: + respx_mock.post("/chat/completions").mock( + side_effect=httpx.TimeoutException("Test timeout error") + ) with pytest.raises(APITimeoutError): client.chat.completions.with_streaming_response.create( @@ -905,11 +985,15 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, clien model="llama3-8b-instruct", ).__enter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(client) == 0 - @mock.patch("gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch( + "gradient._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, client: Gradient) -> None: + def test_retrying_status_errors_doesnt_leak( + self, respx_mock: MockRouter, client: Gradient + ) -> None: respx_mock.post("/chat/completions").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): @@ -922,10 +1006,12 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client ], model="llama3-8b-instruct", ).__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("gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch( + "gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout + ) @pytest.mark.respx(base_url=base_url) @pytest.mark.parametrize("failure_mode", ["status", "exception"]) def test_retries_taken( @@ -961,10 +1047,15 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: ) assert response.retries_taken == failures_before_success - assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success + assert ( + int(response.http_request.headers.get("x-stainless-retry-count")) + == failures_before_success + ) @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) - @mock.patch("gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch( + "gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout + ) @pytest.mark.respx(base_url=base_url) def test_omit_retry_count_header( self, client: Gradient, failures_before_success: int, respx_mock: MockRouter @@ -993,10 +1084,14 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: extra_headers={"x-stainless-retry-count": Omit()}, ) - assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 + assert ( + len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 + ) @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) - @mock.patch("gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch( + "gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout + ) @pytest.mark.respx(base_url=base_url) def test_overwrite_retry_count_header( self, client: Gradient, failures_before_success: int, respx_mock: MockRouter @@ -1050,26 +1145,36 @@ 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: Gradient) -> 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"}) + return_value=httpx.Response( + 302, headers={"Location": f"{base_url}/redirected"} + ) + ) + respx_mock.get("/redirected").mock( + return_value=httpx.Response(200, json={"status": "ok"}) ) - 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: Gradient + ) -> 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"}) + return_value=httpx.Response( + 302, headers={"Location": f"{base_url}/redirected"} + ) ) with pytest.raises(APIStatusError) as exc_info: - self.client.post( + client.post( "/redirect", body={"key": "value"}, options={"follow_redirects": False}, @@ -1081,27 +1186,23 @@ def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None: class TestAsyncGradient: - client = AsyncGradient( - base_url=base_url, - access_token=access_token, - model_access_key=model_access_key, - agent_access_key=agent_access_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: - respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + async def test_raw_response( + self, respx_mock: MockRouter, async_client: AsyncGradient + ) -> 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: AsyncGradient + ) -> None: respx_mock.post("/foo").mock( return_value=httpx.Response( 200, @@ -1110,44 +1211,50 @@ async def test_raw_response_for_binary(self, respx_mock: MockRouter) -> None: ) ) - 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: AsyncGradient) -> None: + copied = async_client.copy() + assert id(copied) != id(async_client) - copied = self.client.copy(access_token="another My Access Token") + copied = async_client.copy(access_token="another My Access Token") assert copied.access_token == "another My Access Token" - assert self.client.access_token == "My Access Token" + assert async_client.access_token == "My Access Token" - copied = self.client.copy(model_access_key="another My Model Access Key") + copied = async_client.copy(model_access_key="another My Model Access Key") assert copied.model_access_key == "another My Model Access Key" - assert self.client.model_access_key == "My Model Access Key" + assert async_client.model_access_key == "My Model Access Key" - copied = self.client.copy(agent_access_key="another My Agent Access Key") + copied = async_client.copy(agent_access_key="another My Agent Access Key") assert copied.agent_access_key == "another My Agent Access Key" - assert self.client.agent_access_key == "My Agent Access Key" + assert async_client.agent_access_key == "My Agent Access Key" def test_copy_default_options(self) -> None: + async_client = AsyncGradient( + base_url=base_url, + access_token=access_token, + model_access_key=model_access_key, + agent_access_key=agent_access_key, + ) # 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 = AsyncGradient( base_url=base_url, access_token=access_token, @@ -1185,8 +1292,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 = AsyncGradient( base_url=base_url, access_token=access_token, @@ -1227,13 +1335,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: AsyncGradient) -> 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(): @@ -1241,18 +1351,26 @@ def test_copy_signature(self) -> None: continue copy_param = copy_signature.parameters.get(name) - assert copy_param is not None, f"copy() signature is missing the {name} param" + 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: + async_client = AsyncGradient( + base_url=base_url, + access_token=access_token, + model_access_key=model_access_key, + agent_access_key=agent_access_key, + ) 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) @@ -1271,7 +1389,9 @@ def build_request(options: FinalRequestOptions) -> None: tracemalloc.stop() - def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.StatisticDiff) -> None: + def add_leak( + leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.StatisticDiff + ) -> None: if diff.count == 0: # Avoid false positives by considering only leaks (i.e. allocations that persist). return @@ -1309,12 +1429,14 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic print(frame) # noqa: T201 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: AsyncGradient) -> 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 @@ -1334,6 +1456,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: @@ -1346,10 +1470,14 @@ async def test_http_client_timeout_option(self) -> None: http_client=http_client, ) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + request = client._build_request( + FinalRequestOptions(method="get", url="/foo") + ) 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 = AsyncGradient( @@ -1361,10 +1489,14 @@ async def test_http_client_timeout_option(self) -> None: http_client=http_client, ) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + request = client._build_request( + FinalRequestOptions(method="get", url="/foo") + ) 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 = AsyncGradient( @@ -1376,10 +1508,14 @@ async def test_http_client_timeout_option(self) -> None: http_client=http_client, ) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + request = client._build_request( + FinalRequestOptions(method="get", url="/foo") + ) 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: @@ -1392,8 +1528,8 @@ def test_invalid_http_client(self) -> None: http_client=cast(Any, http_client), ) - def test_default_headers_option(self) -> None: - client = AsyncGradient( + async def test_default_headers_option(self) -> None: + test_client = AsyncGradient( base_url=base_url, access_token=access_token, model_access_key=model_access_key, @@ -1401,11 +1537,13 @@ def test_default_headers_option(self) -> None: _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 = AsyncGradient( + test_client2 = AsyncGradient( base_url=base_url, access_token=access_token, model_access_key=model_access_key, @@ -1416,10 +1554,15 @@ 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 = AsyncGradient( base_url=base_url, @@ -1432,7 +1575,11 @@ def test_validate_headers(self) -> None: assert request.headers.get("Authorization") == f"Bearer {access_token}" with update_env( - **{"DIGITALOCEAN_ACCESS_TOKEN": Omit(), "MODEL_ACCESS_KEY": Omit(), "AGENT_ACCESS_KEY": Omit()} + **{ + "DIGITALOCEAN_ACCESS_TOKEN": Omit(), + "MODEL_ACCESS_KEY": Omit(), + "AGENT_ACCESS_KEY": Omit(), + } ): client2 = AsyncGradient( base_url=base_url, @@ -1449,11 +1596,13 @@ def test_validate_headers(self) -> None: client2._build_request(FinalRequestOptions(method="get", url="/foo")) request2 = client2._build_request( - FinalRequestOptions(method="get", url="/foo", headers={"Authorization": Omit()}) + FinalRequestOptions( + method="get", url="/foo", headers={"Authorization": Omit()} + ) ) assert request2.headers.get("Authorization") is None - def test_default_query_option(self) -> None: + async def test_default_query_option(self) -> None: client = AsyncGradient( base_url=base_url, access_token=access_token, @@ -1476,8 +1625,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: Gradient) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1488,7 +1639,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", @@ -1499,7 +1650,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", @@ -1510,8 +1661,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: Gradient) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1521,7 +1672,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", @@ -1532,8 +1683,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: Gradient) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1546,7 +1697,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", @@ -1560,7 +1711,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", @@ -1578,7 +1729,9 @@ def test_multipart_repeating_array(self, async_client: AsyncGradient) -> None: FinalRequestOptions.construct( method="post", url="/foo", - headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, + headers={ + "Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82" + }, json_data={"array": ["foo", "bar"]}, files=[("foo.txt", b"hello world")], ) @@ -1603,21 +1756,29 @@ def test_multipart_repeating_array(self, async_client: AsyncGradient) -> 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: AsyncGradient + ) -> None: class Model1(BaseModel): name: str class Model2(BaseModel): foo: str - respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + 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: AsyncGradient + ) -> None: """Union of objects with the same field name using a different type""" class Model1(BaseModel): @@ -1626,20 +1787,28 @@ class Model1(BaseModel): class Model2(BaseModel): foo: str - respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + 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: AsyncGradient + ) -> None: """ Response that sets Content-Type to something other than application/json but returns json data """ @@ -1655,11 +1824,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 = AsyncGradient( base_url="https://example.com/from_init", access_token=access_token, @@ -1673,7 +1842,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(GRADIENT_BASE_URL="http://localhost:5000/from/env"): client = AsyncGradient( access_token=access_token, @@ -1704,7 +1875,7 @@ def test_base_url_env(self) -> None: ], ids=["standard", "custom http client"], ) - def test_base_url_trailing_slash(self, client: AsyncGradient) -> None: + async def test_base_url_trailing_slash(self, client: AsyncGradient) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1713,6 +1884,7 @@ def test_base_url_trailing_slash(self, client: AsyncGradient) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + await client.close() @pytest.mark.parametrize( "client", @@ -1735,7 +1907,7 @@ def test_base_url_trailing_slash(self, client: AsyncGradient) -> None: ], ids=["standard", "custom http client"], ) - def test_base_url_no_trailing_slash(self, client: AsyncGradient) -> None: + async def test_base_url_no_trailing_slash(self, client: AsyncGradient) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1744,6 +1916,7 @@ def test_base_url_no_trailing_slash(self, client: AsyncGradient) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + await client.close() @pytest.mark.parametrize( "client", @@ -1766,7 +1939,7 @@ def test_base_url_no_trailing_slash(self, client: AsyncGradient) -> None: ], ids=["standard", "custom http client"], ) - def test_absolute_request_url(self, client: AsyncGradient) -> None: + async def test_absolute_request_url(self, client: AsyncGradient) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1775,49 +1948,53 @@ def test_absolute_request_url(self, client: AsyncGradient) -> None: ), ) assert request.url == "https://myapi.com/foo" + await client.close() async def test_copied_client_does_not_close_http(self) -> None: - client = AsyncGradient( + test_client = AsyncGradient( base_url=base_url, access_token=access_token, model_access_key=model_access_key, agent_access_key=agent_access_key, _strict_response_validation=True, ) - assert not client.is_closed() + 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 = AsyncGradient( + test_client = AsyncGradient( base_url=base_url, access_token=access_token, model_access_key=model_access_key, agent_access_key=agent_access_key, _strict_response_validation=True, ) - async with client as c2: - assert c2 is client + 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: AsyncGradient + ) -> None: class Model(BaseModel): foo: str - respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": {"invalid": True}})) + 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) @@ -1833,24 +2010,32 @@ async def test_client_max_retries_validation(self) -> None: ) @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio - async def test_default_stream_cls(self, respx_mock: MockRouter) -> None: + async def test_default_stream_cls( + self, respx_mock: MockRouter, async_client: AsyncGradient + ) -> None: class Model(BaseModel): name: str - respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + respx_mock.post("/foo").mock( + return_value=httpx.Response(200, json={"foo": "bar"}) + ) - stream = await self.client.post("/foo", cast_to=Model, stream=True, stream_cls=AsyncStream[Model]) + stream = await async_client.post( + "/foo", cast_to=Model, stream=True, stream_cls=AsyncStream[Model] + ) assert isinstance(stream, AsyncStream) await stream.response.aclose() @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio - async def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None: + async def test_received_text_for_expected_json( + self, respx_mock: MockRouter + ) -> None: class Model(BaseModel): name: str - respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format")) + respx_mock.get("/foo").mock( + return_value=httpx.Response(200, text="my-custom-format") + ) strict_client = AsyncGradient( base_url=base_url, @@ -1863,7 +2048,7 @@ class Model(BaseModel): with pytest.raises(APIResponseValidationError): await strict_client.get("/foo", cast_to=Model) - client = AsyncGradient( + non_strict_client = AsyncGradient( base_url=base_url, access_token=access_token, model_access_key=model_access_key, @@ -1871,9 +2056,12 @@ class Model(BaseModel): _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", [ @@ -1897,8 +2085,10 @@ 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 = AsyncGradient( + async def test_parse_retry_after_header( + self, remaining_retries: int, retry_after: str, timeout: float + ) -> None: + async_client = AsyncGradient( base_url=base_url, access_token=access_token, model_access_key=model_access_key, @@ -1908,15 +2098,21 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte 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) - assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] + calculated = async_client._calculate_retry_timeout( + remaining_retries, options, headers + ) + assert calculated == pytest.approx(timeout, rel=0.5 * 0.875) # type: ignore[misc] - @mock.patch("gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch( + "gradient._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, async_client: AsyncGradient ) -> None: - respx_mock.post("/chat/completions").mock(side_effect=httpx.TimeoutException("Test timeout error")) + respx_mock.post("/chat/completions").mock( + side_effect=httpx.TimeoutException("Test timeout error") + ) with pytest.raises(APITimeoutError): await async_client.chat.completions.with_streaming_response.create( @@ -1929,9 +2125,11 @@ async def test_retrying_timeout_errors_doesnt_leak( model="llama3-8b-instruct", ).__aenter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(async_client) == 0 - @mock.patch("gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch( + "gradient._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, async_client: AsyncGradient @@ -1948,12 +2146,13 @@ async def test_retrying_status_errors_doesnt_leak( ], model="llama3-8b-instruct", ).__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("gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch( + "gradient._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, @@ -1988,12 +2187,16 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: ) assert response.retries_taken == failures_before_success - assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success + assert ( + int(response.http_request.headers.get("x-stainless-retry-count")) + == failures_before_success + ) @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) - @mock.patch("gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch( + "gradient._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: AsyncGradient, @@ -2024,12 +2227,15 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: extra_headers={"x-stainless-retry-count": Omit()}, ) - assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 + assert ( + len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 + ) @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) - @mock.patch("gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch( + "gradient._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: AsyncGradient, @@ -2066,7 +2272,9 @@ 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: + 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") @@ -2089,26 +2297,38 @@ 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: AsyncGradient + ) -> 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"}) + return_value=httpx.Response( + 302, headers={"Location": f"{base_url}/redirected"} + ) + ) + respx_mock.get("/redirected").mock( + return_value=httpx.Response(200, json={"status": "ok"}) ) - 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: AsyncGradient + ) -> 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"}) + 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}, diff --git a/tests/test_models.py b/tests/test_models.py index de5ef465..ba635571 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -9,7 +9,7 @@ from gradient._utils import PropertyInfo from gradient._compat import PYDANTIC_V1, parse_obj, model_dump, model_json -from gradient._models import BaseModel, construct_type +from gradient._models import DISCRIMINATOR_CACHE, BaseModel, construct_type class BasicModel(BaseModel): @@ -809,7 +809,7 @@ class B(BaseModel): UnionType = cast(Any, Union[A, B]) - assert not hasattr(UnionType, "__discriminator__") + assert not DISCRIMINATOR_CACHE.get(UnionType) m = construct_type( value={"type": "b", "data": "foo"}, type_=cast(Any, Annotated[UnionType, PropertyInfo(discriminator="type")]) @@ -818,7 +818,7 @@ class B(BaseModel): assert m.type == "b" assert m.data == "foo" # type: ignore[comparison-overlap] - discriminator = UnionType.__discriminator__ + discriminator = DISCRIMINATOR_CACHE.get(UnionType) assert discriminator is not None m = construct_type( @@ -830,7 +830,7 @@ class B(BaseModel): # if the discriminator details object stays the same between invocations then # we hit the cache - assert UnionType.__discriminator__ is discriminator + assert DISCRIMINATOR_CACHE.get(UnionType) is discriminator @pytest.mark.skipif(PYDANTIC_V1, reason="TypeAliasType is not supported in Pydantic v1") diff --git a/tests/test_smoke_sdk_async.py b/tests/test_smoke_sdk_async.py index e732ec73..49e1ca78 100644 --- a/tests/test_smoke_sdk_async.py +++ b/tests/test_smoke_sdk_async.py @@ -25,61 +25,71 @@ async def test_async_smoke_environment_and_client_state() -> None: missing = [k for k in REQUIRED_ENV_VARS if not os.getenv(k)] if missing: pytest.fail( - "Missing required environment variables for async smoke tests: " + ", ".join(missing), + "Missing required environment variables for async smoke tests: " + + ", ".join(missing), pytrace=False, ) - client = AsyncGradient() - - # Property assertions (auto-loaded from environment) - assert client.access_token == os.environ["DIGITALOCEAN_ACCESS_TOKEN"], "access_token not loaded from env" - assert client.model_access_key == os.environ["GRADIENT_MODEL_ACCESS_KEY"], "model_access_key not loaded from env" - assert client.agent_access_key == os.environ["GRADIENT_AGENT_ACCESS_KEY"], "agent_access_key not loaded from env" - expected_endpoint = os.environ["GRADIENT_AGENT_ENDPOINT"] - normalized_expected = ( - expected_endpoint if expected_endpoint.startswith("https://") else f"https://{expected_endpoint}" - ) - assert client.agent_endpoint == normalized_expected, "agent_endpoint not derived correctly from env" + async with AsyncGradient() as client: + # Property assertions (auto-loaded from environment) + assert ( + client.access_token == os.environ["DIGITALOCEAN_ACCESS_TOKEN"] + ), "access_token not loaded from env" + assert ( + client.model_access_key == os.environ["GRADIENT_MODEL_ACCESS_KEY"] + ), "model_access_key not loaded from env" + assert ( + client.agent_access_key == os.environ["GRADIENT_AGENT_ACCESS_KEY"] + ), "agent_access_key not loaded from env" + expected_endpoint = os.environ["GRADIENT_AGENT_ENDPOINT"] + normalized_expected = ( + expected_endpoint + if expected_endpoint.startswith("https://") + else f"https://{expected_endpoint}" + ) + assert ( + client.agent_endpoint == normalized_expected + ), "agent_endpoint not derived correctly from env" @pytest.mark.smoke @pytest.mark.asyncio async def test_async_smoke_agents_listing() -> None: - client = AsyncGradient() - agents_list = await client.agents.list() - assert agents_list is not None - assert hasattr(agents_list, "agents") + async with AsyncGradient() as client: + agents_list = await client.agents.list() + assert agents_list is not None + assert hasattr(agents_list, "agents") @pytest.mark.smoke @pytest.mark.asyncio async def test_async_smoke_gpu_droplets_listing() -> None: - client = AsyncGradient() - droplets_list = await client.gpu_droplets.list(type="gpus") - assert droplets_list is not None - assert hasattr(droplets_list, "droplets") + async with AsyncGradient() as client: + droplets_list = await client.gpu_droplets.list(type="gpus") + assert droplets_list is not None + assert hasattr(droplets_list, "droplets") @pytest.mark.smoke @pytest.mark.asyncio async def test_async_smoke_inference_completion() -> None: - inference_client = AsyncGradient() - completion = await inference_client.chat.completions.create( - model="llama3-8b-instruct", - messages=[{"role": "user", "content": "ping"}], - ) - assert completion is not None - assert completion.choices - assert completion.choices[0].message.content is not None + async with AsyncGradient() as inference_client: + completion = await inference_client.chat.completions.create( + model="llama3-8b-instruct", + messages=[{"role": "user", "content": "ping"}], + ) + assert completion is not None + assert completion.choices + assert completion.choices[0].message.content is not None @pytest.mark.smoke @pytest.mark.asyncio async def test_async_smoke_agent_inference_chat() -> None: - agent_client = AsyncGradient() - completion = await agent_client.agents.chat.completions.create( - model="", - messages=[{"role": "user", "content": "ping"}], - ) - assert completion is not None - assert completion.choices + async with AsyncGradient() as agent_client: + completion = await agent_client.agents.chat.completions.create( + model="", + messages=[{"role": "user", "content": "ping"}], + ) + assert completion is not None + assert completion.choices From b0966ab9fd0fb0dcd1f2d0ff00ce59812138f5a5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Nov 2025 15:42:38 -0500 Subject: [PATCH 36/96] release: 3.8.0 (#82) * feat(api): manual updates * release: 3.8.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- .stats.yml | 2 +- CHANGELOG.md | 8 + api.md | 12 - pyproject.toml | 2 +- src/gradient/_version.py | 2 +- .../agents/evaluation_metrics/__init__.py | 14 - .../evaluation_metrics/evaluation_metrics.py | 32 --- .../agents/evaluation_metrics/models.py | 254 ------------------ .../agents/evaluation_metrics/__init__.py | 2 - .../evaluation_metrics/model_list_params.py | 42 --- .../evaluation_metrics/model_list_response.py | 21 -- .../agents/evaluation_metrics/test_models.py | 102 ------- 13 files changed, 12 insertions(+), 483 deletions(-) delete mode 100644 src/gradient/resources/agents/evaluation_metrics/models.py delete mode 100644 src/gradient/types/agents/evaluation_metrics/model_list_params.py delete mode 100644 src/gradient/types/agents/evaluation_metrics/model_list_response.py delete mode 100644 tests/api_resources/agents/evaluation_metrics/test_models.py diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 27d2fbbc..078b9e28 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.7.0" + ".": "3.8.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 425463f6..29f00c95 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/digitalocean%2Fgradient-f07d74847e620dfa26d8df40ea4680814af9bba381b3a57a7b6ed76ad49d85f8.yml openapi_spec_hash: e3553dc2abf2afd4368b736bcc32a289 -config_hash: b712366a70c9d33e22d40eb601ca972f +config_hash: b28984dd49d4baf1d68572efe83ac103 diff --git a/CHANGELOG.md b/CHANGELOG.md index 27493281..bf60097a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 3.8.0 (2025-11-20) + +Full Changelog: [v3.7.0...v3.8.0](https://github.com/digitalocean/gradient-python/compare/v3.7.0...v3.8.0) + +### Features + +* **api:** manual updates ([244277b](https://github.com/digitalocean/gradient-python/commit/244277b483ac97f733e8f37e0b556cb49813b554)) + ## 3.7.0 (2025-11-19) Full Changelog: [v3.6.0...v3.7.0](https://github.com/digitalocean/gradient-python/compare/v3.6.0...v3.7.0) diff --git a/api.md b/api.md index 49135772..e32fae32 100644 --- a/api.md +++ b/api.md @@ -155,18 +155,6 @@ Methods: - client.agents.evaluation_metrics.workspaces.agents.list(workspace_uuid, \*\*params) -> AgentListResponse - client.agents.evaluation_metrics.workspaces.agents.move(path_workspace_uuid, \*\*params) -> AgentMoveResponse -### Models - -Types: - -```python -from gradient.types.agents.evaluation_metrics import ModelListResponse -``` - -Methods: - -- client.agents.evaluation_metrics.models.list(\*\*params) -> ModelListResponse - ### Anthropic #### Keys diff --git a/pyproject.toml b/pyproject.toml index 3832f578..28cc09df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gradient" -version = "3.7.0" +version = "3.8.0" description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gradient/_version.py b/src/gradient/_version.py index 6e29a000..defad636 100644 --- a/src/gradient/_version.py +++ b/src/gradient/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gradient" -__version__ = "3.7.0" # x-release-please-version +__version__ = "3.8.0" # x-release-please-version diff --git a/src/gradient/resources/agents/evaluation_metrics/__init__.py b/src/gradient/resources/agents/evaluation_metrics/__init__.py index 515a221b..fcb54c78 100644 --- a/src/gradient/resources/agents/evaluation_metrics/__init__.py +++ b/src/gradient/resources/agents/evaluation_metrics/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .models import ( - ModelsResource, - AsyncModelsResource, - ModelsResourceWithRawResponse, - AsyncModelsResourceWithRawResponse, - ModelsResourceWithStreamingResponse, - AsyncModelsResourceWithStreamingResponse, -) from .oauth2 import ( Oauth2Resource, AsyncOauth2Resource, @@ -64,12 +56,6 @@ "AsyncWorkspacesResourceWithRawResponse", "WorkspacesResourceWithStreamingResponse", "AsyncWorkspacesResourceWithStreamingResponse", - "ModelsResource", - "AsyncModelsResource", - "ModelsResourceWithRawResponse", - "AsyncModelsResourceWithRawResponse", - "ModelsResourceWithStreamingResponse", - "AsyncModelsResourceWithStreamingResponse", "AnthropicResource", "AsyncAnthropicResource", "AnthropicResourceWithRawResponse", diff --git a/src/gradient/resources/agents/evaluation_metrics/evaluation_metrics.py b/src/gradient/resources/agents/evaluation_metrics/evaluation_metrics.py index 14ea4d55..b9080132 100644 --- a/src/gradient/resources/agents/evaluation_metrics/evaluation_metrics.py +++ b/src/gradient/resources/agents/evaluation_metrics/evaluation_metrics.py @@ -4,14 +4,6 @@ import httpx -from .models import ( - ModelsResource, - AsyncModelsResource, - ModelsResourceWithRawResponse, - AsyncModelsResourceWithRawResponse, - ModelsResourceWithStreamingResponse, - AsyncModelsResourceWithStreamingResponse, -) from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property @@ -75,10 +67,6 @@ class EvaluationMetricsResource(SyncAPIResource): def workspaces(self) -> WorkspacesResource: return WorkspacesResource(self._client) - @cached_property - def models(self) -> ModelsResource: - return ModelsResource(self._client) - @cached_property def anthropic(self) -> AnthropicResource: return AnthropicResource(self._client) @@ -192,10 +180,6 @@ class AsyncEvaluationMetricsResource(AsyncAPIResource): def workspaces(self) -> AsyncWorkspacesResource: return AsyncWorkspacesResource(self._client) - @cached_property - def models(self) -> AsyncModelsResource: - return AsyncModelsResource(self._client) - @cached_property def anthropic(self) -> AsyncAnthropicResource: return AsyncAnthropicResource(self._client) @@ -319,10 +303,6 @@ def __init__(self, evaluation_metrics: EvaluationMetricsResource) -> None: def workspaces(self) -> WorkspacesResourceWithRawResponse: return WorkspacesResourceWithRawResponse(self._evaluation_metrics.workspaces) - @cached_property - def models(self) -> ModelsResourceWithRawResponse: - return ModelsResourceWithRawResponse(self._evaluation_metrics.models) - @cached_property def anthropic(self) -> AnthropicResourceWithRawResponse: return AnthropicResourceWithRawResponse(self._evaluation_metrics.anthropic) @@ -355,10 +335,6 @@ def __init__(self, evaluation_metrics: AsyncEvaluationMetricsResource) -> None: def workspaces(self) -> AsyncWorkspacesResourceWithRawResponse: return AsyncWorkspacesResourceWithRawResponse(self._evaluation_metrics.workspaces) - @cached_property - def models(self) -> AsyncModelsResourceWithRawResponse: - return AsyncModelsResourceWithRawResponse(self._evaluation_metrics.models) - @cached_property def anthropic(self) -> AsyncAnthropicResourceWithRawResponse: return AsyncAnthropicResourceWithRawResponse(self._evaluation_metrics.anthropic) @@ -391,10 +367,6 @@ def __init__(self, evaluation_metrics: EvaluationMetricsResource) -> None: def workspaces(self) -> WorkspacesResourceWithStreamingResponse: return WorkspacesResourceWithStreamingResponse(self._evaluation_metrics.workspaces) - @cached_property - def models(self) -> ModelsResourceWithStreamingResponse: - return ModelsResourceWithStreamingResponse(self._evaluation_metrics.models) - @cached_property def anthropic(self) -> AnthropicResourceWithStreamingResponse: return AnthropicResourceWithStreamingResponse(self._evaluation_metrics.anthropic) @@ -427,10 +399,6 @@ def __init__(self, evaluation_metrics: AsyncEvaluationMetricsResource) -> None: def workspaces(self) -> AsyncWorkspacesResourceWithStreamingResponse: return AsyncWorkspacesResourceWithStreamingResponse(self._evaluation_metrics.workspaces) - @cached_property - def models(self) -> AsyncModelsResourceWithStreamingResponse: - return AsyncModelsResourceWithStreamingResponse(self._evaluation_metrics.models) - @cached_property def anthropic(self) -> AsyncAnthropicResourceWithStreamingResponse: return AsyncAnthropicResourceWithStreamingResponse(self._evaluation_metrics.anthropic) diff --git a/src/gradient/resources/agents/evaluation_metrics/models.py b/src/gradient/resources/agents/evaluation_metrics/models.py deleted file mode 100644 index 7728e662..00000000 --- a/src/gradient/resources/agents/evaluation_metrics/models.py +++ /dev/null @@ -1,254 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List -from typing_extensions import Literal - -import httpx - -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 -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...._base_client import make_request_options -from ....types.agents.evaluation_metrics import model_list_params -from ....types.agents.evaluation_metrics.model_list_response import ModelListResponse - -__all__ = ["ModelsResource", "AsyncModelsResource"] - - -class ModelsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> ModelsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers - """ - return ModelsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> ModelsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response - """ - return ModelsResourceWithStreamingResponse(self) - - def list( - self, - *, - page: int | Omit = omit, - per_page: int | Omit = omit, - public_only: bool | Omit = omit, - usecases: List[ - Literal[ - "MODEL_USECASE_UNKNOWN", - "MODEL_USECASE_AGENT", - "MODEL_USECASE_FINETUNED", - "MODEL_USECASE_KNOWLEDGEBASE", - "MODEL_USECASE_GUARDRAIL", - "MODEL_USECASE_REASONING", - "MODEL_USECASE_SERVERLESS", - ] - ] - | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> ModelListResponse: - """ - To list all models, send a GET request to `/v2/gen-ai/models`. - - Args: - page: Page number. - - per_page: Items per page. - - public_only: Only include models that are publicly available. - - usecases: Include only models defined for the listed usecases. - - - MODEL_USECASE_UNKNOWN: The use case of the model is unknown - - MODEL_USECASE_AGENT: The model maybe used in an agent - - MODEL_USECASE_FINETUNED: The model maybe used for fine tuning - - MODEL_USECASE_KNOWLEDGEBASE: The model maybe used for knowledge bases - (embedding models) - - MODEL_USECASE_GUARDRAIL: The model maybe used for guardrails - - MODEL_USECASE_REASONING: The model usecase for reasoning - - MODEL_USECASE_SERVERLESS: The model usecase for serverless inference - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get( - "/v2/gen-ai/models" - if self._client._base_url_overridden - else "https://api.digitalocean.com/v2/gen-ai/models", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "page": page, - "per_page": per_page, - "public_only": public_only, - "usecases": usecases, - }, - model_list_params.ModelListParams, - ), - ), - cast_to=ModelListResponse, - ) - - -class AsyncModelsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncModelsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers - """ - return AsyncModelsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncModelsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response - """ - return AsyncModelsResourceWithStreamingResponse(self) - - async def list( - self, - *, - page: int | Omit = omit, - per_page: int | Omit = omit, - public_only: bool | Omit = omit, - usecases: List[ - Literal[ - "MODEL_USECASE_UNKNOWN", - "MODEL_USECASE_AGENT", - "MODEL_USECASE_FINETUNED", - "MODEL_USECASE_KNOWLEDGEBASE", - "MODEL_USECASE_GUARDRAIL", - "MODEL_USECASE_REASONING", - "MODEL_USECASE_SERVERLESS", - ] - ] - | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> ModelListResponse: - """ - To list all models, send a GET request to `/v2/gen-ai/models`. - - Args: - page: Page number. - - per_page: Items per page. - - public_only: Only include models that are publicly available. - - usecases: Include only models defined for the listed usecases. - - - MODEL_USECASE_UNKNOWN: The use case of the model is unknown - - MODEL_USECASE_AGENT: The model maybe used in an agent - - MODEL_USECASE_FINETUNED: The model maybe used for fine tuning - - MODEL_USECASE_KNOWLEDGEBASE: The model maybe used for knowledge bases - (embedding models) - - MODEL_USECASE_GUARDRAIL: The model maybe used for guardrails - - MODEL_USECASE_REASONING: The model usecase for reasoning - - MODEL_USECASE_SERVERLESS: The model usecase for serverless inference - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return await self._get( - "/v2/gen-ai/models" - if self._client._base_url_overridden - else "https://api.digitalocean.com/v2/gen-ai/models", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "page": page, - "per_page": per_page, - "public_only": public_only, - "usecases": usecases, - }, - model_list_params.ModelListParams, - ), - ), - cast_to=ModelListResponse, - ) - - -class ModelsResourceWithRawResponse: - def __init__(self, models: ModelsResource) -> None: - self._models = models - - self.list = to_raw_response_wrapper( - models.list, - ) - - -class AsyncModelsResourceWithRawResponse: - def __init__(self, models: AsyncModelsResource) -> None: - self._models = models - - self.list = async_to_raw_response_wrapper( - models.list, - ) - - -class ModelsResourceWithStreamingResponse: - def __init__(self, models: ModelsResource) -> None: - self._models = models - - self.list = to_streamed_response_wrapper( - models.list, - ) - - -class AsyncModelsResourceWithStreamingResponse: - def __init__(self, models: AsyncModelsResource) -> None: - self._models = models - - self.list = async_to_streamed_response_wrapper( - models.list, - ) diff --git a/src/gradient/types/agents/evaluation_metrics/__init__.py b/src/gradient/types/agents/evaluation_metrics/__init__.py index ade2b376..971eddef 100644 --- a/src/gradient/types/agents/evaluation_metrics/__init__.py +++ b/src/gradient/types/agents/evaluation_metrics/__init__.py @@ -7,8 +7,6 @@ anthropic, # type: ignore # noqa: F401 workspaces, # type: ignore # noqa: F401 ) -from .model_list_params import ModelListParams as ModelListParams -from .model_list_response import ModelListResponse as ModelListResponse from .workspace_create_params import WorkspaceCreateParams as WorkspaceCreateParams from .workspace_list_response import WorkspaceListResponse as WorkspaceListResponse from .workspace_update_params import WorkspaceUpdateParams as WorkspaceUpdateParams diff --git a/src/gradient/types/agents/evaluation_metrics/model_list_params.py b/src/gradient/types/agents/evaluation_metrics/model_list_params.py deleted file mode 100644 index a2fa066a..00000000 --- a/src/gradient/types/agents/evaluation_metrics/model_list_params.py +++ /dev/null @@ -1,42 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List -from typing_extensions import Literal, TypedDict - -__all__ = ["ModelListParams"] - - -class ModelListParams(TypedDict, total=False): - page: int - """Page number.""" - - per_page: int - """Items per page.""" - - public_only: bool - """Only include models that are publicly available.""" - - usecases: List[ - Literal[ - "MODEL_USECASE_UNKNOWN", - "MODEL_USECASE_AGENT", - "MODEL_USECASE_FINETUNED", - "MODEL_USECASE_KNOWLEDGEBASE", - "MODEL_USECASE_GUARDRAIL", - "MODEL_USECASE_REASONING", - "MODEL_USECASE_SERVERLESS", - ] - ] - """Include only models defined for the listed usecases. - - - MODEL_USECASE_UNKNOWN: The use case of the model is unknown - - MODEL_USECASE_AGENT: The model maybe used in an agent - - MODEL_USECASE_FINETUNED: The model maybe used for fine tuning - - MODEL_USECASE_KNOWLEDGEBASE: The model maybe used for knowledge bases - (embedding models) - - MODEL_USECASE_GUARDRAIL: The model maybe used for guardrails - - MODEL_USECASE_REASONING: The model usecase for reasoning - - MODEL_USECASE_SERVERLESS: The model usecase for serverless inference - """ diff --git a/src/gradient/types/agents/evaluation_metrics/model_list_response.py b/src/gradient/types/agents/evaluation_metrics/model_list_response.py deleted file mode 100644 index 2fc17524..00000000 --- a/src/gradient/types/agents/evaluation_metrics/model_list_response.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ...._models import BaseModel -from ...api_model import APIModel -from ...shared.api_meta import APIMeta -from ...shared.api_links import APILinks - -__all__ = ["ModelListResponse"] - - -class ModelListResponse(BaseModel): - links: Optional[APILinks] = None - """Links to other pages""" - - meta: Optional[APIMeta] = None - """Meta information about the data set""" - - models: Optional[List[APIModel]] = None - """The models""" diff --git a/tests/api_resources/agents/evaluation_metrics/test_models.py b/tests/api_resources/agents/evaluation_metrics/test_models.py deleted file mode 100644 index 677b3383..00000000 --- a/tests/api_resources/agents/evaluation_metrics/test_models.py +++ /dev/null @@ -1,102 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from gradient import Gradient, AsyncGradient -from tests.utils import assert_matches_type -from gradient.types.agents.evaluation_metrics import ModelListResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestModels: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @pytest.mark.skip(reason="Prism tests are disabled") - @parametrize - def test_method_list(self, client: Gradient) -> None: - model = client.agents.evaluation_metrics.models.list() - assert_matches_type(ModelListResponse, model, path=["response"]) - - @pytest.mark.skip(reason="Prism tests are disabled") - @parametrize - def test_method_list_with_all_params(self, client: Gradient) -> None: - model = client.agents.evaluation_metrics.models.list( - page=0, - per_page=0, - public_only=True, - usecases=["MODEL_USECASE_UNKNOWN"], - ) - assert_matches_type(ModelListResponse, model, path=["response"]) - - @pytest.mark.skip(reason="Prism tests are disabled") - @parametrize - def test_raw_response_list(self, client: Gradient) -> None: - response = client.agents.evaluation_metrics.models.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - model = response.parse() - assert_matches_type(ModelListResponse, model, path=["response"]) - - @pytest.mark.skip(reason="Prism tests are disabled") - @parametrize - def test_streaming_response_list(self, client: Gradient) -> None: - with client.agents.evaluation_metrics.models.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - model = response.parse() - assert_matches_type(ModelListResponse, model, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncModels: - parametrize = pytest.mark.parametrize( - "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] - ) - - @pytest.mark.skip(reason="Prism tests are disabled") - @parametrize - async def test_method_list(self, async_client: AsyncGradient) -> None: - model = await async_client.agents.evaluation_metrics.models.list() - assert_matches_type(ModelListResponse, model, path=["response"]) - - @pytest.mark.skip(reason="Prism tests are disabled") - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: - model = await async_client.agents.evaluation_metrics.models.list( - page=0, - per_page=0, - public_only=True, - usecases=["MODEL_USECASE_UNKNOWN"], - ) - assert_matches_type(ModelListResponse, model, path=["response"]) - - @pytest.mark.skip(reason="Prism tests are disabled") - @parametrize - async def test_raw_response_list(self, async_client: AsyncGradient) -> None: - response = await async_client.agents.evaluation_metrics.models.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - model = await response.parse() - assert_matches_type(ModelListResponse, model, path=["response"]) - - @pytest.mark.skip(reason="Prism tests are disabled") - @parametrize - async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: - async with async_client.agents.evaluation_metrics.models.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - model = await response.parse() - assert_matches_type(ModelListResponse, model, path=["response"]) - - assert cast(Any, response.is_closed) is True From f44e9e1a44d2dae7c26993fda540299828a4855e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 22 Nov 2025 04:57:13 +0000 Subject: [PATCH 37/96] chore: add Python 3.14 classifier and testing --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 28cc09df..885c216f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Operating System :: OS Independent", "Operating System :: POSIX", "Operating System :: MacOS", From 22740a742389e64a974eb026042c1f747f2785f4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Nov 2025 16:52:03 +0000 Subject: [PATCH 38/96] fix: ensure streams are always closed --- src/gradient/_streaming.py | 94 +++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 46 deletions(-) diff --git a/src/gradient/_streaming.py b/src/gradient/_streaming.py index df2a5870..f0516264 100644 --- a/src/gradient/_streaming.py +++ b/src/gradient/_streaming.py @@ -55,29 +55,30 @@ def __stream__(self) -> Iterator[_T]: process_data = self._client._process_response_data iterator = self._iter_events() - for sse in iterator: - if sse.data.startswith("[DONE]"): - break - - data = sse.json() - if is_mapping(data) and data.get("error"): - message = None - error = data.get("error") - if is_mapping(error): - message = error.get("message") - if not message or not isinstance(message, str): - message = "An error occurred during streaming" - - raise APIError( - message=message, - request=self.response.request, - body=data["error"], - ) - - yield process_data(data=data, cast_to=cast_to, response=response) - - # As we might not fully consume the response stream, we need to close it explicitly - response.close() + try: + for sse in iterator: + if sse.data.startswith("[DONE]"): + break + + data = sse.json() + if is_mapping(data) and data.get("error"): + message = None + error = data.get("error") + if is_mapping(error): + message = error.get("message") + if not message or not isinstance(message, str): + message = "An error occurred during streaming" + + raise APIError( + message=message, + request=self.response.request, + body=data["error"], + ) + + yield process_data(data=data, cast_to=cast_to, response=response) + finally: + # Ensure the response is closed even if the consumer doesn't read all data + response.close() def __enter__(self) -> Self: return self @@ -136,29 +137,30 @@ async def __stream__(self) -> AsyncIterator[_T]: process_data = self._client._process_response_data iterator = self._iter_events() - async for sse in iterator: - if sse.data.startswith("[DONE]"): - break - - data = sse.json() - if is_mapping(data) and data.get("error"): - message = None - error = data.get("error") - if is_mapping(error): - message = error.get("message") - if not message or not isinstance(message, str): - message = "An error occurred during streaming" - - raise APIError( - message=message, - request=self.response.request, - body=data["error"], - ) - - yield process_data(data=data, cast_to=cast_to, response=response) - - # As we might not fully consume the response stream, we need to close it explicitly - await response.aclose() + try: + async for sse in iterator: + if sse.data.startswith("[DONE]"): + break + + data = sse.json() + if is_mapping(data) and data.get("error"): + message = None + error = data.get("error") + if is_mapping(error): + message = error.get("message") + if not message or not isinstance(message, str): + message = "An error occurred during streaming" + + raise APIError( + message=message, + request=self.response.request, + body=data["error"], + ) + + yield process_data(data=data, cast_to=cast_to, response=response) + finally: + # Ensure the response is closed even if the consumer doesn't read all data + await response.aclose() async def __aenter__(self) -> Self: return self From 78361c45d680bb936956d1ee4e518143d718ce30 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Nov 2025 18:46:54 +0000 Subject: [PATCH 39/96] chore(deps): mypy 1.18.1 has a regression, pin to 1.17 --- pyproject.toml | 2 +- requirements-dev.lock | 4 +++- requirements.lock | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 885c216f..1b1b19b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,7 @@ managed = true # version pins are in requirements-dev.lock dev-dependencies = [ "pyright==1.1.399", - "mypy", + "mypy==1.17", "respx", "pytest", "pytest-asyncio", diff --git a/requirements-dev.lock b/requirements-dev.lock index e5307af8..d4a3215f 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -72,7 +72,7 @@ mdurl==0.1.2 multidict==6.4.4 # via aiohttp # via yarl -mypy==1.14.1 +mypy==1.17.0 mypy-extensions==1.0.0 # via mypy nodeenv==1.8.0 @@ -81,6 +81,8 @@ nox==2023.4.22 packaging==23.2 # via nox # via pytest +pathspec==0.12.1 + # via mypy platformdirs==3.11.0 # via virtualenv pluggy==1.5.0 diff --git a/requirements.lock b/requirements.lock index 8c60e6c5..7f3b8c23 100644 --- a/requirements.lock +++ b/requirements.lock @@ -55,21 +55,21 @@ multidict==6.4.4 propcache==0.3.1 # via aiohttp # via yarl -pydantic==2.11.9 +pydantic==2.12.5 # via gradient -pydantic-core==2.33.2 +pydantic-core==2.41.5 # via pydantic sniffio==1.3.0 # via anyio # via gradient -typing-extensions==4.12.2 +typing-extensions==4.15.0 # via anyio # via gradient # via multidict # via pydantic # via pydantic-core # via typing-inspection -typing-inspection==0.4.1 +typing-inspection==0.4.2 # via pydantic yarl==1.20.0 # via aiohttp From 82706d73b5e9465704a7e6d9f85c5ed6c844e659 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 11:06:38 +0000 Subject: [PATCH 40/96] chore: update lockfile --- pyproject.toml | 2 + requirements-dev.lock | 108 +++++++++++++++++++++++------------------- requirements.lock | 31 ++++++------ 3 files changed, 77 insertions(+), 64 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1b1b19b4..8af6bcd1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,6 +5,7 @@ description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" authors = [{ name = "DigitalOcean, LLC", email = "dev@digitalocean.com" }] + dependencies = [ "httpx>=0.23.0, <1", "pydantic>=1.9.0, <3", @@ -13,6 +14,7 @@ dependencies = [ "distro>=1.7.0, <2", "sniffio", ] + requires-python = ">= 3.9" classifiers = [ "Typing :: Typed", diff --git a/requirements-dev.lock b/requirements-dev.lock index d4a3215f..63b7bd64 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -12,40 +12,45 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.12.8 +aiohttp==3.13.2 # via gradient # via httpx-aiohttp -aiosignal==1.3.2 +aiosignal==1.4.0 # via aiohttp -annotated-types==0.6.0 +annotated-types==0.7.0 # via pydantic -anyio==4.4.0 +anyio==4.12.0 # via gradient # via httpx -argcomplete==3.1.2 +argcomplete==3.6.3 # via nox async-timeout==5.0.1 # via aiohttp -attrs==25.3.0 +attrs==25.4.0 # via aiohttp -certifi==2023.7.22 + # via nox +backports-asyncio-runner==1.2.0 + # via pytest-asyncio +certifi==2025.11.12 # via httpcore # via httpx -colorlog==6.7.0 +colorlog==6.10.1 + # via nox +dependency-groups==1.3.1 # via nox -dirty-equals==0.6.0 -distlib==0.3.7 +dirty-equals==0.11 +distlib==0.4.0 # via virtualenv -distro==1.8.0 +distro==1.9.0 # via gradient -exceptiongroup==1.2.2 +exceptiongroup==1.3.1 # via anyio # via pytest -execnet==2.1.1 +execnet==2.1.2 # via pytest-xdist -filelock==3.12.4 +filelock==3.19.1 # via virtualenv -frozenlist==1.6.2 +frozenlist==1.8.0 # via aiohttp # via aiosignal h11==0.16.0 @@ -58,82 +63,87 @@ httpx==0.28.1 # via respx httpx-aiohttp==0.1.9 # via gradient -idna==3.4 +humanize==4.13.0 + # via nox +idna==3.11 # via anyio # via httpx # via yarl -importlib-metadata==7.0.0 -iniconfig==2.0.0 +importlib-metadata==8.7.0 +iniconfig==2.1.0 # via pytest markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py -multidict==6.4.4 +multidict==6.7.0 # via aiohttp # via yarl mypy==1.17.0 -mypy-extensions==1.0.0 +mypy-extensions==1.1.0 # via mypy -nodeenv==1.8.0 +nodeenv==1.9.1 # via pyright -nox==2023.4.22 -packaging==23.2 +nox==2025.11.12 +packaging==25.0 + # via dependency-groups # via nox # via pytest pathspec==0.12.1 # via mypy -platformdirs==3.11.0 +platformdirs==4.4.0 # via virtualenv -pluggy==1.5.0 +pluggy==1.6.0 # via pytest -propcache==0.3.1 +propcache==0.4.1 # via aiohttp # via yarl -pydantic==2.11.9 +pydantic==2.12.5 # via gradient -pydantic-core==2.33.2 +pydantic-core==2.41.5 # via pydantic -pygments==2.18.0 +pygments==2.19.2 + # via pytest # via rich pyright==1.1.399 -pytest==8.3.3 +pytest==8.4.2 # via pytest-asyncio # via pytest-xdist -pytest-asyncio==0.24.0 -pytest-xdist==3.7.0 -python-dateutil==2.8.2 +pytest-asyncio==1.2.0 +pytest-xdist==3.8.0 +python-dateutil==2.9.0.post0 # via time-machine -pytz==2023.3.post1 - # via dirty-equals respx==0.22.0 -rich==13.7.1 -ruff==0.9.4 -setuptools==68.2.2 - # via nodeenv -six==1.16.0 +rich==14.2.0 +ruff==0.14.7 +six==1.17.0 # via python-dateutil -sniffio==1.3.0 - # via anyio +sniffio==1.3.1 # via gradient -time-machine==2.9.0 -tomli==2.0.2 +time-machine==2.19.0 +tomli==2.3.0 + # via dependency-groups # via mypy + # via nox # via pytest -typing-extensions==4.12.2 +typing-extensions==4.15.0 + # via aiosignal # via anyio + # via exceptiongroup # via gradient # via multidict # via mypy # via pydantic # via pydantic-core # via pyright + # via pytest-asyncio # via typing-inspection -typing-inspection==0.4.1 + # via virtualenv +typing-inspection==0.4.2 # via pydantic -virtualenv==20.24.5 +virtualenv==20.35.4 # via nox -yarl==1.20.0 +yarl==1.22.0 # via aiohttp -zipp==3.17.0 +zipp==3.23.0 # via importlib-metadata diff --git a/requirements.lock b/requirements.lock index 7f3b8c23..b2623a7b 100644 --- a/requirements.lock +++ b/requirements.lock @@ -12,28 +12,28 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.12.8 +aiohttp==3.13.2 # via gradient # via httpx-aiohttp -aiosignal==1.3.2 +aiosignal==1.4.0 # via aiohttp -annotated-types==0.6.0 +annotated-types==0.7.0 # via pydantic -anyio==4.4.0 +anyio==4.12.0 # via gradient # via httpx async-timeout==5.0.1 # via aiohttp -attrs==25.3.0 +attrs==25.4.0 # via aiohttp -certifi==2023.7.22 +certifi==2025.11.12 # via httpcore # via httpx -distro==1.8.0 +distro==1.9.0 # via gradient -exceptiongroup==1.2.2 +exceptiongroup==1.3.1 # via anyio -frozenlist==1.6.2 +frozenlist==1.8.0 # via aiohttp # via aiosignal h11==0.16.0 @@ -45,25 +45,26 @@ httpx==0.28.1 # via httpx-aiohttp httpx-aiohttp==0.1.9 # via gradient -idna==3.4 +idna==3.11 # via anyio # via httpx # via yarl -multidict==6.4.4 +multidict==6.7.0 # via aiohttp # via yarl -propcache==0.3.1 +propcache==0.4.1 # via aiohttp # via yarl pydantic==2.12.5 # via gradient pydantic-core==2.41.5 # via pydantic -sniffio==1.3.0 - # via anyio +sniffio==1.3.1 # via gradient typing-extensions==4.15.0 + # via aiosignal # via anyio + # via exceptiongroup # via gradient # via multidict # via pydantic @@ -71,5 +72,5 @@ typing-extensions==4.15.0 # via typing-inspection typing-inspection==0.4.2 # via pydantic -yarl==1.20.0 +yarl==1.22.0 # via aiohttp From d801576a878c4149588c3a13f06fb2e9ffecb38e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 11 Dec 2025 11:38:52 +0000 Subject: [PATCH 41/96] feat(api): update via SDK Studio --- .stats.yml | 4 +- .../resources/agents/chat/completions.py | 8 +- src/gradient/resources/chat/completions.py | 8 +- src/gradient/resources/images.py | 8 +- src/gradient/resources/nfs/nfs.py | 212 +++++++++++++-- .../types/agents/api_evaluation_metric.py | 15 ++ .../types/knowledge_bases/api_indexing_job.py | 13 +- .../api_knowledge_base_data_source.py | 4 - .../api_web_crawler_data_source.py | 3 +- .../api_web_crawler_data_source_param.py | 3 +- .../types/nf_initiate_action_params.py | 36 ++- tests/api_resources/test_nfs.py | 244 ++++++++++++++++++ 12 files changed, 503 insertions(+), 55 deletions(-) diff --git a/.stats.yml b/.stats.yml index 29f00c95..45ccb9db 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/digitalocean%2Fgradient-f07d74847e620dfa26d8df40ea4680814af9bba381b3a57a7b6ed76ad49d85f8.yml -openapi_spec_hash: e3553dc2abf2afd4368b736bcc32a289 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-30169d8c02f8de86ae431cb475d1c44326289f9690e3c2a7a0442bf081870680.yml +openapi_spec_hash: f266f59f7fcc777103f8b5b002b30c8e config_hash: b28984dd49d4baf1d68572efe83ac103 diff --git a/src/gradient/resources/agents/chat/completions.py b/src/gradient/resources/agents/chat/completions.py index 374fdc16..67a57557 100644 --- a/src/gradient/resources/agents/chat/completions.py +++ b/src/gradient/resources/agents/chat/completions.py @@ -472,9 +472,7 @@ def create( headers = {"Authorization": f"Bearer {self._client.agent_access_key}", **headers} return self._post( - "/chat/completions?agent=true" - if self._client._base_url_overridden - else f"{self._client.agent_endpoint}/api/v1/chat/completions?agent=true", + "/chat/completions?agent=true", body=maybe_transform( { "messages": messages, @@ -958,9 +956,7 @@ async def create( headers = {"Authorization": f"Bearer {self._client.agent_access_key}", **headers} return await self._post( - "/chat/completions?agent=true" - if self._client._base_url_overridden - else f"{self._client.agent_endpoint}/api/v1/chat/completions?agent=true", + "/chat/completions?agent=true", body=await async_maybe_transform( { "messages": messages, diff --git a/src/gradient/resources/chat/completions.py b/src/gradient/resources/chat/completions.py index 779fffb0..8d0c43c5 100644 --- a/src/gradient/resources/chat/completions.py +++ b/src/gradient/resources/chat/completions.py @@ -473,9 +473,7 @@ def create( } return self._post( - "/chat/completions" - if self._client._base_url_overridden - else f"{self._client.inference_endpoint}/v1/chat/completions", + "/chat/completions", body=maybe_transform( { "messages": messages, @@ -963,9 +961,7 @@ async def create( } return await self._post( - "/chat/completions" - if self._client._base_url_overridden - else f"{self._client.inference_endpoint}/v1/chat/completions", + "/chat/completions", body=await async_maybe_transform( { "messages": messages, diff --git a/src/gradient/resources/images.py b/src/gradient/resources/images.py index 14bbfeaa..ce7a7b48 100644 --- a/src/gradient/resources/images.py +++ b/src/gradient/resources/images.py @@ -317,9 +317,7 @@ def generate( } return self._post( - "/images/generations" - if self._client._base_url_overridden - else f"{self._client.inference_endpoint}/v1/images/generations", + "/images/generations", body=maybe_transform( { "prompt": prompt, @@ -638,9 +636,7 @@ async def generate( **headers, } return await self._post( - "/images/generations" - if self._client._base_url_overridden - else f"{self._client.inference_endpoint}/v1/images/generations", + "/images/generations", body=await async_maybe_transform( { "prompt": prompt, diff --git a/src/gradient/resources/nfs/nfs.py b/src/gradient/resources/nfs/nfs.py index 1510bb69..a46df265 100644 --- a/src/gradient/resources/nfs/nfs.py +++ b/src/gradient/resources/nfs/nfs.py @@ -259,10 +259,12 @@ def initiate_action( request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the `type` attribute to on of the supported action types: - | Action | Details | - | ----------------------- | -------------------------------------------------------------------------- | - | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | - | `snapshot` | Takes a snapshot of an NFS share | + | Action | Details | + | ----------------------- | -------------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | + | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | Args: region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. @@ -299,10 +301,96 @@ def initiate_action( request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the `type` attribute to on of the supported action types: - | Action | Details | - | ----------------------- | -------------------------------------------------------------------------- | - | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | - | `snapshot` | Takes a snapshot of an NFS share | + | Action | Details | + | ----------------------- | -------------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | + | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + + Args: + region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. + + type: The type of action to initiate for the NFS share (such as resize or snapshot). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def initiate_action( + self, + nfs_id: str, + *, + region: str, + type: Literal["resize", "snapshot"], + params: nf_initiate_action_params.NfsActionAttachParams | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NfInitiateActionResponse: + """ + To execute an action (such as resize) on a specified NFS share, send a POST + request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the + `type` attribute to on of the supported action types: + + | Action | Details | + | ----------------------- | -------------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | + | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + + Args: + region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. + + type: The type of action to initiate for the NFS share (such as resize or snapshot). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def initiate_action( + self, + nfs_id: str, + *, + region: str, + type: Literal["resize", "snapshot"], + params: nf_initiate_action_params.NfsActionDetachParams | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NfInitiateActionResponse: + """ + To execute an action (such as resize) on a specified NFS share, send a POST + request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the + `type` attribute to on of the supported action types: + + | Action | Details | + | ----------------------- | -------------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | + | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | Args: region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. @@ -328,6 +416,8 @@ def initiate_action( type: Literal["resize", "snapshot"], params: nf_initiate_action_params.NfsActionResizeParams | nf_initiate_action_params.NfsActionSnapshotParams + | nf_initiate_action_params.NfsActionAttachParams + | nf_initiate_action_params.NfsActionDetachParams | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -582,10 +672,12 @@ async def initiate_action( request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the `type` attribute to on of the supported action types: - | Action | Details | - | ----------------------- | -------------------------------------------------------------------------- | - | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | - | `snapshot` | Takes a snapshot of an NFS share | + | Action | Details | + | ----------------------- | -------------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | + | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | Args: region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. @@ -622,10 +714,96 @@ async def initiate_action( request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the `type` attribute to on of the supported action types: - | Action | Details | - | ----------------------- | -------------------------------------------------------------------------- | - | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | - | `snapshot` | Takes a snapshot of an NFS share | + | Action | Details | + | ----------------------- | -------------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | + | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + + Args: + region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. + + type: The type of action to initiate for the NFS share (such as resize or snapshot). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def initiate_action( + self, + nfs_id: str, + *, + region: str, + type: Literal["resize", "snapshot"], + params: nf_initiate_action_params.NfsActionAttachParams | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NfInitiateActionResponse: + """ + To execute an action (such as resize) on a specified NFS share, send a POST + request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the + `type` attribute to on of the supported action types: + + | Action | Details | + | ----------------------- | -------------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | + | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + + Args: + region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. + + type: The type of action to initiate for the NFS share (such as resize or snapshot). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def initiate_action( + self, + nfs_id: str, + *, + region: str, + type: Literal["resize", "snapshot"], + params: nf_initiate_action_params.NfsActionDetachParams | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NfInitiateActionResponse: + """ + To execute an action (such as resize) on a specified NFS share, send a POST + request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the + `type` attribute to on of the supported action types: + + | Action | Details | + | ----------------------- | -------------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | + | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | Args: region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. @@ -651,6 +829,8 @@ async def initiate_action( type: Literal["resize", "snapshot"], params: nf_initiate_action_params.NfsActionResizeParams | nf_initiate_action_params.NfsActionSnapshotParams + | nf_initiate_action_params.NfsActionAttachParams + | nf_initiate_action_params.NfsActionDetachParams | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API 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/gradient/types/agents/api_evaluation_metric.py b/src/gradient/types/agents/api_evaluation_metric.py index 2d3b4194..84c3ea0a 100644 --- a/src/gradient/types/agents/api_evaluation_metric.py +++ b/src/gradient/types/agents/api_evaluation_metric.py @@ -9,13 +9,28 @@ class APIEvaluationMetric(BaseModel): + category: Optional[ + Literal[ + "METRIC_CATEGORY_UNSPECIFIED", + "METRIC_CATEGORY_CORRECTNESS", + "METRIC_CATEGORY_USER_OUTCOMES", + "METRIC_CATEGORY_SAFETY_AND_SECURITY", + "METRIC_CATEGORY_CONTEXT_QUALITY", + "METRIC_CATEGORY_MODEL_FIT", + ] + ] = None + description: Optional[str] = None inverted: Optional[bool] = None """If true, the metric is inverted, meaning that a lower value is better.""" + is_metric_goal: Optional[bool] = None + metric_name: Optional[str] = None + metric_rank: Optional[int] = None + metric_type: Optional[ Literal["METRIC_TYPE_UNSPECIFIED", "METRIC_TYPE_GENERAL_QUALITY", "METRIC_TYPE_RAG_AND_TOOL"] ] = None diff --git a/src/gradient/types/knowledge_bases/api_indexing_job.py b/src/gradient/types/knowledge_bases/api_indexing_job.py index 93124cf8..2389fd9c 100644 --- a/src/gradient/types/knowledge_bases/api_indexing_job.py +++ b/src/gradient/types/knowledge_bases/api_indexing_job.py @@ -53,6 +53,7 @@ class APIIndexingJob(BaseModel): "INDEX_JOB_STATUS_FAILED", "INDEX_JOB_STATUS_NO_CHANGES", "INDEX_JOB_STATUS_PENDING", + "INDEX_JOB_STATUS_CANCELLED", ] ] = None @@ -62,18 +63,6 @@ class APIIndexingJob(BaseModel): total_datasources: Optional[int] = None """Number of datasources being indexed""" - total_items_failed: Optional[str] = None - """Total Items Failed""" - - total_items_indexed: Optional[str] = None - """Total Items Indexed""" - - total_items_removed: Optional[str] = None - """Total Items Removed""" - - total_items_skipped: Optional[str] = None - """Total Items Skipped""" - total_tokens: Optional[str] = None """Total Tokens Consumed By the Indexing Job""" diff --git a/src/gradient/types/knowledge_bases/api_knowledge_base_data_source.py b/src/gradient/types/knowledge_bases/api_knowledge_base_data_source.py index 223797c7..7831bc55 100644 --- a/src/gradient/types/knowledge_bases/api_knowledge_base_data_source.py +++ b/src/gradient/types/knowledge_bases/api_knowledge_base_data_source.py @@ -4,7 +4,6 @@ from datetime import datetime from ..._models import BaseModel -from .api_indexing_job import APIIndexingJob from .api_spaces_data_source import APISpacesDataSource from .api_indexed_data_source import APIIndexedDataSource from .api_file_upload_data_source import APIFileUploadDataSource @@ -58,9 +57,6 @@ class APIKnowledgeBaseDataSource(BaseModel): last_datasource_indexing_job: Optional[APIIndexedDataSource] = None - last_indexing_job: Optional[APIIndexingJob] = None - """IndexingJob description""" - region: Optional[str] = None """Region code - Deprecated, moved to data_source_details""" diff --git a/src/gradient/types/knowledge_bases/api_web_crawler_data_source.py b/src/gradient/types/knowledge_bases/api_web_crawler_data_source.py index 63c9111a..c7060fa6 100644 --- a/src/gradient/types/knowledge_bases/api_web_crawler_data_source.py +++ b/src/gradient/types/knowledge_bases/api_web_crawler_data_source.py @@ -12,7 +12,7 @@ class APIWebCrawlerDataSource(BaseModel): base_url: Optional[str] = None """The base url to crawl.""" - crawling_option: Optional[Literal["UNKNOWN", "SCOPED", "PATH", "DOMAIN", "SUBDOMAINS"]] = None + crawling_option: Optional[Literal["UNKNOWN", "SCOPED", "PATH", "DOMAIN", "SUBDOMAINS", "SITEMAP"]] = None """Options for specifying how URLs found on pages should be handled. - UNKNOWN: Default unknown value @@ -20,6 +20,7 @@ class APIWebCrawlerDataSource(BaseModel): - PATH: Crawl the base URL and linked pages within the URL path. - DOMAIN: Crawl the base URL and linked pages within the same domain. - SUBDOMAINS: Crawl the base URL and linked pages for any subdomain. + - SITEMAP: Crawl URLs discovered in the sitemap. """ embed_media: Optional[bool] = None diff --git a/src/gradient/types/knowledge_bases/api_web_crawler_data_source_param.py b/src/gradient/types/knowledge_bases/api_web_crawler_data_source_param.py index 17988e73..386be8ed 100644 --- a/src/gradient/types/knowledge_bases/api_web_crawler_data_source_param.py +++ b/src/gradient/types/knowledge_bases/api_web_crawler_data_source_param.py @@ -13,7 +13,7 @@ class APIWebCrawlerDataSourceParam(TypedDict, total=False): base_url: str """The base url to crawl.""" - crawling_option: Literal["UNKNOWN", "SCOPED", "PATH", "DOMAIN", "SUBDOMAINS"] + crawling_option: Literal["UNKNOWN", "SCOPED", "PATH", "DOMAIN", "SUBDOMAINS", "SITEMAP"] """Options for specifying how URLs found on pages should be handled. - UNKNOWN: Default unknown value @@ -21,6 +21,7 @@ class APIWebCrawlerDataSourceParam(TypedDict, total=False): - PATH: Crawl the base URL and linked pages within the URL path. - DOMAIN: Crawl the base URL and linked pages within the same domain. - SUBDOMAINS: Crawl the base URL and linked pages for any subdomain. + - SITEMAP: Crawl URLs discovered in the sitemap. """ embed_media: bool diff --git a/src/gradient/types/nf_initiate_action_params.py b/src/gradient/types/nf_initiate_action_params.py index a187f56d..4b297210 100644 --- a/src/gradient/types/nf_initiate_action_params.py +++ b/src/gradient/types/nf_initiate_action_params.py @@ -11,6 +11,10 @@ "NfsActionResizeParams", "NfsActionSnapshot", "NfsActionSnapshotParams", + "NfsActionAttach", + "NfsActionAttachParams", + "NfsActionDetach", + "NfsActionDetachParams", ] @@ -44,4 +48,34 @@ class NfsActionSnapshotParams(TypedDict, total=False): """Snapshot name of the NFS share""" -NfInitiateActionParams: TypeAlias = Union[NfsActionResize, NfsActionSnapshot] +class NfsActionAttach(TypedDict, total=False): + region: Required[str] + """The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides.""" + + type: Required[Literal["resize", "snapshot"]] + """The type of action to initiate for the NFS share (such as resize or snapshot).""" + + params: NfsActionAttachParams + + +class NfsActionAttachParams(TypedDict, total=False): + vpc_id: Required[str] + """The ID of the VPC to which the NFS share will be attached""" + + +class NfsActionDetach(TypedDict, total=False): + region: Required[str] + """The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides.""" + + type: Required[Literal["resize", "snapshot"]] + """The type of action to initiate for the NFS share (such as resize or snapshot).""" + + params: NfsActionDetachParams + + +class NfsActionDetachParams(TypedDict, total=False): + vpc_id: Required[str] + """The ID of the VPC from which the NFS share will be detached""" + + +NfInitiateActionParams: TypeAlias = Union[NfsActionResize, NfsActionSnapshot, NfsActionAttach, NfsActionDetach] diff --git a/tests/api_resources/test_nfs.py b/tests/api_resources/test_nfs.py index f2749330..6969ee96 100644 --- a/tests/api_resources/test_nfs.py +++ b/tests/api_resources/test_nfs.py @@ -313,6 +313,128 @@ def test_path_params_initiate_action_overload_2(self, client: Gradient) -> None: type="resize", ) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_initiate_action_overload_3(self, client: Gradient) -> None: + nf = client.nfs.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_initiate_action_with_all_params_overload_3(self, client: Gradient) -> None: + nf = client.nfs.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + params={"vpc_id": "vpc-id-123"}, + ) + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_initiate_action_overload_3(self, client: Gradient) -> None: + response = client.nfs.with_raw_response.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + nf = response.parse() + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_initiate_action_overload_3(self, client: Gradient) -> None: + with client.nfs.with_streaming_response.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + nf = response.parse() + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_path_params_initiate_action_overload_3(self, client: Gradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): + client.nfs.with_raw_response.initiate_action( + nfs_id="", + region="atl1", + type="resize", + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_initiate_action_overload_4(self, client: Gradient) -> None: + nf = client.nfs.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_initiate_action_with_all_params_overload_4(self, client: Gradient) -> None: + nf = client.nfs.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + params={"vpc_id": "vpc-id-123"}, + ) + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_initiate_action_overload_4(self, client: Gradient) -> None: + response = client.nfs.with_raw_response.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + nf = response.parse() + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_initiate_action_overload_4(self, client: Gradient) -> None: + with client.nfs.with_streaming_response.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + nf = response.parse() + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_path_params_initiate_action_overload_4(self, client: Gradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): + client.nfs.with_raw_response.initiate_action( + nfs_id="", + region="atl1", + type="resize", + ) + class TestAsyncNfs: parametrize = pytest.mark.parametrize( @@ -609,3 +731,125 @@ async def test_path_params_initiate_action_overload_2(self, async_client: AsyncG region="atl1", type="resize", ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_initiate_action_overload_3(self, async_client: AsyncGradient) -> None: + nf = await async_client.nfs.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_initiate_action_with_all_params_overload_3(self, async_client: AsyncGradient) -> None: + nf = await async_client.nfs.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + params={"vpc_id": "vpc-id-123"}, + ) + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_initiate_action_overload_3(self, async_client: AsyncGradient) -> None: + response = await async_client.nfs.with_raw_response.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + nf = await response.parse() + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_initiate_action_overload_3(self, async_client: AsyncGradient) -> None: + async with async_client.nfs.with_streaming_response.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + nf = await response.parse() + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_path_params_initiate_action_overload_3(self, async_client: AsyncGradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): + await async_client.nfs.with_raw_response.initiate_action( + nfs_id="", + region="atl1", + type="resize", + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_initiate_action_overload_4(self, async_client: AsyncGradient) -> None: + nf = await async_client.nfs.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_initiate_action_with_all_params_overload_4(self, async_client: AsyncGradient) -> None: + nf = await async_client.nfs.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + params={"vpc_id": "vpc-id-123"}, + ) + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_initiate_action_overload_4(self, async_client: AsyncGradient) -> None: + response = await async_client.nfs.with_raw_response.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + nf = await response.parse() + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_initiate_action_overload_4(self, async_client: AsyncGradient) -> None: + async with async_client.nfs.with_streaming_response.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + region="atl1", + type="resize", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + nf = await response.parse() + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_path_params_initiate_action_overload_4(self, async_client: AsyncGradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): + await async_client.nfs.with_raw_response.initiate_action( + nfs_id="", + region="atl1", + type="resize", + ) From 6934773f0f7b891a9788f871d00cbf110de41085 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 11 Dec 2025 12:06:51 +0000 Subject: [PATCH 42/96] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 45ccb9db..8996bd49 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/digitalocean%2Fgradient-30169d8c02f8de86ae431cb475d1c44326289f9690e3c2a7a0442bf081870680.yml openapi_spec_hash: f266f59f7fcc777103f8b5b002b30c8e -config_hash: b28984dd49d4baf1d68572efe83ac103 +config_hash: 5b54c76c3693cb84742360bcd6012cd4 From fef2213ad439fe4d704e7982601c44d31ff91e41 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 14 Dec 2025 15:25:10 +0000 Subject: [PATCH 43/96] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8996bd49..eebe6ea4 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/digitalocean%2Fgradient-30169d8c02f8de86ae431cb475d1c44326289f9690e3c2a7a0442bf081870680.yml openapi_spec_hash: f266f59f7fcc777103f8b5b002b30c8e -config_hash: 5b54c76c3693cb84742360bcd6012cd4 +config_hash: 2f0e76498e5329b3822d343ae20012d0 From 7a4fd05c0e58fe545f2e3a26d5091550c0b9622f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 14 Dec 2025 15:25:36 +0000 Subject: [PATCH 44/96] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index eebe6ea4..1a52f261 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/digitalocean%2Fgradient-30169d8c02f8de86ae431cb475d1c44326289f9690e3c2a7a0442bf081870680.yml openapi_spec_hash: f266f59f7fcc777103f8b5b002b30c8e -config_hash: 2f0e76498e5329b3822d343ae20012d0 +config_hash: a9f166c21685fcc7e27b64c0ea37f8b2 From 8ccacb1fffca54234eb3c409dd8000af04cd6911 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 14 Dec 2025 15:31:11 +0000 Subject: [PATCH 45/96] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1a52f261..42250c63 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/digitalocean%2Fgradient-30169d8c02f8de86ae431cb475d1c44326289f9690e3c2a7a0442bf081870680.yml -openapi_spec_hash: f266f59f7fcc777103f8b5b002b30c8e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-8ce16f0e370991d9188237a075d6a5405b43d99c3fe59703aec408ff4242dab9.yml +openapi_spec_hash: 58a7c0915e8d03d18230e547efdd89a2 config_hash: a9f166c21685fcc7e27b64c0ea37f8b2 From 0631d436d0dcf1a1d1f2d80d4d38e194637fba33 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 14 Dec 2025 15:35:14 +0000 Subject: [PATCH 46/96] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 42250c63..50c69c9d 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/digitalocean%2Fgradient-8ce16f0e370991d9188237a075d6a5405b43d99c3fe59703aec408ff4242dab9.yml -openapi_spec_hash: 58a7c0915e8d03d18230e547efdd89a2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-ca993fd0bc66f703323a773c92da75207266f7f9d8c54ddac2fbd271a3cdaf86.yml +openapi_spec_hash: 35d7edb04aab2ab28bc7e5851a54b4e3 config_hash: a9f166c21685fcc7e27b64c0ea37f8b2 From c9c9079a9a34719c263e748e45b02d2a37487962 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 14 Dec 2025 15:35:40 +0000 Subject: [PATCH 47/96] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 50c69c9d..954e402f 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/digitalocean%2Fgradient-ca993fd0bc66f703323a773c92da75207266f7f9d8c54ddac2fbd271a3cdaf86.yml openapi_spec_hash: 35d7edb04aab2ab28bc7e5851a54b4e3 -config_hash: a9f166c21685fcc7e27b64c0ea37f8b2 +config_hash: 9a00a8eb92513ddc0f58cef831f45eb5 From 3e4c536d43b123f949dde8e6a2c1bad700e71335 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 14 Dec 2025 16:28:30 +0000 Subject: [PATCH 48/96] feat(api): update via SDK Studio --- .stats.yml | 4 +- api.md | 12 + src/gradient/_client.py | 38 +++ src/gradient/resources/__init__.py | 14 + src/gradient/resources/retrieve.py | 249 ++++++++++++++++++ src/gradient/types/__init__.py | 2 + .../types/retrieve_documents_params.py | 73 +++++ .../types/retrieve_documents_response.py | 23 ++ tests/api_resources/test_retrieve.py | 192 ++++++++++++++ 9 files changed, 605 insertions(+), 2 deletions(-) create mode 100644 src/gradient/resources/retrieve.py create mode 100644 src/gradient/types/retrieve_documents_params.py create mode 100644 src/gradient/types/retrieve_documents_response.py create mode 100644 tests/api_resources/test_retrieve.py diff --git a/.stats.yml b/.stats.yml index 954e402f..083e49a8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 188 +configured_endpoints: 189 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-ca993fd0bc66f703323a773c92da75207266f7f9d8c54ddac2fbd271a3cdaf86.yml openapi_spec_hash: 35d7edb04aab2ab28bc7e5851a54b4e3 -config_hash: 9a00a8eb92513ddc0f58cef831f45eb5 +config_hash: 70aafd9d59b80da716b5a9d896c8c0bd diff --git a/api.md b/api.md index e32fae32..caf241a4 100644 --- a/api.md +++ b/api.md @@ -1027,3 +1027,15 @@ Methods: - client.nfs.snapshots.retrieve(nfs_snapshot_id, \*\*params) -> SnapshotRetrieveResponse - client.nfs.snapshots.list(\*\*params) -> SnapshotListResponse - client.nfs.snapshots.delete(nfs_snapshot_id, \*\*params) -> None + +# Retrieve + +Types: + +```python +from gradient.types import RetrieveDocumentsResponse +``` + +Methods: + +- client.retrieve.documents(knowledge_base_id, \*\*params) -> RetrieveDocumentsResponse diff --git a/src/gradient/_client.py b/src/gradient/_client.py index f7891ddf..b58766c5 100644 --- a/src/gradient/_client.py +++ b/src/gradient/_client.py @@ -39,6 +39,7 @@ images, models, regions, + retrieve, databases, inference, gpu_droplets, @@ -47,6 +48,7 @@ from .resources.images import ImagesResource, AsyncImagesResource from .resources.nfs.nfs import NfsResource, AsyncNfsResource from .resources.regions import RegionsResource, AsyncRegionsResource + from .resources.retrieve import RetrieveResource, AsyncRetrieveResource from .resources.chat.chat import ChatResource, AsyncChatResource from .resources.gpu_droplets import ( GPUDropletsResource, @@ -237,6 +239,12 @@ def nfs(self) -> NfsResource: return NfsResource(self) + @cached_property + def retrieve(self) -> RetrieveResource: + from .resources.retrieve import RetrieveResource + + return RetrieveResource(self) + @cached_property def with_raw_response(self) -> GradientWithRawResponse: return GradientWithRawResponse(self) @@ -593,6 +601,12 @@ def nfs(self) -> AsyncNfsResource: return AsyncNfsResource(self) + @cached_property + def retrieve(self) -> AsyncRetrieveResource: + from .resources.retrieve import AsyncRetrieveResource + + return AsyncRetrieveResource(self) + @cached_property def with_raw_response(self) -> AsyncGradientWithRawResponse: return AsyncGradientWithRawResponse(self) @@ -851,6 +865,12 @@ def nfs(self) -> nfs.NfsResourceWithRawResponse: return NfsResourceWithRawResponse(self._client.nfs) + @cached_property + def retrieve(self) -> retrieve.RetrieveResourceWithRawResponse: + from .resources.retrieve import RetrieveResourceWithRawResponse + + return RetrieveResourceWithRawResponse(self._client.retrieve) + class AsyncGradientWithRawResponse: _client: AsyncGradient @@ -922,6 +942,12 @@ def nfs(self) -> nfs.AsyncNfsResourceWithRawResponse: return AsyncNfsResourceWithRawResponse(self._client.nfs) + @cached_property + def retrieve(self) -> retrieve.AsyncRetrieveResourceWithRawResponse: + from .resources.retrieve import AsyncRetrieveResourceWithRawResponse + + return AsyncRetrieveResourceWithRawResponse(self._client.retrieve) + class GradientWithStreamedResponse: _client: Gradient @@ -993,6 +1019,12 @@ def nfs(self) -> nfs.NfsResourceWithStreamingResponse: return NfsResourceWithStreamingResponse(self._client.nfs) + @cached_property + def retrieve(self) -> retrieve.RetrieveResourceWithStreamingResponse: + from .resources.retrieve import RetrieveResourceWithStreamingResponse + + return RetrieveResourceWithStreamingResponse(self._client.retrieve) + class AsyncGradientWithStreamedResponse: _client: AsyncGradient @@ -1070,6 +1102,12 @@ def nfs(self) -> nfs.AsyncNfsResourceWithStreamingResponse: return AsyncNfsResourceWithStreamingResponse(self._client.nfs) + @cached_property + def retrieve(self) -> retrieve.AsyncRetrieveResourceWithStreamingResponse: + from .resources.retrieve import AsyncRetrieveResourceWithStreamingResponse + + return AsyncRetrieveResourceWithStreamingResponse(self._client.retrieve) + Client = Gradient diff --git a/src/gradient/resources/__init__.py b/src/gradient/resources/__init__.py index a797b18f..f668bb06 100644 --- a/src/gradient/resources/__init__.py +++ b/src/gradient/resources/__init__.py @@ -48,6 +48,14 @@ RegionsResourceWithStreamingResponse, AsyncRegionsResourceWithStreamingResponse, ) +from .retrieve import ( + RetrieveResource, + AsyncRetrieveResource, + RetrieveResourceWithRawResponse, + AsyncRetrieveResourceWithRawResponse, + RetrieveResourceWithStreamingResponse, + AsyncRetrieveResourceWithStreamingResponse, +) from .databases import ( DatabasesResource, AsyncDatabasesResource, @@ -142,4 +150,10 @@ "AsyncNfsResourceWithRawResponse", "NfsResourceWithStreamingResponse", "AsyncNfsResourceWithStreamingResponse", + "RetrieveResource", + "AsyncRetrieveResource", + "RetrieveResourceWithRawResponse", + "AsyncRetrieveResourceWithRawResponse", + "RetrieveResourceWithStreamingResponse", + "AsyncRetrieveResourceWithStreamingResponse", ] diff --git a/src/gradient/resources/retrieve.py b/src/gradient/resources/retrieve.py new file mode 100644 index 00000000..f0768350 --- /dev/null +++ b/src/gradient/resources/retrieve.py @@ -0,0 +1,249 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..types import retrieve_documents_params +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 +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.retrieve_documents_response import RetrieveDocumentsResponse + +__all__ = ["RetrieveResource", "AsyncRetrieveResource"] + + +class RetrieveResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> RetrieveResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return RetrieveResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> RetrieveResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return RetrieveResourceWithStreamingResponse(self) + + def documents( + self, + knowledge_base_id: str, + *, + num_results: int, + query: str, + alpha: float | Omit = omit, + filters: retrieve_documents_params.Filters | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RetrieveDocumentsResponse: + """ + Retrieve relevant documents from a knowledge base using semantic search. + + This endpoint: + + 1. Authenticates the request using the provided bearer token + 2. Generates embeddings for the query using the knowledge base's configured + model + 3. Performs vector similarity search in the knowledge base + 4. Returns the most relevant document chunks + + The search supports hybrid search combining: + + - Vector similarity (semantic search) + - Keyword matching (BM25) + - Custom metadata filters + + Args: + num_results: Number of results to return + + query: The search query text + + alpha: + Weight for hybrid search (0-1): + + - 0 = pure keyword search (BM25) + - 1 = pure vector search (default) + - 0.5 = balanced hybrid search + + filters: Metadata filters to apply to the search + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not knowledge_base_id: + raise ValueError(f"Expected a non-empty value for `knowledge_base_id` but received {knowledge_base_id!r}") + return self._post( + f"/{knowledge_base_id}/retrieve" + if self._client._base_url_overridden + else f"https://kbaas.do-ai.run/v1/{knowledge_base_id}/retrieve", + body=maybe_transform( + { + "num_results": num_results, + "query": query, + "alpha": alpha, + "filters": filters, + }, + retrieve_documents_params.RetrieveDocumentsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RetrieveDocumentsResponse, + ) + + +class AsyncRetrieveResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncRetrieveResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return AsyncRetrieveResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRetrieveResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return AsyncRetrieveResourceWithStreamingResponse(self) + + async def documents( + self, + knowledge_base_id: str, + *, + num_results: int, + query: str, + alpha: float | Omit = omit, + filters: retrieve_documents_params.Filters | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RetrieveDocumentsResponse: + """ + Retrieve relevant documents from a knowledge base using semantic search. + + This endpoint: + + 1. Authenticates the request using the provided bearer token + 2. Generates embeddings for the query using the knowledge base's configured + model + 3. Performs vector similarity search in the knowledge base + 4. Returns the most relevant document chunks + + The search supports hybrid search combining: + + - Vector similarity (semantic search) + - Keyword matching (BM25) + - Custom metadata filters + + Args: + num_results: Number of results to return + + query: The search query text + + alpha: + Weight for hybrid search (0-1): + + - 0 = pure keyword search (BM25) + - 1 = pure vector search (default) + - 0.5 = balanced hybrid search + + filters: Metadata filters to apply to the search + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not knowledge_base_id: + raise ValueError(f"Expected a non-empty value for `knowledge_base_id` but received {knowledge_base_id!r}") + return await self._post( + f"/{knowledge_base_id}/retrieve" + if self._client._base_url_overridden + else f"https://kbaas.do-ai.run/v1/{knowledge_base_id}/retrieve", + body=await async_maybe_transform( + { + "num_results": num_results, + "query": query, + "alpha": alpha, + "filters": filters, + }, + retrieve_documents_params.RetrieveDocumentsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RetrieveDocumentsResponse, + ) + + +class RetrieveResourceWithRawResponse: + def __init__(self, retrieve: RetrieveResource) -> None: + self._retrieve = retrieve + + self.documents = to_raw_response_wrapper( + retrieve.documents, + ) + + +class AsyncRetrieveResourceWithRawResponse: + def __init__(self, retrieve: AsyncRetrieveResource) -> None: + self._retrieve = retrieve + + self.documents = async_to_raw_response_wrapper( + retrieve.documents, + ) + + +class RetrieveResourceWithStreamingResponse: + def __init__(self, retrieve: RetrieveResource) -> None: + self._retrieve = retrieve + + self.documents = to_streamed_response_wrapper( + retrieve.documents, + ) + + +class AsyncRetrieveResourceWithStreamingResponse: + def __init__(self, retrieve: AsyncRetrieveResource) -> None: + self._retrieve = retrieve + + self.documents = async_to_streamed_response_wrapper( + retrieve.documents, + ) diff --git a/src/gradient/types/__init__.py b/src/gradient/types/__init__.py index 58d45641..e927e099 100644 --- a/src/gradient/types/__init__.py +++ b/src/gradient/types/__init__.py @@ -85,6 +85,7 @@ from .gpu_droplet_create_params import GPUDropletCreateParams as GPUDropletCreateParams from .gpu_droplet_list_response import GPUDropletListResponse as GPUDropletListResponse from .nf_initiate_action_params import NfInitiateActionParams as NfInitiateActionParams +from .retrieve_documents_params import RetrieveDocumentsParams as RetrieveDocumentsParams from .agent_update_status_params import ( AgentUpdateStatusParams as AgentUpdateStatusParams, ) @@ -100,6 +101,7 @@ GPUDropletCreateResponse as GPUDropletCreateResponse, ) from .nf_initiate_action_response import NfInitiateActionResponse as NfInitiateActionResponse +from .retrieve_documents_response import RetrieveDocumentsResponse as RetrieveDocumentsResponse from .agent_update_status_response import ( AgentUpdateStatusResponse as AgentUpdateStatusResponse, ) diff --git a/src/gradient/types/retrieve_documents_params.py b/src/gradient/types/retrieve_documents_params.py new file mode 100644 index 00000000..968d0211 --- /dev/null +++ b/src/gradient/types/retrieve_documents_params.py @@ -0,0 +1,73 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Literal, Required, TypedDict + +from .._types import SequenceNotStr + +__all__ = ["RetrieveDocumentsParams", "Filters", "FiltersMust", "FiltersMustNot", "FiltersShould"] + + +class RetrieveDocumentsParams(TypedDict, total=False): + num_results: Required[int] + """Number of results to return""" + + query: Required[str] + """The search query text""" + + alpha: float + """Weight for hybrid search (0-1): + + - 0 = pure keyword search (BM25) + - 1 = pure vector search (default) + - 0.5 = balanced hybrid search + """ + + filters: Filters + """Metadata filters to apply to the search""" + + +class FiltersMust(TypedDict, total=False): + field: Required[str] + """Metadata field name""" + + operator: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "not_in", "contains"]] + """Comparison operator""" + + value: Required[Union[str, float, bool, SequenceNotStr[str]]] + """Value to compare against (type depends on field)""" + + +class FiltersMustNot(TypedDict, total=False): + field: Required[str] + """Metadata field name""" + + operator: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "not_in", "contains"]] + """Comparison operator""" + + value: Required[Union[str, float, bool, SequenceNotStr[str]]] + """Value to compare against (type depends on field)""" + + +class FiltersShould(TypedDict, total=False): + field: Required[str] + """Metadata field name""" + + operator: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "not_in", "contains"]] + """Comparison operator""" + + value: Required[Union[str, float, bool, SequenceNotStr[str]]] + """Value to compare against (type depends on field)""" + + +class Filters(TypedDict, total=False): + must: Iterable[FiltersMust] + """All conditions must match (AND)""" + + must_not: Iterable[FiltersMustNot] + """No conditions should match (NOT)""" + + should: Iterable[FiltersShould] + """At least one condition must match (OR)""" diff --git a/src/gradient/types/retrieve_documents_response.py b/src/gradient/types/retrieve_documents_response.py new file mode 100644 index 00000000..79f3e8eb --- /dev/null +++ b/src/gradient/types/retrieve_documents_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from .._models import BaseModel + +__all__ = ["RetrieveDocumentsResponse", "Result"] + + +class Result(BaseModel): + metadata: Dict[str, object] + """Metadata associated with the document""" + + text_content: str + """The text content of the document chunk""" + + +class RetrieveDocumentsResponse(BaseModel): + results: List[Result] + """Array of retrieved document chunks""" + + total_results: int + """Number of results returned""" diff --git a/tests/api_resources/test_retrieve.py b/tests/api_resources/test_retrieve.py new file mode 100644 index 00000000..167d2a96 --- /dev/null +++ b/tests/api_resources/test_retrieve.py @@ -0,0 +1,192 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gradient import Gradient, AsyncGradient +from tests.utils import assert_matches_type +from gradient.types import RetrieveDocumentsResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestRetrieve: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_documents(self, client: Gradient) -> None: + retrieve = client.retrieve.documents( + knowledge_base_id="550e8400-e29b-41d4-a716-446655440000", + num_results=5, + query="What are the best practices for deploying machine learning models?", + ) + assert_matches_type(RetrieveDocumentsResponse, retrieve, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_documents_with_all_params(self, client: Gradient) -> None: + retrieve = client.retrieve.documents( + knowledge_base_id="550e8400-e29b-41d4-a716-446655440000", + num_results=5, + query="What are the best practices for deploying machine learning models?", + alpha=0.75, + filters={ + "must": [ + { + "field": "category", + "operator": "eq", + "value": "documentation", + } + ], + "must_not": [ + { + "field": "category", + "operator": "eq", + "value": "documentation", + } + ], + "should": [ + { + "field": "category", + "operator": "eq", + "value": "documentation", + } + ], + }, + ) + assert_matches_type(RetrieveDocumentsResponse, retrieve, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_documents(self, client: Gradient) -> None: + response = client.retrieve.with_raw_response.documents( + knowledge_base_id="550e8400-e29b-41d4-a716-446655440000", + num_results=5, + query="What are the best practices for deploying machine learning models?", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + retrieve = response.parse() + assert_matches_type(RetrieveDocumentsResponse, retrieve, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_documents(self, client: Gradient) -> None: + with client.retrieve.with_streaming_response.documents( + knowledge_base_id="550e8400-e29b-41d4-a716-446655440000", + num_results=5, + query="What are the best practices for deploying machine learning models?", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + retrieve = response.parse() + assert_matches_type(RetrieveDocumentsResponse, retrieve, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_path_params_documents(self, client: Gradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `knowledge_base_id` but received ''"): + client.retrieve.with_raw_response.documents( + knowledge_base_id="", + num_results=5, + query="What are the best practices for deploying machine learning models?", + ) + + +class TestAsyncRetrieve: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_documents(self, async_client: AsyncGradient) -> None: + retrieve = await async_client.retrieve.documents( + knowledge_base_id="550e8400-e29b-41d4-a716-446655440000", + num_results=5, + query="What are the best practices for deploying machine learning models?", + ) + assert_matches_type(RetrieveDocumentsResponse, retrieve, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_documents_with_all_params(self, async_client: AsyncGradient) -> None: + retrieve = await async_client.retrieve.documents( + knowledge_base_id="550e8400-e29b-41d4-a716-446655440000", + num_results=5, + query="What are the best practices for deploying machine learning models?", + alpha=0.75, + filters={ + "must": [ + { + "field": "category", + "operator": "eq", + "value": "documentation", + } + ], + "must_not": [ + { + "field": "category", + "operator": "eq", + "value": "documentation", + } + ], + "should": [ + { + "field": "category", + "operator": "eq", + "value": "documentation", + } + ], + }, + ) + assert_matches_type(RetrieveDocumentsResponse, retrieve, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_documents(self, async_client: AsyncGradient) -> None: + response = await async_client.retrieve.with_raw_response.documents( + knowledge_base_id="550e8400-e29b-41d4-a716-446655440000", + num_results=5, + query="What are the best practices for deploying machine learning models?", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + retrieve = await response.parse() + assert_matches_type(RetrieveDocumentsResponse, retrieve, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_documents(self, async_client: AsyncGradient) -> None: + async with async_client.retrieve.with_streaming_response.documents( + knowledge_base_id="550e8400-e29b-41d4-a716-446655440000", + num_results=5, + query="What are the best practices for deploying machine learning models?", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + retrieve = await response.parse() + assert_matches_type(RetrieveDocumentsResponse, retrieve, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_path_params_documents(self, async_client: AsyncGradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `knowledge_base_id` but received ''"): + await async_client.retrieve.with_raw_response.documents( + knowledge_base_id="", + num_results=5, + query="What are the best practices for deploying machine learning models?", + ) From 42e372ac50a326e80c7682b0025595dc45a52622 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 14 Dec 2025 16:29:00 +0000 Subject: [PATCH 49/96] feat(api): update via SDK Studio --- .stats.yml | 2 +- src/gradient/_client.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 083e49a8..b4763701 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 189 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-ca993fd0bc66f703323a773c92da75207266f7f9d8c54ddac2fbd271a3cdaf86.yml openapi_spec_hash: 35d7edb04aab2ab28bc7e5851a54b4e3 -config_hash: 70aafd9d59b80da716b5a9d896c8c0bd +config_hash: fad48c8ac796b240fe3b90181586d1a4 diff --git a/src/gradient/_client.py b/src/gradient/_client.py index b58766c5..47fae3cd 100644 --- a/src/gradient/_client.py +++ b/src/gradient/_client.py @@ -82,6 +82,7 @@ class Gradient(SyncAPIClient): agent_access_key: str | None _agent_endpoint: str | None inference_endpoint: str | None + kbass_endpoint: str | None def __init__( self, @@ -91,6 +92,7 @@ def __init__( agent_access_key: str | None = None, agent_endpoint: str | None = None, inference_endpoint: str | None = None, + kbass_endpoint: str | None = None, base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = not_given, max_retries: int = DEFAULT_MAX_RETRIES, @@ -121,6 +123,7 @@ def __init__( - `agent_access_key` from `GRADIENT_AGENT_ACCESS_KEY` - `agent_endpoint` from `GRADIENT_AGENT_ENDPOINT` - `inference_endpoint` from `GRADIENT_INFERENCE_ENDPOINT` + - `kbass_endpoint` from `GRADIENT_KBASS_ENDPOINT` """ if access_token is None: access_token = os.environ.get("DIGITALOCEAN_ACCESS_TOKEN") @@ -145,6 +148,10 @@ def __init__( ) self.inference_endpoint = inference_endpoint + if kbass_endpoint is None: + kbass_endpoint = os.environ.get("GRADIENT_KBASS_ENDPOINT") or "kbaas.do-ai.run" + self.kbass_endpoint = kbass_endpoint + if base_url is None: base_url = os.environ.get("GRADIENT_BASE_URL") self._base_url_overridden = base_url is not None @@ -334,6 +341,7 @@ def copy( agent_access_key: str | None = None, agent_endpoint: str | None = None, inference_endpoint: str | None = None, + kbass_endpoint: str | None = None, base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.Client | None = None, @@ -378,6 +386,7 @@ def copy( agent_access_key=agent_access_key or self.agent_access_key, agent_endpoint=agent_endpoint or self._agent_endpoint, inference_endpoint=inference_endpoint or self.inference_endpoint, + kbass_endpoint=kbass_endpoint or self.kbass_endpoint, base_url=base_url or self.base_url, timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, http_client=http_client, @@ -444,6 +453,7 @@ class AsyncGradient(AsyncAPIClient): agent_access_key: str | None _agent_endpoint: str | None inference_endpoint: str | None + kbass_endpoint: str | None def __init__( self, @@ -453,6 +463,7 @@ def __init__( agent_access_key: str | None = None, agent_endpoint: str | None = None, inference_endpoint: str | None = None, + kbass_endpoint: str | None = None, base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = not_given, max_retries: int = DEFAULT_MAX_RETRIES, @@ -483,6 +494,7 @@ def __init__( - `agent_access_key` from `GRADIENT_AGENT_ACCESS_KEY` - `agent_endpoint` from `GRADIENT_AGENT_ENDPOINT` - `inference_endpoint` from `GRADIENT_INFERENCE_ENDPOINT` + - `kbass_endpoint` from `GRADIENT_KBASS_ENDPOINT` """ if access_token is None: access_token = os.environ.get("DIGITALOCEAN_ACCESS_TOKEN") @@ -507,6 +519,10 @@ def __init__( ) self.inference_endpoint = inference_endpoint + if kbass_endpoint is None: + kbass_endpoint = os.environ.get("GRADIENT_KBASS_ENDPOINT") or "kbaas.do-ai.run" + self.kbass_endpoint = kbass_endpoint + if base_url is None: base_url = os.environ.get("GRADIENT_BASE_URL") self._base_url_overridden = base_url is not None @@ -696,6 +712,7 @@ def copy( model_access_key: str | None = None, agent_access_key: str | None = None, inference_endpoint: str | None = None, + kbass_endpoint: str | None = None, base_url: str | httpx.URL | None = None, timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.AsyncClient | None = None, @@ -740,6 +757,7 @@ def copy( agent_access_key=agent_access_key or self.agent_access_key, agent_endpoint=agent_endpoint or self._agent_endpoint, inference_endpoint=inference_endpoint or self.inference_endpoint, + kbass_endpoint=kbass_endpoint or self.kbass_endpoint, base_url=base_url or self.base_url, timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, http_client=http_client, From d7818a12c678bbf4597b525a6e36bc48458d299f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 14:32:26 +0000 Subject: [PATCH 50/96] chore(docs): use environment variables for authentication in code snippets --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index a3029a83..c69fdd1b 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,7 @@ pip install gradient[aiohttp] Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: ```python +import os import asyncio from gradient import DefaultAioHttpClient from gradient import AsyncGradient @@ -147,6 +148,9 @@ from gradient import AsyncGradient async def main() -> None: async with AsyncGradient( + model_access_key=os.environ.get( + "GRADIENT_MODEL_ACCESS_KEY" + ), # This is the default and can be omitted http_client=DefaultAioHttpClient(), ) as client: completion = await client.chat.completions.create( From d6f5fea6580c68a31c2dc768b8324fbc0bd700e6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 8 Dec 2025 18:37:59 +0000 Subject: [PATCH 51/96] fix(types): allow pyright to infer TypedDict types within SequenceNotStr --- src/gradient/_types.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gradient/_types.py b/src/gradient/_types.py index 11a40997..65831fee 100644 --- a/src/gradient/_types.py +++ b/src/gradient/_types.py @@ -243,6 +243,9 @@ class HttpxSendArgs(TypedDict, total=False): 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 + # + # Note: index() and count() methods are intentionally omitted to allow pyright to properly + # infer TypedDict types when dict literals are used in lists assigned to SequenceNotStr. class SequenceNotStr(Protocol[_T_co]): @overload def __getitem__(self, index: SupportsIndex, /) -> _T_co: ... @@ -251,8 +254,6 @@ 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 From cf78e8dc2ca398819a6162bbe58eea8ee37e48b2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 8 Dec 2025 19:29:19 +0000 Subject: [PATCH 52/96] chore: add missing docstrings --- src/gradient/types/agent_create_response.py | 2 ++ src/gradient/types/agent_delete_response.py | 2 ++ src/gradient/types/agent_list_response.py | 12 +++++++ src/gradient/types/agent_retrieve_response.py | 2 ++ .../types/agent_retrieve_usage_response.py | 10 ++++++ src/gradient/types/agent_update_response.py | 2 ++ .../types/agent_update_status_response.py | 2 ++ .../agents/api_link_knowledge_base_output.py | 2 ++ .../agents/chat/completion_create_params.py | 34 +++++++++++++++++++ .../agents/chat/completion_create_response.py | 10 ++++++ ...reate_file_upload_presigned_urls_params.py | 2 ++ ...ate_file_upload_presigned_urls_response.py | 4 +++ .../evaluation_dataset_create_response.py | 2 ++ ...evaluation_metric_list_regions_response.py | 4 +++ .../anthropic/key_create_response.py | 4 +++ .../anthropic/key_delete_response.py | 2 ++ .../anthropic/key_list_agents_response.py | 2 ++ .../anthropic/key_list_response.py | 4 +++ .../anthropic/key_update_response.py | 2 ++ .../oauth2/dropbox_create_tokens_response.py | 2 ++ .../oauth2_generate_url_response.py | 2 ++ .../openai/key_create_response.py | 2 ++ .../openai/key_delete_response.py | 2 ++ .../openai/key_list_agents_response.py | 2 ++ .../openai/key_list_response.py | 4 +++ .../openai/key_update_response.py | 2 ++ .../scheduled_indexing_create_response.py | 2 ++ .../scheduled_indexing_delete_response.py | 2 ++ .../scheduled_indexing_retrieve_response.py | 2 ++ .../evaluation_run_list_results_response.py | 2 ++ .../types/agents/function_create_response.py | 2 ++ .../types/agents/function_delete_response.py | 2 ++ .../types/agents/function_update_response.py | 2 ++ .../agents/knowledge_base_detach_response.py | 2 ++ .../types/agents/route_add_response.py | 2 ++ .../types/agents/route_delete_response.py | 2 ++ .../types/agents/route_update_response.py | 2 ++ .../types/agents/route_view_response.py | 2 ++ .../types/agents/version_list_response.py | 8 +++++ .../types/agents/version_update_response.py | 2 ++ src/gradient/types/api_agent.py | 16 +++++++++ src/gradient/types/api_agent_api_key_info.py | 2 ++ src/gradient/types/api_agent_model.py | 2 ++ src/gradient/types/api_agreement.py | 2 ++ .../types/api_anthropic_api_key_info.py | 2 ++ src/gradient/types/api_knowledge_base.py | 2 ++ src/gradient/types/api_model.py | 2 ++ src/gradient/types/api_model_version.py | 2 ++ src/gradient/types/api_openai_api_key_info.py | 2 ++ .../types/chat/completion_create_params.py | 34 +++++++++++++++++++ .../types/chat/completion_create_response.py | 10 ++++++ .../types/gpu_droplets/associated_resource.py | 2 ++ ...sociated_resource_check_status_response.py | 6 ++++ .../destroyed_associated_resource.py | 2 ++ src/gradient/types/gpu_droplets/domains.py | 2 ++ .../types/gpu_droplets/domains_param.py | 2 ++ .../types/gpu_droplets/floating_ip.py | 5 +++ .../types/gpu_droplets/forwarding_rule.py | 2 ++ .../gpu_droplets/forwarding_rule_param.py | 2 ++ .../types/gpu_droplets/glb_settings.py | 4 +++ .../types/gpu_droplets/glb_settings_param.py | 4 +++ .../types/gpu_droplets/health_check.py | 2 ++ .../types/gpu_droplets/health_check_param.py | 2 ++ .../types/gpu_droplets/lb_firewall.py | 4 +++ .../types/gpu_droplets/lb_firewall_param.py | 4 +++ .../types/gpu_droplets/sticky_sessions.py | 2 ++ .../gpu_droplets/sticky_sessions_param.py | 2 ++ src/gradient/types/image_generate_response.py | 8 +++++ .../types/inference/api_model_api_key_info.py | 2 ++ .../types/knowledge_base_create_params.py | 4 +++ .../types/knowledge_base_create_response.py | 2 ++ .../types/knowledge_base_delete_response.py | 2 ++ ...wledge_base_list_indexing_jobs_response.py | 2 ++ .../types/knowledge_base_list_response.py | 2 ++ .../types/knowledge_base_retrieve_response.py | 2 ++ .../types/knowledge_base_update_response.py | 2 ++ .../api_file_upload_data_source.py | 2 ++ .../api_file_upload_data_source_param.py | 2 ++ .../types/knowledge_bases/api_indexing_job.py | 2 ++ .../api_knowledge_base_data_source.py | 8 +++++ .../knowledge_bases/api_spaces_data_source.py | 2 ++ .../api_spaces_data_source_param.py | 2 ++ .../api_web_crawler_data_source.py | 2 ++ .../api_web_crawler_data_source_param.py | 2 ++ .../knowledge_bases/aws_data_source_param.py | 2 ++ ...ata_source_create_presigned_urls_params.py | 2 ++ ...a_source_create_presigned_urls_response.py | 4 +++ .../data_source_create_response.py | 2 ++ .../data_source_delete_response.py | 2 ++ .../data_source_list_response.py | 2 ++ .../indexing_job_create_response.py | 2 ++ .../indexing_job_list_response.py | 2 ++ .../indexing_job_retrieve_response.py | 2 ++ .../indexing_job_update_cancel_response.py | 2 ++ src/gradient/types/model_list_response.py | 2 ++ .../providers/anthropic_create_response.py | 4 +++ .../providers/anthropic_delete_response.py | 2 ++ .../anthropic_list_agents_response.py | 2 ++ .../providers/anthropic_list_response.py | 4 +++ .../providers/anthropic_update_response.py | 2 ++ .../providers/openai_create_response.py | 2 ++ .../providers/openai_delete_response.py | 2 ++ .../models/providers/openai_list_response.py | 4 +++ .../openai_retrieve_agents_response.py | 2 ++ .../providers/openai_update_response.py | 2 ++ .../types/nf_initiate_action_response.py | 4 +++ .../types/nfs/snapshot_list_response.py | 2 ++ .../types/nfs/snapshot_retrieve_response.py | 2 ++ src/gradient/types/shared/action_link.py | 2 ++ src/gradient/types/shared/api_links.py | 4 +++ src/gradient/types/shared/api_meta.py | 2 ++ .../types/shared/chat_completion_chunk.py | 11 ++++++ src/gradient/types/shared/completion_usage.py | 2 ++ src/gradient/types/shared/droplet.py | 5 +++ src/gradient/types/shared/gpu_info.py | 4 +++ .../types/shared/image_gen_completed_event.py | 6 ++++ .../shared/image_gen_partial_image_event.py | 2 ++ src/gradient/types/shared/kernel.py | 9 +++++ src/gradient/types/shared/meta_properties.py | 2 ++ 119 files changed, 432 insertions(+) diff --git a/src/gradient/types/agent_create_response.py b/src/gradient/types/agent_create_response.py index edd48b7d..a9138a04 100644 --- a/src/gradient/types/agent_create_response.py +++ b/src/gradient/types/agent_create_response.py @@ -10,6 +10,8 @@ class AgentCreateResponse(BaseModel): + """Information about a newly created Agent""" + agent: Optional["APIAgent"] = None """An Agent""" diff --git a/src/gradient/types/agent_delete_response.py b/src/gradient/types/agent_delete_response.py index 8c2b2e14..c16ea9fc 100644 --- a/src/gradient/types/agent_delete_response.py +++ b/src/gradient/types/agent_delete_response.py @@ -10,6 +10,8 @@ class AgentDeleteResponse(BaseModel): + """Info about a deleted agent""" + agent: Optional["APIAgent"] = None """An Agent""" diff --git a/src/gradient/types/agent_list_response.py b/src/gradient/types/agent_list_response.py index c461f152..a3b5cf6c 100644 --- a/src/gradient/types/agent_list_response.py +++ b/src/gradient/types/agent_list_response.py @@ -24,6 +24,8 @@ class AgentChatbot(BaseModel): + """A Chatbot""" + allowed_domains: Optional[List[str]] = None button_background_color: Optional[str] = None @@ -41,11 +43,15 @@ class AgentChatbot(BaseModel): class AgentChatbotIdentifier(BaseModel): + """Agent Chatbot Identifier""" + agent_chatbot_identifier: Optional[str] = None """Agent chatbot identifier""" class AgentDeployment(BaseModel): + """Description of deployment""" + created_at: Optional[datetime] = None """Creation date / time""" @@ -98,6 +104,8 @@ class AgentTemplateGuardrail(BaseModel): class AgentTemplate(BaseModel): + """Represents an AgentTemplate entity""" + created_at: Optional[datetime] = None """The agent template's creation date""" @@ -157,6 +165,8 @@ class AgentTemplate(BaseModel): class Agent(BaseModel): + """A GenAI Agent's configuration""" + chatbot: Optional[AgentChatbot] = None """A Chatbot""" @@ -266,6 +276,8 @@ class Agent(BaseModel): class AgentListResponse(BaseModel): + """List of Agents""" + agents: Optional[List[Agent]] = None """Agents""" diff --git a/src/gradient/types/agent_retrieve_response.py b/src/gradient/types/agent_retrieve_response.py index 2836558b..c8b25e0b 100644 --- a/src/gradient/types/agent_retrieve_response.py +++ b/src/gradient/types/agent_retrieve_response.py @@ -10,6 +10,8 @@ class AgentRetrieveResponse(BaseModel): + """One Agent""" + agent: Optional["APIAgent"] = None """An Agent""" diff --git a/src/gradient/types/agent_retrieve_usage_response.py b/src/gradient/types/agent_retrieve_usage_response.py index 1d65addd..f4622ec8 100644 --- a/src/gradient/types/agent_retrieve_usage_response.py +++ b/src/gradient/types/agent_retrieve_usage_response.py @@ -9,12 +9,16 @@ class LogInsightsUsageMeasurement(BaseModel): + """Usage Measurement Description""" + tokens: Optional[int] = None usage_type: Optional[str] = None class LogInsightsUsage(BaseModel): + """Resource Usage Description""" + measurements: Optional[List[LogInsightsUsageMeasurement]] = None resource_uuid: Optional[str] = None @@ -25,12 +29,16 @@ class LogInsightsUsage(BaseModel): class UsageMeasurement(BaseModel): + """Usage Measurement Description""" + tokens: Optional[int] = None usage_type: Optional[str] = None class Usage(BaseModel): + """Resource Usage Description""" + measurements: Optional[List[UsageMeasurement]] = None resource_uuid: Optional[str] = None @@ -41,6 +49,8 @@ class Usage(BaseModel): class AgentRetrieveUsageResponse(BaseModel): + """Agent usage""" + log_insights_usage: Optional[LogInsightsUsage] = None """Resource Usage Description""" diff --git a/src/gradient/types/agent_update_response.py b/src/gradient/types/agent_update_response.py index 1976089b..fb232225 100644 --- a/src/gradient/types/agent_update_response.py +++ b/src/gradient/types/agent_update_response.py @@ -10,6 +10,8 @@ class AgentUpdateResponse(BaseModel): + """Information about an updated agent""" + agent: Optional["APIAgent"] = None """An Agent""" diff --git a/src/gradient/types/agent_update_status_response.py b/src/gradient/types/agent_update_status_response.py index 84457d85..a562915e 100644 --- a/src/gradient/types/agent_update_status_response.py +++ b/src/gradient/types/agent_update_status_response.py @@ -10,6 +10,8 @@ class AgentUpdateStatusResponse(BaseModel): + """UpdateAgentDeploymentVisbilityOutput description""" + agent: Optional["APIAgent"] = None """An Agent""" diff --git a/src/gradient/types/agents/api_link_knowledge_base_output.py b/src/gradient/types/agents/api_link_knowledge_base_output.py index 2e7cec1e..d59f2677 100644 --- a/src/gradient/types/agents/api_link_knowledge_base_output.py +++ b/src/gradient/types/agents/api_link_knowledge_base_output.py @@ -10,6 +10,8 @@ class APILinkKnowledgeBaseOutput(BaseModel): + """Information about a linked knowledge base""" + agent: Optional["APIAgent"] = None """An Agent""" diff --git a/src/gradient/types/agents/chat/completion_create_params.py b/src/gradient/types/agents/chat/completion_create_params.py index 0980132e..d238f8e1 100644 --- a/src/gradient/types/agents/chat/completion_create_params.py +++ b/src/gradient/types/agents/chat/completion_create_params.py @@ -166,6 +166,8 @@ class CompletionCreateParamsBase(TypedDict, total=False): class MessageChatCompletionRequestSystemMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): + """Content part with type and text""" + text: Required[str] """The text content""" @@ -179,6 +181,11 @@ class MessageChatCompletionRequestSystemMessageContentArrayOfContentPartUnionMem class MessageChatCompletionRequestSystemMessage(TypedDict, total=False): + """ + System-provided instructions that the model should follow, regardless of + messages sent by the user. + """ + content: Required[Union[str, SequenceNotStr[MessageChatCompletionRequestSystemMessageContentArrayOfContentPart]]] """The contents of the system message.""" @@ -187,6 +194,8 @@ class MessageChatCompletionRequestSystemMessage(TypedDict, total=False): class MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): + """Content part with type and text""" + text: Required[str] """The text content""" @@ -200,6 +209,11 @@ class MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartUnion class MessageChatCompletionRequestDeveloperMessage(TypedDict, total=False): + """ + Developer-provided instructions that the model should follow, regardless of + messages sent by the user. + """ + content: Required[Union[str, SequenceNotStr[MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPart]]] """The contents of the developer message.""" @@ -208,6 +222,8 @@ class MessageChatCompletionRequestDeveloperMessage(TypedDict, total=False): class MessageChatCompletionRequestUserMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): + """Content part with type and text""" + text: Required[str] """The text content""" @@ -221,6 +237,11 @@ class MessageChatCompletionRequestUserMessageContentArrayOfContentPartUnionMembe class MessageChatCompletionRequestUserMessage(TypedDict, total=False): + """ + Messages sent by an end user, containing prompts or additional context + information. + """ + content: Required[Union[str, SequenceNotStr[MessageChatCompletionRequestUserMessageContentArrayOfContentPart]]] """The contents of the user message.""" @@ -229,6 +250,8 @@ class MessageChatCompletionRequestUserMessage(TypedDict, total=False): class MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): + """Content part with type and text""" + text: Required[str] """The text content""" @@ -242,6 +265,8 @@ class MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartUnion class MessageChatCompletionRequestAssistantMessageToolCallFunction(TypedDict, total=False): + """The function that the model called.""" + arguments: Required[str] """ The arguments to call the function with, as generated by the model in JSON @@ -266,6 +291,8 @@ class MessageChatCompletionRequestAssistantMessageToolCall(TypedDict, total=Fals class MessageChatCompletionRequestAssistantMessage(TypedDict, total=False): + """Messages sent by the model in response to user messages.""" + role: Required[Literal["assistant"]] """The role of the messages author, in this case `assistant`.""" @@ -297,6 +324,8 @@ class MessageChatCompletionRequestToolMessage(TypedDict, total=False): class StreamOptions(TypedDict, total=False): + """Options for streaming response. Only set this when you set `stream: true`.""" + include_usage: bool """If set, an additional chunk will be streamed before the `data: [DONE]` message. @@ -315,6 +344,11 @@ class ToolChoiceChatCompletionNamedToolChoiceFunction(TypedDict, total=False): class ToolChoiceChatCompletionNamedToolChoice(TypedDict, total=False): + """Specifies a tool the model should use. + + Use to force the model to call a specific function. + """ + function: Required[ToolChoiceChatCompletionNamedToolChoiceFunction] type: Required[Literal["function"]] diff --git a/src/gradient/types/agents/chat/completion_create_response.py b/src/gradient/types/agents/chat/completion_create_response.py index 69b3d203..88c64763 100644 --- a/src/gradient/types/agents/chat/completion_create_response.py +++ b/src/gradient/types/agents/chat/completion_create_response.py @@ -18,6 +18,8 @@ class ChoiceLogprobs(BaseModel): + """Log probability information for the choice.""" + content: Optional[List[ChatCompletionTokenLogprob]] = None """A list of message content tokens with log probability information.""" @@ -26,6 +28,8 @@ class ChoiceLogprobs(BaseModel): class ChoiceMessageToolCallFunction(BaseModel): + """The function that the model called.""" + arguments: str """ The arguments to call the function with, as generated by the model in JSON @@ -50,6 +54,8 @@ class ChoiceMessageToolCall(BaseModel): class ChoiceMessage(BaseModel): + """A chat completion message generated by the model.""" + content: Optional[str] = None """The contents of the message.""" @@ -86,6 +92,10 @@ class Choice(BaseModel): class CompletionCreateResponse(BaseModel): + """ + Represents a chat completion response returned by model, based on the provided input. + """ + id: str """A unique identifier for the chat completion.""" diff --git a/src/gradient/types/agents/evaluation_dataset_create_file_upload_presigned_urls_params.py b/src/gradient/types/agents/evaluation_dataset_create_file_upload_presigned_urls_params.py index 9a4000c0..9412b46c 100644 --- a/src/gradient/types/agents/evaluation_dataset_create_file_upload_presigned_urls_params.py +++ b/src/gradient/types/agents/evaluation_dataset_create_file_upload_presigned_urls_params.py @@ -14,6 +14,8 @@ class EvaluationDatasetCreateFileUploadPresignedURLsParams(TypedDict, total=Fals class File(TypedDict, total=False): + """A single file’s metadata in the request.""" + file_name: str """Local filename""" diff --git a/src/gradient/types/agents/evaluation_dataset_create_file_upload_presigned_urls_response.py b/src/gradient/types/agents/evaluation_dataset_create_file_upload_presigned_urls_response.py index bee94c93..3648a9ed 100644 --- a/src/gradient/types/agents/evaluation_dataset_create_file_upload_presigned_urls_response.py +++ b/src/gradient/types/agents/evaluation_dataset_create_file_upload_presigned_urls_response.py @@ -9,6 +9,8 @@ class Upload(BaseModel): + """Detailed info about each presigned URL returned to the client.""" + expires_at: Optional[datetime] = None """The time the url expires at.""" @@ -23,6 +25,8 @@ class Upload(BaseModel): class EvaluationDatasetCreateFileUploadPresignedURLsResponse(BaseModel): + """Response with pre-signed urls to upload files.""" + request_id: Optional[str] = None """The ID generated for the request for Presigned URLs.""" diff --git a/src/gradient/types/agents/evaluation_dataset_create_response.py b/src/gradient/types/agents/evaluation_dataset_create_response.py index f5c7fbac..4e5f8c9b 100644 --- a/src/gradient/types/agents/evaluation_dataset_create_response.py +++ b/src/gradient/types/agents/evaluation_dataset_create_response.py @@ -8,5 +8,7 @@ class EvaluationDatasetCreateResponse(BaseModel): + """Output for creating an agent evaluation dataset""" + evaluation_dataset_uuid: Optional[str] = None """Evaluation dataset uuid.""" diff --git a/src/gradient/types/agents/evaluation_metric_list_regions_response.py b/src/gradient/types/agents/evaluation_metric_list_regions_response.py index 7246d484..dc07a7ef 100644 --- a/src/gradient/types/agents/evaluation_metric_list_regions_response.py +++ b/src/gradient/types/agents/evaluation_metric_list_regions_response.py @@ -8,6 +8,8 @@ class Region(BaseModel): + """Description for a specific Region""" + inference_url: Optional[str] = None """Url for inference server""" @@ -25,5 +27,7 @@ class Region(BaseModel): class EvaluationMetricListRegionsResponse(BaseModel): + """Region Codes""" + regions: Optional[List[Region]] = None """Region code""" diff --git a/src/gradient/types/agents/evaluation_metrics/anthropic/key_create_response.py b/src/gradient/types/agents/evaluation_metrics/anthropic/key_create_response.py index 24b7bbb2..34babe47 100644 --- a/src/gradient/types/agents/evaluation_metrics/anthropic/key_create_response.py +++ b/src/gradient/types/agents/evaluation_metrics/anthropic/key_create_response.py @@ -9,5 +9,9 @@ class KeyCreateResponse(BaseModel): + """ + CreateAnthropicAPIKeyOutput is used to return the newly created Anthropic API key. + """ + api_key_info: Optional[APIAnthropicAPIKeyInfo] = None """Anthropic API Key Info""" diff --git a/src/gradient/types/agents/evaluation_metrics/anthropic/key_delete_response.py b/src/gradient/types/agents/evaluation_metrics/anthropic/key_delete_response.py index b5d8584e..c2796b36 100644 --- a/src/gradient/types/agents/evaluation_metrics/anthropic/key_delete_response.py +++ b/src/gradient/types/agents/evaluation_metrics/anthropic/key_delete_response.py @@ -9,5 +9,7 @@ class KeyDeleteResponse(BaseModel): + """DeleteAnthropicAPIKeyOutput is used to return the deleted Anthropic API key.""" + api_key_info: Optional[APIAnthropicAPIKeyInfo] = None """Anthropic API Key Info""" diff --git a/src/gradient/types/agents/evaluation_metrics/anthropic/key_list_agents_response.py b/src/gradient/types/agents/evaluation_metrics/anthropic/key_list_agents_response.py index 633211cc..34ab7508 100644 --- a/src/gradient/types/agents/evaluation_metrics/anthropic/key_list_agents_response.py +++ b/src/gradient/types/agents/evaluation_metrics/anthropic/key_list_agents_response.py @@ -12,6 +12,8 @@ class KeyListAgentsResponse(BaseModel): + """List of Agents that linked to a specific Anthropic Key""" + agents: Optional[List["APIAgent"]] = None links: Optional[APILinks] = None diff --git a/src/gradient/types/agents/evaluation_metrics/anthropic/key_list_response.py b/src/gradient/types/agents/evaluation_metrics/anthropic/key_list_response.py index edc9e75a..21729e57 100644 --- a/src/gradient/types/agents/evaluation_metrics/anthropic/key_list_response.py +++ b/src/gradient/types/agents/evaluation_metrics/anthropic/key_list_response.py @@ -11,6 +11,10 @@ class KeyListResponse(BaseModel): + """ + ListAnthropicAPIKeysOutput is used to return the list of Anthropic API keys for a specific agent. + """ + api_key_infos: Optional[List[APIAnthropicAPIKeyInfo]] = None """Api key infos""" diff --git a/src/gradient/types/agents/evaluation_metrics/anthropic/key_update_response.py b/src/gradient/types/agents/evaluation_metrics/anthropic/key_update_response.py index 06fa2d18..04d20e9b 100644 --- a/src/gradient/types/agents/evaluation_metrics/anthropic/key_update_response.py +++ b/src/gradient/types/agents/evaluation_metrics/anthropic/key_update_response.py @@ -9,5 +9,7 @@ class KeyUpdateResponse(BaseModel): + """UpdateAnthropicAPIKeyOutput is used to return the updated Anthropic API key.""" + api_key_info: Optional[APIAnthropicAPIKeyInfo] = None """Anthropic API Key Info""" diff --git a/src/gradient/types/agents/evaluation_metrics/oauth2/dropbox_create_tokens_response.py b/src/gradient/types/agents/evaluation_metrics/oauth2/dropbox_create_tokens_response.py index 816b89f4..6277059b 100644 --- a/src/gradient/types/agents/evaluation_metrics/oauth2/dropbox_create_tokens_response.py +++ b/src/gradient/types/agents/evaluation_metrics/oauth2/dropbox_create_tokens_response.py @@ -8,6 +8,8 @@ class DropboxCreateTokensResponse(BaseModel): + """The dropbox oauth2 token and refresh token""" + token: Optional[str] = None """The access token""" diff --git a/src/gradient/types/agents/evaluation_metrics/oauth2_generate_url_response.py b/src/gradient/types/agents/evaluation_metrics/oauth2_generate_url_response.py index 8be21b8a..f1e782c4 100644 --- a/src/gradient/types/agents/evaluation_metrics/oauth2_generate_url_response.py +++ b/src/gradient/types/agents/evaluation_metrics/oauth2_generate_url_response.py @@ -8,5 +8,7 @@ class Oauth2GenerateURLResponse(BaseModel): + """The url for the oauth2 flow""" + url: Optional[str] = None """The oauth2 url""" diff --git a/src/gradient/types/agents/evaluation_metrics/openai/key_create_response.py b/src/gradient/types/agents/evaluation_metrics/openai/key_create_response.py index 4af7b872..f6254e1c 100644 --- a/src/gradient/types/agents/evaluation_metrics/openai/key_create_response.py +++ b/src/gradient/types/agents/evaluation_metrics/openai/key_create_response.py @@ -9,5 +9,7 @@ class KeyCreateResponse(BaseModel): + """CreateOpenAIAPIKeyOutput is used to return the newly created OpenAI API key.""" + api_key_info: Optional[APIOpenAIAPIKeyInfo] = None """OpenAI API Key Info""" diff --git a/src/gradient/types/agents/evaluation_metrics/openai/key_delete_response.py b/src/gradient/types/agents/evaluation_metrics/openai/key_delete_response.py index f1ebc73a..1ac937f4 100644 --- a/src/gradient/types/agents/evaluation_metrics/openai/key_delete_response.py +++ b/src/gradient/types/agents/evaluation_metrics/openai/key_delete_response.py @@ -9,5 +9,7 @@ class KeyDeleteResponse(BaseModel): + """DeleteOpenAIAPIKeyOutput is used to return the deleted OpenAI API key.""" + api_key_info: Optional[APIOpenAIAPIKeyInfo] = None """OpenAI API Key Info""" diff --git a/src/gradient/types/agents/evaluation_metrics/openai/key_list_agents_response.py b/src/gradient/types/agents/evaluation_metrics/openai/key_list_agents_response.py index 633211cc..fa2ba7cc 100644 --- a/src/gradient/types/agents/evaluation_metrics/openai/key_list_agents_response.py +++ b/src/gradient/types/agents/evaluation_metrics/openai/key_list_agents_response.py @@ -12,6 +12,8 @@ class KeyListAgentsResponse(BaseModel): + """List of Agents that are linked to a specific OpenAI Key""" + agents: Optional[List["APIAgent"]] = None links: Optional[APILinks] = None diff --git a/src/gradient/types/agents/evaluation_metrics/openai/key_list_response.py b/src/gradient/types/agents/evaluation_metrics/openai/key_list_response.py index 00738f68..f335cfc9 100644 --- a/src/gradient/types/agents/evaluation_metrics/openai/key_list_response.py +++ b/src/gradient/types/agents/evaluation_metrics/openai/key_list_response.py @@ -11,6 +11,10 @@ class KeyListResponse(BaseModel): + """ + ListOpenAIAPIKeysOutput is used to return the list of OpenAI API keys for a specific agent. + """ + api_key_infos: Optional[List[APIOpenAIAPIKeyInfo]] = None """Api key infos""" diff --git a/src/gradient/types/agents/evaluation_metrics/openai/key_update_response.py b/src/gradient/types/agents/evaluation_metrics/openai/key_update_response.py index 222a8416..28b56926 100644 --- a/src/gradient/types/agents/evaluation_metrics/openai/key_update_response.py +++ b/src/gradient/types/agents/evaluation_metrics/openai/key_update_response.py @@ -9,5 +9,7 @@ class KeyUpdateResponse(BaseModel): + """UpdateOpenAIAPIKeyOutput is used to return the updated OpenAI API key.""" + api_key_info: Optional[APIOpenAIAPIKeyInfo] = None """OpenAI API Key Info""" diff --git a/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_create_response.py b/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_create_response.py index c306c5b1..78cb1e73 100644 --- a/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_create_response.py +++ b/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_create_response.py @@ -9,6 +9,8 @@ class IndexingInfo(BaseModel): + """Metadata for scheduled indexing entries""" + created_at: Optional[datetime] = None """Created at timestamp""" diff --git a/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_delete_response.py b/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_delete_response.py index febf3759..b359cb18 100644 --- a/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_delete_response.py +++ b/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_delete_response.py @@ -9,6 +9,8 @@ class IndexingInfo(BaseModel): + """Metadata for scheduled indexing entries""" + created_at: Optional[datetime] = None """Created at timestamp""" diff --git a/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_retrieve_response.py b/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_retrieve_response.py index 1776c83d..4d3840a3 100644 --- a/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_retrieve_response.py +++ b/src/gradient/types/agents/evaluation_metrics/scheduled_indexing_retrieve_response.py @@ -9,6 +9,8 @@ class IndexingInfo(BaseModel): + """Metadata for scheduled indexing entries""" + created_at: Optional[datetime] = None """Created at timestamp""" diff --git a/src/gradient/types/agents/evaluation_run_list_results_response.py b/src/gradient/types/agents/evaluation_run_list_results_response.py index df830a5b..e06bac94 100644 --- a/src/gradient/types/agents/evaluation_run_list_results_response.py +++ b/src/gradient/types/agents/evaluation_run_list_results_response.py @@ -12,6 +12,8 @@ class EvaluationRunListResultsResponse(BaseModel): + """Gets the full results of an evaluation run with all prompts.""" + evaluation_run: Optional[APIEvaluationRun] = None links: Optional[APILinks] = None diff --git a/src/gradient/types/agents/function_create_response.py b/src/gradient/types/agents/function_create_response.py index 65a4bb2b..335ebac0 100644 --- a/src/gradient/types/agents/function_create_response.py +++ b/src/gradient/types/agents/function_create_response.py @@ -10,6 +10,8 @@ class FunctionCreateResponse(BaseModel): + """Information about a newly function linked agent""" + agent: Optional["APIAgent"] = None """An Agent""" diff --git a/src/gradient/types/agents/function_delete_response.py b/src/gradient/types/agents/function_delete_response.py index 26ad02e6..7490d34d 100644 --- a/src/gradient/types/agents/function_delete_response.py +++ b/src/gradient/types/agents/function_delete_response.py @@ -10,6 +10,8 @@ class FunctionDeleteResponse(BaseModel): + """Information about a newly unlinked agent""" + agent: Optional["APIAgent"] = None """An Agent""" diff --git a/src/gradient/types/agents/function_update_response.py b/src/gradient/types/agents/function_update_response.py index eebde3e6..72399e92 100644 --- a/src/gradient/types/agents/function_update_response.py +++ b/src/gradient/types/agents/function_update_response.py @@ -10,6 +10,8 @@ class FunctionUpdateResponse(BaseModel): + """The updated agent""" + agent: Optional["APIAgent"] = None """An Agent""" diff --git a/src/gradient/types/agents/knowledge_base_detach_response.py b/src/gradient/types/agents/knowledge_base_detach_response.py index 0dc90aaf..c94b99a1 100644 --- a/src/gradient/types/agents/knowledge_base_detach_response.py +++ b/src/gradient/types/agents/knowledge_base_detach_response.py @@ -10,6 +10,8 @@ class KnowledgeBaseDetachResponse(BaseModel): + """Informatinon about a unlinked knowledge base""" + agent: Optional["APIAgent"] = None """An Agent""" diff --git a/src/gradient/types/agents/route_add_response.py b/src/gradient/types/agents/route_add_response.py index b9cc2b7d..b1755d54 100644 --- a/src/gradient/types/agents/route_add_response.py +++ b/src/gradient/types/agents/route_add_response.py @@ -8,6 +8,8 @@ class RouteAddResponse(BaseModel): + """Information about a newly linked agent""" + child_agent_uuid: Optional[str] = None """Routed agent id""" diff --git a/src/gradient/types/agents/route_delete_response.py b/src/gradient/types/agents/route_delete_response.py index b49c8b7c..6dcc03b6 100644 --- a/src/gradient/types/agents/route_delete_response.py +++ b/src/gradient/types/agents/route_delete_response.py @@ -8,6 +8,8 @@ class RouteDeleteResponse(BaseModel): + """Information about a removed linkage""" + child_agent_uuid: Optional[str] = None """Routed agent id""" diff --git a/src/gradient/types/agents/route_update_response.py b/src/gradient/types/agents/route_update_response.py index b79fc9fe..dfcec469 100644 --- a/src/gradient/types/agents/route_update_response.py +++ b/src/gradient/types/agents/route_update_response.py @@ -8,6 +8,8 @@ class RouteUpdateResponse(BaseModel): + """Information about an updated linkage""" + child_agent_uuid: Optional[str] = None """Routed agent id""" diff --git a/src/gradient/types/agents/route_view_response.py b/src/gradient/types/agents/route_view_response.py index f0ee2d71..ddbf6f33 100644 --- a/src/gradient/types/agents/route_view_response.py +++ b/src/gradient/types/agents/route_view_response.py @@ -10,6 +10,8 @@ class RouteViewResponse(BaseModel): + """Child list for an agent""" + children: Optional[List["APIAgent"]] = None """Child agents""" diff --git a/src/gradient/types/agents/version_list_response.py b/src/gradient/types/agents/version_list_response.py index c35a5ba4..75c45a95 100644 --- a/src/gradient/types/agents/version_list_response.py +++ b/src/gradient/types/agents/version_list_response.py @@ -38,6 +38,8 @@ class AgentVersionAttachedChildAgent(BaseModel): class AgentVersionAttachedFunction(BaseModel): + """Function represents a function configuration for an agent""" + description: Optional[str] = None """Description of the function""" @@ -55,6 +57,8 @@ class AgentVersionAttachedFunction(BaseModel): class AgentVersionAttachedGuardrail(BaseModel): + """Agent Guardrail version""" + is_deleted: Optional[bool] = None """Whether the guardrail is deleted""" @@ -80,6 +84,8 @@ class AgentVersionAttachedKnowledgebase(BaseModel): class AgentVersion(BaseModel): + """Represents an AgentVersion entity""" + id: Optional[str] = None """Unique identifier""" @@ -157,6 +163,8 @@ class AgentVersion(BaseModel): class VersionListResponse(BaseModel): + """List of agent versions""" + agent_versions: Optional[List[AgentVersion]] = None """Agents""" diff --git a/src/gradient/types/agents/version_update_response.py b/src/gradient/types/agents/version_update_response.py index 464ef12f..ee1188d1 100644 --- a/src/gradient/types/agents/version_update_response.py +++ b/src/gradient/types/agents/version_update_response.py @@ -8,6 +8,8 @@ class AuditHeader(BaseModel): + """An alternative way to provide auth information. for internal use only.""" + actor_id: Optional[str] = None actor_ip: Optional[str] = None diff --git a/src/gradient/types/api_agent.py b/src/gradient/types/api_agent.py index f52e44c8..e3fb21f2 100644 --- a/src/gradient/types/api_agent.py +++ b/src/gradient/types/api_agent.py @@ -33,11 +33,15 @@ class APIKey(BaseModel): + """Agent API Key""" + api_key: Optional[str] = None """Api key""" class Chatbot(BaseModel): + """A Chatbot""" + allowed_domains: Optional[List[str]] = None button_background_color: Optional[str] = None @@ -55,11 +59,15 @@ class Chatbot(BaseModel): class ChatbotIdentifier(BaseModel): + """Agent Chatbot Identifier""" + agent_chatbot_identifier: Optional[str] = None """Agent chatbot identifier""" class Deployment(BaseModel): + """Description of deployment""" + created_at: Optional[datetime] = None """Creation date / time""" @@ -104,6 +112,8 @@ class Deployment(BaseModel): class Function(BaseModel): + """Description missing""" + api_key: Optional[str] = None """Api key""" @@ -138,6 +148,8 @@ class Function(BaseModel): class Guardrail(BaseModel): + """A Agent Guardrail""" + agent_uuid: Optional[str] = None created_at: Optional[datetime] = None @@ -228,6 +240,8 @@ class TemplateGuardrail(BaseModel): class Template(BaseModel): + """Represents an AgentTemplate entity""" + created_at: Optional[datetime] = None """The agent template's creation date""" @@ -287,6 +301,8 @@ class Template(BaseModel): class APIAgent(BaseModel): + """An Agent""" + anthropic_api_key: Optional[APIAnthropicAPIKeyInfo] = None """Anthropic API Key Info""" diff --git a/src/gradient/types/api_agent_api_key_info.py b/src/gradient/types/api_agent_api_key_info.py index 7222153c..06bd0fda 100644 --- a/src/gradient/types/api_agent_api_key_info.py +++ b/src/gradient/types/api_agent_api_key_info.py @@ -9,6 +9,8 @@ class APIAgentAPIKeyInfo(BaseModel): + """Agent API Key Info""" + created_at: Optional[datetime] = None """Creation date""" diff --git a/src/gradient/types/api_agent_model.py b/src/gradient/types/api_agent_model.py index f111bfb7..e42bb5d5 100644 --- a/src/gradient/types/api_agent_model.py +++ b/src/gradient/types/api_agent_model.py @@ -12,6 +12,8 @@ class APIAgentModel(BaseModel): + """Description of a Model""" + agreement: Optional[APIAgreement] = None """Agreement Description""" diff --git a/src/gradient/types/api_agreement.py b/src/gradient/types/api_agreement.py index c4359f1f..8eca3c3c 100644 --- a/src/gradient/types/api_agreement.py +++ b/src/gradient/types/api_agreement.py @@ -8,6 +8,8 @@ class APIAgreement(BaseModel): + """Agreement Description""" + description: Optional[str] = None name: Optional[str] = None diff --git a/src/gradient/types/api_anthropic_api_key_info.py b/src/gradient/types/api_anthropic_api_key_info.py index 6440c5ef..bf13fd60 100644 --- a/src/gradient/types/api_anthropic_api_key_info.py +++ b/src/gradient/types/api_anthropic_api_key_info.py @@ -9,6 +9,8 @@ class APIAnthropicAPIKeyInfo(BaseModel): + """Anthropic API Key Info""" + created_at: Optional[datetime] = None """Key creation date""" diff --git a/src/gradient/types/api_knowledge_base.py b/src/gradient/types/api_knowledge_base.py index 4e4a6567..e64f9336 100644 --- a/src/gradient/types/api_knowledge_base.py +++ b/src/gradient/types/api_knowledge_base.py @@ -10,6 +10,8 @@ class APIKnowledgeBase(BaseModel): + """Knowledgebase Description""" + added_to_agent_at: Optional[datetime] = None """Time when the knowledge base was added to the agent""" diff --git a/src/gradient/types/api_model.py b/src/gradient/types/api_model.py index e7f99bc1..83b1b66a 100644 --- a/src/gradient/types/api_model.py +++ b/src/gradient/types/api_model.py @@ -11,6 +11,8 @@ class APIModel(BaseModel): + """A machine learning model stored on the GenAI platform""" + id: Optional[str] = None """Human-readable model identifier""" diff --git a/src/gradient/types/api_model_version.py b/src/gradient/types/api_model_version.py index f19a78c6..3989e256 100644 --- a/src/gradient/types/api_model_version.py +++ b/src/gradient/types/api_model_version.py @@ -8,6 +8,8 @@ class APIModelVersion(BaseModel): + """Version Information about a Model""" + major: Optional[int] = None """Major version number""" diff --git a/src/gradient/types/api_openai_api_key_info.py b/src/gradient/types/api_openai_api_key_info.py index bcee992b..69e9b138 100644 --- a/src/gradient/types/api_openai_api_key_info.py +++ b/src/gradient/types/api_openai_api_key_info.py @@ -10,6 +10,8 @@ class APIOpenAIAPIKeyInfo(BaseModel): + """OpenAI API Key Info""" + created_at: Optional[datetime] = None """Key creation date""" diff --git a/src/gradient/types/chat/completion_create_params.py b/src/gradient/types/chat/completion_create_params.py index 7874d893..e889c5e8 100644 --- a/src/gradient/types/chat/completion_create_params.py +++ b/src/gradient/types/chat/completion_create_params.py @@ -166,6 +166,8 @@ class CompletionCreateParamsBase(TypedDict, total=False): class MessageChatCompletionRequestSystemMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): + """Content part with type and text""" + text: Required[str] """The text content""" @@ -179,6 +181,11 @@ class MessageChatCompletionRequestSystemMessageContentArrayOfContentPartUnionMem class MessageChatCompletionRequestSystemMessage(TypedDict, total=False): + """ + System-provided instructions that the model should follow, regardless of + messages sent by the user. + """ + content: Required[Union[str, SequenceNotStr[MessageChatCompletionRequestSystemMessageContentArrayOfContentPart]]] """The contents of the system message.""" @@ -187,6 +194,8 @@ class MessageChatCompletionRequestSystemMessage(TypedDict, total=False): class MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): + """Content part with type and text""" + text: Required[str] """The text content""" @@ -200,6 +209,11 @@ class MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartUnion class MessageChatCompletionRequestDeveloperMessage(TypedDict, total=False): + """ + Developer-provided instructions that the model should follow, regardless of + messages sent by the user. + """ + content: Required[Union[str, SequenceNotStr[MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPart]]] """The contents of the developer message.""" @@ -208,6 +222,8 @@ class MessageChatCompletionRequestDeveloperMessage(TypedDict, total=False): class MessageChatCompletionRequestUserMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): + """Content part with type and text""" + text: Required[str] """The text content""" @@ -221,6 +237,11 @@ class MessageChatCompletionRequestUserMessageContentArrayOfContentPartUnionMembe class MessageChatCompletionRequestUserMessage(TypedDict, total=False): + """ + Messages sent by an end user, containing prompts or additional context + information. + """ + content: Required[Union[str, SequenceNotStr[MessageChatCompletionRequestUserMessageContentArrayOfContentPart]]] """The contents of the user message.""" @@ -229,6 +250,8 @@ class MessageChatCompletionRequestUserMessage(TypedDict, total=False): class MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): + """Content part with type and text""" + text: Required[str] """The text content""" @@ -242,6 +265,8 @@ class MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartUnion class MessageChatCompletionRequestAssistantMessageToolCallFunction(TypedDict, total=False): + """The function that the model called.""" + arguments: Required[str] """ The arguments to call the function with, as generated by the model in JSON @@ -266,6 +291,8 @@ class MessageChatCompletionRequestAssistantMessageToolCall(TypedDict, total=Fals class MessageChatCompletionRequestAssistantMessage(TypedDict, total=False): + """Messages sent by the model in response to user messages.""" + role: Required[Literal["assistant"]] """The role of the messages author, in this case `assistant`.""" @@ -297,6 +324,8 @@ class MessageChatCompletionRequestToolMessage(TypedDict, total=False): class StreamOptions(TypedDict, total=False): + """Options for streaming response. Only set this when you set `stream: true`.""" + include_usage: bool """If set, an additional chunk will be streamed before the `data: [DONE]` message. @@ -315,6 +344,11 @@ class ToolChoiceChatCompletionNamedToolChoiceFunction(TypedDict, total=False): class ToolChoiceChatCompletionNamedToolChoice(TypedDict, total=False): + """Specifies a tool the model should use. + + Use to force the model to call a specific function. + """ + function: Required[ToolChoiceChatCompletionNamedToolChoiceFunction] type: Required[Literal["function"]] diff --git a/src/gradient/types/chat/completion_create_response.py b/src/gradient/types/chat/completion_create_response.py index 151f6556..13efee40 100644 --- a/src/gradient/types/chat/completion_create_response.py +++ b/src/gradient/types/chat/completion_create_response.py @@ -18,6 +18,8 @@ class ChoiceLogprobs(BaseModel): + """Log probability information for the choice.""" + content: Optional[List[ChatCompletionTokenLogprob]] = None """A list of message content tokens with log probability information.""" @@ -26,6 +28,8 @@ class ChoiceLogprobs(BaseModel): class ChoiceMessageToolCallFunction(BaseModel): + """The function that the model called.""" + arguments: str """ The arguments to call the function with, as generated by the model in JSON @@ -50,6 +54,8 @@ class ChoiceMessageToolCall(BaseModel): class ChoiceMessage(BaseModel): + """A chat completion message generated by the model.""" + content: Optional[str] = None """The contents of the message.""" @@ -86,6 +92,10 @@ class Choice(BaseModel): class CompletionCreateResponse(BaseModel): + """ + Represents a chat completion response returned by model, based on the provided input. + """ + id: str """A unique identifier for the chat completion.""" diff --git a/src/gradient/types/gpu_droplets/associated_resource.py b/src/gradient/types/gpu_droplets/associated_resource.py index f72c3d32..500c69e2 100644 --- a/src/gradient/types/gpu_droplets/associated_resource.py +++ b/src/gradient/types/gpu_droplets/associated_resource.py @@ -8,6 +8,8 @@ class AssociatedResource(BaseModel): + """An objects containing information about a resource associated with a Droplet.""" + id: Optional[str] = None """The unique identifier for the resource associated with the Droplet.""" diff --git a/src/gradient/types/gpu_droplets/destroy_with_associated_resource_check_status_response.py b/src/gradient/types/gpu_droplets/destroy_with_associated_resource_check_status_response.py index f2f2ff67..8dd32c14 100644 --- a/src/gradient/types/gpu_droplets/destroy_with_associated_resource_check_status_response.py +++ b/src/gradient/types/gpu_droplets/destroy_with_associated_resource_check_status_response.py @@ -10,6 +10,10 @@ class Resources(BaseModel): + """ + An object containing additional information about resource related to a Droplet requested to be destroyed. + """ + floating_ips: Optional[List[DestroyedAssociatedResource]] = None reserved_ips: Optional[List[DestroyedAssociatedResource]] = None @@ -22,6 +26,8 @@ class Resources(BaseModel): class DestroyWithAssociatedResourceCheckStatusResponse(BaseModel): + """An objects containing information about a resources scheduled for deletion.""" + completed_at: Optional[datetime] = None """ A time value given in ISO8601 combined date and time format indicating when the diff --git a/src/gradient/types/gpu_droplets/destroyed_associated_resource.py b/src/gradient/types/gpu_droplets/destroyed_associated_resource.py index 358c14e9..fd3784e4 100644 --- a/src/gradient/types/gpu_droplets/destroyed_associated_resource.py +++ b/src/gradient/types/gpu_droplets/destroyed_associated_resource.py @@ -9,6 +9,8 @@ class DestroyedAssociatedResource(BaseModel): + """An object containing information about a resource scheduled for deletion.""" + id: Optional[str] = None """The unique identifier for the resource scheduled for deletion.""" diff --git a/src/gradient/types/gpu_droplets/domains.py b/src/gradient/types/gpu_droplets/domains.py index 6a9400f9..14d4a0bb 100644 --- a/src/gradient/types/gpu_droplets/domains.py +++ b/src/gradient/types/gpu_droplets/domains.py @@ -8,6 +8,8 @@ class Domains(BaseModel): + """An object specifying domain configurations for a Global load balancer.""" + certificate_id: Optional[str] = None """The ID of the TLS certificate used for SSL termination.""" diff --git a/src/gradient/types/gpu_droplets/domains_param.py b/src/gradient/types/gpu_droplets/domains_param.py index d2d21faf..44481775 100644 --- a/src/gradient/types/gpu_droplets/domains_param.py +++ b/src/gradient/types/gpu_droplets/domains_param.py @@ -8,6 +8,8 @@ class DomainsParam(TypedDict, total=False): + """An object specifying domain configurations for a Global load balancer.""" + certificate_id: str """The ID of the TLS certificate used for SSL termination.""" diff --git a/src/gradient/types/gpu_droplets/floating_ip.py b/src/gradient/types/gpu_droplets/floating_ip.py index 81c58753..f592d510 100644 --- a/src/gradient/types/gpu_droplets/floating_ip.py +++ b/src/gradient/types/gpu_droplets/floating_ip.py @@ -12,6 +12,11 @@ class Region(region.Region): + """The region that the floating IP is reserved to. + + When you query a floating IP, the entire region object will be returned. + """ + pass diff --git a/src/gradient/types/gpu_droplets/forwarding_rule.py b/src/gradient/types/gpu_droplets/forwarding_rule.py index 40a310ab..a9345e05 100644 --- a/src/gradient/types/gpu_droplets/forwarding_rule.py +++ b/src/gradient/types/gpu_droplets/forwarding_rule.py @@ -9,6 +9,8 @@ class ForwardingRule(BaseModel): + """An object specifying a forwarding rule for a load balancer.""" + entry_port: int """ An integer representing the port on which the load balancer instance will diff --git a/src/gradient/types/gpu_droplets/forwarding_rule_param.py b/src/gradient/types/gpu_droplets/forwarding_rule_param.py index 70285bf6..f81dfd6b 100644 --- a/src/gradient/types/gpu_droplets/forwarding_rule_param.py +++ b/src/gradient/types/gpu_droplets/forwarding_rule_param.py @@ -8,6 +8,8 @@ class ForwardingRuleParam(TypedDict, total=False): + """An object specifying a forwarding rule for a load balancer.""" + entry_port: Required[int] """ An integer representing the port on which the load balancer instance will diff --git a/src/gradient/types/gpu_droplets/glb_settings.py b/src/gradient/types/gpu_droplets/glb_settings.py index 9aa790d8..0af332eb 100644 --- a/src/gradient/types/gpu_droplets/glb_settings.py +++ b/src/gradient/types/gpu_droplets/glb_settings.py @@ -9,11 +9,15 @@ class Cdn(BaseModel): + """An object specifying CDN configurations for a Global load balancer.""" + is_enabled: Optional[bool] = None """A boolean flag to enable CDN caching.""" class GlbSettings(BaseModel): + """An object specifying forwarding configurations for a Global load balancer.""" + cdn: Optional[Cdn] = None """An object specifying CDN configurations for a Global load balancer.""" diff --git a/src/gradient/types/gpu_droplets/glb_settings_param.py b/src/gradient/types/gpu_droplets/glb_settings_param.py index f1b25c8b..a790d0ee 100644 --- a/src/gradient/types/gpu_droplets/glb_settings_param.py +++ b/src/gradient/types/gpu_droplets/glb_settings_param.py @@ -9,11 +9,15 @@ class Cdn(TypedDict, total=False): + """An object specifying CDN configurations for a Global load balancer.""" + is_enabled: bool """A boolean flag to enable CDN caching.""" class GlbSettingsParam(TypedDict, total=False): + """An object specifying forwarding configurations for a Global load balancer.""" + cdn: Cdn """An object specifying CDN configurations for a Global load balancer.""" diff --git a/src/gradient/types/gpu_droplets/health_check.py b/src/gradient/types/gpu_droplets/health_check.py index db44d84e..e20cbc65 100644 --- a/src/gradient/types/gpu_droplets/health_check.py +++ b/src/gradient/types/gpu_droplets/health_check.py @@ -9,6 +9,8 @@ class HealthCheck(BaseModel): + """An object specifying health check settings for the load balancer.""" + check_interval_seconds: Optional[int] = None """The number of seconds between between two consecutive health checks.""" diff --git a/src/gradient/types/gpu_droplets/health_check_param.py b/src/gradient/types/gpu_droplets/health_check_param.py index e840f818..47de9e45 100644 --- a/src/gradient/types/gpu_droplets/health_check_param.py +++ b/src/gradient/types/gpu_droplets/health_check_param.py @@ -8,6 +8,8 @@ class HealthCheckParam(TypedDict, total=False): + """An object specifying health check settings for the load balancer.""" + check_interval_seconds: int """The number of seconds between between two consecutive health checks.""" diff --git a/src/gradient/types/gpu_droplets/lb_firewall.py b/src/gradient/types/gpu_droplets/lb_firewall.py index aea1887c..d233c642 100644 --- a/src/gradient/types/gpu_droplets/lb_firewall.py +++ b/src/gradient/types/gpu_droplets/lb_firewall.py @@ -8,6 +8,10 @@ class LbFirewall(BaseModel): + """ + An object specifying allow and deny rules to control traffic to the load balancer. + """ + allow: Optional[List[str]] = None """ the rules for allowing traffic to the load balancer (in the form 'ip:1.2.3.4' or diff --git a/src/gradient/types/gpu_droplets/lb_firewall_param.py b/src/gradient/types/gpu_droplets/lb_firewall_param.py index 7d54a048..b15cb32c 100644 --- a/src/gradient/types/gpu_droplets/lb_firewall_param.py +++ b/src/gradient/types/gpu_droplets/lb_firewall_param.py @@ -10,6 +10,10 @@ class LbFirewallParam(TypedDict, total=False): + """ + An object specifying allow and deny rules to control traffic to the load balancer. + """ + allow: SequenceNotStr[str] """ the rules for allowing traffic to the load balancer (in the form 'ip:1.2.3.4' or diff --git a/src/gradient/types/gpu_droplets/sticky_sessions.py b/src/gradient/types/gpu_droplets/sticky_sessions.py index 78debc07..1723241a 100644 --- a/src/gradient/types/gpu_droplets/sticky_sessions.py +++ b/src/gradient/types/gpu_droplets/sticky_sessions.py @@ -9,6 +9,8 @@ class StickySessions(BaseModel): + """An object specifying sticky sessions settings for the load balancer.""" + cookie_name: Optional[str] = None """The name of the cookie sent to the client. diff --git a/src/gradient/types/gpu_droplets/sticky_sessions_param.py b/src/gradient/types/gpu_droplets/sticky_sessions_param.py index acea4a4a..425873dc 100644 --- a/src/gradient/types/gpu_droplets/sticky_sessions_param.py +++ b/src/gradient/types/gpu_droplets/sticky_sessions_param.py @@ -8,6 +8,8 @@ class StickySessionsParam(TypedDict, total=False): + """An object specifying sticky sessions settings for the load balancer.""" + cookie_name: str """The name of the cookie sent to the client. diff --git a/src/gradient/types/image_generate_response.py b/src/gradient/types/image_generate_response.py index 5f97697c..324e6038 100644 --- a/src/gradient/types/image_generate_response.py +++ b/src/gradient/types/image_generate_response.py @@ -8,6 +8,8 @@ class Data(BaseModel): + """Represents the content of a generated image from GPT-IMAGE-1""" + b64_json: str """The base64-encoded JSON of the generated image. @@ -22,11 +24,15 @@ class Data(BaseModel): class UsageInputTokensDetails(BaseModel): + """Detailed breakdown of input tokens""" + text_tokens: Optional[int] = None """Number of text tokens in the input""" class Usage(BaseModel): + """Usage statistics for the image generation request""" + input_tokens: int """Number of tokens in the input prompt""" @@ -41,6 +47,8 @@ class Usage(BaseModel): class ImageGenerateResponse(BaseModel): + """The response from the image generation endpoint""" + created: int """The Unix timestamp (in seconds) of when the images were created""" diff --git a/src/gradient/types/inference/api_model_api_key_info.py b/src/gradient/types/inference/api_model_api_key_info.py index 3da1c70a..28f96839 100644 --- a/src/gradient/types/inference/api_model_api_key_info.py +++ b/src/gradient/types/inference/api_model_api_key_info.py @@ -9,6 +9,8 @@ class APIModelAPIKeyInfo(BaseModel): + """Model API Key Info""" + created_at: Optional[datetime] = None """Creation date""" diff --git a/src/gradient/types/knowledge_base_create_params.py b/src/gradient/types/knowledge_base_create_params.py index 4dc42098..24cfd98b 100644 --- a/src/gradient/types/knowledge_base_create_params.py +++ b/src/gradient/types/knowledge_base_create_params.py @@ -53,6 +53,8 @@ class KnowledgeBaseCreateParams(TypedDict, total=False): class DatasourceDropboxDataSource(TypedDict, total=False): + """Dropbox Data Source""" + folder: str refresh_token: str @@ -64,6 +66,8 @@ class DatasourceDropboxDataSource(TypedDict, total=False): class DatasourceGoogleDriveDataSource(TypedDict, total=False): + """Google Drive Data Source""" + folder_id: str refresh_token: str diff --git a/src/gradient/types/knowledge_base_create_response.py b/src/gradient/types/knowledge_base_create_response.py index 6d846fa5..72f0b58c 100644 --- a/src/gradient/types/knowledge_base_create_response.py +++ b/src/gradient/types/knowledge_base_create_response.py @@ -9,5 +9,7 @@ class KnowledgeBaseCreateResponse(BaseModel): + """Information about a newly created knowledge base""" + knowledge_base: Optional[APIKnowledgeBase] = None """Knowledgebase Description""" diff --git a/src/gradient/types/knowledge_base_delete_response.py b/src/gradient/types/knowledge_base_delete_response.py index b0605a20..cdf154ba 100644 --- a/src/gradient/types/knowledge_base_delete_response.py +++ b/src/gradient/types/knowledge_base_delete_response.py @@ -8,5 +8,7 @@ class KnowledgeBaseDeleteResponse(BaseModel): + """Information about a deleted knowledge base""" + uuid: Optional[str] = None """The id of the deleted knowledge base""" diff --git a/src/gradient/types/knowledge_base_list_indexing_jobs_response.py b/src/gradient/types/knowledge_base_list_indexing_jobs_response.py index d88f83fc..f5376c61 100644 --- a/src/gradient/types/knowledge_base_list_indexing_jobs_response.py +++ b/src/gradient/types/knowledge_base_list_indexing_jobs_response.py @@ -11,6 +11,8 @@ class KnowledgeBaseListIndexingJobsResponse(BaseModel): + """Indexing jobs""" + jobs: Optional[List[APIIndexingJob]] = None """The indexing jobs""" diff --git a/src/gradient/types/knowledge_base_list_response.py b/src/gradient/types/knowledge_base_list_response.py index 08227316..3231f643 100644 --- a/src/gradient/types/knowledge_base_list_response.py +++ b/src/gradient/types/knowledge_base_list_response.py @@ -11,6 +11,8 @@ class KnowledgeBaseListResponse(BaseModel): + """List of knowledge bases""" + knowledge_bases: Optional[List[APIKnowledgeBase]] = None """The knowledge bases""" diff --git a/src/gradient/types/knowledge_base_retrieve_response.py b/src/gradient/types/knowledge_base_retrieve_response.py index 55994f70..712f858c 100644 --- a/src/gradient/types/knowledge_base_retrieve_response.py +++ b/src/gradient/types/knowledge_base_retrieve_response.py @@ -10,6 +10,8 @@ class KnowledgeBaseRetrieveResponse(BaseModel): + """The knowledge base""" + database_status: Optional[ Literal[ "CREATING", diff --git a/src/gradient/types/knowledge_base_update_response.py b/src/gradient/types/knowledge_base_update_response.py index 0840622c..0e4ff539 100644 --- a/src/gradient/types/knowledge_base_update_response.py +++ b/src/gradient/types/knowledge_base_update_response.py @@ -9,5 +9,7 @@ class KnowledgeBaseUpdateResponse(BaseModel): + """Information about an updated knowledge base""" + knowledge_base: Optional[APIKnowledgeBase] = None """Knowledgebase Description""" diff --git a/src/gradient/types/knowledge_bases/api_file_upload_data_source.py b/src/gradient/types/knowledge_bases/api_file_upload_data_source.py index a1c23e09..6aaeb0e7 100644 --- a/src/gradient/types/knowledge_bases/api_file_upload_data_source.py +++ b/src/gradient/types/knowledge_bases/api_file_upload_data_source.py @@ -8,6 +8,8 @@ class APIFileUploadDataSource(BaseModel): + """File to upload as data source for knowledge base.""" + original_file_name: Optional[str] = None """The original file name""" diff --git a/src/gradient/types/knowledge_bases/api_file_upload_data_source_param.py b/src/gradient/types/knowledge_bases/api_file_upload_data_source_param.py index 562f8a34..3cdd34ee 100644 --- a/src/gradient/types/knowledge_bases/api_file_upload_data_source_param.py +++ b/src/gradient/types/knowledge_bases/api_file_upload_data_source_param.py @@ -8,6 +8,8 @@ class APIFileUploadDataSourceParam(TypedDict, total=False): + """File to upload as data source for knowledge base.""" + original_file_name: str """The original file name""" diff --git a/src/gradient/types/knowledge_bases/api_indexing_job.py b/src/gradient/types/knowledge_bases/api_indexing_job.py index 2389fd9c..d43ddd6e 100644 --- a/src/gradient/types/knowledge_bases/api_indexing_job.py +++ b/src/gradient/types/knowledge_bases/api_indexing_job.py @@ -11,6 +11,8 @@ class APIIndexingJob(BaseModel): + """IndexingJob description""" + completed_datasources: Optional[int] = None """Number of datasources indexed completed""" diff --git a/src/gradient/types/knowledge_bases/api_knowledge_base_data_source.py b/src/gradient/types/knowledge_bases/api_knowledge_base_data_source.py index 7831bc55..b73e325e 100644 --- a/src/gradient/types/knowledge_bases/api_knowledge_base_data_source.py +++ b/src/gradient/types/knowledge_bases/api_knowledge_base_data_source.py @@ -13,6 +13,8 @@ class AwsDataSource(BaseModel): + """AWS S3 Data Source for Display""" + bucket_name: Optional[str] = None """Spaces bucket name""" @@ -23,10 +25,14 @@ class AwsDataSource(BaseModel): class DropboxDataSource(BaseModel): + """Dropbox Data Source for Display""" + folder: Optional[str] = None class GoogleDriveDataSource(BaseModel): + """Google Drive Data Source for Display""" + folder_id: Optional[str] = None folder_name: Optional[str] = None @@ -34,6 +40,8 @@ class GoogleDriveDataSource(BaseModel): class APIKnowledgeBaseDataSource(BaseModel): + """Data Source configuration for Knowledge Bases""" + aws_data_source: Optional[AwsDataSource] = None """AWS S3 Data Source for Display""" diff --git a/src/gradient/types/knowledge_bases/api_spaces_data_source.py b/src/gradient/types/knowledge_bases/api_spaces_data_source.py index 02aa479a..2ac76d69 100644 --- a/src/gradient/types/knowledge_bases/api_spaces_data_source.py +++ b/src/gradient/types/knowledge_bases/api_spaces_data_source.py @@ -8,6 +8,8 @@ class APISpacesDataSource(BaseModel): + """Spaces Bucket Data Source""" + bucket_name: Optional[str] = None """Spaces bucket name""" diff --git a/src/gradient/types/knowledge_bases/api_spaces_data_source_param.py b/src/gradient/types/knowledge_bases/api_spaces_data_source_param.py index 5eaeb0ad..9c3daf03 100644 --- a/src/gradient/types/knowledge_bases/api_spaces_data_source_param.py +++ b/src/gradient/types/knowledge_bases/api_spaces_data_source_param.py @@ -8,6 +8,8 @@ class APISpacesDataSourceParam(TypedDict, total=False): + """Spaces Bucket Data Source""" + bucket_name: str """Spaces bucket name""" diff --git a/src/gradient/types/knowledge_bases/api_web_crawler_data_source.py b/src/gradient/types/knowledge_bases/api_web_crawler_data_source.py index c7060fa6..ba1ee81f 100644 --- a/src/gradient/types/knowledge_bases/api_web_crawler_data_source.py +++ b/src/gradient/types/knowledge_bases/api_web_crawler_data_source.py @@ -9,6 +9,8 @@ class APIWebCrawlerDataSource(BaseModel): + """WebCrawlerDataSource""" + base_url: Optional[str] = None """The base url to crawl.""" diff --git a/src/gradient/types/knowledge_bases/api_web_crawler_data_source_param.py b/src/gradient/types/knowledge_bases/api_web_crawler_data_source_param.py index 386be8ed..ff4f3307 100644 --- a/src/gradient/types/knowledge_bases/api_web_crawler_data_source_param.py +++ b/src/gradient/types/knowledge_bases/api_web_crawler_data_source_param.py @@ -10,6 +10,8 @@ class APIWebCrawlerDataSourceParam(TypedDict, total=False): + """WebCrawlerDataSource""" + base_url: str """The base url to crawl.""" diff --git a/src/gradient/types/knowledge_bases/aws_data_source_param.py b/src/gradient/types/knowledge_bases/aws_data_source_param.py index 912e3e29..fa99a8c1 100644 --- a/src/gradient/types/knowledge_bases/aws_data_source_param.py +++ b/src/gradient/types/knowledge_bases/aws_data_source_param.py @@ -8,6 +8,8 @@ class AwsDataSourceParam(TypedDict, total=False): + """AWS S3 Data Source""" + bucket_name: str """Spaces bucket name""" diff --git a/src/gradient/types/knowledge_bases/data_source_create_presigned_urls_params.py b/src/gradient/types/knowledge_bases/data_source_create_presigned_urls_params.py index 253cbce7..1d27f0ca 100644 --- a/src/gradient/types/knowledge_bases/data_source_create_presigned_urls_params.py +++ b/src/gradient/types/knowledge_bases/data_source_create_presigned_urls_params.py @@ -14,6 +14,8 @@ class DataSourceCreatePresignedURLsParams(TypedDict, total=False): class File(TypedDict, total=False): + """A single file’s metadata in the request.""" + file_name: str """Local filename""" diff --git a/src/gradient/types/knowledge_bases/data_source_create_presigned_urls_response.py b/src/gradient/types/knowledge_bases/data_source_create_presigned_urls_response.py index c3d172d7..daca9865 100644 --- a/src/gradient/types/knowledge_bases/data_source_create_presigned_urls_response.py +++ b/src/gradient/types/knowledge_bases/data_source_create_presigned_urls_response.py @@ -9,6 +9,8 @@ class Upload(BaseModel): + """Detailed info about each presigned URL returned to the client.""" + expires_at: Optional[datetime] = None """The time the url expires at.""" @@ -23,6 +25,8 @@ class Upload(BaseModel): class DataSourceCreatePresignedURLsResponse(BaseModel): + """Response with pre-signed urls to upload files.""" + request_id: Optional[str] = None """The ID generated for the request for Presigned URLs.""" diff --git a/src/gradient/types/knowledge_bases/data_source_create_response.py b/src/gradient/types/knowledge_bases/data_source_create_response.py index 76ec88e2..da49d870 100644 --- a/src/gradient/types/knowledge_bases/data_source_create_response.py +++ b/src/gradient/types/knowledge_bases/data_source_create_response.py @@ -9,5 +9,7 @@ class DataSourceCreateResponse(BaseModel): + """Information about a newly created knowldege base data source""" + knowledge_base_data_source: Optional[APIKnowledgeBaseDataSource] = None """Data Source configuration for Knowledge Bases""" diff --git a/src/gradient/types/knowledge_bases/data_source_delete_response.py b/src/gradient/types/knowledge_bases/data_source_delete_response.py index eaad72ff..fc3e59da 100644 --- a/src/gradient/types/knowledge_bases/data_source_delete_response.py +++ b/src/gradient/types/knowledge_bases/data_source_delete_response.py @@ -8,6 +8,8 @@ class DataSourceDeleteResponse(BaseModel): + """Information about a newly deleted knowledge base data source""" + data_source_uuid: Optional[str] = None """Data source id""" diff --git a/src/gradient/types/knowledge_bases/data_source_list_response.py b/src/gradient/types/knowledge_bases/data_source_list_response.py index f05a49bc..5de5d372 100644 --- a/src/gradient/types/knowledge_bases/data_source_list_response.py +++ b/src/gradient/types/knowledge_bases/data_source_list_response.py @@ -11,6 +11,8 @@ class DataSourceListResponse(BaseModel): + """A list of knowledge base data sources""" + knowledge_base_data_sources: Optional[List[APIKnowledgeBaseDataSource]] = None """The data sources""" diff --git a/src/gradient/types/knowledge_bases/indexing_job_create_response.py b/src/gradient/types/knowledge_bases/indexing_job_create_response.py index 685f40ef..df7e6911 100644 --- a/src/gradient/types/knowledge_bases/indexing_job_create_response.py +++ b/src/gradient/types/knowledge_bases/indexing_job_create_response.py @@ -9,5 +9,7 @@ class IndexingJobCreateResponse(BaseModel): + """StartKnowledgeBaseIndexingJobOutput description""" + job: Optional[APIIndexingJob] = None """IndexingJob description""" diff --git a/src/gradient/types/knowledge_bases/indexing_job_list_response.py b/src/gradient/types/knowledge_bases/indexing_job_list_response.py index 371f51bb..374533df 100644 --- a/src/gradient/types/knowledge_bases/indexing_job_list_response.py +++ b/src/gradient/types/knowledge_bases/indexing_job_list_response.py @@ -11,6 +11,8 @@ class IndexingJobListResponse(BaseModel): + """Indexing jobs""" + jobs: Optional[List[APIIndexingJob]] = None """The indexing jobs""" diff --git a/src/gradient/types/knowledge_bases/indexing_job_retrieve_response.py b/src/gradient/types/knowledge_bases/indexing_job_retrieve_response.py index 2d6be855..ea24de65 100644 --- a/src/gradient/types/knowledge_bases/indexing_job_retrieve_response.py +++ b/src/gradient/types/knowledge_bases/indexing_job_retrieve_response.py @@ -9,5 +9,7 @@ class IndexingJobRetrieveResponse(BaseModel): + """GetKnowledgeBaseIndexingJobOutput description""" + job: Optional[APIIndexingJob] = None """IndexingJob description""" diff --git a/src/gradient/types/knowledge_bases/indexing_job_update_cancel_response.py b/src/gradient/types/knowledge_bases/indexing_job_update_cancel_response.py index 9fd41764..2622779b 100644 --- a/src/gradient/types/knowledge_bases/indexing_job_update_cancel_response.py +++ b/src/gradient/types/knowledge_bases/indexing_job_update_cancel_response.py @@ -9,5 +9,7 @@ class IndexingJobUpdateCancelResponse(BaseModel): + """CancelKnowledgeBaseIndexingJobOutput description""" + job: Optional[APIIndexingJob] = None """IndexingJob description""" diff --git a/src/gradient/types/model_list_response.py b/src/gradient/types/model_list_response.py index 12d95437..48e17809 100644 --- a/src/gradient/types/model_list_response.py +++ b/src/gradient/types/model_list_response.py @@ -11,6 +11,8 @@ class ModelListResponse(BaseModel): + """A list of models""" + links: Optional[APILinks] = None """Links to other pages""" diff --git a/src/gradient/types/models/providers/anthropic_create_response.py b/src/gradient/types/models/providers/anthropic_create_response.py index 0fbe50bc..0609a486 100644 --- a/src/gradient/types/models/providers/anthropic_create_response.py +++ b/src/gradient/types/models/providers/anthropic_create_response.py @@ -9,5 +9,9 @@ class AnthropicCreateResponse(BaseModel): + """ + CreateAnthropicAPIKeyOutput is used to return the newly created Anthropic API key. + """ + api_key_info: Optional[APIAnthropicAPIKeyInfo] = None """Anthropic API Key Info""" diff --git a/src/gradient/types/models/providers/anthropic_delete_response.py b/src/gradient/types/models/providers/anthropic_delete_response.py index b4fdd978..3ad6a9c6 100644 --- a/src/gradient/types/models/providers/anthropic_delete_response.py +++ b/src/gradient/types/models/providers/anthropic_delete_response.py @@ -9,5 +9,7 @@ class AnthropicDeleteResponse(BaseModel): + """DeleteAnthropicAPIKeyOutput is used to return the deleted Anthropic API key.""" + api_key_info: Optional[APIAnthropicAPIKeyInfo] = None """Anthropic API Key Info""" diff --git a/src/gradient/types/models/providers/anthropic_list_agents_response.py b/src/gradient/types/models/providers/anthropic_list_agents_response.py index a1525275..8e2186cb 100644 --- a/src/gradient/types/models/providers/anthropic_list_agents_response.py +++ b/src/gradient/types/models/providers/anthropic_list_agents_response.py @@ -12,6 +12,8 @@ class AnthropicListAgentsResponse(BaseModel): + """List of Agents that linked to a specific Anthropic Key""" + agents: Optional[List["APIAgent"]] = None links: Optional[APILinks] = None diff --git a/src/gradient/types/models/providers/anthropic_list_response.py b/src/gradient/types/models/providers/anthropic_list_response.py index 24d6547a..458bd311 100644 --- a/src/gradient/types/models/providers/anthropic_list_response.py +++ b/src/gradient/types/models/providers/anthropic_list_response.py @@ -11,6 +11,10 @@ class AnthropicListResponse(BaseModel): + """ + ListAnthropicAPIKeysOutput is used to return the list of Anthropic API keys for a specific agent. + """ + api_key_infos: Optional[List[APIAnthropicAPIKeyInfo]] = None """Api key infos""" diff --git a/src/gradient/types/models/providers/anthropic_update_response.py b/src/gradient/types/models/providers/anthropic_update_response.py index 3a6daaea..3e24273c 100644 --- a/src/gradient/types/models/providers/anthropic_update_response.py +++ b/src/gradient/types/models/providers/anthropic_update_response.py @@ -9,5 +9,7 @@ class AnthropicUpdateResponse(BaseModel): + """UpdateAnthropicAPIKeyOutput is used to return the updated Anthropic API key.""" + api_key_info: Optional[APIAnthropicAPIKeyInfo] = None """Anthropic API Key Info""" diff --git a/src/gradient/types/models/providers/openai_create_response.py b/src/gradient/types/models/providers/openai_create_response.py index b2e94766..16aff373 100644 --- a/src/gradient/types/models/providers/openai_create_response.py +++ b/src/gradient/types/models/providers/openai_create_response.py @@ -9,5 +9,7 @@ class OpenAICreateResponse(BaseModel): + """CreateOpenAIAPIKeyOutput is used to return the newly created OpenAI API key.""" + api_key_info: Optional[APIOpenAIAPIKeyInfo] = None """OpenAI API Key Info""" diff --git a/src/gradient/types/models/providers/openai_delete_response.py b/src/gradient/types/models/providers/openai_delete_response.py index e59c89fe..d73a681e 100644 --- a/src/gradient/types/models/providers/openai_delete_response.py +++ b/src/gradient/types/models/providers/openai_delete_response.py @@ -9,5 +9,7 @@ class OpenAIDeleteResponse(BaseModel): + """DeleteOpenAIAPIKeyOutput is used to return the deleted OpenAI API key.""" + api_key_info: Optional[APIOpenAIAPIKeyInfo] = None """OpenAI API Key Info""" diff --git a/src/gradient/types/models/providers/openai_list_response.py b/src/gradient/types/models/providers/openai_list_response.py index 698cd11e..825ac890 100644 --- a/src/gradient/types/models/providers/openai_list_response.py +++ b/src/gradient/types/models/providers/openai_list_response.py @@ -11,6 +11,10 @@ class OpenAIListResponse(BaseModel): + """ + ListOpenAIAPIKeysOutput is used to return the list of OpenAI API keys for a specific agent. + """ + api_key_infos: Optional[List[APIOpenAIAPIKeyInfo]] = None """Api key infos""" diff --git a/src/gradient/types/models/providers/openai_retrieve_agents_response.py b/src/gradient/types/models/providers/openai_retrieve_agents_response.py index 717a56cd..f2266f8f 100644 --- a/src/gradient/types/models/providers/openai_retrieve_agents_response.py +++ b/src/gradient/types/models/providers/openai_retrieve_agents_response.py @@ -12,6 +12,8 @@ class OpenAIRetrieveAgentsResponse(BaseModel): + """List of Agents that are linked to a specific OpenAI Key""" + agents: Optional[List["APIAgent"]] = None links: Optional[APILinks] = None diff --git a/src/gradient/types/models/providers/openai_update_response.py b/src/gradient/types/models/providers/openai_update_response.py index ec7a1c94..b94a8efe 100644 --- a/src/gradient/types/models/providers/openai_update_response.py +++ b/src/gradient/types/models/providers/openai_update_response.py @@ -9,5 +9,7 @@ class OpenAIUpdateResponse(BaseModel): + """UpdateOpenAIAPIKeyOutput is used to return the updated OpenAI API key.""" + api_key_info: Optional[APIOpenAIAPIKeyInfo] = None """OpenAI API Key Info""" diff --git a/src/gradient/types/nf_initiate_action_response.py b/src/gradient/types/nf_initiate_action_response.py index 9f38a4b2..58618450 100644 --- a/src/gradient/types/nf_initiate_action_response.py +++ b/src/gradient/types/nf_initiate_action_response.py @@ -9,6 +9,8 @@ class Action(BaseModel): + """The action that was submitted.""" + region_slug: str """The DigitalOcean region slug where the resource is located.""" @@ -29,5 +31,7 @@ class Action(BaseModel): class NfInitiateActionResponse(BaseModel): + """Action response of an NFS share.""" + action: Action """The action that was submitted.""" diff --git a/src/gradient/types/nfs/snapshot_list_response.py b/src/gradient/types/nfs/snapshot_list_response.py index 8a6864dc..a46342ce 100644 --- a/src/gradient/types/nfs/snapshot_list_response.py +++ b/src/gradient/types/nfs/snapshot_list_response.py @@ -10,6 +10,8 @@ class Snapshot(BaseModel): + """Represents an NFS snapshot.""" + id: str """The unique identifier of the snapshot.""" diff --git a/src/gradient/types/nfs/snapshot_retrieve_response.py b/src/gradient/types/nfs/snapshot_retrieve_response.py index 2d54d523..12a69d0a 100644 --- a/src/gradient/types/nfs/snapshot_retrieve_response.py +++ b/src/gradient/types/nfs/snapshot_retrieve_response.py @@ -10,6 +10,8 @@ class Snapshot(BaseModel): + """Represents an NFS snapshot.""" + id: str """The unique identifier of the snapshot.""" diff --git a/src/gradient/types/shared/action_link.py b/src/gradient/types/shared/action_link.py index 78aec9ff..143c66e3 100644 --- a/src/gradient/types/shared/action_link.py +++ b/src/gradient/types/shared/action_link.py @@ -8,6 +8,8 @@ class ActionLink(BaseModel): + """The linked actions can be used to check the status of a Droplet's create event.""" + id: Optional[int] = None """A unique numeric ID that can be used to identify and reference an action.""" diff --git a/src/gradient/types/shared/api_links.py b/src/gradient/types/shared/api_links.py index 24b19cfe..ce9be06b 100644 --- a/src/gradient/types/shared/api_links.py +++ b/src/gradient/types/shared/api_links.py @@ -8,6 +8,8 @@ class Pages(BaseModel): + """Information about how to reach other pages""" + first: Optional[str] = None """First page""" @@ -22,5 +24,7 @@ class Pages(BaseModel): class APILinks(BaseModel): + """Links to other pages""" + pages: Optional[Pages] = None """Information about how to reach other pages""" diff --git a/src/gradient/types/shared/api_meta.py b/src/gradient/types/shared/api_meta.py index dc267527..1a8cdede 100644 --- a/src/gradient/types/shared/api_meta.py +++ b/src/gradient/types/shared/api_meta.py @@ -8,6 +8,8 @@ class APIMeta(BaseModel): + """Meta information about the data set""" + page: Optional[int] = None """The current page""" diff --git a/src/gradient/types/shared/chat_completion_chunk.py b/src/gradient/types/shared/chat_completion_chunk.py index ff705bf4..53d5a563 100644 --- a/src/gradient/types/shared/chat_completion_chunk.py +++ b/src/gradient/types/shared/chat_completion_chunk.py @@ -18,6 +18,8 @@ class ChoiceDeltaToolCallFunction(BaseModel): + """A chunk of a function that the model called.""" + arguments: Optional[str] = None """ The arguments to call the function with, as generated by the model in JSON @@ -44,6 +46,8 @@ class ChoiceDeltaToolCall(BaseModel): class ChoiceDelta(BaseModel): + """A chat completion delta generated by streamed model responses.""" + content: Optional[str] = None """The contents of the chunk message.""" @@ -60,6 +64,8 @@ class ChoiceDelta(BaseModel): class ChoiceLogprobs(BaseModel): + """Log probability information for the choice.""" + content: Optional[List[ChatCompletionTokenLogprob]] = None """A list of message content tokens with log probability information.""" @@ -87,6 +93,11 @@ class Choice(BaseModel): class ChatCompletionChunk(BaseModel): + """ + Represents a streamed chunk of a chat completion response returned + by the model, based on the provided input. + """ + id: str """A unique identifier for the chat completion. Each chunk has the same ID.""" diff --git a/src/gradient/types/shared/completion_usage.py b/src/gradient/types/shared/completion_usage.py index a2012eef..79ce64ee 100644 --- a/src/gradient/types/shared/completion_usage.py +++ b/src/gradient/types/shared/completion_usage.py @@ -6,6 +6,8 @@ class CompletionUsage(BaseModel): + """Usage statistics for the completion request.""" + completion_tokens: int """Number of tokens in the generated completion.""" diff --git a/src/gradient/types/shared/droplet.py b/src/gradient/types/shared/droplet.py index 9d2bb17c..4ae5bae4 100644 --- a/src/gradient/types/shared/droplet.py +++ b/src/gradient/types/shared/droplet.py @@ -19,6 +19,11 @@ class Networks(BaseModel): + """The details of the network that are configured for the Droplet instance. + + This is an object that contains keys for IPv4 and IPv6. The value of each of these is an array that contains objects describing an individual IP resource allocated to the Droplet. These will define attributes like the IP address, netmask, and gateway of the specific network depending on the type of network it is. + """ + v4: Optional[List[NetworkV4]] = None v6: Optional[List[NetworkV6]] = None diff --git a/src/gradient/types/shared/gpu_info.py b/src/gradient/types/shared/gpu_info.py index a285dd23..7f9d7329 100644 --- a/src/gradient/types/shared/gpu_info.py +++ b/src/gradient/types/shared/gpu_info.py @@ -16,6 +16,10 @@ class Vram(BaseModel): class GPUInfo(BaseModel): + """ + An object containing information about the GPU capabilities of Droplets created with this size. + """ + count: Optional[int] = None """The number of GPUs allocated to the Droplet.""" diff --git a/src/gradient/types/shared/image_gen_completed_event.py b/src/gradient/types/shared/image_gen_completed_event.py index cbb282e5..de44188f 100644 --- a/src/gradient/types/shared/image_gen_completed_event.py +++ b/src/gradient/types/shared/image_gen_completed_event.py @@ -8,6 +8,8 @@ class UsageInputTokensDetails(BaseModel): + """The input tokens detailed information for the image generation.""" + image_tokens: int """The number of image tokens in the input prompt.""" @@ -16,6 +18,8 @@ class UsageInputTokensDetails(BaseModel): class Usage(BaseModel): + """For `gpt-image-1` only, the token usage information for the image generation.""" + input_tokens: int """The number of tokens (images and text) in the input prompt.""" @@ -30,6 +34,8 @@ class Usage(BaseModel): class ImageGenCompletedEvent(BaseModel): + """Emitted when image generation has completed and the final image is available.""" + b64_json: str """Base64-encoded image data, suitable for rendering as an image.""" diff --git a/src/gradient/types/shared/image_gen_partial_image_event.py b/src/gradient/types/shared/image_gen_partial_image_event.py index 4cc704b2..e2740e08 100644 --- a/src/gradient/types/shared/image_gen_partial_image_event.py +++ b/src/gradient/types/shared/image_gen_partial_image_event.py @@ -8,6 +8,8 @@ class ImageGenPartialImageEvent(BaseModel): + """Emitted when a partial image is available during image generation streaming.""" + b64_json: str """Base64-encoded partial image data, suitable for rendering as an image.""" diff --git a/src/gradient/types/shared/kernel.py b/src/gradient/types/shared/kernel.py index 78a63427..79091d33 100644 --- a/src/gradient/types/shared/kernel.py +++ b/src/gradient/types/shared/kernel.py @@ -8,6 +8,15 @@ class Kernel(BaseModel): + """ + **Note**: All Droplets created after March 2017 use internal kernels by default. + These Droplets will have this attribute set to `null`. + + The current [kernel](https://docs.digitalocean.com/products/droplets/how-to/kernel/) + for Droplets with externally managed kernels. This will initially be set to + the kernel of the base image when the Droplet is created. + """ + id: Optional[int] = None """A unique number used to identify and reference a specific kernel.""" diff --git a/src/gradient/types/shared/meta_properties.py b/src/gradient/types/shared/meta_properties.py index a78a64d6..b7d703df 100644 --- a/src/gradient/types/shared/meta_properties.py +++ b/src/gradient/types/shared/meta_properties.py @@ -8,5 +8,7 @@ class MetaProperties(BaseModel): + """Information about the response itself.""" + total: Optional[int] = None """Number of objects returned by the request.""" From f2eb44d17997854e9fc1971a538a8a1e1b339005 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 19:18:28 +0000 Subject: [PATCH 53/96] chore(internal): add missing files argument to base client --- src/gradient/_base_client.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gradient/_base_client.py b/src/gradient/_base_client.py index c6d52884..9438b155 100644 --- a/src/gradient/_base_client.py +++ b/src/gradient/_base_client.py @@ -1267,9 +1267,12 @@ def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + opts = FinalRequestOptions.construct( + method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + ) return self.request(cast_to, opts) def put( @@ -1805,9 +1808,12 @@ async def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + opts = FinalRequestOptions.construct( + method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + ) return await self.request(cast_to, opts) async def put( From abe4c4ec72a66662812ce66b564f4387992e372a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 15:48:05 +0000 Subject: [PATCH 54/96] fix: use async_to_httpx_files in patch method --- src/gradient/_base_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gradient/_base_client.py b/src/gradient/_base_client.py index 9438b155..f038b215 100644 --- a/src/gradient/_base_client.py +++ b/src/gradient/_base_client.py @@ -1812,7 +1812,7 @@ async def patch( options: RequestOptions = {}, ) -> ResponseT: opts = FinalRequestOptions.construct( - method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + method="patch", url=path, json_data=body, files=await async_to_httpx_files(files), **options ) return await self.request(cast_to, opts) From 861e7f2f21761df9d7939bb17e37c4ccc64220cc Mon Sep 17 00:00:00 2001 From: Chandru Date: Wed, 17 Dec 2025 22:02:46 +0530 Subject: [PATCH 55/96] link fix --- examples/knowledge_base_indexing_wait.py | 2 -- src/gradient/resources/knowledge_bases/indexing_jobs.py | 8 ++------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/examples/knowledge_base_indexing_wait.py b/examples/knowledge_base_indexing_wait.py index 1171fea3..94550ee2 100644 --- a/examples/knowledge_base_indexing_wait.py +++ b/examples/knowledge_base_indexing_wait.py @@ -43,8 +43,6 @@ def main() -> None: print("\n✅ Indexing job completed successfully!") if completed_job.job: print(f"Phase: {completed_job.job.phase}") - print(f"Total items indexed: {completed_job.job.total_items_indexed}") - print(f"Total items failed: {completed_job.job.total_items_failed}") print(f"Total datasources: {completed_job.job.total_datasources}") print(f"Completed datasources: {completed_job.job.completed_datasources}") diff --git a/src/gradient/resources/knowledge_bases/indexing_jobs.py b/src/gradient/resources/knowledge_bases/indexing_jobs.py index 7936c73c..2759c3fa 100644 --- a/src/gradient/resources/knowledge_bases/indexing_jobs.py +++ b/src/gradient/resources/knowledge_bases/indexing_jobs.py @@ -367,9 +367,7 @@ def wait_for_completion( # Failure states if phase == "BATCH_JOB_PHASE_FAILED": raise IndexingJobError( - f"Indexing job {uuid} failed. " - f"Total items indexed: {response.job.total_items_indexed}, " - f"Total items failed: {response.job.total_items_failed}", + f"Indexing job {uuid} failed. ", uuid=uuid, phase=phase, ) @@ -737,9 +735,7 @@ async def wait_for_completion( # Failure states if phase == "BATCH_JOB_PHASE_FAILED": raise IndexingJobError( - f"Indexing job {uuid} failed. " - f"Total items indexed: {response.job.total_items_indexed}, " - f"Total items failed: {response.job.total_items_failed}", + f"Indexing job {uuid} failed. ", uuid=uuid, phase=phase, ) From 7f07a77bdaaeb8677812724acc397c80e99963e1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 16:47:52 +0000 Subject: [PATCH 56/96] release: 3.9.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 27 +++++++++++++++++++++++++++ pyproject.toml | 2 +- src/gradient/_version.py | 2 +- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 078b9e28..9127b1bd 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.8.0" + ".": "3.9.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index bf60097a..fc39fcc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,32 @@ # Changelog +## 3.9.0 (2025-12-17) + +Full Changelog: [v3.8.0...v3.9.0](https://github.com/digitalocean/gradient-python/compare/v3.8.0...v3.9.0) + +### Features + +* **api:** update via SDK Studio ([4173864](https://github.com/digitalocean/gradient-python/commit/4173864db71088fb5a2e3fc8033462580bb66603)) +* **api:** update via SDK Studio ([f6b12b8](https://github.com/digitalocean/gradient-python/commit/f6b12b8a67014dd608d8260c056d1c75342edda6)) +* **api:** update via SDK Studio ([a9cd7d3](https://github.com/digitalocean/gradient-python/commit/a9cd7d3bc6e2e988901e31064a4e607059c7ac09)) + + +### Bug Fixes + +* ensure streams are always closed ([80881b5](https://github.com/digitalocean/gradient-python/commit/80881b5248ac8baa2b34043df1d20086f319d2d1)) +* **types:** allow pyright to infer TypedDict types within SequenceNotStr ([b400d38](https://github.com/digitalocean/gradient-python/commit/b400d3808dc93924d7d44b25714bb53ef220bfe8)) +* use async_to_httpx_files in patch method ([33d2306](https://github.com/digitalocean/gradient-python/commit/33d2306ee7211b7180ab156697159b9aa02d564e)) + + +### Chores + +* add missing docstrings ([9ac1364](https://github.com/digitalocean/gradient-python/commit/9ac136400dbd411b3d2177d20b255b0572861c48)) +* add Python 3.14 classifier and testing ([db08b3f](https://github.com/digitalocean/gradient-python/commit/db08b3fb9a7d07ff02a8d45804647ce7c1e34e5a)) +* **deps:** mypy 1.18.1 has a regression, pin to 1.17 ([4710dcd](https://github.com/digitalocean/gradient-python/commit/4710dcdcc4600546a048e2769abeee056d9383f6)) +* **docs:** use environment variables for authentication in code snippets ([47b051a](https://github.com/digitalocean/gradient-python/commit/47b051af6578df97f84464ae40f04f957a00160a)) +* **internal:** add missing files argument to base client ([8ffa56c](https://github.com/digitalocean/gradient-python/commit/8ffa56c38b3816d5598d83976030e1a8706ec45e)) +* update lockfile ([516734f](https://github.com/digitalocean/gradient-python/commit/516734f2d19eb314061fb27c049a878b8c766313)) + ## 3.8.0 (2025-11-20) Full Changelog: [v3.7.0...v3.8.0](https://github.com/digitalocean/gradient-python/compare/v3.7.0...v3.8.0) diff --git a/pyproject.toml b/pyproject.toml index 8af6bcd1..9cce1fde 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gradient" -version = "3.8.0" +version = "3.9.0" description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gradient/_version.py b/src/gradient/_version.py index defad636..abe0382c 100644 --- a/src/gradient/_version.py +++ b/src/gradient/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gradient" -__version__ = "3.8.0" # x-release-please-version +__version__ = "3.9.0" # x-release-please-version From a24c141f48c3828bccf9a681f02ee28b8a11868a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 19:38:14 +0000 Subject: [PATCH 57/96] feat(api): manual updates --- src/gradient/resources/retrieve.py | 241 ++++++++++++++++++ .../types/retrieve_documents_params.py | 79 ++++++ 2 files changed, 320 insertions(+) diff --git a/src/gradient/resources/retrieve.py b/src/gradient/resources/retrieve.py index f0768350..6ffbf45b 100644 --- a/src/gradient/resources/retrieve.py +++ b/src/gradient/resources/retrieve.py @@ -1,3 +1,4 @@ +<<<<<<< HEAD # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations @@ -247,3 +248,243 @@ def __init__(self, retrieve: AsyncRetrieveResource) -> None: self.documents = async_to_streamed_response_wrapper( retrieve.documents, ) +||||||| parent of 8b48985 (feat(api): manual updates) +======= +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..types import retrieve_documents_params +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 +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.retrieve_documents_response import RetrieveDocumentsResponse + +__all__ = ["RetrieveResource", "AsyncRetrieveResource"] + + +class RetrieveResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> RetrieveResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return RetrieveResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> RetrieveResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return RetrieveResourceWithStreamingResponse(self) + + def documents( + self, + knowledge_base_id: str, + *, + num_results: int, + query: str, + alpha: float | Omit = omit, + filters: retrieve_documents_params.Filters | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RetrieveDocumentsResponse: + """ + Retrieve relevant documents from a knowledge base using semantic search. + + This endpoint: + + 1. Authenticates the request using the provided bearer token + 2. Generates embeddings for the query using the knowledge base's configured + model + 3. Performs vector similarity search in the knowledge base + 4. Returns the most relevant document chunks + + Args: + num_results: Number of results to return + + query: The search query text + + alpha: + Weight for hybrid search (0-1): + + - 0 = pure keyword search (BM25) + - 1 = pure vector search (default) + - 0.5 = balanced hybrid search + + filters: Metadata filters to apply to the search + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not knowledge_base_id: + raise ValueError(f"Expected a non-empty value for `knowledge_base_id` but received {knowledge_base_id!r}") + return self._post( + f"/{knowledge_base_id}/retrieve" + if self._client._base_url_overridden + else f"https://kbaas.do-ai.run/v1/{knowledge_base_id}/retrieve", + body=maybe_transform( + { + "num_results": num_results, + "query": query, + "alpha": alpha, + "filters": filters, + }, + retrieve_documents_params.RetrieveDocumentsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RetrieveDocumentsResponse, + ) + + +class AsyncRetrieveResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncRetrieveResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return AsyncRetrieveResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRetrieveResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return AsyncRetrieveResourceWithStreamingResponse(self) + + async def documents( + self, + knowledge_base_id: str, + *, + num_results: int, + query: str, + alpha: float | Omit = omit, + filters: retrieve_documents_params.Filters | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RetrieveDocumentsResponse: + """ + Retrieve relevant documents from a knowledge base using semantic search. + + This endpoint: + + 1. Authenticates the request using the provided bearer token + 2. Generates embeddings for the query using the knowledge base's configured + model + 3. Performs vector similarity search in the knowledge base + 4. Returns the most relevant document chunks + + Args: + num_results: Number of results to return + + query: The search query text + + alpha: + Weight for hybrid search (0-1): + + - 0 = pure keyword search (BM25) + - 1 = pure vector search (default) + - 0.5 = balanced hybrid search + + filters: Metadata filters to apply to the search + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not knowledge_base_id: + raise ValueError(f"Expected a non-empty value for `knowledge_base_id` but received {knowledge_base_id!r}") + return await self._post( + f"/{knowledge_base_id}/retrieve" + if self._client._base_url_overridden + else f"https://kbaas.do-ai.run/v1/{knowledge_base_id}/retrieve", + body=await async_maybe_transform( + { + "num_results": num_results, + "query": query, + "alpha": alpha, + "filters": filters, + }, + retrieve_documents_params.RetrieveDocumentsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RetrieveDocumentsResponse, + ) + + +class RetrieveResourceWithRawResponse: + def __init__(self, retrieve: RetrieveResource) -> None: + self._retrieve = retrieve + + self.documents = to_raw_response_wrapper( + retrieve.documents, + ) + + +class AsyncRetrieveResourceWithRawResponse: + def __init__(self, retrieve: AsyncRetrieveResource) -> None: + self._retrieve = retrieve + + self.documents = async_to_raw_response_wrapper( + retrieve.documents, + ) + + +class RetrieveResourceWithStreamingResponse: + def __init__(self, retrieve: RetrieveResource) -> None: + self._retrieve = retrieve + + self.documents = to_streamed_response_wrapper( + retrieve.documents, + ) + + +class AsyncRetrieveResourceWithStreamingResponse: + def __init__(self, retrieve: AsyncRetrieveResource) -> None: + self._retrieve = retrieve + + self.documents = async_to_streamed_response_wrapper( + retrieve.documents, + ) +>>>>>>> 8b48985 (feat(api): manual updates) diff --git a/src/gradient/types/retrieve_documents_params.py b/src/gradient/types/retrieve_documents_params.py index 968d0211..4ebed8ff 100644 --- a/src/gradient/types/retrieve_documents_params.py +++ b/src/gradient/types/retrieve_documents_params.py @@ -1,3 +1,4 @@ +<<<<<<< HEAD # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations @@ -71,3 +72,81 @@ class Filters(TypedDict, total=False): should: Iterable[FiltersShould] """At least one condition must match (OR)""" +||||||| parent of 8b48985 (feat(api): manual updates) +======= +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Literal, Required, TypedDict + +from .._types import SequenceNotStr + +__all__ = ["RetrieveDocumentsParams", "Filters", "FiltersMust", "FiltersMustNot", "FiltersShould"] + + +class RetrieveDocumentsParams(TypedDict, total=False): + num_results: Required[int] + """Number of results to return""" + + query: Required[str] + """The search query text""" + + alpha: float + """Weight for hybrid search (0-1): + + - 0 = pure keyword search (BM25) + - 1 = pure vector search (default) + - 0.5 = balanced hybrid search + """ + + filters: Filters + """Metadata filters to apply to the search""" + + +class FiltersMust(TypedDict, total=False): + field: Required[str] + """Metadata field name""" + + operator: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "not_in", "contains"]] + """Comparison operator""" + + value: Required[Union[str, float, bool, SequenceNotStr[str]]] + """Value to compare against (type depends on field)""" + + +class FiltersMustNot(TypedDict, total=False): + field: Required[str] + """Metadata field name""" + + operator: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "not_in", "contains"]] + """Comparison operator""" + + value: Required[Union[str, float, bool, SequenceNotStr[str]]] + """Value to compare against (type depends on field)""" + + +class FiltersShould(TypedDict, total=False): + field: Required[str] + """Metadata field name""" + + operator: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "not_in", "contains"]] + """Comparison operator""" + + value: Required[Union[str, float, bool, SequenceNotStr[str]]] + """Value to compare against (type depends on field)""" + + +class Filters(TypedDict, total=False): + """Metadata filters to apply to the search""" + + must: Iterable[FiltersMust] + """All conditions must match (AND)""" + + must_not: Iterable[FiltersMustNot] + """No conditions should match (NOT)""" + + should: Iterable[FiltersShould] + """At least one condition must match (OR)""" +>>>>>>> 8b48985 (feat(api): manual updates) From 8ecba403d6b1e628cb3cbba6d4cda58c8c0c5a1b Mon Sep 17 00:00:00 2001 From: Ben Batha Date: Fri, 19 Dec 2025 14:37:00 -0500 Subject: [PATCH 58/96] fix: restore inference endpoints (#120) --- src/gradient/resources/agents/chat/completions.py | 8 ++++++-- src/gradient/resources/chat/completions.py | 8 ++++++-- src/gradient/resources/images.py | 8 ++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/gradient/resources/agents/chat/completions.py b/src/gradient/resources/agents/chat/completions.py index 67a57557..374fdc16 100644 --- a/src/gradient/resources/agents/chat/completions.py +++ b/src/gradient/resources/agents/chat/completions.py @@ -472,7 +472,9 @@ def create( headers = {"Authorization": f"Bearer {self._client.agent_access_key}", **headers} return self._post( - "/chat/completions?agent=true", + "/chat/completions?agent=true" + if self._client._base_url_overridden + else f"{self._client.agent_endpoint}/api/v1/chat/completions?agent=true", body=maybe_transform( { "messages": messages, @@ -956,7 +958,9 @@ async def create( headers = {"Authorization": f"Bearer {self._client.agent_access_key}", **headers} return await self._post( - "/chat/completions?agent=true", + "/chat/completions?agent=true" + if self._client._base_url_overridden + else f"{self._client.agent_endpoint}/api/v1/chat/completions?agent=true", body=await async_maybe_transform( { "messages": messages, diff --git a/src/gradient/resources/chat/completions.py b/src/gradient/resources/chat/completions.py index 8d0c43c5..779fffb0 100644 --- a/src/gradient/resources/chat/completions.py +++ b/src/gradient/resources/chat/completions.py @@ -473,7 +473,9 @@ def create( } return self._post( - "/chat/completions", + "/chat/completions" + if self._client._base_url_overridden + else f"{self._client.inference_endpoint}/v1/chat/completions", body=maybe_transform( { "messages": messages, @@ -961,7 +963,9 @@ async def create( } return await self._post( - "/chat/completions", + "/chat/completions" + if self._client._base_url_overridden + else f"{self._client.inference_endpoint}/v1/chat/completions", body=await async_maybe_transform( { "messages": messages, diff --git a/src/gradient/resources/images.py b/src/gradient/resources/images.py index ce7a7b48..14bbfeaa 100644 --- a/src/gradient/resources/images.py +++ b/src/gradient/resources/images.py @@ -317,7 +317,9 @@ def generate( } return self._post( - "/images/generations", + "/images/generations" + if self._client._base_url_overridden + else f"{self._client.inference_endpoint}/v1/images/generations", body=maybe_transform( { "prompt": prompt, @@ -636,7 +638,9 @@ async def generate( **headers, } return await self._post( - "/images/generations", + "/images/generations" + if self._client._base_url_overridden + else f"{self._client.inference_endpoint}/v1/images/generations", body=await async_maybe_transform( { "prompt": prompt, From 2941a60474f7f28dec6d02f88ecba293a8ab9403 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Dec 2025 20:09:45 +0000 Subject: [PATCH 59/96] feat(api): manual updates --- .stats.yml | 4 +- src/gradient/_client.py | 18 +- .../resources/agents/chat/completions.py | 8 +- src/gradient/resources/chat/completions.py | 8 +- src/gradient/resources/images.py | 8 +- .../knowledge_bases/knowledge_bases.py | 16 +- src/gradient/resources/retrieve.py | 277 ++---------------- .../types/retrieve_documents_params.py | 78 +---- tests/test_client.py | 16 +- tests/test_smoke_sdk_async.py | 27 +- 10 files changed, 48 insertions(+), 412 deletions(-) diff --git a/.stats.yml b/.stats.yml index b4763701..d321100e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 189 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-ca993fd0bc66f703323a773c92da75207266f7f9d8c54ddac2fbd271a3cdaf86.yml -openapi_spec_hash: 35d7edb04aab2ab28bc7e5851a54b4e3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-0778b2e9d56c826f92ee69ef081d8d73fd94c139b85e11becaa88bf1cbe95fb9.yml +openapi_spec_hash: 49daca0dd735cad7200ca1c741a5dd43 config_hash: fad48c8ac796b240fe3b90181586d1a4 diff --git a/src/gradient/_client.py b/src/gradient/_client.py index 47fae3cd..847121b1 100644 --- a/src/gradient/_client.py +++ b/src/gradient/_client.py @@ -142,10 +142,7 @@ def __init__( self._agent_endpoint = agent_endpoint if inference_endpoint is None: - inference_endpoint = ( - os.environ.get("GRADIENT_INFERENCE_ENDPOINT") - or "https://inference.do-ai.run" - ) + inference_endpoint = os.environ.get("GRADIENT_INFERENCE_ENDPOINT") or "https://inference.do-ai.run" self.inference_endpoint = inference_endpoint if kbass_endpoint is None: @@ -302,9 +299,7 @@ def default_headers(self) -> dict[str, str | Omit]: @override def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None: - if ( - self.access_token or self.agent_access_key or self.model_access_key - ) and headers.get("Authorization"): + if (self.access_token or self.agent_access_key or self.model_access_key) and headers.get("Authorization"): return if isinstance(custom_headers.get("Authorization"), Omit): return @@ -513,10 +508,7 @@ def __init__( self._agent_endpoint = agent_endpoint if inference_endpoint is None: - inference_endpoint = ( - os.environ.get("GRADIENT_INFERENCE_ENDPOINT") - or "https://inference.do-ai.run" - ) + inference_endpoint = os.environ.get("GRADIENT_INFERENCE_ENDPOINT") or "https://inference.do-ai.run" self.inference_endpoint = inference_endpoint if kbass_endpoint is None: @@ -673,9 +665,7 @@ def default_headers(self) -> dict[str, str | Omit]: @override def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None: - if ( - self.access_token or self.agent_access_key or self.model_access_key - ) and headers.get("Authorization"): + if (self.access_token or self.agent_access_key or self.model_access_key) and headers.get("Authorization"): return if isinstance(custom_headers.get("Authorization"), Omit): return diff --git a/src/gradient/resources/agents/chat/completions.py b/src/gradient/resources/agents/chat/completions.py index 374fdc16..67a57557 100644 --- a/src/gradient/resources/agents/chat/completions.py +++ b/src/gradient/resources/agents/chat/completions.py @@ -472,9 +472,7 @@ def create( headers = {"Authorization": f"Bearer {self._client.agent_access_key}", **headers} return self._post( - "/chat/completions?agent=true" - if self._client._base_url_overridden - else f"{self._client.agent_endpoint}/api/v1/chat/completions?agent=true", + "/chat/completions?agent=true", body=maybe_transform( { "messages": messages, @@ -958,9 +956,7 @@ async def create( headers = {"Authorization": f"Bearer {self._client.agent_access_key}", **headers} return await self._post( - "/chat/completions?agent=true" - if self._client._base_url_overridden - else f"{self._client.agent_endpoint}/api/v1/chat/completions?agent=true", + "/chat/completions?agent=true", body=await async_maybe_transform( { "messages": messages, diff --git a/src/gradient/resources/chat/completions.py b/src/gradient/resources/chat/completions.py index 779fffb0..8d0c43c5 100644 --- a/src/gradient/resources/chat/completions.py +++ b/src/gradient/resources/chat/completions.py @@ -473,9 +473,7 @@ def create( } return self._post( - "/chat/completions" - if self._client._base_url_overridden - else f"{self._client.inference_endpoint}/v1/chat/completions", + "/chat/completions", body=maybe_transform( { "messages": messages, @@ -963,9 +961,7 @@ async def create( } return await self._post( - "/chat/completions" - if self._client._base_url_overridden - else f"{self._client.inference_endpoint}/v1/chat/completions", + "/chat/completions", body=await async_maybe_transform( { "messages": messages, diff --git a/src/gradient/resources/images.py b/src/gradient/resources/images.py index 14bbfeaa..ce7a7b48 100644 --- a/src/gradient/resources/images.py +++ b/src/gradient/resources/images.py @@ -317,9 +317,7 @@ def generate( } return self._post( - "/images/generations" - if self._client._base_url_overridden - else f"{self._client.inference_endpoint}/v1/images/generations", + "/images/generations", body=maybe_transform( { "prompt": prompt, @@ -638,9 +636,7 @@ async def generate( **headers, } return await self._post( - "/images/generations" - if self._client._base_url_overridden - else f"{self._client.inference_endpoint}/v1/images/generations", + "/images/generations", body=await async_maybe_transform( { "prompt": prompt, diff --git a/src/gradient/resources/knowledge_bases/knowledge_bases.py b/src/gradient/resources/knowledge_bases/knowledge_bases.py index 2378f7f4..04c19b32 100644 --- a/src/gradient/resources/knowledge_bases/knowledge_bases.py +++ b/src/gradient/resources/knowledge_bases/knowledge_bases.py @@ -434,9 +434,7 @@ def wait_for_database( KnowledgeBaseTimeoutError: If the timeout is exceeded before the database becomes ONLINE """ if not uuid: - raise ValueError( - f"Expected a non-empty value for `uuid` but received {uuid!r}" - ) + raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") start_time = time.time() failed_states = {"DECOMMISSIONED", "UNHEALTHY"} @@ -462,9 +460,7 @@ def wait_for_database( return response if status in failed_states: - raise KnowledgeBaseDatabaseError( - f"Knowledge base database entered failed state: {status}" - ) + raise KnowledgeBaseDatabaseError(f"Knowledge base database entered failed state: {status}") # Sleep before next poll, but don't exceed timeout remaining_time = timeout - elapsed @@ -874,9 +870,7 @@ async def wait_for_database( KnowledgeBaseTimeoutError: If the timeout is exceeded before the database becomes ONLINE """ if not uuid: - raise ValueError( - f"Expected a non-empty value for `uuid` but received {uuid!r}" - ) + raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") start_time = time.time() failed_states = {"DECOMMISSIONED", "UNHEALTHY"} @@ -902,9 +896,7 @@ async def wait_for_database( return response if status in failed_states: - raise KnowledgeBaseDatabaseError( - f"Knowledge base database entered failed state: {status}" - ) + raise KnowledgeBaseDatabaseError(f"Knowledge base database entered failed state: {status}") # Sleep before next poll, but don't exceed timeout remaining_time = timeout - elapsed diff --git a/src/gradient/resources/retrieve.py b/src/gradient/resources/retrieve.py index 6ffbf45b..f8335ab3 100644 --- a/src/gradient/resources/retrieve.py +++ b/src/gradient/resources/retrieve.py @@ -1,4 +1,3 @@ -<<<<<<< HEAD # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations @@ -68,12 +67,6 @@ def documents( 3. Performs vector similarity search in the knowledge base 4. Returns the most relevant document chunks - The search supports hybrid search combining: - - - Vector similarity (semantic search) - - Keyword matching (BM25) - - Custom metadata filters - Args: num_results: Number of results to return @@ -99,254 +92,11 @@ def documents( if not knowledge_base_id: raise ValueError(f"Expected a non-empty value for `knowledge_base_id` but received {knowledge_base_id!r}") return self._post( - f"/{knowledge_base_id}/retrieve" - if self._client._base_url_overridden - else f"https://kbaas.do-ai.run/v1/{knowledge_base_id}/retrieve", - body=maybe_transform( - { - "num_results": num_results, - "query": query, - "alpha": alpha, - "filters": filters, - }, - retrieve_documents_params.RetrieveDocumentsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ( + f"/{knowledge_base_id}/retrieve" + if self._client._base_url_overridden + else f"https://kbaas.do-ai.run/v1/{knowledge_base_id}/retrieve" ), - cast_to=RetrieveDocumentsResponse, - ) - - -class AsyncRetrieveResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncRetrieveResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers - """ - return AsyncRetrieveResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncRetrieveResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response - """ - return AsyncRetrieveResourceWithStreamingResponse(self) - - async def documents( - self, - knowledge_base_id: str, - *, - num_results: int, - query: str, - alpha: float | Omit = omit, - filters: retrieve_documents_params.Filters | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> RetrieveDocumentsResponse: - """ - Retrieve relevant documents from a knowledge base using semantic search. - - This endpoint: - - 1. Authenticates the request using the provided bearer token - 2. Generates embeddings for the query using the knowledge base's configured - model - 3. Performs vector similarity search in the knowledge base - 4. Returns the most relevant document chunks - - The search supports hybrid search combining: - - - Vector similarity (semantic search) - - Keyword matching (BM25) - - Custom metadata filters - - Args: - num_results: Number of results to return - - query: The search query text - - alpha: - Weight for hybrid search (0-1): - - - 0 = pure keyword search (BM25) - - 1 = pure vector search (default) - - 0.5 = balanced hybrid search - - filters: Metadata filters to apply to the search - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not knowledge_base_id: - raise ValueError(f"Expected a non-empty value for `knowledge_base_id` but received {knowledge_base_id!r}") - return await self._post( - f"/{knowledge_base_id}/retrieve" - if self._client._base_url_overridden - else f"https://kbaas.do-ai.run/v1/{knowledge_base_id}/retrieve", - body=await async_maybe_transform( - { - "num_results": num_results, - "query": query, - "alpha": alpha, - "filters": filters, - }, - retrieve_documents_params.RetrieveDocumentsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RetrieveDocumentsResponse, - ) - - -class RetrieveResourceWithRawResponse: - def __init__(self, retrieve: RetrieveResource) -> None: - self._retrieve = retrieve - - self.documents = to_raw_response_wrapper( - retrieve.documents, - ) - - -class AsyncRetrieveResourceWithRawResponse: - def __init__(self, retrieve: AsyncRetrieveResource) -> None: - self._retrieve = retrieve - - self.documents = async_to_raw_response_wrapper( - retrieve.documents, - ) - - -class RetrieveResourceWithStreamingResponse: - def __init__(self, retrieve: RetrieveResource) -> None: - self._retrieve = retrieve - - self.documents = to_streamed_response_wrapper( - retrieve.documents, - ) - - -class AsyncRetrieveResourceWithStreamingResponse: - def __init__(self, retrieve: AsyncRetrieveResource) -> None: - self._retrieve = retrieve - - self.documents = async_to_streamed_response_wrapper( - retrieve.documents, - ) -||||||| parent of 8b48985 (feat(api): manual updates) -======= -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..types import retrieve_documents_params -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 -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._base_client import make_request_options -from ..types.retrieve_documents_response import RetrieveDocumentsResponse - -__all__ = ["RetrieveResource", "AsyncRetrieveResource"] - - -class RetrieveResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> RetrieveResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers - """ - return RetrieveResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> RetrieveResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response - """ - return RetrieveResourceWithStreamingResponse(self) - - def documents( - self, - knowledge_base_id: str, - *, - num_results: int, - query: str, - alpha: float | Omit = omit, - filters: retrieve_documents_params.Filters | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> RetrieveDocumentsResponse: - """ - Retrieve relevant documents from a knowledge base using semantic search. - - This endpoint: - - 1. Authenticates the request using the provided bearer token - 2. Generates embeddings for the query using the knowledge base's configured - model - 3. Performs vector similarity search in the knowledge base - 4. Returns the most relevant document chunks - - Args: - num_results: Number of results to return - - query: The search query text - - alpha: - Weight for hybrid search (0-1): - - - 0 = pure keyword search (BM25) - - 1 = pure vector search (default) - - 0.5 = balanced hybrid search - - filters: Metadata filters to apply to the search - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not knowledge_base_id: - raise ValueError(f"Expected a non-empty value for `knowledge_base_id` but received {knowledge_base_id!r}") - return self._post( - f"/{knowledge_base_id}/retrieve" - if self._client._base_url_overridden - else f"https://kbaas.do-ai.run/v1/{knowledge_base_id}/retrieve", body=maybe_transform( { "num_results": num_results, @@ -357,7 +107,10 @@ def documents( retrieve_documents_params.RetrieveDocumentsParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, ), cast_to=RetrieveDocumentsResponse, ) @@ -434,9 +187,11 @@ async def documents( if not knowledge_base_id: raise ValueError(f"Expected a non-empty value for `knowledge_base_id` but received {knowledge_base_id!r}") return await self._post( - f"/{knowledge_base_id}/retrieve" - if self._client._base_url_overridden - else f"https://kbaas.do-ai.run/v1/{knowledge_base_id}/retrieve", + ( + f"/{knowledge_base_id}/retrieve" + if self._client._base_url_overridden + else f"https://kbaas.do-ai.run/v1/{knowledge_base_id}/retrieve" + ), body=await async_maybe_transform( { "num_results": num_results, @@ -447,7 +202,10 @@ async def documents( retrieve_documents_params.RetrieveDocumentsParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, ), cast_to=RetrieveDocumentsResponse, ) @@ -487,4 +245,3 @@ def __init__(self, retrieve: AsyncRetrieveResource) -> None: self.documents = async_to_streamed_response_wrapper( retrieve.documents, ) ->>>>>>> 8b48985 (feat(api): manual updates) diff --git a/src/gradient/types/retrieve_documents_params.py b/src/gradient/types/retrieve_documents_params.py index 4ebed8ff..bad99ad3 100644 --- a/src/gradient/types/retrieve_documents_params.py +++ b/src/gradient/types/retrieve_documents_params.py @@ -1,79 +1,3 @@ -<<<<<<< HEAD -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Literal, Required, TypedDict - -from .._types import SequenceNotStr - -__all__ = ["RetrieveDocumentsParams", "Filters", "FiltersMust", "FiltersMustNot", "FiltersShould"] - - -class RetrieveDocumentsParams(TypedDict, total=False): - num_results: Required[int] - """Number of results to return""" - - query: Required[str] - """The search query text""" - - alpha: float - """Weight for hybrid search (0-1): - - - 0 = pure keyword search (BM25) - - 1 = pure vector search (default) - - 0.5 = balanced hybrid search - """ - - filters: Filters - """Metadata filters to apply to the search""" - - -class FiltersMust(TypedDict, total=False): - field: Required[str] - """Metadata field name""" - - operator: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "not_in", "contains"]] - """Comparison operator""" - - value: Required[Union[str, float, bool, SequenceNotStr[str]]] - """Value to compare against (type depends on field)""" - - -class FiltersMustNot(TypedDict, total=False): - field: Required[str] - """Metadata field name""" - - operator: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "not_in", "contains"]] - """Comparison operator""" - - value: Required[Union[str, float, bool, SequenceNotStr[str]]] - """Value to compare against (type depends on field)""" - - -class FiltersShould(TypedDict, total=False): - field: Required[str] - """Metadata field name""" - - operator: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte", "in", "not_in", "contains"]] - """Comparison operator""" - - value: Required[Union[str, float, bool, SequenceNotStr[str]]] - """Value to compare against (type depends on field)""" - - -class Filters(TypedDict, total=False): - must: Iterable[FiltersMust] - """All conditions must match (AND)""" - - must_not: Iterable[FiltersMustNot] - """No conditions should match (NOT)""" - - should: Iterable[FiltersShould] - """At least one condition must match (OR)""" -||||||| parent of 8b48985 (feat(api): manual updates) -======= # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations @@ -149,4 +73,4 @@ class Filters(TypedDict, total=False): should: Iterable[FiltersShould] """At least one condition must match (OR)""" ->>>>>>> 8b48985 (feat(api): manual updates) + diff --git a/tests/test_client.py b/tests/test_client.py index c2406d77..4b645c08 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -945,9 +945,7 @@ 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: + def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: client = Gradient( base_url=base_url, access_token=access_token, @@ -958,9 +956,7 @@ def test_parse_retry_after_header( 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 = client._calculate_retry_timeout(remaining_retries, options, headers) assert calculated == pytest.approx(timeout, rel=0.5 * 0.875) # type: ignore[misc] @mock.patch( @@ -2085,9 +2081,7 @@ 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: + async def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: async_client = AsyncGradient( base_url=base_url, access_token=access_token, @@ -2098,9 +2092,7 @@ async def test_parse_retry_after_header( headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) - calculated = async_client._calculate_retry_timeout( - remaining_retries, options, headers - ) + calculated = async_client._calculate_retry_timeout(remaining_retries, options, headers) assert calculated == pytest.approx(timeout, rel=0.5 * 0.875) # type: ignore[misc] @mock.patch( diff --git a/tests/test_smoke_sdk_async.py b/tests/test_smoke_sdk_async.py index 49e1ca78..8425fa77 100644 --- a/tests/test_smoke_sdk_async.py +++ b/tests/test_smoke_sdk_async.py @@ -25,31 +25,24 @@ async def test_async_smoke_environment_and_client_state() -> None: missing = [k for k in REQUIRED_ENV_VARS if not os.getenv(k)] if missing: pytest.fail( - "Missing required environment variables for async smoke tests: " - + ", ".join(missing), + "Missing required environment variables for async smoke tests: " + ", ".join(missing), pytrace=False, ) async with AsyncGradient() as client: # Property assertions (auto-loaded from environment) - assert ( - client.access_token == os.environ["DIGITALOCEAN_ACCESS_TOKEN"] - ), "access_token not loaded from env" - assert ( - client.model_access_key == os.environ["GRADIENT_MODEL_ACCESS_KEY"] - ), "model_access_key not loaded from env" - assert ( - client.agent_access_key == os.environ["GRADIENT_AGENT_ACCESS_KEY"] - ), "agent_access_key not loaded from env" + assert client.access_token == os.environ["DIGITALOCEAN_ACCESS_TOKEN"], "access_token not loaded from env" + assert client.model_access_key == os.environ["GRADIENT_MODEL_ACCESS_KEY"], ( + "model_access_key not loaded from env" + ) + assert client.agent_access_key == os.environ["GRADIENT_AGENT_ACCESS_KEY"], ( + "agent_access_key not loaded from env" + ) expected_endpoint = os.environ["GRADIENT_AGENT_ENDPOINT"] normalized_expected = ( - expected_endpoint - if expected_endpoint.startswith("https://") - else f"https://{expected_endpoint}" + expected_endpoint if expected_endpoint.startswith("https://") else f"https://{expected_endpoint}" ) - assert ( - client.agent_endpoint == normalized_expected - ), "agent_endpoint not derived correctly from env" + assert client.agent_endpoint == normalized_expected, "agent_endpoint not derived correctly from env" @pytest.mark.smoke From ec5d9a46ce0a690e76783816ad7e003a933cd15f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 18 Dec 2025 21:52:31 +0000 Subject: [PATCH 60/96] chore(internal): add `--fix` argument to lint script --- scripts/lint | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/lint b/scripts/lint index 9ccb6ae5..bc51411f 100755 --- a/scripts/lint +++ b/scripts/lint @@ -4,8 +4,13 @@ set -e cd "$(dirname "$0")/.." -echo "==> Running lints" -rye run lint +if [ "$1" = "--fix" ]; then + echo "==> Running lints with --fix" + rye run fix:ruff +else + echo "==> Running lints" + rye run lint +fi echo "==> Making sure it imports" rye run python -c 'import gradient' From 25852eecb7261fa4ea0ab71597ecb6d22273ca4f Mon Sep 17 00:00:00 2001 From: Ben Batha Date: Fri, 19 Dec 2025 15:14:52 -0500 Subject: [PATCH 61/96] chore: run smoke tests on prs (#121) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ffd92fb9..42a31c2a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,7 +100,7 @@ jobs: smoke: name: smoke # Only run smoke tests on pushes to main repo (not forks) so that secrets can be accessed - if: github.repository == 'stainless-sdks/gradient-python' && github.event_name == 'push' + if: github.repository == 'stainless-sdks/gradient-python' && (github.event_name == 'push' || github.event_name == 'pull_request') runs-on: ${{ github.repository == 'stainless-sdks/gradient-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} timeout-minutes: 10 steps: From 927a3e864466bf2463c99b66c6fbcfde26505159 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Dec 2025 20:15:20 +0000 Subject: [PATCH 62/96] release: 3.10.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 20 ++++++++++++++++++++ pyproject.toml | 2 +- src/gradient/_version.py | 2 +- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 9127b1bd..25709d1b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.9.0" + ".": "3.10.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index fc39fcc7..9bd90ccd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## 3.10.0 (2025-12-19) + +Full Changelog: [v3.9.0...v3.10.0](https://github.com/digitalocean/gradient-python/compare/v3.9.0...v3.10.0) + +### Features + +* **api:** manual updates ([f1c2eb2](https://github.com/digitalocean/gradient-python/commit/f1c2eb25ae1787b661ab1323528077074aa0cab6)) +* **api:** manual updates ([355e13f](https://github.com/digitalocean/gradient-python/commit/355e13f1a4b012e09bc2056179419ede57044b97)) + + +### Bug Fixes + +* restore inference endpoints ([#120](https://github.com/digitalocean/gradient-python/issues/120)) ([ee792a1](https://github.com/digitalocean/gradient-python/commit/ee792a181e819d8fa26712fe8bc96ffd4c02d2ed)) + + +### Chores + +* **internal:** add `--fix` argument to lint script ([2825cb7](https://github.com/digitalocean/gradient-python/commit/2825cb750edd261a324c2da28afc3cb6ee90f5e9)) +* run smoke tests on prs ([#121](https://github.com/digitalocean/gradient-python/issues/121)) ([719a5fb](https://github.com/digitalocean/gradient-python/commit/719a5fb4fcf418db9ede5659710377a47d41b6a8)) + ## 3.9.0 (2025-12-17) Full Changelog: [v3.8.0...v3.9.0](https://github.com/digitalocean/gradient-python/compare/v3.8.0...v3.9.0) diff --git a/pyproject.toml b/pyproject.toml index 9cce1fde..35e2247e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gradient" -version = "3.9.0" +version = "3.10.0" description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gradient/_version.py b/src/gradient/_version.py index abe0382c..c633db37 100644 --- a/src/gradient/_version.py +++ b/src/gradient/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gradient" -__version__ = "3.9.0" # x-release-please-version +__version__ = "3.10.0" # x-release-please-version From 060c76201b90573918f782da896eba890c5ed7ce Mon Sep 17 00:00:00 2001 From: Ben Batha Date: Fri, 19 Dec 2025 15:26:42 -0500 Subject: [PATCH 63/96] fix: restore inference base urls (#122) --- src/gradient/resources/agents/chat/completions.py | 8 ++++++-- src/gradient/resources/chat/completions.py | 8 ++++++-- src/gradient/resources/images.py | 8 ++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/gradient/resources/agents/chat/completions.py b/src/gradient/resources/agents/chat/completions.py index 67a57557..374fdc16 100644 --- a/src/gradient/resources/agents/chat/completions.py +++ b/src/gradient/resources/agents/chat/completions.py @@ -472,7 +472,9 @@ def create( headers = {"Authorization": f"Bearer {self._client.agent_access_key}", **headers} return self._post( - "/chat/completions?agent=true", + "/chat/completions?agent=true" + if self._client._base_url_overridden + else f"{self._client.agent_endpoint}/api/v1/chat/completions?agent=true", body=maybe_transform( { "messages": messages, @@ -956,7 +958,9 @@ async def create( headers = {"Authorization": f"Bearer {self._client.agent_access_key}", **headers} return await self._post( - "/chat/completions?agent=true", + "/chat/completions?agent=true" + if self._client._base_url_overridden + else f"{self._client.agent_endpoint}/api/v1/chat/completions?agent=true", body=await async_maybe_transform( { "messages": messages, diff --git a/src/gradient/resources/chat/completions.py b/src/gradient/resources/chat/completions.py index 8d0c43c5..779fffb0 100644 --- a/src/gradient/resources/chat/completions.py +++ b/src/gradient/resources/chat/completions.py @@ -473,7 +473,9 @@ def create( } return self._post( - "/chat/completions", + "/chat/completions" + if self._client._base_url_overridden + else f"{self._client.inference_endpoint}/v1/chat/completions", body=maybe_transform( { "messages": messages, @@ -961,7 +963,9 @@ async def create( } return await self._post( - "/chat/completions", + "/chat/completions" + if self._client._base_url_overridden + else f"{self._client.inference_endpoint}/v1/chat/completions", body=await async_maybe_transform( { "messages": messages, diff --git a/src/gradient/resources/images.py b/src/gradient/resources/images.py index ce7a7b48..14bbfeaa 100644 --- a/src/gradient/resources/images.py +++ b/src/gradient/resources/images.py @@ -317,7 +317,9 @@ def generate( } return self._post( - "/images/generations", + "/images/generations" + if self._client._base_url_overridden + else f"{self._client.inference_endpoint}/v1/images/generations", body=maybe_transform( { "prompt": prompt, @@ -636,7 +638,9 @@ async def generate( **headers, } return await self._post( - "/images/generations", + "/images/generations" + if self._client._base_url_overridden + else f"{self._client.inference_endpoint}/v1/images/generations", body=await async_maybe_transform( { "prompt": prompt, From 1da4a91eed3269d6f8c75dfeea6be77d634f80c6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Dec 2025 20:27:06 +0000 Subject: [PATCH 64/96] release: 3.10.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/gradient/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 25709d1b..cc4da81f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.10.0" + ".": "3.10.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bd90ccd..a82ede75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 3.10.1 (2025-12-19) + +Full Changelog: [v3.10.0...v3.10.1](https://github.com/digitalocean/gradient-python/compare/v3.10.0...v3.10.1) + +### Bug Fixes + +* restore inference base urls ([#122](https://github.com/digitalocean/gradient-python/issues/122)) ([2a1c687](https://github.com/digitalocean/gradient-python/commit/2a1c687b46192afa210c3d159f3e087d3fe1a3b9)) + ## 3.10.0 (2025-12-19) Full Changelog: [v3.9.0...v3.10.0](https://github.com/digitalocean/gradient-python/compare/v3.9.0...v3.10.0) diff --git a/pyproject.toml b/pyproject.toml index 35e2247e..5d4e9ebe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gradient" -version = "3.10.0" +version = "3.10.1" description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gradient/_version.py b/src/gradient/_version.py index c633db37..f1eb0021 100644 --- a/src/gradient/_version.py +++ b/src/gradient/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gradient" -__version__ = "3.10.0" # x-release-please-version +__version__ = "3.10.1" # x-release-please-version From 04718116155509b633775a2927ad192f5975cdec Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Feb 2026 18:33:37 +0000 Subject: [PATCH 65/96] fix(client): loosen auth header validation --- src/gradient/_client.py | 52 +-- .../knowledge_bases/knowledge_bases.py | 48 +-- .../types/retrieve_documents_params.py | 1 - tests/test_client.py | 322 +++++------------- 4 files changed, 105 insertions(+), 318 deletions(-) diff --git a/src/gradient/_client.py b/src/gradient/_client.py index 847121b1..fc58b291 100644 --- a/src/gradient/_client.py +++ b/src/gradient/_client.py @@ -353,14 +353,10 @@ def copy( Create a new client instance re-using the same options given to the current client with optional overriding. """ if default_headers is not None and set_default_headers is not None: - raise ValueError( - "The `default_headers` and `set_default_headers` arguments are mutually exclusive" - ) + raise ValueError("The `default_headers` and `set_default_headers` arguments are mutually exclusive") if default_query is not None and set_default_query is not None: - raise ValueError( - "The `default_query` and `set_default_query` arguments are mutually exclusive" - ) + raise ValueError("The `default_query` and `set_default_query` arguments are mutually exclusive") headers = self._custom_headers if default_headers is not None: @@ -411,14 +407,10 @@ def _make_status_error( return _exceptions.BadRequestError(err_msg, response=response, body=body) if response.status_code == 401: - return _exceptions.AuthenticationError( - err_msg, response=response, body=body - ) + return _exceptions.AuthenticationError(err_msg, response=response, body=body) if response.status_code == 403: - return _exceptions.PermissionDeniedError( - err_msg, response=response, body=body - ) + return _exceptions.PermissionDeniedError(err_msg, response=response, body=body) if response.status_code == 404: return _exceptions.NotFoundError(err_msg, response=response, body=body) @@ -427,17 +419,13 @@ def _make_status_error( return _exceptions.ConflictError(err_msg, response=response, body=body) if response.status_code == 422: - return _exceptions.UnprocessableEntityError( - err_msg, response=response, body=body - ) + return _exceptions.UnprocessableEntityError(err_msg, response=response, body=body) if response.status_code == 429: return _exceptions.RateLimitError(err_msg, response=response, body=body) if response.status_code >= 500: - return _exceptions.InternalServerError( - err_msg, response=response, body=body - ) + return _exceptions.InternalServerError(err_msg, response=response, body=body) return APIStatusError(err_msg, response=response, body=body) @@ -719,14 +707,10 @@ def copy( Create a new client instance re-using the same options given to the current client with optional overriding. """ if default_headers is not None and set_default_headers is not None: - raise ValueError( - "The `default_headers` and `set_default_headers` arguments are mutually exclusive" - ) + raise ValueError("The `default_headers` and `set_default_headers` arguments are mutually exclusive") if default_query is not None and set_default_query is not None: - raise ValueError( - "The `default_query` and `set_default_query` arguments are mutually exclusive" - ) + raise ValueError("The `default_query` and `set_default_query` arguments are mutually exclusive") headers = self._custom_headers if default_headers is not None: @@ -777,14 +761,10 @@ def _make_status_error( return _exceptions.BadRequestError(err_msg, response=response, body=body) if response.status_code == 401: - return _exceptions.AuthenticationError( - err_msg, response=response, body=body - ) + return _exceptions.AuthenticationError(err_msg, response=response, body=body) if response.status_code == 403: - return _exceptions.PermissionDeniedError( - err_msg, response=response, body=body - ) + return _exceptions.PermissionDeniedError(err_msg, response=response, body=body) if response.status_code == 404: return _exceptions.NotFoundError(err_msg, response=response, body=body) @@ -793,17 +773,13 @@ def _make_status_error( return _exceptions.ConflictError(err_msg, response=response, body=body) if response.status_code == 422: - return _exceptions.UnprocessableEntityError( - err_msg, response=response, body=body - ) + return _exceptions.UnprocessableEntityError(err_msg, response=response, body=body) if response.status_code == 429: return _exceptions.RateLimitError(err_msg, response=response, body=body) if response.status_code >= 500: - return _exceptions.InternalServerError( - err_msg, response=response, body=body - ) + return _exceptions.InternalServerError(err_msg, response=response, body=body) return APIStatusError(err_msg, response=response, body=body) @@ -1082,9 +1058,7 @@ def knowledge_bases( AsyncKnowledgeBasesResourceWithStreamingResponse, ) - return AsyncKnowledgeBasesResourceWithStreamingResponse( - self._client.knowledge_bases - ) + return AsyncKnowledgeBasesResourceWithStreamingResponse(self._client.knowledge_bases) @cached_property def models(self) -> models.AsyncModelsResourceWithStreamingResponse: diff --git a/src/gradient/resources/knowledge_bases/knowledge_bases.py b/src/gradient/resources/knowledge_bases/knowledge_bases.py index 04c19b32..9c22a60c 100644 --- a/src/gradient/resources/knowledge_bases/knowledge_bases.py +++ b/src/gradient/resources/knowledge_bases/knowledge_bases.py @@ -210,9 +210,7 @@ def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not uuid: - raise ValueError( - f"Expected a non-empty value for `uuid` but received {uuid!r}" - ) + raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") return self._get( ( f"/v2/gen-ai/knowledge_bases/{uuid}" @@ -271,9 +269,7 @@ def update( timeout: Override the client-level default timeout for this request, in seconds """ if not path_uuid: - raise ValueError( - f"Expected a non-empty value for `path_uuid` but received {path_uuid!r}" - ) + raise ValueError(f"Expected a non-empty value for `path_uuid` but received {path_uuid!r}") return self._put( ( f"/v2/gen-ai/knowledge_bases/{path_uuid}" @@ -375,9 +371,7 @@ def delete( timeout: Override the client-level default timeout for this request, in seconds """ if not uuid: - raise ValueError( - f"Expected a non-empty value for `uuid` but received {uuid!r}" - ) + raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") return self._delete( ( f"/v2/gen-ai/knowledge_bases/{uuid}" @@ -646,9 +640,7 @@ async def retrieve( timeout: Override the client-level default timeout for this request, in seconds """ if not uuid: - raise ValueError( - f"Expected a non-empty value for `uuid` but received {uuid!r}" - ) + raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") return await self._get( ( f"/v2/gen-ai/knowledge_bases/{uuid}" @@ -707,9 +699,7 @@ async def update( timeout: Override the client-level default timeout for this request, in seconds """ if not path_uuid: - raise ValueError( - f"Expected a non-empty value for `path_uuid` but received {path_uuid!r}" - ) + raise ValueError(f"Expected a non-empty value for `path_uuid` but received {path_uuid!r}") return await self._put( ( f"/v2/gen-ai/knowledge_bases/{path_uuid}" @@ -811,9 +801,7 @@ async def delete( timeout: Override the client-level default timeout for this request, in seconds """ if not uuid: - raise ValueError( - f"Expected a non-empty value for `uuid` but received {uuid!r}" - ) + raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}") return await self._delete( ( f"/v2/gen-ai/knowledge_bases/{uuid}" @@ -1011,15 +999,11 @@ def __init__(self, knowledge_bases: AsyncKnowledgeBasesResource) -> None: @cached_property def data_sources(self) -> AsyncDataSourcesResourceWithRawResponse: - return AsyncDataSourcesResourceWithRawResponse( - self._knowledge_bases.data_sources - ) + return AsyncDataSourcesResourceWithRawResponse(self._knowledge_bases.data_sources) @cached_property def indexing_jobs(self) -> AsyncIndexingJobsResourceWithRawResponse: - return AsyncIndexingJobsResourceWithRawResponse( - self._knowledge_bases.indexing_jobs - ) + return AsyncIndexingJobsResourceWithRawResponse(self._knowledge_bases.indexing_jobs) class KnowledgeBasesResourceWithStreamingResponse: @@ -1050,15 +1034,11 @@ def __init__(self, knowledge_bases: KnowledgeBasesResource) -> None: @cached_property def data_sources(self) -> DataSourcesResourceWithStreamingResponse: - return DataSourcesResourceWithStreamingResponse( - self._knowledge_bases.data_sources - ) + return DataSourcesResourceWithStreamingResponse(self._knowledge_bases.data_sources) @cached_property def indexing_jobs(self) -> IndexingJobsResourceWithStreamingResponse: - return IndexingJobsResourceWithStreamingResponse( - self._knowledge_bases.indexing_jobs - ) + return IndexingJobsResourceWithStreamingResponse(self._knowledge_bases.indexing_jobs) class AsyncKnowledgeBasesResourceWithStreamingResponse: @@ -1089,12 +1069,8 @@ def __init__(self, knowledge_bases: AsyncKnowledgeBasesResource) -> None: @cached_property def data_sources(self) -> AsyncDataSourcesResourceWithStreamingResponse: - return AsyncDataSourcesResourceWithStreamingResponse( - self._knowledge_bases.data_sources - ) + return AsyncDataSourcesResourceWithStreamingResponse(self._knowledge_bases.data_sources) @cached_property def indexing_jobs(self) -> AsyncIndexingJobsResourceWithStreamingResponse: - return AsyncIndexingJobsResourceWithStreamingResponse( - self._knowledge_bases.indexing_jobs - ) + return AsyncIndexingJobsResourceWithStreamingResponse(self._knowledge_bases.indexing_jobs) diff --git a/src/gradient/types/retrieve_documents_params.py b/src/gradient/types/retrieve_documents_params.py index bad99ad3..359d8a07 100644 --- a/src/gradient/types/retrieve_documents_params.py +++ b/src/gradient/types/retrieve_documents_params.py @@ -73,4 +73,3 @@ class Filters(TypedDict, total=False): should: Iterable[FiltersShould] """At least one condition must match (OR)""" - diff --git a/tests/test_client.py b/tests/test_client.py index 4b645c08..c78fa9f8 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -59,9 +59,7 @@ def _low_retry_timeout(*_args: Any, **_kwargs: Any) -> float: def _get_open_connections(client: Gradient | AsyncGradient) -> int: transport = client._client._transport - assert isinstance(transport, httpx.HTTPTransport) or isinstance( - transport, httpx.AsyncHTTPTransport - ) + assert isinstance(transport, httpx.HTTPTransport) or isinstance(transport, httpx.AsyncHTTPTransport) pool = transport._pool return len(pool._requests) @@ -70,9 +68,7 @@ def _get_open_connections(client: Gradient | AsyncGradient) -> int: class TestGradient: @pytest.mark.respx(base_url=base_url) def test_raw_response(self, respx_mock: MockRouter, client: Gradient) -> None: - respx_mock.post("/foo").mock( - return_value=httpx.Response(200, json={"foo": "bar"}) - ) + respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) response = client.post("/foo", cast_to=httpx.Response) assert response.status_code == 200 @@ -80,9 +76,7 @@ def test_raw_response(self, respx_mock: MockRouter, client: Gradient) -> None: assert response.json() == {"foo": "bar"} @pytest.mark.respx(base_url=base_url) - def test_raw_response_for_binary( - self, respx_mock: MockRouter, client: Gradient - ) -> None: + def test_raw_response_for_binary(self, respx_mock: MockRouter, client: Gradient) -> None: respx_mock.post("/foo").mock( return_value=httpx.Response( 200, @@ -231,9 +225,7 @@ def test_copy_signature(self, client: Gradient) -> None: continue copy_param = copy_signature.parameters.get(name) - assert ( - copy_param is not None - ), f"copy() signature is missing the {name} param" + assert copy_param is not None, f"copy() signature is missing the {name} param" @pytest.mark.skipif( sys.version_info >= (3, 10), @@ -269,9 +261,7 @@ def build_request(options: FinalRequestOptions) -> None: tracemalloc.stop() - def add_leak( - leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.StatisticDiff - ) -> None: + def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.StatisticDiff) -> None: if diff.count == 0: # Avoid false positives by considering only leaks (i.e. allocations that persist). return @@ -314,9 +304,7 @@ def test_request_timeout(self, client: Gradient) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT - request = 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) @@ -348,9 +336,7 @@ def test_http_client_timeout_option(self) -> None: http_client=http_client, ) - request = client._build_request( - FinalRequestOptions(method="get", url="/foo") - ) + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(None) @@ -367,9 +353,7 @@ def test_http_client_timeout_option(self) -> None: http_client=http_client, ) - request = client._build_request( - FinalRequestOptions(method="get", url="/foo") - ) + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT @@ -386,9 +370,7 @@ def test_http_client_timeout_option(self) -> None: http_client=http_client, ) - request = client._build_request( - FinalRequestOptions(method="get", url="/foo") - ) + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT # our default @@ -415,9 +397,7 @@ def test_default_headers_option(self) -> None: _strict_response_validation=True, default_headers={"X-Foo": "bar"}, ) - request = test_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" @@ -432,9 +412,7 @@ def test_default_headers_option(self) -> None: "X-Stainless-Lang": "my-overriding-header", }, ) - request = test_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" @@ -474,9 +452,7 @@ def test_validate_headers(self) -> None: client2._build_request(FinalRequestOptions(method="get", url="/foo")) request2 = client2._build_request( - FinalRequestOptions( - method="get", url="/foo", headers={"Authorization": Omit()} - ) + FinalRequestOptions(method="get", url="/foo", headers={"Authorization": Omit()}) ) assert request2.headers.get("Authorization") is None @@ -607,9 +583,7 @@ def test_multipart_repeating_array(self, client: Gradient) -> None: FinalRequestOptions.construct( method="post", url="/foo", - headers={ - "Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82" - }, + headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, json_data={"array": ["foo", "bar"]}, files=[("foo.txt", b"hello world")], ) @@ -634,27 +608,21 @@ def test_multipart_repeating_array(self, client: Gradient) -> None: ] @pytest.mark.respx(base_url=base_url) - def test_basic_union_response( - self, respx_mock: MockRouter, client: Gradient - ) -> None: + def test_basic_union_response(self, respx_mock: MockRouter, client: Gradient) -> None: class Model1(BaseModel): name: str class Model2(BaseModel): foo: str - respx_mock.get("/foo").mock( - return_value=httpx.Response(200, json={"foo": "bar"}) - ) + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) 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, client: Gradient - ) -> None: + def test_union_response_different_types(self, respx_mock: MockRouter, client: Gradient) -> None: """Union of objects with the same field name using a different type""" class Model1(BaseModel): @@ -663,9 +631,7 @@ class Model1(BaseModel): class Model2(BaseModel): foo: str - respx_mock.get("/foo").mock( - return_value=httpx.Response(200, json={"foo": "bar"}) - ) + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) response = client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model2) @@ -678,9 +644,7 @@ class Model2(BaseModel): 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, client: Gradient - ) -> None: + def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter, client: Gradient) -> None: """ Response that sets Content-Type to something other than application/json but returns json data """ @@ -850,15 +814,11 @@ def test_client_context_manager(self) -> None: assert test_client.is_closed() @pytest.mark.respx(base_url=base_url) - def test_client_response_validation_error( - self, respx_mock: MockRouter, client: Gradient - ) -> None: + def test_client_response_validation_error(self, respx_mock: MockRouter, client: Gradient) -> None: class Model(BaseModel): foo: str - respx_mock.get("/foo").mock( - return_value=httpx.Response(200, json={"foo": {"invalid": True}}) - ) + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": {"invalid": True}})) with pytest.raises(APIResponseValidationError) as exc: client.get("/foo", cast_to=Model) @@ -881,13 +841,9 @@ def test_default_stream_cls(self, respx_mock: MockRouter, client: Gradient) -> N class Model(BaseModel): name: str - respx_mock.post("/foo").mock( - return_value=httpx.Response(200, json={"foo": "bar"}) - ) + respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - stream = client.post( - "/foo", cast_to=Model, stream=True, stream_cls=Stream[Model] - ) + stream = client.post("/foo", cast_to=Model, stream=True, stream_cls=Stream[Model]) assert isinstance(stream, Stream) stream.response.close() @@ -896,9 +852,7 @@ def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None: class Model(BaseModel): name: str - respx_mock.get("/foo").mock( - return_value=httpx.Response(200, text="my-custom-format") - ) + respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format")) strict_client = Gradient( base_url=base_url, @@ -959,16 +913,10 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str calculated = client._calculate_retry_timeout(remaining_retries, options, headers) assert calculated == pytest.approx(timeout, rel=0.5 * 0.875) # type: ignore[misc] - @mock.patch( - "gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout - ) + @mock.patch("gradient._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, client: Gradient - ) -> None: - respx_mock.post("/chat/completions").mock( - side_effect=httpx.TimeoutException("Test timeout error") - ) + def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, client: Gradient) -> None: + respx_mock.post("/chat/completions").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): client.chat.completions.with_streaming_response.create( @@ -983,13 +931,9 @@ def test_retrying_timeout_errors_doesnt_leak( assert _get_open_connections(client) == 0 - @mock.patch( - "gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout - ) + @mock.patch("gradient._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, client: Gradient - ) -> None: + def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client: Gradient) -> None: respx_mock.post("/chat/completions").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): @@ -1005,9 +949,7 @@ def test_retrying_status_errors_doesnt_leak( assert _get_open_connections(client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) - @mock.patch( - "gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout - ) + @mock.patch("gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) @pytest.mark.parametrize("failure_mode", ["status", "exception"]) def test_retries_taken( @@ -1043,15 +985,10 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: ) assert response.retries_taken == failures_before_success - assert ( - int(response.http_request.headers.get("x-stainless-retry-count")) - == failures_before_success - ) + assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) - @mock.patch( - "gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout - ) + @mock.patch("gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) def test_omit_retry_count_header( self, client: Gradient, failures_before_success: int, respx_mock: MockRouter @@ -1080,14 +1017,10 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: extra_headers={"x-stainless-retry-count": Omit()}, ) - assert ( - len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 - ) + assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) - @mock.patch( - "gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout - ) + @mock.patch("gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) def test_overwrite_retry_count_header( self, client: Gradient, failures_before_success: int, respx_mock: MockRouter @@ -1144,29 +1077,19 @@ def test_default_client_creation(self) -> None: def test_follow_redirects(self, respx_mock: MockRouter, client: Gradient) -> 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"}) + 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 = 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, client: Gradient - ) -> None: + def test_follow_redirects_disabled(self, respx_mock: MockRouter, client: Gradient) -> 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"} - ) + return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) with pytest.raises(APIStatusError) as exc_info: @@ -1183,12 +1106,8 @@ def test_follow_redirects_disabled( class TestAsyncGradient: @pytest.mark.respx(base_url=base_url) - async def test_raw_response( - self, respx_mock: MockRouter, async_client: AsyncGradient - ) -> None: - respx_mock.post("/foo").mock( - return_value=httpx.Response(200, json={"foo": "bar"}) - ) + async def test_raw_response(self, respx_mock: MockRouter, async_client: AsyncGradient) -> None: + respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) response = await async_client.post("/foo", cast_to=httpx.Response) assert response.status_code == 200 @@ -1196,9 +1115,7 @@ async def test_raw_response( assert response.json() == {"foo": "bar"} @pytest.mark.respx(base_url=base_url) - async def test_raw_response_for_binary( - self, respx_mock: MockRouter, async_client: AsyncGradient - ) -> None: + async def test_raw_response_for_binary(self, respx_mock: MockRouter, async_client: AsyncGradient) -> None: respx_mock.post("/foo").mock( return_value=httpx.Response( 200, @@ -1347,9 +1264,7 @@ def test_copy_signature(self, async_client: AsyncGradient) -> None: continue copy_param = copy_signature.parameters.get(name) - assert ( - copy_param is not None - ), f"copy() signature is missing the {name} param" + assert copy_param is not None, f"copy() signature is missing the {name} param" @pytest.mark.skipif( sys.version_info >= (3, 10), @@ -1385,9 +1300,7 @@ def build_request(options: FinalRequestOptions) -> None: tracemalloc.stop() - def add_leak( - leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.StatisticDiff - ) -> None: + def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.StatisticDiff) -> None: if diff.count == 0: # Avoid false positives by considering only leaks (i.e. allocations that persist). return @@ -1426,9 +1339,7 @@ def add_leak( raise AssertionError() async def test_request_timeout(self, async_client: AsyncGradient) -> None: - request = async_client._build_request( - FinalRequestOptions(method="get", url="/foo") - ) + request = async_client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT @@ -1466,9 +1377,7 @@ async def test_http_client_timeout_option(self) -> None: http_client=http_client, ) - request = client._build_request( - FinalRequestOptions(method="get", url="/foo") - ) + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(None) @@ -1485,9 +1394,7 @@ async def test_http_client_timeout_option(self) -> None: http_client=http_client, ) - request = client._build_request( - FinalRequestOptions(method="get", url="/foo") - ) + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT @@ -1504,9 +1411,7 @@ async def test_http_client_timeout_option(self) -> None: http_client=http_client, ) - request = client._build_request( - FinalRequestOptions(method="get", url="/foo") - ) + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT # our default @@ -1533,9 +1438,7 @@ async def test_default_headers_option(self) -> None: _strict_response_validation=True, default_headers={"X-Foo": "bar"}, ) - request = test_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" @@ -1550,9 +1453,7 @@ async def test_default_headers_option(self) -> None: "X-Stainless-Lang": "my-overriding-header", }, ) - request = test_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" @@ -1592,9 +1493,7 @@ def test_validate_headers(self) -> None: client2._build_request(FinalRequestOptions(method="get", url="/foo")) request2 = client2._build_request( - FinalRequestOptions( - method="get", url="/foo", headers={"Authorization": Omit()} - ) + FinalRequestOptions(method="get", url="/foo", headers={"Authorization": Omit()}) ) assert request2.headers.get("Authorization") is None @@ -1725,9 +1624,7 @@ def test_multipart_repeating_array(self, async_client: AsyncGradient) -> None: FinalRequestOptions.construct( method="post", url="/foo", - headers={ - "Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82" - }, + headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, json_data={"array": ["foo", "bar"]}, files=[("foo.txt", b"hello world")], ) @@ -1752,29 +1649,21 @@ def test_multipart_repeating_array(self, async_client: AsyncGradient) -> None: ] @pytest.mark.respx(base_url=base_url) - async def test_basic_union_response( - self, respx_mock: MockRouter, async_client: AsyncGradient - ) -> None: + async def test_basic_union_response(self, respx_mock: MockRouter, async_client: AsyncGradient) -> None: class Model1(BaseModel): name: str class Model2(BaseModel): foo: str - respx_mock.get("/foo").mock( - return_value=httpx.Response(200, json={"foo": "bar"}) - ) + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = await async_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, async_client: AsyncGradient - ) -> None: + async def test_union_response_different_types(self, respx_mock: MockRouter, async_client: AsyncGradient) -> None: """Union of objects with the same field name using a different type""" class Model1(BaseModel): @@ -1783,21 +1672,15 @@ class Model1(BaseModel): class Model2(BaseModel): foo: str - respx_mock.get("/foo").mock( - return_value=httpx.Response(200, json={"foo": "bar"}) - ) + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = await async_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 async_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 @@ -1979,15 +1862,11 @@ async def test_client_context_manager(self) -> None: assert test_client.is_closed() @pytest.mark.respx(base_url=base_url) - async def test_client_response_validation_error( - self, respx_mock: MockRouter, async_client: AsyncGradient - ) -> None: + async def test_client_response_validation_error(self, respx_mock: MockRouter, async_client: AsyncGradient) -> None: class Model(BaseModel): foo: str - respx_mock.get("/foo").mock( - return_value=httpx.Response(200, json={"foo": {"invalid": True}}) - ) + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": {"invalid": True}})) with pytest.raises(APIResponseValidationError) as exc: await async_client.get("/foo", cast_to=Model) @@ -2006,32 +1885,22 @@ async def test_client_max_retries_validation(self) -> None: ) @pytest.mark.respx(base_url=base_url) - async def test_default_stream_cls( - self, respx_mock: MockRouter, async_client: AsyncGradient - ) -> None: + async def test_default_stream_cls(self, respx_mock: MockRouter, async_client: AsyncGradient) -> None: class Model(BaseModel): name: str - respx_mock.post("/foo").mock( - return_value=httpx.Response(200, json={"foo": "bar"}) - ) + respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - stream = await async_client.post( - "/foo", cast_to=Model, stream=True, stream_cls=AsyncStream[Model] - ) + stream = await async_client.post("/foo", cast_to=Model, stream=True, stream_cls=AsyncStream[Model]) assert isinstance(stream, AsyncStream) await stream.response.aclose() @pytest.mark.respx(base_url=base_url) - async def test_received_text_for_expected_json( - self, respx_mock: MockRouter - ) -> None: + async def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None: class Model(BaseModel): name: str - respx_mock.get("/foo").mock( - return_value=httpx.Response(200, text="my-custom-format") - ) + respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format")) strict_client = AsyncGradient( base_url=base_url, @@ -2095,16 +1964,12 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte calculated = async_client._calculate_retry_timeout(remaining_retries, options, headers) assert calculated == pytest.approx(timeout, rel=0.5 * 0.875) # type: ignore[misc] - @mock.patch( - "gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout - ) + @mock.patch("gradient._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, async_client: AsyncGradient ) -> None: - respx_mock.post("/chat/completions").mock( - side_effect=httpx.TimeoutException("Test timeout error") - ) + respx_mock.post("/chat/completions").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): await async_client.chat.completions.with_streaming_response.create( @@ -2119,9 +1984,7 @@ async def test_retrying_timeout_errors_doesnt_leak( assert _get_open_connections(async_client) == 0 - @mock.patch( - "gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout - ) + @mock.patch("gradient._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, async_client: AsyncGradient @@ -2141,9 +2004,7 @@ async def test_retrying_status_errors_doesnt_leak( assert _get_open_connections(async_client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) - @mock.patch( - "gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout - ) + @mock.patch("gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) @pytest.mark.parametrize("failure_mode", ["status", "exception"]) async def test_retries_taken( @@ -2179,15 +2040,10 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: ) assert response.retries_taken == failures_before_success - assert ( - int(response.http_request.headers.get("x-stainless-retry-count")) - == failures_before_success - ) + assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) - @mock.patch( - "gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout - ) + @mock.patch("gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) async def test_omit_retry_count_header( self, @@ -2219,14 +2075,10 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: extra_headers={"x-stainless-retry-count": Omit()}, ) - assert ( - len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 - ) + assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) - @mock.patch( - "gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout - ) + @mock.patch("gradient._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) async def test_overwrite_retry_count_header( self, @@ -2264,9 +2116,7 @@ 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: + 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") @@ -2289,34 +2139,22 @@ async def test_default_client_creation(self) -> None: ) @pytest.mark.respx(base_url=base_url) - async def test_follow_redirects( - self, respx_mock: MockRouter, async_client: AsyncGradient - ) -> None: + async def test_follow_redirects(self, respx_mock: MockRouter, async_client: AsyncGradient) -> 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"}) + 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 async_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, async_client: AsyncGradient - ) -> None: + async def test_follow_redirects_disabled(self, respx_mock: MockRouter, async_client: AsyncGradient) -> 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"} - ) + return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) with pytest.raises(APIStatusError) as exc_info: From 9788d3c6f322b9d63df537829c73ba6bb39d90e2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Feb 2026 22:42:20 +0000 Subject: [PATCH 66/96] feat(api): api update --- .github/workflows/ci.yml | 6 +- .github/workflows/publish-pypi.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- .stats.yml | 8 +- api.md | 36 + requirements-dev.lock | 20 +- requirements.lock | 8 +- src/gradient/_base_client.py | 168 +++- src/gradient/_client.py | 118 ++- src/gradient/_compat.py | 6 +- src/gradient/_models.py | 17 +- src/gradient/_types.py | 9 + src/gradient/_utils/_compat.py | 2 +- src/gradient/_utils/_json.py | 35 + src/gradient/resources/__init__.py | 42 + .../resources/agents/evaluation_datasets.py | 11 + .../resources/agents/evaluation_runs.py | 12 +- .../resources/agents/evaluation_test_cases.py | 4 + src/gradient/resources/apps/__init__.py | 33 + src/gradient/resources/apps/apps.py | 102 +++ .../resources/apps/job_invocations.py | 191 ++++ src/gradient/resources/billing.py | 226 +++++ .../resources/knowledge_bases/data_sources.py | 213 +++++ src/gradient/resources/responses.py | 860 ++++++++++++++++++ src/gradient/resources/retrieve.py | 12 + src/gradient/types/__init__.py | 7 + .../types/agents/api_evaluation_prompt.py | 57 +- .../types/agents/api_evaluation_run.py | 3 + .../agents/chat/completion_create_params.py | 315 ++++++- .../evaluation_dataset_create_params.py | 6 +- .../agents/evaluation_run_create_params.py | 5 +- .../evaluation_test_case_create_params.py | 2 + src/gradient/types/api_agent_model.py | 9 + src/gradient/types/api_model.py | 9 + src/gradient/types/apps/__init__.py | 6 + .../apps/job_invocation_cancel_params.py | 14 + .../apps/job_invocation_cancel_response.py | 77 ++ .../types/billing_list_insights_params.py | 23 + .../types/billing_list_insights_response.py | 51 ++ .../types/chat/completion_create_params.py | 315 ++++++- .../types/knowledge_base_create_params.py | 49 +- .../types/knowledge_bases/__init__.py | 2 + .../api_knowledge_base_data_source.py | 50 +- .../data_source_create_params.py | 43 +- .../data_source_update_params.py | 58 ++ .../data_source_update_response.py | 17 + src/gradient/types/response_create_params.py | 331 +++++++ src/gradient/types/shared/__init__.py | 2 + src/gradient/types/shared/completion_usage.py | 21 +- .../types/shared/create_response_response.py | 332 +++++++ .../shared/create_response_stream_response.py | 139 +++ .../agents/test_evaluation_datasets.py | 2 + .../agents/test_evaluation_runs.py | 2 + .../agents/test_evaluation_test_cases.py | 2 + tests/api_resources/apps/__init__.py | 1 + .../apps/test_job_invocations.py | 148 +++ .../api_resources/gpu_droplets/test_images.py | 8 +- .../knowledge_bases/test_data_sources.py | 159 ++++ tests/api_resources/test_billing.py | 177 ++++ tests/api_resources/test_knowledge_bases.py | 14 + tests/api_resources/test_responses.py | 296 ++++++ tests/test_client.py | 187 +++- tests/test_utils/test_json.py | 126 +++ 63 files changed, 5096 insertions(+), 112 deletions(-) create mode 100644 src/gradient/_utils/_json.py create mode 100644 src/gradient/resources/apps/__init__.py create mode 100644 src/gradient/resources/apps/apps.py create mode 100644 src/gradient/resources/apps/job_invocations.py create mode 100644 src/gradient/resources/billing.py create mode 100644 src/gradient/resources/responses.py create mode 100644 src/gradient/types/apps/__init__.py create mode 100644 src/gradient/types/apps/job_invocation_cancel_params.py create mode 100644 src/gradient/types/apps/job_invocation_cancel_response.py create mode 100644 src/gradient/types/billing_list_insights_params.py create mode 100644 src/gradient/types/billing_list_insights_response.py create mode 100644 src/gradient/types/knowledge_bases/data_source_update_params.py create mode 100644 src/gradient/types/knowledge_bases/data_source_update_response.py create mode 100644 src/gradient/types/response_create_params.py create mode 100644 src/gradient/types/shared/create_response_response.py create mode 100644 src/gradient/types/shared/create_response_stream_response.py create mode 100644 tests/api_resources/apps/__init__.py create mode 100644 tests/api_resources/apps/test_job_invocations.py create mode 100644 tests/api_resources/test_billing.py create mode 100644 tests/api_resources/test_responses.py create mode 100644 tests/test_utils/test_json.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42a31c2a..9fb3fd00 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/gradient-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install Rye run: | @@ -44,7 +44,7 @@ jobs: id-token: write runs-on: ${{ github.repository == 'stainless-sdks/gradient-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install Rye run: | @@ -81,7 +81,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/gradient-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install Rye run: | diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index cb2d6509..2b8edb2f 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install Rye run: | diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 9c8912bc..bde3b3ed 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -12,7 +12,7 @@ jobs: if: github.repository == 'digitalocean/gradient-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Check release environment run: | diff --git a/.stats.yml b/.stats.yml index d321100e..0d591538 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 189 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-0778b2e9d56c826f92ee69ef081d8d73fd94c139b85e11becaa88bf1cbe95fb9.yml -openapi_spec_hash: 49daca0dd735cad7200ca1c741a5dd43 -config_hash: fad48c8ac796b240fe3b90181586d1a4 +configured_endpoints: 193 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-2344b44246a44d39ad5b74d3077bd2958745aad67feb15970756532fa0b3f9d6.yml +openapi_spec_hash: a1913979235ce152a8dc380fabe5362e +config_hash: 6c9a04f3cc5dd88e1e4f0ae42d98ba9a diff --git a/api.md b/api.md index caf241a4..45e4eaeb 100644 --- a/api.md +++ b/api.md @@ -10,6 +10,8 @@ from gradient.types import ( ChatCompletionChunk, ChatCompletionTokenLogprob, CompletionUsage, + CreateResponseResponse, + CreateResponseStreamResponse, DiskInfo, Droplet, DropletNextBackupWindow, @@ -404,6 +406,12 @@ Methods: - client.images.generate(\*\*params) -> ImageGenerateResponse +# Responses + +Methods: + +- client.responses.create(\*\*params) -> CreateResponseResponse + # GPUDroplets Types: @@ -856,6 +864,7 @@ from gradient.types.knowledge_bases import ( APIWebCrawlerDataSource, AwsDataSource, DataSourceCreateResponse, + DataSourceUpdateResponse, DataSourceListResponse, DataSourceDeleteResponse, DataSourceCreatePresignedURLsResponse, @@ -865,6 +874,7 @@ from gradient.types.knowledge_bases import ( Methods: - client.knowledge_bases.data_sources.create(path_knowledge_base_uuid, \*\*params) -> DataSourceCreateResponse +- client.knowledge_bases.data_sources.update(path_data_source_uuid, \*, path_knowledge_base_uuid, \*\*params) -> DataSourceUpdateResponse - client.knowledge_bases.data_sources.list(knowledge_base_uuid, \*\*params) -> DataSourceListResponse - client.knowledge_bases.data_sources.delete(data_source_uuid, \*, knowledge_base_uuid) -> DataSourceDeleteResponse - client.knowledge_bases.data_sources.create_presigned_urls(\*\*params) -> DataSourceCreatePresignedURLsResponse @@ -1039,3 +1049,29 @@ from gradient.types import RetrieveDocumentsResponse Methods: - client.retrieve.documents(knowledge_base_id, \*\*params) -> RetrieveDocumentsResponse + +# Apps + +## JobInvocations + +Types: + +```python +from gradient.types.apps import JobInvocationCancelResponse +``` + +Methods: + +- client.apps.job_invocations.cancel(job_invocation_id, \*, app_id, \*\*params) -> JobInvocationCancelResponse + +# Billing + +Types: + +```python +from gradient.types import BillingListInsightsResponse +``` + +Methods: + +- client.billing.list_insights(end_date, \*, account_urn, start_date, \*\*params) -> BillingListInsightsResponse diff --git a/requirements-dev.lock b/requirements-dev.lock index 63b7bd64..667e0dff 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -12,14 +12,14 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.13.2 +aiohttp==3.13.3 # via gradient # via httpx-aiohttp aiosignal==1.4.0 # via aiohttp annotated-types==0.7.0 # via pydantic -anyio==4.12.0 +anyio==4.12.1 # via gradient # via httpx argcomplete==3.6.3 @@ -31,7 +31,7 @@ attrs==25.4.0 # via nox backports-asyncio-runner==1.2.0 # via pytest-asyncio -certifi==2025.11.12 +certifi==2026.1.4 # via httpcore # via httpx colorlog==6.10.1 @@ -61,7 +61,7 @@ httpx==0.28.1 # via gradient # via httpx-aiohttp # via respx -httpx-aiohttp==0.1.9 +httpx-aiohttp==0.1.12 # via gradient humanize==4.13.0 # via nox @@ -69,7 +69,7 @@ idna==3.11 # via anyio # via httpx # via yarl -importlib-metadata==8.7.0 +importlib-metadata==8.7.1 iniconfig==2.1.0 # via pytest markdown-it-py==3.0.0 @@ -82,14 +82,14 @@ multidict==6.7.0 mypy==1.17.0 mypy-extensions==1.1.0 # via mypy -nodeenv==1.9.1 +nodeenv==1.10.0 # via pyright nox==2025.11.12 packaging==25.0 # via dependency-groups # via nox # via pytest -pathspec==0.12.1 +pathspec==1.0.3 # via mypy platformdirs==4.4.0 # via virtualenv @@ -115,13 +115,13 @@ python-dateutil==2.9.0.post0 # via time-machine respx==0.22.0 rich==14.2.0 -ruff==0.14.7 +ruff==0.14.13 six==1.17.0 # via python-dateutil sniffio==1.3.1 # via gradient time-machine==2.19.0 -tomli==2.3.0 +tomli==2.4.0 # via dependency-groups # via mypy # via nox @@ -141,7 +141,7 @@ typing-extensions==4.15.0 # via virtualenv typing-inspection==0.4.2 # via pydantic -virtualenv==20.35.4 +virtualenv==20.36.1 # via nox yarl==1.22.0 # via aiohttp diff --git a/requirements.lock b/requirements.lock index b2623a7b..b48c65ea 100644 --- a/requirements.lock +++ b/requirements.lock @@ -12,21 +12,21 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.13.2 +aiohttp==3.13.3 # via gradient # via httpx-aiohttp aiosignal==1.4.0 # via aiohttp annotated-types==0.7.0 # via pydantic -anyio==4.12.0 +anyio==4.12.1 # via gradient # via httpx async-timeout==5.0.1 # via aiohttp attrs==25.4.0 # via aiohttp -certifi==2025.11.12 +certifi==2026.1.4 # via httpcore # via httpx distro==1.9.0 @@ -43,7 +43,7 @@ httpcore==1.0.9 httpx==0.28.1 # via gradient # via httpx-aiohttp -httpx-aiohttp==0.1.9 +httpx-aiohttp==0.1.12 # via gradient idna==3.11 # via anyio diff --git a/src/gradient/_base_client.py b/src/gradient/_base_client.py index f038b215..e2135952 100644 --- a/src/gradient/_base_client.py +++ b/src/gradient/_base_client.py @@ -9,6 +9,7 @@ import inspect import logging import platform +import warnings import email.utils from types import TracebackType from random import random @@ -51,9 +52,11 @@ ResponseT, AnyMapping, PostParser, + BinaryTypes, RequestFiles, HttpxSendArgs, RequestOptions, + AsyncBinaryTypes, HttpxRequestFiles, ModelBuilderProtocol, not_given, @@ -83,6 +86,7 @@ APIConnectionError, APIResponseValidationError, ) +from ._utils._json import openapi_dumps log: logging.Logger = logging.getLogger(__name__) @@ -481,8 +485,19 @@ def _build_request( retries_taken: int = 0, ) -> httpx.Request: if log.isEnabledFor(logging.DEBUG): - log.debug("Request options: %s", model_dump(options, exclude_unset=True)) - + log.debug( + "Request options: %s", + model_dump( + options, + exclude_unset=True, + # Pydantic v1 can't dump every type we support in content, so we exclude it for now. + exclude={ + "content", + } + if PYDANTIC_V1 + else {}, + ), + ) kwargs: dict[str, Any] = {} json_data = options.json_data @@ -536,10 +551,18 @@ def _build_request( is_body_allowed = options.method.lower() != "get" if is_body_allowed: - if isinstance(json_data, bytes): + if options.content is not None and json_data is not None: + raise TypeError("Passing both `content` and `json_data` is not supported") + if options.content is not None and files is not None: + raise TypeError("Passing both `content` and `files` is not supported") + if options.content is not None: + kwargs["content"] = options.content + elif isinstance(json_data, bytes): kwargs["content"] = json_data - else: - kwargs["json"] = json_data if is_given(json_data) else None + elif not files: + # Don't set content when JSON is sent as multipart/form-data, + # since httpx's content param overrides other body arguments + kwargs["content"] = openapi_dumps(json_data) if is_given(json_data) and json_data is not None else None kwargs["files"] = files else: headers.pop("Content-Type", None) @@ -1210,6 +1233,7 @@ def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, files: RequestFiles | None = None, stream: Literal[False] = False, @@ -1222,6 +1246,7 @@ def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, files: RequestFiles | None = None, stream: Literal[True], @@ -1235,6 +1260,7 @@ def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, files: RequestFiles | None = None, stream: bool, @@ -1247,17 +1273,25 @@ def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, files: RequestFiles | None = None, stream: bool = False, stream_cls: type[_StreamT] | None = None, ) -> ResponseT | _StreamT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="post", - url=path, - json_data=body, - files=to_httpx_files(files), - **options, + method="post", url=path, json_data=body, content=content, files=to_httpx_files(files), **options ) return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) @@ -1267,11 +1301,23 @@ def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + method="patch", url=path, json_data=body, content=content, files=to_httpx_files(files), **options ) return self.request(cast_to, opts) @@ -1281,15 +1327,23 @@ def put( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="put", - url=path, - json_data=body, - files=to_httpx_files(files), - **options, + method="put", url=path, json_data=body, content=content, files=to_httpx_files(files), **options ) return self.request(cast_to, opts) @@ -1299,9 +1353,19 @@ def delete( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options) + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) + opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options) return self.request(cast_to, opts) def get_api_list( @@ -1751,6 +1815,7 @@ async def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, stream: Literal[False] = False, @@ -1763,6 +1828,7 @@ async def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, stream: Literal[True], @@ -1776,6 +1842,7 @@ async def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, stream: bool, @@ -1788,17 +1855,25 @@ async def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, stream: bool = False, stream_cls: type[_AsyncStreamT] | None = None, ) -> ResponseT | _AsyncStreamT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="post", - url=path, - json_data=body, - files=await async_to_httpx_files(files), - **options, + method="post", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options ) return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) @@ -1808,11 +1883,28 @@ async def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="patch", url=path, json_data=body, files=await async_to_httpx_files(files), **options + method="patch", + url=path, + json_data=body, + content=content, + files=await async_to_httpx_files(files), + **options, ) return await self.request(cast_to, opts) @@ -1822,15 +1914,23 @@ async def put( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="put", - url=path, - json_data=body, - files=await async_to_httpx_files(files), - **options, + method="put", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options ) return await self.request(cast_to, opts) @@ -1840,9 +1940,19 @@ async def delete( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options) + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) + opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options) return await self.request(cast_to, opts) def get_api_list( diff --git a/src/gradient/_client.py b/src/gradient/_client.py index fc58b291..18ef0c7a 100644 --- a/src/gradient/_client.py +++ b/src/gradient/_client.py @@ -34,26 +34,28 @@ if TYPE_CHECKING: from .resources import ( nfs, + apps, chat, agents, images, models, + billing, regions, retrieve, databases, inference, + responses, gpu_droplets, knowledge_bases, ) from .resources.images import ImagesResource, AsyncImagesResource + from .resources.billing import BillingResource, AsyncBillingResource from .resources.nfs.nfs import NfsResource, AsyncNfsResource from .resources.regions import RegionsResource, AsyncRegionsResource from .resources.retrieve import RetrieveResource, AsyncRetrieveResource + from .resources.apps.apps import AppsResource, AsyncAppsResource from .resources.chat.chat import ChatResource, AsyncChatResource - from .resources.gpu_droplets import ( - GPUDropletsResource, - AsyncGPUDropletsResource, - ) + from .resources.responses import ResponsesResource, AsyncResponsesResource from .resources.agents.agents import AgentsResource, AsyncAgentsResource from .resources.models.models import ModelsResource, AsyncModelsResource from .resources.databases.databases import DatabasesResource, AsyncDatabasesResource @@ -201,6 +203,12 @@ def images(self) -> ImagesResource: return ImagesResource(self) + @cached_property + def responses(self) -> ResponsesResource: + from .resources.responses import ResponsesResource + + return ResponsesResource(self) + @cached_property def gpu_droplets(self) -> GPUDropletsResource: from .resources.gpu_droplets import GPUDropletsResource @@ -249,6 +257,18 @@ def retrieve(self) -> RetrieveResource: return RetrieveResource(self) + @cached_property + def apps(self) -> AppsResource: + from .resources.apps import AppsResource + + return AppsResource(self) + + @cached_property + def billing(self) -> BillingResource: + from .resources.billing import BillingResource + + return BillingResource(self) + @cached_property def with_raw_response(self) -> GradientWithRawResponse: return GradientWithRawResponse(self) @@ -555,6 +575,12 @@ def images(self) -> AsyncImagesResource: return AsyncImagesResource(self) + @cached_property + def responses(self) -> AsyncResponsesResource: + from .resources.responses import AsyncResponsesResource + + return AsyncResponsesResource(self) + @cached_property def gpu_droplets(self) -> AsyncGPUDropletsResource: from .resources.gpu_droplets import AsyncGPUDropletsResource @@ -603,6 +629,18 @@ def retrieve(self) -> AsyncRetrieveResource: return AsyncRetrieveResource(self) + @cached_property + def apps(self) -> AsyncAppsResource: + from .resources.apps import AsyncAppsResource + + return AsyncAppsResource(self) + + @cached_property + def billing(self) -> AsyncBillingResource: + from .resources.billing import AsyncBillingResource + + return AsyncBillingResource(self) + @cached_property def with_raw_response(self) -> AsyncGradientWithRawResponse: return AsyncGradientWithRawResponse(self) @@ -807,6 +845,12 @@ def images(self) -> images.ImagesResourceWithRawResponse: return ImagesResourceWithRawResponse(self._client.images) + @cached_property + def responses(self) -> responses.ResponsesResourceWithRawResponse: + from .resources.responses import ResponsesResourceWithRawResponse + + return ResponsesResourceWithRawResponse(self._client.responses) + @cached_property def gpu_droplets(self) -> gpu_droplets.GPUDropletsResourceWithRawResponse: from .resources.gpu_droplets import GPUDropletsResourceWithRawResponse @@ -855,6 +899,18 @@ def retrieve(self) -> retrieve.RetrieveResourceWithRawResponse: return RetrieveResourceWithRawResponse(self._client.retrieve) + @cached_property + def apps(self) -> apps.AppsResourceWithRawResponse: + from .resources.apps import AppsResourceWithRawResponse + + return AppsResourceWithRawResponse(self._client.apps) + + @cached_property + def billing(self) -> billing.BillingResourceWithRawResponse: + from .resources.billing import BillingResourceWithRawResponse + + return BillingResourceWithRawResponse(self._client.billing) + class AsyncGradientWithRawResponse: _client: AsyncGradient @@ -880,6 +936,12 @@ def images(self) -> images.AsyncImagesResourceWithRawResponse: return AsyncImagesResourceWithRawResponse(self._client.images) + @cached_property + def responses(self) -> responses.AsyncResponsesResourceWithRawResponse: + from .resources.responses import AsyncResponsesResourceWithRawResponse + + return AsyncResponsesResourceWithRawResponse(self._client.responses) + @cached_property def gpu_droplets(self) -> gpu_droplets.AsyncGPUDropletsResourceWithRawResponse: from .resources.gpu_droplets import AsyncGPUDropletsResourceWithRawResponse @@ -932,6 +994,18 @@ def retrieve(self) -> retrieve.AsyncRetrieveResourceWithRawResponse: return AsyncRetrieveResourceWithRawResponse(self._client.retrieve) + @cached_property + def apps(self) -> apps.AsyncAppsResourceWithRawResponse: + from .resources.apps import AsyncAppsResourceWithRawResponse + + return AsyncAppsResourceWithRawResponse(self._client.apps) + + @cached_property + def billing(self) -> billing.AsyncBillingResourceWithRawResponse: + from .resources.billing import AsyncBillingResourceWithRawResponse + + return AsyncBillingResourceWithRawResponse(self._client.billing) + class GradientWithStreamedResponse: _client: Gradient @@ -957,6 +1031,12 @@ def images(self) -> images.ImagesResourceWithStreamingResponse: return ImagesResourceWithStreamingResponse(self._client.images) + @cached_property + def responses(self) -> responses.ResponsesResourceWithStreamingResponse: + from .resources.responses import ResponsesResourceWithStreamingResponse + + return ResponsesResourceWithStreamingResponse(self._client.responses) + @cached_property def gpu_droplets(self) -> gpu_droplets.GPUDropletsResourceWithStreamingResponse: from .resources.gpu_droplets import GPUDropletsResourceWithStreamingResponse @@ -1009,6 +1089,18 @@ def retrieve(self) -> retrieve.RetrieveResourceWithStreamingResponse: return RetrieveResourceWithStreamingResponse(self._client.retrieve) + @cached_property + def apps(self) -> apps.AppsResourceWithStreamingResponse: + from .resources.apps import AppsResourceWithStreamingResponse + + return AppsResourceWithStreamingResponse(self._client.apps) + + @cached_property + def billing(self) -> billing.BillingResourceWithStreamingResponse: + from .resources.billing import BillingResourceWithStreamingResponse + + return BillingResourceWithStreamingResponse(self._client.billing) + class AsyncGradientWithStreamedResponse: _client: AsyncGradient @@ -1034,6 +1126,12 @@ def images(self) -> images.AsyncImagesResourceWithStreamingResponse: return AsyncImagesResourceWithStreamingResponse(self._client.images) + @cached_property + def responses(self) -> responses.AsyncResponsesResourceWithStreamingResponse: + from .resources.responses import AsyncResponsesResourceWithStreamingResponse + + return AsyncResponsesResourceWithStreamingResponse(self._client.responses) + @cached_property def gpu_droplets( self, @@ -1090,6 +1188,18 @@ def retrieve(self) -> retrieve.AsyncRetrieveResourceWithStreamingResponse: return AsyncRetrieveResourceWithStreamingResponse(self._client.retrieve) + @cached_property + def apps(self) -> apps.AsyncAppsResourceWithStreamingResponse: + from .resources.apps import AsyncAppsResourceWithStreamingResponse + + return AsyncAppsResourceWithStreamingResponse(self._client.apps) + + @cached_property + def billing(self) -> billing.AsyncBillingResourceWithStreamingResponse: + from .resources.billing import AsyncBillingResourceWithStreamingResponse + + return AsyncBillingResourceWithStreamingResponse(self._client.billing) + Client = Gradient diff --git a/src/gradient/_compat.py b/src/gradient/_compat.py index bdef67f0..786ff42a 100644 --- a/src/gradient/_compat.py +++ b/src/gradient/_compat.py @@ -139,6 +139,7 @@ def model_dump( exclude_defaults: bool = False, warnings: bool = True, mode: Literal["json", "python"] = "python", + by_alias: bool | None = None, ) -> dict[str, Any]: if (not PYDANTIC_V1) or hasattr(model, "model_dump"): return model.model_dump( @@ -148,13 +149,12 @@ def model_dump( exclude_defaults=exclude_defaults, # warnings are not supported in Pydantic v1 warnings=True if PYDANTIC_V1 else warnings, + by_alias=by_alias, ) return cast( "dict[str, Any]", model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast] - exclude=exclude, - exclude_unset=exclude_unset, - exclude_defaults=exclude_defaults, + exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, by_alias=bool(by_alias) ), ) diff --git a/src/gradient/_models.py b/src/gradient/_models.py index ca9500b2..29070e05 100644 --- a/src/gradient/_models.py +++ b/src/gradient/_models.py @@ -3,7 +3,20 @@ import os import inspect import weakref -from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast +from typing import ( + IO, + TYPE_CHECKING, + Any, + Type, + Union, + Generic, + TypeVar, + Callable, + Iterable, + Optional, + AsyncIterable, + cast, +) from datetime import date, datetime from typing_extensions import ( List, @@ -787,6 +800,7 @@ class FinalRequestOptionsInput(TypedDict, total=False): timeout: float | Timeout | None files: HttpxRequestFiles | None idempotency_key: str + content: Union[bytes, bytearray, IO[bytes], Iterable[bytes], AsyncIterable[bytes], None] json_data: Body extra_json: AnyMapping follow_redirects: bool @@ -805,6 +819,7 @@ class FinalRequestOptions(pydantic.BaseModel): post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven() follow_redirects: Union[bool, None] = None + content: Union[bytes, bytearray, IO[bytes], Iterable[bytes], AsyncIterable[bytes], None] = None # It should be noted that we cannot use `json` here as that would override # a BaseModel method in an incompatible fashion. json_data: Union[Body, None] = None diff --git a/src/gradient/_types.py b/src/gradient/_types.py index 65831fee..338a463d 100644 --- a/src/gradient/_types.py +++ b/src/gradient/_types.py @@ -13,9 +13,11 @@ Mapping, TypeVar, Callable, + Iterable, Iterator, Optional, Sequence, + AsyncIterable, ) from typing_extensions import ( Set, @@ -56,6 +58,13 @@ else: Base64FileInput = Union[IO[bytes], PathLike] FileContent = Union[IO[bytes], bytes, PathLike] # PathLike is not subscriptable in Python 3.8. + + +# Used for sending raw binary data / streaming data in request bodies +# e.g. for file uploads without multipart encoding +BinaryTypes = Union[bytes, bytearray, IO[bytes], Iterable[bytes]] +AsyncBinaryTypes = Union[bytes, bytearray, IO[bytes], AsyncIterable[bytes]] + FileTypes = Union[ # file (or bytes) FileContent, diff --git a/src/gradient/_utils/_compat.py b/src/gradient/_utils/_compat.py index dd703233..2c70b299 100644 --- a/src/gradient/_utils/_compat.py +++ b/src/gradient/_utils/_compat.py @@ -26,7 +26,7 @@ def is_union(tp: Optional[Type[Any]]) -> bool: else: import types - return tp is Union or tp is types.UnionType + return tp is Union or tp is types.UnionType # type: ignore[comparison-overlap] def is_typeddict(tp: Type[Any]) -> bool: diff --git a/src/gradient/_utils/_json.py b/src/gradient/_utils/_json.py new file mode 100644 index 00000000..60584214 --- /dev/null +++ b/src/gradient/_utils/_json.py @@ -0,0 +1,35 @@ +import json +from typing import Any +from datetime import datetime +from typing_extensions import override + +import pydantic + +from .._compat import model_dump + + +def openapi_dumps(obj: Any) -> bytes: + """ + Serialize an object to UTF-8 encoded JSON bytes. + + Extends the standard json.dumps with support for additional types + commonly used in the SDK, such as `datetime`, `pydantic.BaseModel`, etc. + """ + return json.dumps( + obj, + cls=_CustomEncoder, + # Uses the same defaults as httpx's JSON serialization + ensure_ascii=False, + separators=(",", ":"), + allow_nan=False, + ).encode() + + +class _CustomEncoder(json.JSONEncoder): + @override + def default(self, o: Any) -> Any: + if isinstance(o, datetime): + return o.isoformat() + if isinstance(o, pydantic.BaseModel): + return model_dump(o, exclude_unset=True, mode="json", by_alias=True) + return super().default(o) diff --git a/src/gradient/resources/__init__.py b/src/gradient/resources/__init__.py index f668bb06..6f218273 100644 --- a/src/gradient/resources/__init__.py +++ b/src/gradient/resources/__init__.py @@ -8,6 +8,14 @@ NfsResourceWithStreamingResponse, AsyncNfsResourceWithStreamingResponse, ) +from .apps import ( + AppsResource, + AsyncAppsResource, + AppsResourceWithRawResponse, + AsyncAppsResourceWithRawResponse, + AppsResourceWithStreamingResponse, + AsyncAppsResourceWithStreamingResponse, +) from .chat import ( ChatResource, AsyncChatResource, @@ -40,6 +48,14 @@ ModelsResourceWithStreamingResponse, AsyncModelsResourceWithStreamingResponse, ) +from .billing import ( + BillingResource, + AsyncBillingResource, + BillingResourceWithRawResponse, + AsyncBillingResourceWithRawResponse, + BillingResourceWithStreamingResponse, + AsyncBillingResourceWithStreamingResponse, +) from .regions import ( RegionsResource, AsyncRegionsResource, @@ -72,6 +88,14 @@ InferenceResourceWithStreamingResponse, AsyncInferenceResourceWithStreamingResponse, ) +from .responses import ( + ResponsesResource, + AsyncResponsesResource, + ResponsesResourceWithRawResponse, + AsyncResponsesResourceWithRawResponse, + ResponsesResourceWithStreamingResponse, + AsyncResponsesResourceWithStreamingResponse, +) from .gpu_droplets import ( GPUDropletsResource, AsyncGPUDropletsResource, @@ -108,6 +132,12 @@ "AsyncImagesResourceWithRawResponse", "ImagesResourceWithStreamingResponse", "AsyncImagesResourceWithStreamingResponse", + "ResponsesResource", + "AsyncResponsesResource", + "ResponsesResourceWithRawResponse", + "AsyncResponsesResourceWithRawResponse", + "ResponsesResourceWithStreamingResponse", + "AsyncResponsesResourceWithStreamingResponse", "GPUDropletsResource", "AsyncGPUDropletsResource", "GPUDropletsResourceWithRawResponse", @@ -156,4 +186,16 @@ "AsyncRetrieveResourceWithRawResponse", "RetrieveResourceWithStreamingResponse", "AsyncRetrieveResourceWithStreamingResponse", + "AppsResource", + "AsyncAppsResource", + "AppsResourceWithRawResponse", + "AsyncAppsResourceWithRawResponse", + "AppsResourceWithStreamingResponse", + "AsyncAppsResourceWithStreamingResponse", + "BillingResource", + "AsyncBillingResource", + "BillingResourceWithRawResponse", + "AsyncBillingResourceWithRawResponse", + "BillingResourceWithStreamingResponse", + "AsyncBillingResourceWithStreamingResponse", ] diff --git a/src/gradient/resources/agents/evaluation_datasets.py b/src/gradient/resources/agents/evaluation_datasets.py index 0f9631ba..db9b473d 100644 --- a/src/gradient/resources/agents/evaluation_datasets.py +++ b/src/gradient/resources/agents/evaluation_datasets.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import Iterable +from typing_extensions import Literal import httpx @@ -53,6 +54,10 @@ def with_streaming_response(self) -> EvaluationDatasetsResourceWithStreamingResp def create( self, *, + dataset_type: Literal[ + "EVALUATION_DATASET_TYPE_UNKNOWN", "EVALUATION_DATASET_TYPE_ADK", "EVALUATION_DATASET_TYPE_NON_ADK" + ] + | Omit = omit, file_upload_dataset: APIFileUploadDataSourceParam | Omit = omit, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -85,6 +90,7 @@ def create( else "https://api.digitalocean.com/v2/gen-ai/evaluation_datasets", body=maybe_transform( { + "dataset_type": dataset_type, "file_upload_dataset": file_upload_dataset, "name": name, }, @@ -160,6 +166,10 @@ def with_streaming_response(self) -> AsyncEvaluationDatasetsResourceWithStreamin async def create( self, *, + dataset_type: Literal[ + "EVALUATION_DATASET_TYPE_UNKNOWN", "EVALUATION_DATASET_TYPE_ADK", "EVALUATION_DATASET_TYPE_NON_ADK" + ] + | Omit = omit, file_upload_dataset: APIFileUploadDataSourceParam | Omit = omit, name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -192,6 +202,7 @@ async def create( else "https://api.digitalocean.com/v2/gen-ai/evaluation_datasets", body=await async_maybe_transform( { + "dataset_type": dataset_type, "file_upload_dataset": file_upload_dataset, "name": name, }, diff --git a/src/gradient/resources/agents/evaluation_runs.py b/src/gradient/resources/agents/evaluation_runs.py index 8506b00f..2b5745af 100644 --- a/src/gradient/resources/agents/evaluation_runs.py +++ b/src/gradient/resources/agents/evaluation_runs.py @@ -47,6 +47,7 @@ def with_streaming_response(self) -> EvaluationRunsResourceWithStreamingResponse def create( self, *, + agent_deployment_names: SequenceNotStr[str] | Omit = omit, agent_uuids: SequenceNotStr[str] | Omit = omit, run_name: str | Omit = omit, test_case_uuid: str | Omit = omit, @@ -62,7 +63,9 @@ def create( `/v2/gen-ai/evaluation_runs`. Args: - agent_uuids: Agent UUIDs to run the test case against. + agent_deployment_names: Agent deployment names to run the test case against (ADK agent workspaces). + + agent_uuids: Agent UUIDs to run the test case against (legacy agents). run_name: The name of the run. @@ -82,6 +85,7 @@ def create( else "https://api.digitalocean.com/v2/gen-ai/evaluation_runs", body=maybe_transform( { + "agent_deployment_names": agent_deployment_names, "agent_uuids": agent_uuids, "run_name": run_name, "test_case_uuid": test_case_uuid, @@ -249,6 +253,7 @@ def with_streaming_response(self) -> AsyncEvaluationRunsResourceWithStreamingRes async def create( self, *, + agent_deployment_names: SequenceNotStr[str] | Omit = omit, agent_uuids: SequenceNotStr[str] | Omit = omit, run_name: str | Omit = omit, test_case_uuid: str | Omit = omit, @@ -264,7 +269,9 @@ async def create( `/v2/gen-ai/evaluation_runs`. Args: - agent_uuids: Agent UUIDs to run the test case against. + agent_deployment_names: Agent deployment names to run the test case against (ADK agent workspaces). + + agent_uuids: Agent UUIDs to run the test case against (legacy agents). run_name: The name of the run. @@ -284,6 +291,7 @@ async def create( else "https://api.digitalocean.com/v2/gen-ai/evaluation_runs", body=await async_maybe_transform( { + "agent_deployment_names": agent_deployment_names, "agent_uuids": agent_uuids, "run_name": run_name, "test_case_uuid": test_case_uuid, diff --git a/src/gradient/resources/agents/evaluation_test_cases.py b/src/gradient/resources/agents/evaluation_test_cases.py index d53b8c26..0e8cce03 100644 --- a/src/gradient/resources/agents/evaluation_test_cases.py +++ b/src/gradient/resources/agents/evaluation_test_cases.py @@ -56,6 +56,7 @@ def with_streaming_response(self) -> EvaluationTestCasesResourceWithStreamingRes def create( self, *, + agent_workspace_name: str | Omit = omit, dataset_uuid: str | Omit = omit, description: str | Omit = omit, metrics: SequenceNotStr[str] | Omit = omit, @@ -98,6 +99,7 @@ def create( else "https://api.digitalocean.com/v2/gen-ai/evaluation_test_cases", body=maybe_transform( { + "agent_workspace_name": agent_workspace_name, "dataset_uuid": dataset_uuid, "description": description, "metrics": metrics, @@ -318,6 +320,7 @@ def with_streaming_response(self) -> AsyncEvaluationTestCasesResourceWithStreami async def create( self, *, + agent_workspace_name: str | Omit = omit, dataset_uuid: str | Omit = omit, description: str | Omit = omit, metrics: SequenceNotStr[str] | Omit = omit, @@ -360,6 +363,7 @@ async def create( else "https://api.digitalocean.com/v2/gen-ai/evaluation_test_cases", body=await async_maybe_transform( { + "agent_workspace_name": agent_workspace_name, "dataset_uuid": dataset_uuid, "description": description, "metrics": metrics, diff --git a/src/gradient/resources/apps/__init__.py b/src/gradient/resources/apps/__init__.py new file mode 100644 index 00000000..3033a599 --- /dev/null +++ b/src/gradient/resources/apps/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .apps import ( + AppsResource, + AsyncAppsResource, + AppsResourceWithRawResponse, + AsyncAppsResourceWithRawResponse, + AppsResourceWithStreamingResponse, + AsyncAppsResourceWithStreamingResponse, +) +from .job_invocations import ( + JobInvocationsResource, + AsyncJobInvocationsResource, + JobInvocationsResourceWithRawResponse, + AsyncJobInvocationsResourceWithRawResponse, + JobInvocationsResourceWithStreamingResponse, + AsyncJobInvocationsResourceWithStreamingResponse, +) + +__all__ = [ + "JobInvocationsResource", + "AsyncJobInvocationsResource", + "JobInvocationsResourceWithRawResponse", + "AsyncJobInvocationsResourceWithRawResponse", + "JobInvocationsResourceWithStreamingResponse", + "AsyncJobInvocationsResourceWithStreamingResponse", + "AppsResource", + "AsyncAppsResource", + "AppsResourceWithRawResponse", + "AsyncAppsResourceWithRawResponse", + "AppsResourceWithStreamingResponse", + "AsyncAppsResourceWithStreamingResponse", +] diff --git a/src/gradient/resources/apps/apps.py b/src/gradient/resources/apps/apps.py new file mode 100644 index 00000000..889f2406 --- /dev/null +++ b/src/gradient/resources/apps/apps.py @@ -0,0 +1,102 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from .job_invocations import ( + JobInvocationsResource, + AsyncJobInvocationsResource, + JobInvocationsResourceWithRawResponse, + AsyncJobInvocationsResourceWithRawResponse, + JobInvocationsResourceWithStreamingResponse, + AsyncJobInvocationsResourceWithStreamingResponse, +) + +__all__ = ["AppsResource", "AsyncAppsResource"] + + +class AppsResource(SyncAPIResource): + @cached_property + def job_invocations(self) -> JobInvocationsResource: + return JobInvocationsResource(self._client) + + @cached_property + def with_raw_response(self) -> AppsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return AppsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AppsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return AppsResourceWithStreamingResponse(self) + + +class AsyncAppsResource(AsyncAPIResource): + @cached_property + def job_invocations(self) -> AsyncJobInvocationsResource: + return AsyncJobInvocationsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncAppsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return AsyncAppsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAppsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return AsyncAppsResourceWithStreamingResponse(self) + + +class AppsResourceWithRawResponse: + def __init__(self, apps: AppsResource) -> None: + self._apps = apps + + @cached_property + def job_invocations(self) -> JobInvocationsResourceWithRawResponse: + return JobInvocationsResourceWithRawResponse(self._apps.job_invocations) + + +class AsyncAppsResourceWithRawResponse: + def __init__(self, apps: AsyncAppsResource) -> None: + self._apps = apps + + @cached_property + def job_invocations(self) -> AsyncJobInvocationsResourceWithRawResponse: + return AsyncJobInvocationsResourceWithRawResponse(self._apps.job_invocations) + + +class AppsResourceWithStreamingResponse: + def __init__(self, apps: AppsResource) -> None: + self._apps = apps + + @cached_property + def job_invocations(self) -> JobInvocationsResourceWithStreamingResponse: + return JobInvocationsResourceWithStreamingResponse(self._apps.job_invocations) + + +class AsyncAppsResourceWithStreamingResponse: + def __init__(self, apps: AsyncAppsResource) -> None: + self._apps = apps + + @cached_property + def job_invocations(self) -> AsyncJobInvocationsResourceWithStreamingResponse: + return AsyncJobInvocationsResourceWithStreamingResponse(self._apps.job_invocations) diff --git a/src/gradient/resources/apps/job_invocations.py b/src/gradient/resources/apps/job_invocations.py new file mode 100644 index 00000000..449dd829 --- /dev/null +++ b/src/gradient/resources/apps/job_invocations.py @@ -0,0 +1,191 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +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 +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...types.apps import job_invocation_cancel_params +from ..._base_client import make_request_options +from ...types.apps.job_invocation_cancel_response import JobInvocationCancelResponse + +__all__ = ["JobInvocationsResource", "AsyncJobInvocationsResource"] + + +class JobInvocationsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> JobInvocationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return JobInvocationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> JobInvocationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return JobInvocationsResourceWithStreamingResponse(self) + + def cancel( + self, + job_invocation_id: str, + *, + app_id: str, + job_name: 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, + ) -> JobInvocationCancelResponse: + """ + Cancel a specific job invocation for an app. + + Args: + job_name: The job name to list job invocations for. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not app_id: + raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") + if not job_invocation_id: + raise ValueError(f"Expected a non-empty value for `job_invocation_id` but received {job_invocation_id!r}") + return self._post( + f"/v2/apps/{app_id}/job-invocations/{job_invocation_id}/cancel" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/apps/{app_id}/job-invocations/{job_invocation_id}/cancel", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"job_name": job_name}, job_invocation_cancel_params.JobInvocationCancelParams), + ), + cast_to=JobInvocationCancelResponse, + ) + + +class AsyncJobInvocationsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncJobInvocationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return AsyncJobInvocationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncJobInvocationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return AsyncJobInvocationsResourceWithStreamingResponse(self) + + async def cancel( + self, + job_invocation_id: str, + *, + app_id: str, + job_name: 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, + ) -> JobInvocationCancelResponse: + """ + Cancel a specific job invocation for an app. + + Args: + job_name: The job name to list job invocations for. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not app_id: + raise ValueError(f"Expected a non-empty value for `app_id` but received {app_id!r}") + if not job_invocation_id: + raise ValueError(f"Expected a non-empty value for `job_invocation_id` but received {job_invocation_id!r}") + return await self._post( + f"/v2/apps/{app_id}/job-invocations/{job_invocation_id}/cancel" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/apps/{app_id}/job-invocations/{job_invocation_id}/cancel", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + {"job_name": job_name}, job_invocation_cancel_params.JobInvocationCancelParams + ), + ), + cast_to=JobInvocationCancelResponse, + ) + + +class JobInvocationsResourceWithRawResponse: + def __init__(self, job_invocations: JobInvocationsResource) -> None: + self._job_invocations = job_invocations + + self.cancel = to_raw_response_wrapper( + job_invocations.cancel, + ) + + +class AsyncJobInvocationsResourceWithRawResponse: + def __init__(self, job_invocations: AsyncJobInvocationsResource) -> None: + self._job_invocations = job_invocations + + self.cancel = async_to_raw_response_wrapper( + job_invocations.cancel, + ) + + +class JobInvocationsResourceWithStreamingResponse: + def __init__(self, job_invocations: JobInvocationsResource) -> None: + self._job_invocations = job_invocations + + self.cancel = to_streamed_response_wrapper( + job_invocations.cancel, + ) + + +class AsyncJobInvocationsResourceWithStreamingResponse: + def __init__(self, job_invocations: AsyncJobInvocationsResource) -> None: + self._job_invocations = job_invocations + + self.cancel = async_to_streamed_response_wrapper( + job_invocations.cancel, + ) diff --git a/src/gradient/resources/billing.py b/src/gradient/resources/billing.py new file mode 100644 index 00000000..f9f42aad --- /dev/null +++ b/src/gradient/resources/billing.py @@ -0,0 +1,226 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import date + +import httpx + +from ..types import billing_list_insights_params +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 +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.billing_list_insights_response import BillingListInsightsResponse + +__all__ = ["BillingResource", "AsyncBillingResource"] + + +class BillingResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> BillingResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return BillingResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> BillingResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return BillingResourceWithStreamingResponse(self) + + def list_insights( + self, + end_date: Union[str, date], + *, + account_urn: str, + start_date: Union[str, date], + page: int | Omit = omit, + per_page: 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, + ) -> BillingListInsightsResponse: + """ + This endpoint returns day-over-day changes in billing resource usage based on + nightly invoice items, including total amount, region, SKU, and description for + a specified date range. It is important to note that the daily resource usage + may not reflect month-end billing totals when totaled for a given month as + nightly invoice item estimates do not necessarily encompass all invoicing + factors for the entire month. + + Args: + page: Which 'page' of paginated results to return. + + per_page: Number of items returned per page + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_urn: + raise ValueError(f"Expected a non-empty value for `account_urn` but received {account_urn!r}") + if not start_date: + raise ValueError(f"Expected a non-empty value for `start_date` but received {start_date!r}") + if not end_date: + raise ValueError(f"Expected a non-empty value for `end_date` but received {end_date!r}") + return self._get( + f"/v2/billing/{account_urn}/insights/{start_date}/{end_date}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/billing/{account_urn}/insights/{start_date}/{end_date}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + }, + billing_list_insights_params.BillingListInsightsParams, + ), + ), + cast_to=BillingListInsightsResponse, + ) + + +class AsyncBillingResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncBillingResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return AsyncBillingResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncBillingResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return AsyncBillingResourceWithStreamingResponse(self) + + async def list_insights( + self, + end_date: Union[str, date], + *, + account_urn: str, + start_date: Union[str, date], + page: int | Omit = omit, + per_page: 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, + ) -> BillingListInsightsResponse: + """ + This endpoint returns day-over-day changes in billing resource usage based on + nightly invoice items, including total amount, region, SKU, and description for + a specified date range. It is important to note that the daily resource usage + may not reflect month-end billing totals when totaled for a given month as + nightly invoice item estimates do not necessarily encompass all invoicing + factors for the entire month. + + Args: + page: Which 'page' of paginated results to return. + + per_page: Number of items returned per page + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not account_urn: + raise ValueError(f"Expected a non-empty value for `account_urn` but received {account_urn!r}") + if not start_date: + raise ValueError(f"Expected a non-empty value for `start_date` but received {start_date!r}") + if not end_date: + raise ValueError(f"Expected a non-empty value for `end_date` but received {end_date!r}") + return await self._get( + f"/v2/billing/{account_urn}/insights/{start_date}/{end_date}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/billing/{account_urn}/insights/{start_date}/{end_date}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "page": page, + "per_page": per_page, + }, + billing_list_insights_params.BillingListInsightsParams, + ), + ), + cast_to=BillingListInsightsResponse, + ) + + +class BillingResourceWithRawResponse: + def __init__(self, billing: BillingResource) -> None: + self._billing = billing + + self.list_insights = to_raw_response_wrapper( + billing.list_insights, + ) + + +class AsyncBillingResourceWithRawResponse: + def __init__(self, billing: AsyncBillingResource) -> None: + self._billing = billing + + self.list_insights = async_to_raw_response_wrapper( + billing.list_insights, + ) + + +class BillingResourceWithStreamingResponse: + def __init__(self, billing: BillingResource) -> None: + self._billing = billing + + self.list_insights = to_streamed_response_wrapper( + billing.list_insights, + ) + + +class AsyncBillingResourceWithStreamingResponse: + def __init__(self, billing: AsyncBillingResource) -> None: + self._billing = billing + + self.list_insights = async_to_streamed_response_wrapper( + billing.list_insights, + ) diff --git a/src/gradient/resources/knowledge_bases/data_sources.py b/src/gradient/resources/knowledge_bases/data_sources.py index a00d93f5..6c339108 100644 --- a/src/gradient/resources/knowledge_bases/data_sources.py +++ b/src/gradient/resources/knowledge_bases/data_sources.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import Iterable +from typing_extensions import Literal import httpx @@ -20,12 +21,14 @@ from ...types.knowledge_bases import ( data_source_list_params, data_source_create_params, + data_source_update_params, data_source_create_presigned_urls_params, ) from ...types.knowledge_bases.aws_data_source_param import AwsDataSourceParam from ...types.knowledge_bases.data_source_list_response import DataSourceListResponse from ...types.knowledge_bases.data_source_create_response import DataSourceCreateResponse from ...types.knowledge_bases.data_source_delete_response import DataSourceDeleteResponse +from ...types.knowledge_bases.data_source_update_response import DataSourceUpdateResponse from ...types.knowledge_bases.api_spaces_data_source_param import APISpacesDataSourceParam from ...types.knowledge_bases.api_web_crawler_data_source_param import APIWebCrawlerDataSourceParam from ...types.knowledge_bases.data_source_create_presigned_urls_response import DataSourceCreatePresignedURLsResponse @@ -58,6 +61,15 @@ def create( path_knowledge_base_uuid: str, *, aws_data_source: AwsDataSourceParam | Omit = omit, + chunking_algorithm: Literal[ + "CHUNKING_ALGORITHM_UNKNOWN", + "CHUNKING_ALGORITHM_SECTION_BASED", + "CHUNKING_ALGORITHM_HIERARCHICAL", + "CHUNKING_ALGORITHM_SEMANTIC", + "CHUNKING_ALGORITHM_FIXED_LENGTH", + ] + | Omit = omit, + chunking_options: data_source_create_params.ChunkingOptions | Omit = omit, body_knowledge_base_uuid: str | Omit = omit, spaces_data_source: APISpacesDataSourceParam | Omit = omit, web_crawler_data_source: APIWebCrawlerDataSourceParam | Omit = omit, @@ -75,6 +87,16 @@ def create( Args: aws_data_source: AWS S3 Data Source + chunking_algorithm: The chunking algorithm to use for processing data sources. + + **Note: This feature requires enabling the knowledgebase enhancements feature + preview flag.** + + chunking_options: Configuration options for the chunking algorithm. + + **Note: This feature requires enabling the knowledgebase enhancements feature + preview flag.** + body_knowledge_base_uuid: Knowledge base id spaces_data_source: Spaces Bucket Data Source @@ -100,6 +122,8 @@ def create( body=maybe_transform( { "aws_data_source": aws_data_source, + "chunking_algorithm": chunking_algorithm, + "chunking_options": chunking_options, "body_knowledge_base_uuid": body_knowledge_base_uuid, "spaces_data_source": spaces_data_source, "web_crawler_data_source": web_crawler_data_source, @@ -112,6 +136,84 @@ def create( cast_to=DataSourceCreateResponse, ) + def update( + self, + path_data_source_uuid: str, + *, + path_knowledge_base_uuid: str, + chunking_algorithm: Literal[ + "CHUNKING_ALGORITHM_UNKNOWN", + "CHUNKING_ALGORITHM_SECTION_BASED", + "CHUNKING_ALGORITHM_HIERARCHICAL", + "CHUNKING_ALGORITHM_SEMANTIC", + "CHUNKING_ALGORITHM_FIXED_LENGTH", + ] + | Omit = omit, + chunking_options: data_source_update_params.ChunkingOptions | Omit = omit, + body_data_source_uuid: str | Omit = omit, + body_knowledge_base_uuid: 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, + ) -> DataSourceUpdateResponse: + """To update a data source (e.g. + + chunking options), send a PUT request to + `/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources/{data_source_uuid}`. + + Args: + chunking_algorithm: The chunking algorithm to use for processing data sources. + + **Note: This feature requires enabling the knowledgebase enhancements feature + preview flag.** + + chunking_options: Configuration options for the chunking algorithm. + + **Note: This feature requires enabling the knowledgebase enhancements feature + preview flag.** + + body_data_source_uuid: Data Source ID (Path Parameter) + + body_knowledge_base_uuid: Knowledge Base ID (Path Parameter) + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not path_knowledge_base_uuid: + raise ValueError( + f"Expected a non-empty value for `path_knowledge_base_uuid` but received {path_knowledge_base_uuid!r}" + ) + if not path_data_source_uuid: + raise ValueError( + f"Expected a non-empty value for `path_data_source_uuid` but received {path_data_source_uuid!r}" + ) + return self._put( + f"/v2/gen-ai/knowledge_bases/{path_knowledge_base_uuid}/data_sources/{path_data_source_uuid}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/gen-ai/knowledge_bases/{path_knowledge_base_uuid}/data_sources/{path_data_source_uuid}", + body=maybe_transform( + { + "chunking_algorithm": chunking_algorithm, + "chunking_options": chunking_options, + "body_data_source_uuid": body_data_source_uuid, + "body_knowledge_base_uuid": body_knowledge_base_uuid, + }, + data_source_update_params.DataSourceUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DataSourceUpdateResponse, + ) + def list( self, knowledge_base_uuid: str, @@ -272,6 +374,15 @@ async def create( path_knowledge_base_uuid: str, *, aws_data_source: AwsDataSourceParam | Omit = omit, + chunking_algorithm: Literal[ + "CHUNKING_ALGORITHM_UNKNOWN", + "CHUNKING_ALGORITHM_SECTION_BASED", + "CHUNKING_ALGORITHM_HIERARCHICAL", + "CHUNKING_ALGORITHM_SEMANTIC", + "CHUNKING_ALGORITHM_FIXED_LENGTH", + ] + | Omit = omit, + chunking_options: data_source_create_params.ChunkingOptions | Omit = omit, body_knowledge_base_uuid: str | Omit = omit, spaces_data_source: APISpacesDataSourceParam | Omit = omit, web_crawler_data_source: APIWebCrawlerDataSourceParam | Omit = omit, @@ -289,6 +400,16 @@ async def create( Args: aws_data_source: AWS S3 Data Source + chunking_algorithm: The chunking algorithm to use for processing data sources. + + **Note: This feature requires enabling the knowledgebase enhancements feature + preview flag.** + + chunking_options: Configuration options for the chunking algorithm. + + **Note: This feature requires enabling the knowledgebase enhancements feature + preview flag.** + body_knowledge_base_uuid: Knowledge base id spaces_data_source: Spaces Bucket Data Source @@ -314,6 +435,8 @@ async def create( body=await async_maybe_transform( { "aws_data_source": aws_data_source, + "chunking_algorithm": chunking_algorithm, + "chunking_options": chunking_options, "body_knowledge_base_uuid": body_knowledge_base_uuid, "spaces_data_source": spaces_data_source, "web_crawler_data_source": web_crawler_data_source, @@ -326,6 +449,84 @@ async def create( cast_to=DataSourceCreateResponse, ) + async def update( + self, + path_data_source_uuid: str, + *, + path_knowledge_base_uuid: str, + chunking_algorithm: Literal[ + "CHUNKING_ALGORITHM_UNKNOWN", + "CHUNKING_ALGORITHM_SECTION_BASED", + "CHUNKING_ALGORITHM_HIERARCHICAL", + "CHUNKING_ALGORITHM_SEMANTIC", + "CHUNKING_ALGORITHM_FIXED_LENGTH", + ] + | Omit = omit, + chunking_options: data_source_update_params.ChunkingOptions | Omit = omit, + body_data_source_uuid: str | Omit = omit, + body_knowledge_base_uuid: 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, + ) -> DataSourceUpdateResponse: + """To update a data source (e.g. + + chunking options), send a PUT request to + `/v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources/{data_source_uuid}`. + + Args: + chunking_algorithm: The chunking algorithm to use for processing data sources. + + **Note: This feature requires enabling the knowledgebase enhancements feature + preview flag.** + + chunking_options: Configuration options for the chunking algorithm. + + **Note: This feature requires enabling the knowledgebase enhancements feature + preview flag.** + + body_data_source_uuid: Data Source ID (Path Parameter) + + body_knowledge_base_uuid: Knowledge Base ID (Path Parameter) + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not path_knowledge_base_uuid: + raise ValueError( + f"Expected a non-empty value for `path_knowledge_base_uuid` but received {path_knowledge_base_uuid!r}" + ) + if not path_data_source_uuid: + raise ValueError( + f"Expected a non-empty value for `path_data_source_uuid` but received {path_data_source_uuid!r}" + ) + return await self._put( + f"/v2/gen-ai/knowledge_bases/{path_knowledge_base_uuid}/data_sources/{path_data_source_uuid}" + if self._client._base_url_overridden + else f"https://api.digitalocean.com/v2/gen-ai/knowledge_bases/{path_knowledge_base_uuid}/data_sources/{path_data_source_uuid}", + body=await async_maybe_transform( + { + "chunking_algorithm": chunking_algorithm, + "chunking_options": chunking_options, + "body_data_source_uuid": body_data_source_uuid, + "body_knowledge_base_uuid": body_knowledge_base_uuid, + }, + data_source_update_params.DataSourceUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DataSourceUpdateResponse, + ) + async def list( self, knowledge_base_uuid: str, @@ -468,6 +669,9 @@ def __init__(self, data_sources: DataSourcesResource) -> None: self.create = to_raw_response_wrapper( data_sources.create, ) + self.update = to_raw_response_wrapper( + data_sources.update, + ) self.list = to_raw_response_wrapper( data_sources.list, ) @@ -486,6 +690,9 @@ def __init__(self, data_sources: AsyncDataSourcesResource) -> None: self.create = async_to_raw_response_wrapper( data_sources.create, ) + self.update = async_to_raw_response_wrapper( + data_sources.update, + ) self.list = async_to_raw_response_wrapper( data_sources.list, ) @@ -504,6 +711,9 @@ def __init__(self, data_sources: DataSourcesResource) -> None: self.create = to_streamed_response_wrapper( data_sources.create, ) + self.update = to_streamed_response_wrapper( + data_sources.update, + ) self.list = to_streamed_response_wrapper( data_sources.list, ) @@ -522,6 +732,9 @@ def __init__(self, data_sources: AsyncDataSourcesResource) -> None: self.create = async_to_streamed_response_wrapper( data_sources.create, ) + self.update = async_to_streamed_response_wrapper( + data_sources.update, + ) self.list = async_to_streamed_response_wrapper( data_sources.list, ) diff --git a/src/gradient/resources/responses.py b/src/gradient/resources/responses.py new file mode 100644 index 00000000..a342a78d --- /dev/null +++ b/src/gradient/resources/responses.py @@ -0,0 +1,860 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, List, Union, Iterable, Optional +from typing_extensions import Literal, overload + +import httpx + +from ..types import response_create_params +from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given +from .._utils import required_args, maybe_transform, async_maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._streaming import Stream, AsyncStream +from .._base_client import make_request_options +from ..types.shared.create_response_response import CreateResponseResponse +from ..types.shared.create_response_stream_response import CreateResponseStreamResponse + +__all__ = ["ResponsesResource", "AsyncResponsesResource"] + + +class ResponsesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ResponsesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return ResponsesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ResponsesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return ResponsesResourceWithStreamingResponse(self) + + @overload + def create( + self, + *, + input: Union[str, Iterable[response_create_params.InputUnionMember1]], + model: str, + instructions: Optional[str] | Omit = omit, + max_output_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + modalities: Optional[List[Literal["text"]]] | Omit = omit, + parallel_tool_calls: Optional[bool] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream: Optional[Literal[False]] | Omit = omit, + stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: response_create_params.ToolChoice | Omit = omit, + tools: Iterable[response_create_params.Tool] | Omit = omit, + top_p: Optional[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, + ) -> CreateResponseResponse: + """Generate text responses from text prompts. + + This endpoint supports both streaming + and non-streaming responses for VLLM models only. + + Args: + input: The input text prompt or conversation history. Can be a string or an array of + message objects for conversation context. + + model: Model ID used to generate the response. Must be a VLLM model. + + instructions: System-level instructions for the model. This sets the behavior and context for + the response generation. + + max_output_tokens: Maximum number of tokens to generate in the response. If not specified, the + model will use a default value. + + max_tokens: The maximum number of tokens that can be generated in the completion. Alias for + max_output_tokens for compatibility. + + metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful + for storing additional information about the object in a structured format, and + querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + + modalities: Specifies the output types the model should generate. For text-to-text, this + should be ["text"]. + + parallel_tool_calls: Whether to enable parallel tool calls. When true, the model can make multiple + tool calls in parallel. + + stop: Up to 4 sequences where the API will stop generating further tokens. The + returned text will not contain the stop sequence. + + stream: If set to true, the model response data will be streamed to the client as it is + generated using server-sent events. + + stream_options: Options for streaming response. Only set this when you set `stream: true`. + + temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + make the output more random, while lower values like 0.2 will make it more + focused and deterministic. We generally recommend altering this or `top_p` but + not both. + + tool_choice: Controls which (if any) tool is called by the model. `none` means the model will + not call any tool and instead generates a message. `auto` means the model can + pick between generating a message or calling one or more tools. `required` means + the model must call one or more tools. Specifying a particular tool via + `{"type": "function", "function": {"name": "my_function"}}` forces the model to + call that tool. + + `none` is the default when no tools are present. `auto` is the default if tools + are present. + + tools: A list of tools the model may call. Currently, only functions are supported as a + tool. Uses Responses API format (with `name`, `description`, `parameters` at top + level). + + top_p: An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 + means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or `temperature` but not both. + + user: A unique identifier representing your end-user, which can help DigitalOcean to + monitor and detect abuse. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def create( + self, + *, + input: Union[str, Iterable[response_create_params.InputUnionMember1]], + model: str, + stream: Literal[True], + instructions: Optional[str] | Omit = omit, + max_output_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + modalities: Optional[List[Literal["text"]]] | Omit = omit, + parallel_tool_calls: Optional[bool] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: response_create_params.ToolChoice | Omit = omit, + tools: Iterable[response_create_params.Tool] | Omit = omit, + top_p: Optional[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, + ) -> Stream[CreateResponseStreamResponse]: + """Generate text responses from text prompts. + + This endpoint supports both streaming + and non-streaming responses for VLLM models only. + + Args: + input: The input text prompt or conversation history. Can be a string or an array of + message objects for conversation context. + + model: Model ID used to generate the response. Must be a VLLM model. + + stream: If set to true, the model response data will be streamed to the client as it is + generated using server-sent events. + + instructions: System-level instructions for the model. This sets the behavior and context for + the response generation. + + max_output_tokens: Maximum number of tokens to generate in the response. If not specified, the + model will use a default value. + + max_tokens: The maximum number of tokens that can be generated in the completion. Alias for + max_output_tokens for compatibility. + + metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful + for storing additional information about the object in a structured format, and + querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + + modalities: Specifies the output types the model should generate. For text-to-text, this + should be ["text"]. + + parallel_tool_calls: Whether to enable parallel tool calls. When true, the model can make multiple + tool calls in parallel. + + stop: Up to 4 sequences where the API will stop generating further tokens. The + returned text will not contain the stop sequence. + + stream_options: Options for streaming response. Only set this when you set `stream: true`. + + temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + make the output more random, while lower values like 0.2 will make it more + focused and deterministic. We generally recommend altering this or `top_p` but + not both. + + tool_choice: Controls which (if any) tool is called by the model. `none` means the model will + not call any tool and instead generates a message. `auto` means the model can + pick between generating a message or calling one or more tools. `required` means + the model must call one or more tools. Specifying a particular tool via + `{"type": "function", "function": {"name": "my_function"}}` forces the model to + call that tool. + + `none` is the default when no tools are present. `auto` is the default if tools + are present. + + tools: A list of tools the model may call. Currently, only functions are supported as a + tool. Uses Responses API format (with `name`, `description`, `parameters` at top + level). + + top_p: An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 + means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or `temperature` but not both. + + user: A unique identifier representing your end-user, which can help DigitalOcean to + monitor and detect abuse. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def create( + self, + *, + input: Union[str, Iterable[response_create_params.InputUnionMember1]], + model: str, + stream: bool, + instructions: Optional[str] | Omit = omit, + max_output_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + modalities: Optional[List[Literal["text"]]] | Omit = omit, + parallel_tool_calls: Optional[bool] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: response_create_params.ToolChoice | Omit = omit, + tools: Iterable[response_create_params.Tool] | Omit = omit, + top_p: Optional[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, + ) -> CreateResponseResponse | Stream[CreateResponseStreamResponse]: + """Generate text responses from text prompts. + + This endpoint supports both streaming + and non-streaming responses for VLLM models only. + + Args: + input: The input text prompt or conversation history. Can be a string or an array of + message objects for conversation context. + + model: Model ID used to generate the response. Must be a VLLM model. + + stream: If set to true, the model response data will be streamed to the client as it is + generated using server-sent events. + + instructions: System-level instructions for the model. This sets the behavior and context for + the response generation. + + max_output_tokens: Maximum number of tokens to generate in the response. If not specified, the + model will use a default value. + + max_tokens: The maximum number of tokens that can be generated in the completion. Alias for + max_output_tokens for compatibility. + + metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful + for storing additional information about the object in a structured format, and + querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + + modalities: Specifies the output types the model should generate. For text-to-text, this + should be ["text"]. + + parallel_tool_calls: Whether to enable parallel tool calls. When true, the model can make multiple + tool calls in parallel. + + stop: Up to 4 sequences where the API will stop generating further tokens. The + returned text will not contain the stop sequence. + + stream_options: Options for streaming response. Only set this when you set `stream: true`. + + temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + make the output more random, while lower values like 0.2 will make it more + focused and deterministic. We generally recommend altering this or `top_p` but + not both. + + tool_choice: Controls which (if any) tool is called by the model. `none` means the model will + not call any tool and instead generates a message. `auto` means the model can + pick between generating a message or calling one or more tools. `required` means + the model must call one or more tools. Specifying a particular tool via + `{"type": "function", "function": {"name": "my_function"}}` forces the model to + call that tool. + + `none` is the default when no tools are present. `auto` is the default if tools + are present. + + tools: A list of tools the model may call. Currently, only functions are supported as a + tool. Uses Responses API format (with `name`, `description`, `parameters` at top + level). + + top_p: An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 + means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or `temperature` but not both. + + user: A unique identifier representing your end-user, which can help DigitalOcean to + monitor and detect abuse. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["input", "model"], ["input", "model", "stream"]) + def create( + self, + *, + input: Union[str, Iterable[response_create_params.InputUnionMember1]], + model: str, + instructions: Optional[str] | Omit = omit, + max_output_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + modalities: Optional[List[Literal["text"]]] | Omit = omit, + parallel_tool_calls: Optional[bool] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream: Optional[Literal[False]] | Literal[True] | Omit = omit, + stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: response_create_params.ToolChoice | Omit = omit, + tools: Iterable[response_create_params.Tool] | Omit = omit, + top_p: Optional[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, + ) -> CreateResponseResponse | Stream[CreateResponseStreamResponse]: + return self._post( + "/responses", + body=maybe_transform( + { + "input": input, + "model": model, + "instructions": instructions, + "max_output_tokens": max_output_tokens, + "max_tokens": max_tokens, + "metadata": metadata, + "modalities": modalities, + "parallel_tool_calls": parallel_tool_calls, + "stop": stop, + "stream": stream, + "stream_options": stream_options, + "temperature": temperature, + "tool_choice": tool_choice, + "tools": tools, + "top_p": top_p, + "user": user, + }, + response_create_params.ResponseCreateParamsStreaming + if stream + else response_create_params.ResponseCreateParamsNonStreaming, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CreateResponseResponse, + stream=stream or False, + stream_cls=Stream[CreateResponseStreamResponse], + ) + + +class AsyncResponsesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncResponsesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/digitalocean/gradient-python#accessing-raw-response-data-eg-headers + """ + return AsyncResponsesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncResponsesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/digitalocean/gradient-python#with_streaming_response + """ + return AsyncResponsesResourceWithStreamingResponse(self) + + @overload + async def create( + self, + *, + input: Union[str, Iterable[response_create_params.InputUnionMember1]], + model: str, + instructions: Optional[str] | Omit = omit, + max_output_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + modalities: Optional[List[Literal["text"]]] | Omit = omit, + parallel_tool_calls: Optional[bool] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream: Optional[Literal[False]] | Omit = omit, + stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: response_create_params.ToolChoice | Omit = omit, + tools: Iterable[response_create_params.Tool] | Omit = omit, + top_p: Optional[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, + ) -> CreateResponseResponse: + """Generate text responses from text prompts. + + This endpoint supports both streaming + and non-streaming responses for VLLM models only. + + Args: + input: The input text prompt or conversation history. Can be a string or an array of + message objects for conversation context. + + model: Model ID used to generate the response. Must be a VLLM model. + + instructions: System-level instructions for the model. This sets the behavior and context for + the response generation. + + max_output_tokens: Maximum number of tokens to generate in the response. If not specified, the + model will use a default value. + + max_tokens: The maximum number of tokens that can be generated in the completion. Alias for + max_output_tokens for compatibility. + + metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful + for storing additional information about the object in a structured format, and + querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + + modalities: Specifies the output types the model should generate. For text-to-text, this + should be ["text"]. + + parallel_tool_calls: Whether to enable parallel tool calls. When true, the model can make multiple + tool calls in parallel. + + stop: Up to 4 sequences where the API will stop generating further tokens. The + returned text will not contain the stop sequence. + + stream: If set to true, the model response data will be streamed to the client as it is + generated using server-sent events. + + stream_options: Options for streaming response. Only set this when you set `stream: true`. + + temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + make the output more random, while lower values like 0.2 will make it more + focused and deterministic. We generally recommend altering this or `top_p` but + not both. + + tool_choice: Controls which (if any) tool is called by the model. `none` means the model will + not call any tool and instead generates a message. `auto` means the model can + pick between generating a message or calling one or more tools. `required` means + the model must call one or more tools. Specifying a particular tool via + `{"type": "function", "function": {"name": "my_function"}}` forces the model to + call that tool. + + `none` is the default when no tools are present. `auto` is the default if tools + are present. + + tools: A list of tools the model may call. Currently, only functions are supported as a + tool. Uses Responses API format (with `name`, `description`, `parameters` at top + level). + + top_p: An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 + means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or `temperature` but not both. + + user: A unique identifier representing your end-user, which can help DigitalOcean to + monitor and detect abuse. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def create( + self, + *, + input: Union[str, Iterable[response_create_params.InputUnionMember1]], + model: str, + stream: Literal[True], + instructions: Optional[str] | Omit = omit, + max_output_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + modalities: Optional[List[Literal["text"]]] | Omit = omit, + parallel_tool_calls: Optional[bool] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: response_create_params.ToolChoice | Omit = omit, + tools: Iterable[response_create_params.Tool] | Omit = omit, + top_p: Optional[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, + ) -> AsyncStream[CreateResponseStreamResponse]: + """Generate text responses from text prompts. + + This endpoint supports both streaming + and non-streaming responses for VLLM models only. + + Args: + input: The input text prompt or conversation history. Can be a string or an array of + message objects for conversation context. + + model: Model ID used to generate the response. Must be a VLLM model. + + stream: If set to true, the model response data will be streamed to the client as it is + generated using server-sent events. + + instructions: System-level instructions for the model. This sets the behavior and context for + the response generation. + + max_output_tokens: Maximum number of tokens to generate in the response. If not specified, the + model will use a default value. + + max_tokens: The maximum number of tokens that can be generated in the completion. Alias for + max_output_tokens for compatibility. + + metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful + for storing additional information about the object in a structured format, and + querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + + modalities: Specifies the output types the model should generate. For text-to-text, this + should be ["text"]. + + parallel_tool_calls: Whether to enable parallel tool calls. When true, the model can make multiple + tool calls in parallel. + + stop: Up to 4 sequences where the API will stop generating further tokens. The + returned text will not contain the stop sequence. + + stream_options: Options for streaming response. Only set this when you set `stream: true`. + + temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + make the output more random, while lower values like 0.2 will make it more + focused and deterministic. We generally recommend altering this or `top_p` but + not both. + + tool_choice: Controls which (if any) tool is called by the model. `none` means the model will + not call any tool and instead generates a message. `auto` means the model can + pick between generating a message or calling one or more tools. `required` means + the model must call one or more tools. Specifying a particular tool via + `{"type": "function", "function": {"name": "my_function"}}` forces the model to + call that tool. + + `none` is the default when no tools are present. `auto` is the default if tools + are present. + + tools: A list of tools the model may call. Currently, only functions are supported as a + tool. Uses Responses API format (with `name`, `description`, `parameters` at top + level). + + top_p: An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 + means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or `temperature` but not both. + + user: A unique identifier representing your end-user, which can help DigitalOcean to + monitor and detect abuse. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def create( + self, + *, + input: Union[str, Iterable[response_create_params.InputUnionMember1]], + model: str, + stream: bool, + instructions: Optional[str] | Omit = omit, + max_output_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + modalities: Optional[List[Literal["text"]]] | Omit = omit, + parallel_tool_calls: Optional[bool] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: response_create_params.ToolChoice | Omit = omit, + tools: Iterable[response_create_params.Tool] | Omit = omit, + top_p: Optional[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, + ) -> CreateResponseResponse | AsyncStream[CreateResponseStreamResponse]: + """Generate text responses from text prompts. + + This endpoint supports both streaming + and non-streaming responses for VLLM models only. + + Args: + input: The input text prompt or conversation history. Can be a string or an array of + message objects for conversation context. + + model: Model ID used to generate the response. Must be a VLLM model. + + stream: If set to true, the model response data will be streamed to the client as it is + generated using server-sent events. + + instructions: System-level instructions for the model. This sets the behavior and context for + the response generation. + + max_output_tokens: Maximum number of tokens to generate in the response. If not specified, the + model will use a default value. + + max_tokens: The maximum number of tokens that can be generated in the completion. Alias for + max_output_tokens for compatibility. + + metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful + for storing additional information about the object in a structured format, and + querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + + modalities: Specifies the output types the model should generate. For text-to-text, this + should be ["text"]. + + parallel_tool_calls: Whether to enable parallel tool calls. When true, the model can make multiple + tool calls in parallel. + + stop: Up to 4 sequences where the API will stop generating further tokens. The + returned text will not contain the stop sequence. + + stream_options: Options for streaming response. Only set this when you set `stream: true`. + + temperature: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + make the output more random, while lower values like 0.2 will make it more + focused and deterministic. We generally recommend altering this or `top_p` but + not both. + + tool_choice: Controls which (if any) tool is called by the model. `none` means the model will + not call any tool and instead generates a message. `auto` means the model can + pick between generating a message or calling one or more tools. `required` means + the model must call one or more tools. Specifying a particular tool via + `{"type": "function", "function": {"name": "my_function"}}` forces the model to + call that tool. + + `none` is the default when no tools are present. `auto` is the default if tools + are present. + + tools: A list of tools the model may call. Currently, only functions are supported as a + tool. Uses Responses API format (with `name`, `description`, `parameters` at top + level). + + top_p: An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 + means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or `temperature` but not both. + + user: A unique identifier representing your end-user, which can help DigitalOcean to + monitor and detect abuse. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @required_args(["input", "model"], ["input", "model", "stream"]) + async def create( + self, + *, + input: Union[str, Iterable[response_create_params.InputUnionMember1]], + model: str, + instructions: Optional[str] | Omit = omit, + max_output_tokens: Optional[int] | Omit = omit, + max_tokens: Optional[int] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + modalities: Optional[List[Literal["text"]]] | Omit = omit, + parallel_tool_calls: Optional[bool] | Omit = omit, + stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, + stream: Optional[Literal[False]] | Literal[True] | Omit = omit, + stream_options: Optional[response_create_params.StreamOptions] | Omit = omit, + temperature: Optional[float] | Omit = omit, + tool_choice: response_create_params.ToolChoice | Omit = omit, + tools: Iterable[response_create_params.Tool] | Omit = omit, + top_p: Optional[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, + ) -> CreateResponseResponse | AsyncStream[CreateResponseStreamResponse]: + return await self._post( + "/responses", + body=await async_maybe_transform( + { + "input": input, + "model": model, + "instructions": instructions, + "max_output_tokens": max_output_tokens, + "max_tokens": max_tokens, + "metadata": metadata, + "modalities": modalities, + "parallel_tool_calls": parallel_tool_calls, + "stop": stop, + "stream": stream, + "stream_options": stream_options, + "temperature": temperature, + "tool_choice": tool_choice, + "tools": tools, + "top_p": top_p, + "user": user, + }, + response_create_params.ResponseCreateParamsStreaming + if stream + else response_create_params.ResponseCreateParamsNonStreaming, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CreateResponseResponse, + stream=stream or False, + stream_cls=AsyncStream[CreateResponseStreamResponse], + ) + + +class ResponsesResourceWithRawResponse: + def __init__(self, responses: ResponsesResource) -> None: + self._responses = responses + + self.create = to_raw_response_wrapper( + responses.create, + ) + + +class AsyncResponsesResourceWithRawResponse: + def __init__(self, responses: AsyncResponsesResource) -> None: + self._responses = responses + + self.create = async_to_raw_response_wrapper( + responses.create, + ) + + +class ResponsesResourceWithStreamingResponse: + def __init__(self, responses: ResponsesResource) -> None: + self._responses = responses + + self.create = to_streamed_response_wrapper( + responses.create, + ) + + +class AsyncResponsesResourceWithStreamingResponse: + def __init__(self, responses: AsyncResponsesResource) -> None: + self._responses = responses + + self.create = async_to_streamed_response_wrapper( + responses.create, + ) diff --git a/src/gradient/resources/retrieve.py b/src/gradient/resources/retrieve.py index f8335ab3..992fa37f 100644 --- a/src/gradient/resources/retrieve.py +++ b/src/gradient/resources/retrieve.py @@ -67,6 +67,12 @@ def documents( 3. Performs vector similarity search in the knowledge base 4. Returns the most relevant document chunks + The search supports hybrid search combining: + + - Vector similarity (semantic search) + - Keyword matching (BM25) + - Custom metadata filters + Args: num_results: Number of results to return @@ -162,6 +168,12 @@ async def documents( 3. Performs vector similarity search in the knowledge base 4. Returns the most relevant document chunks + The search supports hybrid search combining: + + - Vector similarity (semantic search) + - Keyword matching (BM25) + - Custom metadata filters + Args: num_results: Number of results to return diff --git a/src/gradient/types/__init__.py b/src/gradient/types/__init__.py index e927e099..fc2907b2 100644 --- a/src/gradient/types/__init__.py +++ b/src/gradient/types/__init__.py @@ -43,10 +43,12 @@ ChatCompletionChunk as ChatCompletionChunk, ImageGenStreamEvent as ImageGenStreamEvent, SubscriptionTierBase as SubscriptionTierBase, + CreateResponseResponse as CreateResponseResponse, ImageGenCompletedEvent as ImageGenCompletedEvent, DropletNextBackupWindow as DropletNextBackupWindow, ImageGenPartialImageEvent as ImageGenPartialImageEvent, ChatCompletionTokenLogprob as ChatCompletionTokenLogprob, + CreateResponseStreamResponse as CreateResponseStreamResponse, ) from .api_agent import APIAgent as APIAgent from .api_model import APIModel as APIModel @@ -77,6 +79,7 @@ from .droplet_backup_policy import DropletBackupPolicy as DropletBackupPolicy from .image_generate_params import ImageGenerateParams as ImageGenerateParams from .api_agent_api_key_info import APIAgentAPIKeyInfo as APIAgentAPIKeyInfo +from .response_create_params import ResponseCreateParams as ResponseCreateParams from .agent_retrieve_response import AgentRetrieveResponse as AgentRetrieveResponse from .api_openai_api_key_info import APIOpenAIAPIKeyInfo as APIOpenAIAPIKeyInfo from .gpu_droplet_list_params import GPUDropletListParams as GPUDropletListParams @@ -105,6 +108,7 @@ from .agent_update_status_response import ( AgentUpdateStatusResponse as AgentUpdateStatusResponse, ) +from .billing_list_insights_params import BillingListInsightsParams as BillingListInsightsParams from .knowledge_base_create_params import ( KnowledgeBaseCreateParams as KnowledgeBaseCreateParams, ) @@ -118,6 +122,9 @@ from .gpu_droplet_retrieve_response import ( GPUDropletRetrieveResponse as GPUDropletRetrieveResponse, ) +from .billing_list_insights_response import ( + BillingListInsightsResponse as BillingListInsightsResponse, +) from .knowledge_base_create_response import ( KnowledgeBaseCreateResponse as KnowledgeBaseCreateResponse, ) diff --git a/src/gradient/types/agents/api_evaluation_prompt.py b/src/gradient/types/agents/api_evaluation_prompt.py index 7471e9ae..1bb08bf1 100644 --- a/src/gradient/types/agents/api_evaluation_prompt.py +++ b/src/gradient/types/agents/api_evaluation_prompt.py @@ -1,11 +1,60 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal from ..._models import BaseModel from .api_evaluation_metric_result import APIEvaluationMetricResult -__all__ = ["APIEvaluationPrompt", "PromptChunk"] +__all__ = ["APIEvaluationPrompt", "EvaluationTraceSpan", "EvaluationTraceSpanRetrieverChunk", "PromptChunk"] + + +class EvaluationTraceSpanRetrieverChunk(BaseModel): + chunk_usage_pct: Optional[float] = None + """The usage percentage of the chunk.""" + + chunk_used: Optional[bool] = None + """Indicates if the chunk was used in the prompt.""" + + index_uuid: Optional[str] = None + """The index uuid (Knowledge Base) of the chunk.""" + + source_name: Optional[str] = None + """The source name for the chunk, e.g., the file name or document title.""" + + text: Optional[str] = None + """Text content of the chunk.""" + + +class EvaluationTraceSpan(BaseModel): + """Represents a span within an evaluatioin trace (e.g., LLM call, tool call, etc.)""" + + created_at: Optional[datetime] = None + """When the span was created""" + + input: Optional[object] = None + """ + Input data for the span (flexible structure - can be messages array, string, + etc.) + """ + + name: Optional[str] = None + """Name/identifier for the span""" + + output: Optional[object] = None + """Output data from the span (flexible structure - can be message, string, etc.)""" + + retriever_chunks: Optional[List[EvaluationTraceSpanRetrieverChunk]] = None + """Any retriever span chunks that were included as part of the span.""" + + span_level_metric_results: Optional[List[APIEvaluationMetricResult]] = None + """The span-level metric results.""" + + type: Optional[ + Literal["TRACE_SPAN_TYPE_UNKNOWN", "TRACE_SPAN_TYPE_LLM", "TRACE_SPAN_TYPE_RETRIEVER", "TRACE_SPAN_TYPE_TOOL"] + ] = None + """Types of spans in a trace""" class PromptChunk(BaseModel): @@ -26,6 +75,9 @@ class PromptChunk(BaseModel): class APIEvaluationPrompt(BaseModel): + evaluation_trace_spans: Optional[List[EvaluationTraceSpan]] = None + """The evaluated trace spans.""" + ground_truth: Optional[str] = None """The ground truth for the prompt.""" @@ -47,3 +99,6 @@ class APIEvaluationPrompt(BaseModel): prompt_level_metric_results: Optional[List[APIEvaluationMetricResult]] = None """The metric results for the prompt.""" + + trace_id: Optional[str] = None + """The trace id for the prompt.""" diff --git a/src/gradient/types/agents/api_evaluation_run.py b/src/gradient/types/agents/api_evaluation_run.py index 5a758898..ed4ef0a1 100644 --- a/src/gradient/types/agents/api_evaluation_run.py +++ b/src/gradient/types/agents/api_evaluation_run.py @@ -14,6 +14,9 @@ class APIEvaluationRun(BaseModel): agent_deleted: Optional[bool] = None """Whether agent is deleted""" + agent_deployment_name: Optional[str] = None + """The agent deployment name""" + agent_name: Optional[str] = None """Agent name""" diff --git a/src/gradient/types/agents/chat/completion_create_params.py b/src/gradient/types/agents/chat/completion_create_params.py index d238f8e1..797c6ea3 100644 --- a/src/gradient/types/agents/chat/completion_create_params.py +++ b/src/gradient/types/agents/chat/completion_create_params.py @@ -11,20 +11,42 @@ "CompletionCreateParamsBase", "Message", "MessageChatCompletionRequestSystemMessage", + "MessageChatCompletionRequestSystemMessageContent", + "MessageChatCompletionRequestSystemMessageContentChatCompletionRequestContentPartText", + "MessageChatCompletionRequestSystemMessageContentChatCompletionRequestContentPartTextCacheControl", "MessageChatCompletionRequestSystemMessageContentArrayOfContentPart", - "MessageChatCompletionRequestSystemMessageContentArrayOfContentPartUnionMember1", + "MessageChatCompletionRequestSystemMessageContentArrayOfContentPartChatCompletionRequestContentPartText", + "MessageChatCompletionRequestSystemMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl", "MessageChatCompletionRequestDeveloperMessage", + "MessageChatCompletionRequestDeveloperMessageContent", + "MessageChatCompletionRequestDeveloperMessageContentChatCompletionRequestContentPartText", + "MessageChatCompletionRequestDeveloperMessageContentChatCompletionRequestContentPartTextCacheControl", "MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPart", - "MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartUnionMember1", + "MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartChatCompletionRequestContentPartText", + "MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl", "MessageChatCompletionRequestUserMessage", + "MessageChatCompletionRequestUserMessageContent", + "MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartText", + "MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartTextCacheControl", "MessageChatCompletionRequestUserMessageContentArrayOfContentPart", - "MessageChatCompletionRequestUserMessageContentArrayOfContentPartUnionMember1", + "MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartText", + "MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl", "MessageChatCompletionRequestAssistantMessage", + "MessageChatCompletionRequestAssistantMessageContent", + "MessageChatCompletionRequestAssistantMessageContentChatCompletionRequestContentPartText", + "MessageChatCompletionRequestAssistantMessageContentChatCompletionRequestContentPartTextCacheControl", "MessageChatCompletionRequestAssistantMessageContentArrayOfContentPart", - "MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartUnionMember1", + "MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartChatCompletionRequestContentPartText", + "MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl", "MessageChatCompletionRequestAssistantMessageToolCall", "MessageChatCompletionRequestAssistantMessageToolCallFunction", "MessageChatCompletionRequestToolMessage", + "MessageChatCompletionRequestToolMessageContent", + "MessageChatCompletionRequestToolMessageContentChatCompletionRequestContentPartText", + "MessageChatCompletionRequestToolMessageContentChatCompletionRequestContentPartTextCacheControl", + "MessageChatCompletionRequestToolMessageContentArrayOfContentPart", + "MessageChatCompletionRequestToolMessageContentArrayOfContentPartChatCompletionRequestContentPartText", + "MessageChatCompletionRequestToolMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl", "StreamOptions", "ToolChoice", "ToolChoiceChatCompletionNamedToolChoice", @@ -165,7 +187,46 @@ class CompletionCreateParamsBase(TypedDict, total=False): """ -class MessageChatCompletionRequestSystemMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): +class MessageChatCompletionRequestSystemMessageContentChatCompletionRequestContentPartTextCacheControl( + TypedDict, total=False +): + """Cache control settings for the content part.""" + + type: Required[Literal["ephemeral"]] + """The cache control type.""" + + ttl: Literal["5m", "1h"] + """The cache TTL.""" + + +class MessageChatCompletionRequestSystemMessageContentChatCompletionRequestContentPartText(TypedDict, total=False): + """Content part with type and text""" + + text: Required[str] + """The text content""" + + type: Required[Literal["text"]] + """The type of content part""" + + cache_control: MessageChatCompletionRequestSystemMessageContentChatCompletionRequestContentPartTextCacheControl + """Cache control settings for the content part.""" + + +class MessageChatCompletionRequestSystemMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl( + TypedDict, total=False +): + """Cache control settings for the content part.""" + + type: Required[Literal["ephemeral"]] + """The cache control type.""" + + ttl: Literal["5m", "1h"] + """The cache TTL.""" + + +class MessageChatCompletionRequestSystemMessageContentArrayOfContentPartChatCompletionRequestContentPartText( + TypedDict, total=False +): """Content part with type and text""" text: Required[str] @@ -174,9 +235,18 @@ class MessageChatCompletionRequestSystemMessageContentArrayOfContentPartUnionMem type: Required[Literal["text"]] """The type of content part""" + cache_control: MessageChatCompletionRequestSystemMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl + """Cache control settings for the content part.""" + MessageChatCompletionRequestSystemMessageContentArrayOfContentPart: TypeAlias = Union[ - str, MessageChatCompletionRequestSystemMessageContentArrayOfContentPartUnionMember1 + str, MessageChatCompletionRequestSystemMessageContentArrayOfContentPartChatCompletionRequestContentPartText +] + +MessageChatCompletionRequestSystemMessageContent: TypeAlias = Union[ + str, + MessageChatCompletionRequestSystemMessageContentChatCompletionRequestContentPartText, + SequenceNotStr[MessageChatCompletionRequestSystemMessageContentArrayOfContentPart], ] @@ -186,14 +256,26 @@ class MessageChatCompletionRequestSystemMessage(TypedDict, total=False): messages sent by the user. """ - content: Required[Union[str, SequenceNotStr[MessageChatCompletionRequestSystemMessageContentArrayOfContentPart]]] + content: Required[MessageChatCompletionRequestSystemMessageContent] """The contents of the system message.""" role: Required[Literal["system"]] """The role of the messages author, in this case `system`.""" -class MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): +class MessageChatCompletionRequestDeveloperMessageContentChatCompletionRequestContentPartTextCacheControl( + TypedDict, total=False +): + """Cache control settings for the content part.""" + + type: Required[Literal["ephemeral"]] + """The cache control type.""" + + ttl: Literal["5m", "1h"] + """The cache TTL.""" + + +class MessageChatCompletionRequestDeveloperMessageContentChatCompletionRequestContentPartText(TypedDict, total=False): """Content part with type and text""" text: Required[str] @@ -202,9 +284,45 @@ class MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartUnion type: Required[Literal["text"]] """The type of content part""" + cache_control: MessageChatCompletionRequestDeveloperMessageContentChatCompletionRequestContentPartTextCacheControl + """Cache control settings for the content part.""" + + +class MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl( + TypedDict, total=False +): + """Cache control settings for the content part.""" + + type: Required[Literal["ephemeral"]] + """The cache control type.""" + + ttl: Literal["5m", "1h"] + """The cache TTL.""" + + +class MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartChatCompletionRequestContentPartText( + TypedDict, total=False +): + """Content part with type and text""" + + text: Required[str] + """The text content""" + + type: Required[Literal["text"]] + """The type of content part""" + + cache_control: MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl + """Cache control settings for the content part.""" + MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPart: TypeAlias = Union[ - str, MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartUnionMember1 + str, MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartChatCompletionRequestContentPartText +] + +MessageChatCompletionRequestDeveloperMessageContent: TypeAlias = Union[ + str, + MessageChatCompletionRequestDeveloperMessageContentChatCompletionRequestContentPartText, + SequenceNotStr[MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPart], ] @@ -214,14 +332,26 @@ class MessageChatCompletionRequestDeveloperMessage(TypedDict, total=False): messages sent by the user. """ - content: Required[Union[str, SequenceNotStr[MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPart]]] + content: Required[MessageChatCompletionRequestDeveloperMessageContent] """The contents of the developer message.""" role: Required[Literal["developer"]] """The role of the messages author, in this case `developer`.""" -class MessageChatCompletionRequestUserMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): +class MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartTextCacheControl( + TypedDict, total=False +): + """Cache control settings for the content part.""" + + type: Required[Literal["ephemeral"]] + """The cache control type.""" + + ttl: Literal["5m", "1h"] + """The cache TTL.""" + + +class MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartText(TypedDict, total=False): """Content part with type and text""" text: Required[str] @@ -230,9 +360,47 @@ class MessageChatCompletionRequestUserMessageContentArrayOfContentPartUnionMembe type: Required[Literal["text"]] """The type of content part""" + cache_control: MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartTextCacheControl + """Cache control settings for the content part.""" + + +class MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl( + TypedDict, total=False +): + """Cache control settings for the content part.""" + + type: Required[Literal["ephemeral"]] + """The cache control type.""" + + ttl: Literal["5m", "1h"] + """The cache TTL.""" + + +class MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartText( + TypedDict, total=False +): + """Content part with type and text""" + + text: Required[str] + """The text content""" + + type: Required[Literal["text"]] + """The type of content part""" + + cache_control: ( + MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl + ) + """Cache control settings for the content part.""" + MessageChatCompletionRequestUserMessageContentArrayOfContentPart: TypeAlias = Union[ - str, MessageChatCompletionRequestUserMessageContentArrayOfContentPartUnionMember1 + str, MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartText +] + +MessageChatCompletionRequestUserMessageContent: TypeAlias = Union[ + str, + MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartText, + SequenceNotStr[MessageChatCompletionRequestUserMessageContentArrayOfContentPart], ] @@ -242,14 +410,26 @@ class MessageChatCompletionRequestUserMessage(TypedDict, total=False): information. """ - content: Required[Union[str, SequenceNotStr[MessageChatCompletionRequestUserMessageContentArrayOfContentPart]]] + content: Required[MessageChatCompletionRequestUserMessageContent] """The contents of the user message.""" role: Required[Literal["user"]] """The role of the messages author, in this case `user`.""" -class MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): +class MessageChatCompletionRequestAssistantMessageContentChatCompletionRequestContentPartTextCacheControl( + TypedDict, total=False +): + """Cache control settings for the content part.""" + + type: Required[Literal["ephemeral"]] + """The cache control type.""" + + ttl: Literal["5m", "1h"] + """The cache TTL.""" + + +class MessageChatCompletionRequestAssistantMessageContentChatCompletionRequestContentPartText(TypedDict, total=False): """Content part with type and text""" text: Required[str] @@ -258,9 +438,45 @@ class MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartUnion type: Required[Literal["text"]] """The type of content part""" + cache_control: MessageChatCompletionRequestAssistantMessageContentChatCompletionRequestContentPartTextCacheControl + """Cache control settings for the content part.""" + + +class MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl( + TypedDict, total=False +): + """Cache control settings for the content part.""" + + type: Required[Literal["ephemeral"]] + """The cache control type.""" + + ttl: Literal["5m", "1h"] + """The cache TTL.""" + + +class MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartChatCompletionRequestContentPartText( + TypedDict, total=False +): + """Content part with type and text""" + + text: Required[str] + """The text content""" + + type: Required[Literal["text"]] + """The type of content part""" + + cache_control: MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl + """Cache control settings for the content part.""" + MessageChatCompletionRequestAssistantMessageContentArrayOfContentPart: TypeAlias = Union[ - str, MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartUnionMember1 + str, MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartChatCompletionRequestContentPartText +] + +MessageChatCompletionRequestAssistantMessageContent: TypeAlias = Union[ + str, + MessageChatCompletionRequestAssistantMessageContentChatCompletionRequestContentPartText, + SequenceNotStr[MessageChatCompletionRequestAssistantMessageContentArrayOfContentPart], ] @@ -296,15 +512,80 @@ class MessageChatCompletionRequestAssistantMessage(TypedDict, total=False): role: Required[Literal["assistant"]] """The role of the messages author, in this case `assistant`.""" - content: Union[str, SequenceNotStr[MessageChatCompletionRequestAssistantMessageContentArrayOfContentPart], None] + content: Optional[MessageChatCompletionRequestAssistantMessageContent] """The contents of the assistant message.""" tool_calls: Iterable[MessageChatCompletionRequestAssistantMessageToolCall] """The tool calls generated by the model, such as function calls.""" +class MessageChatCompletionRequestToolMessageContentChatCompletionRequestContentPartTextCacheControl( + TypedDict, total=False +): + """Cache control settings for the content part.""" + + type: Required[Literal["ephemeral"]] + """The cache control type.""" + + ttl: Literal["5m", "1h"] + """The cache TTL.""" + + +class MessageChatCompletionRequestToolMessageContentChatCompletionRequestContentPartText(TypedDict, total=False): + """Content part with type and text""" + + text: Required[str] + """The text content""" + + type: Required[Literal["text"]] + """The type of content part""" + + cache_control: MessageChatCompletionRequestToolMessageContentChatCompletionRequestContentPartTextCacheControl + """Cache control settings for the content part.""" + + +class MessageChatCompletionRequestToolMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl( + TypedDict, total=False +): + """Cache control settings for the content part.""" + + type: Required[Literal["ephemeral"]] + """The cache control type.""" + + ttl: Literal["5m", "1h"] + """The cache TTL.""" + + +class MessageChatCompletionRequestToolMessageContentArrayOfContentPartChatCompletionRequestContentPartText( + TypedDict, total=False +): + """Content part with type and text""" + + text: Required[str] + """The text content""" + + type: Required[Literal["text"]] + """The type of content part""" + + cache_control: ( + MessageChatCompletionRequestToolMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl + ) + """Cache control settings for the content part.""" + + +MessageChatCompletionRequestToolMessageContentArrayOfContentPart: TypeAlias = Union[ + str, MessageChatCompletionRequestToolMessageContentArrayOfContentPartChatCompletionRequestContentPartText +] + +MessageChatCompletionRequestToolMessageContent: TypeAlias = Union[ + str, + MessageChatCompletionRequestToolMessageContentChatCompletionRequestContentPartText, + SequenceNotStr[MessageChatCompletionRequestToolMessageContentArrayOfContentPart], +] + + class MessageChatCompletionRequestToolMessage(TypedDict, total=False): - content: Required[str] + content: Required[MessageChatCompletionRequestToolMessageContent] """The contents of the tool message.""" role: Required[Literal["tool"]] diff --git a/src/gradient/types/agents/evaluation_dataset_create_params.py b/src/gradient/types/agents/evaluation_dataset_create_params.py index c8a84c23..661a42da 100644 --- a/src/gradient/types/agents/evaluation_dataset_create_params.py +++ b/src/gradient/types/agents/evaluation_dataset_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Literal, TypedDict from ..knowledge_bases.api_file_upload_data_source_param import APIFileUploadDataSourceParam @@ -10,6 +10,10 @@ class EvaluationDatasetCreateParams(TypedDict, total=False): + dataset_type: Literal[ + "EVALUATION_DATASET_TYPE_UNKNOWN", "EVALUATION_DATASET_TYPE_ADK", "EVALUATION_DATASET_TYPE_NON_ADK" + ] + file_upload_dataset: APIFileUploadDataSourceParam """File to upload as data source for knowledge base.""" diff --git a/src/gradient/types/agents/evaluation_run_create_params.py b/src/gradient/types/agents/evaluation_run_create_params.py index 52bbee85..b5e60803 100644 --- a/src/gradient/types/agents/evaluation_run_create_params.py +++ b/src/gradient/types/agents/evaluation_run_create_params.py @@ -10,8 +10,11 @@ class EvaluationRunCreateParams(TypedDict, total=False): + agent_deployment_names: SequenceNotStr[str] + """Agent deployment names to run the test case against (ADK agent workspaces).""" + agent_uuids: SequenceNotStr[str] - """Agent UUIDs to run the test case against.""" + """Agent UUIDs to run the test case against (legacy agents).""" run_name: str """The name of the run.""" diff --git a/src/gradient/types/agents/evaluation_test_case_create_params.py b/src/gradient/types/agents/evaluation_test_case_create_params.py index af49d024..ff0666b9 100644 --- a/src/gradient/types/agents/evaluation_test_case_create_params.py +++ b/src/gradient/types/agents/evaluation_test_case_create_params.py @@ -11,6 +11,8 @@ class EvaluationTestCaseCreateParams(TypedDict, total=False): + agent_workspace_name: str + dataset_uuid: str """Dataset against which the test‑case is executed.""" diff --git a/src/gradient/types/api_agent_model.py b/src/gradient/types/api_agent_model.py index e42bb5d5..a6a36c6f 100644 --- a/src/gradient/types/api_agent_model.py +++ b/src/gradient/types/api_agent_model.py @@ -29,6 +29,15 @@ class APIAgentModel(BaseModel): is_foundational: Optional[bool] = None """True if it is a foundational model provided by do""" + kb_default_chunk_size: Optional[int] = None + """Default chunking size limit to show in UI""" + + kb_max_chunk_size: Optional[int] = None + """Maximum chunk size limit of model""" + + kb_min_chunk_size: Optional[int] = None + """Minimum chunking size token limits if model supports KNOWLEDGEBASE usecase""" + metadata: Optional[object] = None """Additional meta data""" diff --git a/src/gradient/types/api_model.py b/src/gradient/types/api_model.py index 83b1b66a..1d9752e4 100644 --- a/src/gradient/types/api_model.py +++ b/src/gradient/types/api_model.py @@ -25,6 +25,15 @@ class APIModel(BaseModel): is_foundational: Optional[bool] = None """True if it is a foundational model provided by do""" + kb_default_chunk_size: Optional[int] = None + """Default chunking size limit to show in UI""" + + kb_max_chunk_size: Optional[int] = None + """Maximum chunk size limit of model""" + + kb_min_chunk_size: Optional[int] = None + """Minimum chunking size token limits if model supports KNOWLEDGEBASE usecase""" + name: Optional[str] = None """Display name of the model""" diff --git a/src/gradient/types/apps/__init__.py b/src/gradient/types/apps/__init__.py new file mode 100644 index 00000000..b4a2e426 --- /dev/null +++ b/src/gradient/types/apps/__init__.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .job_invocation_cancel_params import JobInvocationCancelParams as JobInvocationCancelParams +from .job_invocation_cancel_response import JobInvocationCancelResponse as JobInvocationCancelResponse diff --git a/src/gradient/types/apps/job_invocation_cancel_params.py b/src/gradient/types/apps/job_invocation_cancel_params.py new file mode 100644 index 00000000..b026fcb9 --- /dev/null +++ b/src/gradient/types/apps/job_invocation_cancel_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["JobInvocationCancelParams"] + + +class JobInvocationCancelParams(TypedDict, total=False): + app_id: Required[str] + + job_name: str + """The job name to list job invocations for.""" diff --git a/src/gradient/types/apps/job_invocation_cancel_response.py b/src/gradient/types/apps/job_invocation_cancel_response.py new file mode 100644 index 00000000..96b2c642 --- /dev/null +++ b/src/gradient/types/apps/job_invocation_cancel_response.py @@ -0,0 +1,77 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = [ + "JobInvocationCancelResponse", + "Trigger", + "TriggerManual", + "TriggerManualUser", + "TriggerScheduled", + "TriggerScheduledSchedule", +] + + +class TriggerManualUser(BaseModel): + """The user who triggered the job""" + + email: Optional[str] = None + + full_name: Optional[str] = None + + uuid: Optional[str] = None + + +class TriggerManual(BaseModel): + """Details about the manual trigger, if applicable""" + + user: Optional[TriggerManualUser] = None + """The user who triggered the job""" + + +class TriggerScheduledSchedule(BaseModel): + cron: Optional[str] = None + """The cron expression defining the schedule""" + + time_zone: Optional[str] = None + """The time zone for the schedule""" + + +class TriggerScheduled(BaseModel): + """The schedule for the job""" + + schedule: Optional[TriggerScheduledSchedule] = None + + +class Trigger(BaseModel): + manual: Optional[TriggerManual] = None + """Details about the manual trigger, if applicable""" + + scheduled: Optional[TriggerScheduled] = None + """The schedule for the job""" + + type: Optional[Literal["MANUAL", "SCHEDULE", "UNKNOWN"]] = None + """The type of trigger that initiated the job invocation.""" + + +class JobInvocationCancelResponse(BaseModel): + id: Optional[str] = None + + completed_at: Optional[datetime] = None + + created_at: Optional[datetime] = None + + deployment_id: Optional[str] = None + + job_name: Optional[str] = None + + phase: Optional[Literal["UNKNOWN", "PENDING", "RUNNING", "SUCCEEDED", "FAILED", "CANCELED", "SKIPPED"]] = None + """The phase of the job invocation""" + + started_at: Optional[datetime] = None + + trigger: Optional[Trigger] = None diff --git a/src/gradient/types/billing_list_insights_params.py b/src/gradient/types/billing_list_insights_params.py new file mode 100644 index 00000000..6e89dd1e --- /dev/null +++ b/src/gradient/types/billing_list_insights_params.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import date +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["BillingListInsightsParams"] + + +class BillingListInsightsParams(TypedDict, total=False): + account_urn: Required[str] + + start_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]] + + page: int + """Which 'page' of paginated results to return.""" + + per_page: int + """Number of items returned per page""" diff --git a/src/gradient/types/billing_list_insights_response.py b/src/gradient/types/billing_list_insights_response.py new file mode 100644 index 00000000..f7515a6b --- /dev/null +++ b/src/gradient/types/billing_list_insights_response.py @@ -0,0 +1,51 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import date + +from .._models import BaseModel + +__all__ = ["BillingListInsightsResponse", "DataPoint"] + + +class DataPoint(BaseModel): + description: Optional[str] = None + """Description of the billed resource or service as shown on an invoice item""" + + group_description: Optional[str] = None + """ + Optional invoice item group name of the billed resource or service, blank when + not part an invoice item group + """ + + region: Optional[str] = None + """Region where the usage occurred""" + + sku: Optional[str] = None + """Unique SKU identifier for the billed resource""" + + start_date: Optional[date] = None + """Start date of the billing data point in YYYY-MM-DD format""" + + total_amount: Optional[str] = None + """Total amount for this data point in USD""" + + usage_team_urn: Optional[str] = None + """URN of the team that incurred the usage""" + + +class BillingListInsightsResponse(BaseModel): + current_page: int + """Current page number""" + + data_points: List[DataPoint] + """ + Array of billing data points, which are day-over-day changes in billing resource + usage based on nightly invoice item estimates, for the requested period + """ + + total_items: int + """Total number of items available across all pages""" + + total_pages: int + """Total number of pages available""" diff --git a/src/gradient/types/chat/completion_create_params.py b/src/gradient/types/chat/completion_create_params.py index e889c5e8..bf5bd49d 100644 --- a/src/gradient/types/chat/completion_create_params.py +++ b/src/gradient/types/chat/completion_create_params.py @@ -11,20 +11,42 @@ "CompletionCreateParamsBase", "Message", "MessageChatCompletionRequestSystemMessage", + "MessageChatCompletionRequestSystemMessageContent", + "MessageChatCompletionRequestSystemMessageContentChatCompletionRequestContentPartText", + "MessageChatCompletionRequestSystemMessageContentChatCompletionRequestContentPartTextCacheControl", "MessageChatCompletionRequestSystemMessageContentArrayOfContentPart", - "MessageChatCompletionRequestSystemMessageContentArrayOfContentPartUnionMember1", + "MessageChatCompletionRequestSystemMessageContentArrayOfContentPartChatCompletionRequestContentPartText", + "MessageChatCompletionRequestSystemMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl", "MessageChatCompletionRequestDeveloperMessage", + "MessageChatCompletionRequestDeveloperMessageContent", + "MessageChatCompletionRequestDeveloperMessageContentChatCompletionRequestContentPartText", + "MessageChatCompletionRequestDeveloperMessageContentChatCompletionRequestContentPartTextCacheControl", "MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPart", - "MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartUnionMember1", + "MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartChatCompletionRequestContentPartText", + "MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl", "MessageChatCompletionRequestUserMessage", + "MessageChatCompletionRequestUserMessageContent", + "MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartText", + "MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartTextCacheControl", "MessageChatCompletionRequestUserMessageContentArrayOfContentPart", - "MessageChatCompletionRequestUserMessageContentArrayOfContentPartUnionMember1", + "MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartText", + "MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl", "MessageChatCompletionRequestAssistantMessage", + "MessageChatCompletionRequestAssistantMessageContent", + "MessageChatCompletionRequestAssistantMessageContentChatCompletionRequestContentPartText", + "MessageChatCompletionRequestAssistantMessageContentChatCompletionRequestContentPartTextCacheControl", "MessageChatCompletionRequestAssistantMessageContentArrayOfContentPart", - "MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartUnionMember1", + "MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartChatCompletionRequestContentPartText", + "MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl", "MessageChatCompletionRequestAssistantMessageToolCall", "MessageChatCompletionRequestAssistantMessageToolCallFunction", "MessageChatCompletionRequestToolMessage", + "MessageChatCompletionRequestToolMessageContent", + "MessageChatCompletionRequestToolMessageContentChatCompletionRequestContentPartText", + "MessageChatCompletionRequestToolMessageContentChatCompletionRequestContentPartTextCacheControl", + "MessageChatCompletionRequestToolMessageContentArrayOfContentPart", + "MessageChatCompletionRequestToolMessageContentArrayOfContentPartChatCompletionRequestContentPartText", + "MessageChatCompletionRequestToolMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl", "StreamOptions", "ToolChoice", "ToolChoiceChatCompletionNamedToolChoice", @@ -165,7 +187,46 @@ class CompletionCreateParamsBase(TypedDict, total=False): """ -class MessageChatCompletionRequestSystemMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): +class MessageChatCompletionRequestSystemMessageContentChatCompletionRequestContentPartTextCacheControl( + TypedDict, total=False +): + """Cache control settings for the content part.""" + + type: Required[Literal["ephemeral"]] + """The cache control type.""" + + ttl: Literal["5m", "1h"] + """The cache TTL.""" + + +class MessageChatCompletionRequestSystemMessageContentChatCompletionRequestContentPartText(TypedDict, total=False): + """Content part with type and text""" + + text: Required[str] + """The text content""" + + type: Required[Literal["text"]] + """The type of content part""" + + cache_control: MessageChatCompletionRequestSystemMessageContentChatCompletionRequestContentPartTextCacheControl + """Cache control settings for the content part.""" + + +class MessageChatCompletionRequestSystemMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl( + TypedDict, total=False +): + """Cache control settings for the content part.""" + + type: Required[Literal["ephemeral"]] + """The cache control type.""" + + ttl: Literal["5m", "1h"] + """The cache TTL.""" + + +class MessageChatCompletionRequestSystemMessageContentArrayOfContentPartChatCompletionRequestContentPartText( + TypedDict, total=False +): """Content part with type and text""" text: Required[str] @@ -174,9 +235,18 @@ class MessageChatCompletionRequestSystemMessageContentArrayOfContentPartUnionMem type: Required[Literal["text"]] """The type of content part""" + cache_control: MessageChatCompletionRequestSystemMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl + """Cache control settings for the content part.""" + MessageChatCompletionRequestSystemMessageContentArrayOfContentPart: TypeAlias = Union[ - str, MessageChatCompletionRequestSystemMessageContentArrayOfContentPartUnionMember1 + str, MessageChatCompletionRequestSystemMessageContentArrayOfContentPartChatCompletionRequestContentPartText +] + +MessageChatCompletionRequestSystemMessageContent: TypeAlias = Union[ + str, + MessageChatCompletionRequestSystemMessageContentChatCompletionRequestContentPartText, + SequenceNotStr[MessageChatCompletionRequestSystemMessageContentArrayOfContentPart], ] @@ -186,14 +256,26 @@ class MessageChatCompletionRequestSystemMessage(TypedDict, total=False): messages sent by the user. """ - content: Required[Union[str, SequenceNotStr[MessageChatCompletionRequestSystemMessageContentArrayOfContentPart]]] + content: Required[MessageChatCompletionRequestSystemMessageContent] """The contents of the system message.""" role: Required[Literal["system"]] """The role of the messages author, in this case `system`.""" -class MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): +class MessageChatCompletionRequestDeveloperMessageContentChatCompletionRequestContentPartTextCacheControl( + TypedDict, total=False +): + """Cache control settings for the content part.""" + + type: Required[Literal["ephemeral"]] + """The cache control type.""" + + ttl: Literal["5m", "1h"] + """The cache TTL.""" + + +class MessageChatCompletionRequestDeveloperMessageContentChatCompletionRequestContentPartText(TypedDict, total=False): """Content part with type and text""" text: Required[str] @@ -202,9 +284,45 @@ class MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartUnion type: Required[Literal["text"]] """The type of content part""" + cache_control: MessageChatCompletionRequestDeveloperMessageContentChatCompletionRequestContentPartTextCacheControl + """Cache control settings for the content part.""" + + +class MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl( + TypedDict, total=False +): + """Cache control settings for the content part.""" + + type: Required[Literal["ephemeral"]] + """The cache control type.""" + + ttl: Literal["5m", "1h"] + """The cache TTL.""" + + +class MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartChatCompletionRequestContentPartText( + TypedDict, total=False +): + """Content part with type and text""" + + text: Required[str] + """The text content""" + + type: Required[Literal["text"]] + """The type of content part""" + + cache_control: MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl + """Cache control settings for the content part.""" + MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPart: TypeAlias = Union[ - str, MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartUnionMember1 + str, MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPartChatCompletionRequestContentPartText +] + +MessageChatCompletionRequestDeveloperMessageContent: TypeAlias = Union[ + str, + MessageChatCompletionRequestDeveloperMessageContentChatCompletionRequestContentPartText, + SequenceNotStr[MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPart], ] @@ -214,14 +332,26 @@ class MessageChatCompletionRequestDeveloperMessage(TypedDict, total=False): messages sent by the user. """ - content: Required[Union[str, SequenceNotStr[MessageChatCompletionRequestDeveloperMessageContentArrayOfContentPart]]] + content: Required[MessageChatCompletionRequestDeveloperMessageContent] """The contents of the developer message.""" role: Required[Literal["developer"]] """The role of the messages author, in this case `developer`.""" -class MessageChatCompletionRequestUserMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): +class MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartTextCacheControl( + TypedDict, total=False +): + """Cache control settings for the content part.""" + + type: Required[Literal["ephemeral"]] + """The cache control type.""" + + ttl: Literal["5m", "1h"] + """The cache TTL.""" + + +class MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartText(TypedDict, total=False): """Content part with type and text""" text: Required[str] @@ -230,9 +360,47 @@ class MessageChatCompletionRequestUserMessageContentArrayOfContentPartUnionMembe type: Required[Literal["text"]] """The type of content part""" + cache_control: MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartTextCacheControl + """Cache control settings for the content part.""" + + +class MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl( + TypedDict, total=False +): + """Cache control settings for the content part.""" + + type: Required[Literal["ephemeral"]] + """The cache control type.""" + + ttl: Literal["5m", "1h"] + """The cache TTL.""" + + +class MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartText( + TypedDict, total=False +): + """Content part with type and text""" + + text: Required[str] + """The text content""" + + type: Required[Literal["text"]] + """The type of content part""" + + cache_control: ( + MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl + ) + """Cache control settings for the content part.""" + MessageChatCompletionRequestUserMessageContentArrayOfContentPart: TypeAlias = Union[ - str, MessageChatCompletionRequestUserMessageContentArrayOfContentPartUnionMember1 + str, MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartText +] + +MessageChatCompletionRequestUserMessageContent: TypeAlias = Union[ + str, + MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartText, + SequenceNotStr[MessageChatCompletionRequestUserMessageContentArrayOfContentPart], ] @@ -242,14 +410,26 @@ class MessageChatCompletionRequestUserMessage(TypedDict, total=False): information. """ - content: Required[Union[str, SequenceNotStr[MessageChatCompletionRequestUserMessageContentArrayOfContentPart]]] + content: Required[MessageChatCompletionRequestUserMessageContent] """The contents of the user message.""" role: Required[Literal["user"]] """The role of the messages author, in this case `user`.""" -class MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartUnionMember1(TypedDict, total=False): +class MessageChatCompletionRequestAssistantMessageContentChatCompletionRequestContentPartTextCacheControl( + TypedDict, total=False +): + """Cache control settings for the content part.""" + + type: Required[Literal["ephemeral"]] + """The cache control type.""" + + ttl: Literal["5m", "1h"] + """The cache TTL.""" + + +class MessageChatCompletionRequestAssistantMessageContentChatCompletionRequestContentPartText(TypedDict, total=False): """Content part with type and text""" text: Required[str] @@ -258,9 +438,45 @@ class MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartUnion type: Required[Literal["text"]] """The type of content part""" + cache_control: MessageChatCompletionRequestAssistantMessageContentChatCompletionRequestContentPartTextCacheControl + """Cache control settings for the content part.""" + + +class MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl( + TypedDict, total=False +): + """Cache control settings for the content part.""" + + type: Required[Literal["ephemeral"]] + """The cache control type.""" + + ttl: Literal["5m", "1h"] + """The cache TTL.""" + + +class MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartChatCompletionRequestContentPartText( + TypedDict, total=False +): + """Content part with type and text""" + + text: Required[str] + """The text content""" + + type: Required[Literal["text"]] + """The type of content part""" + + cache_control: MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl + """Cache control settings for the content part.""" + MessageChatCompletionRequestAssistantMessageContentArrayOfContentPart: TypeAlias = Union[ - str, MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartUnionMember1 + str, MessageChatCompletionRequestAssistantMessageContentArrayOfContentPartChatCompletionRequestContentPartText +] + +MessageChatCompletionRequestAssistantMessageContent: TypeAlias = Union[ + str, + MessageChatCompletionRequestAssistantMessageContentChatCompletionRequestContentPartText, + SequenceNotStr[MessageChatCompletionRequestAssistantMessageContentArrayOfContentPart], ] @@ -296,15 +512,80 @@ class MessageChatCompletionRequestAssistantMessage(TypedDict, total=False): role: Required[Literal["assistant"]] """The role of the messages author, in this case `assistant`.""" - content: Union[str, SequenceNotStr[MessageChatCompletionRequestAssistantMessageContentArrayOfContentPart], None] + content: Optional[MessageChatCompletionRequestAssistantMessageContent] """The contents of the assistant message.""" tool_calls: Iterable[MessageChatCompletionRequestAssistantMessageToolCall] """The tool calls generated by the model, such as function calls.""" +class MessageChatCompletionRequestToolMessageContentChatCompletionRequestContentPartTextCacheControl( + TypedDict, total=False +): + """Cache control settings for the content part.""" + + type: Required[Literal["ephemeral"]] + """The cache control type.""" + + ttl: Literal["5m", "1h"] + """The cache TTL.""" + + +class MessageChatCompletionRequestToolMessageContentChatCompletionRequestContentPartText(TypedDict, total=False): + """Content part with type and text""" + + text: Required[str] + """The text content""" + + type: Required[Literal["text"]] + """The type of content part""" + + cache_control: MessageChatCompletionRequestToolMessageContentChatCompletionRequestContentPartTextCacheControl + """Cache control settings for the content part.""" + + +class MessageChatCompletionRequestToolMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl( + TypedDict, total=False +): + """Cache control settings for the content part.""" + + type: Required[Literal["ephemeral"]] + """The cache control type.""" + + ttl: Literal["5m", "1h"] + """The cache TTL.""" + + +class MessageChatCompletionRequestToolMessageContentArrayOfContentPartChatCompletionRequestContentPartText( + TypedDict, total=False +): + """Content part with type and text""" + + text: Required[str] + """The text content""" + + type: Required[Literal["text"]] + """The type of content part""" + + cache_control: ( + MessageChatCompletionRequestToolMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl + ) + """Cache control settings for the content part.""" + + +MessageChatCompletionRequestToolMessageContentArrayOfContentPart: TypeAlias = Union[ + str, MessageChatCompletionRequestToolMessageContentArrayOfContentPartChatCompletionRequestContentPartText +] + +MessageChatCompletionRequestToolMessageContent: TypeAlias = Union[ + str, + MessageChatCompletionRequestToolMessageContentChatCompletionRequestContentPartText, + SequenceNotStr[MessageChatCompletionRequestToolMessageContentArrayOfContentPart], +] + + class MessageChatCompletionRequestToolMessage(TypedDict, total=False): - content: Required[str] + content: Required[MessageChatCompletionRequestToolMessageContent] """The contents of the tool message.""" role: Required[Literal["tool"]] diff --git a/src/gradient/types/knowledge_base_create_params.py b/src/gradient/types/knowledge_base_create_params.py index 24cfd98b..2c7bece1 100644 --- a/src/gradient/types/knowledge_base_create_params.py +++ b/src/gradient/types/knowledge_base_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Iterable -from typing_extensions import TypedDict +from typing_extensions import Literal, TypedDict from .._types import SequenceNotStr from .knowledge_bases.aws_data_source_param import AwsDataSourceParam @@ -11,7 +11,13 @@ from .knowledge_bases.api_file_upload_data_source_param import APIFileUploadDataSourceParam from .knowledge_bases.api_web_crawler_data_source_param import APIWebCrawlerDataSourceParam -__all__ = ["KnowledgeBaseCreateParams", "Datasource", "DatasourceDropboxDataSource", "DatasourceGoogleDriveDataSource"] +__all__ = [ + "KnowledgeBaseCreateParams", + "Datasource", + "DatasourceChunkingOptions", + "DatasourceDropboxDataSource", + "DatasourceGoogleDriveDataSource", +] class KnowledgeBaseCreateParams(TypedDict, total=False): @@ -52,6 +58,25 @@ class KnowledgeBaseCreateParams(TypedDict, total=False): """The VPC to deploy the knowledge base database in""" +class DatasourceChunkingOptions(TypedDict, total=False): + """Configuration options for the chunking algorithm. + + **Note: This feature requires enabling the knowledgebase enhancements feature preview flag.** + """ + + child_chunk_size: int + """Hierarchical options""" + + max_chunk_size: int + """Section_Based and Fixed_Length options""" + + parent_chunk_size: int + """Hierarchical options""" + + semantic_threshold: float + """Semantic options""" + + class DatasourceDropboxDataSource(TypedDict, total=False): """Dropbox Data Source""" @@ -88,6 +113,26 @@ class Datasource(TypedDict, total=False): bucket_region: str """Deprecated, moved to data_source_details""" + chunking_algorithm: Literal[ + "CHUNKING_ALGORITHM_UNKNOWN", + "CHUNKING_ALGORITHM_SECTION_BASED", + "CHUNKING_ALGORITHM_HIERARCHICAL", + "CHUNKING_ALGORITHM_SEMANTIC", + "CHUNKING_ALGORITHM_FIXED_LENGTH", + ] + """The chunking algorithm to use for processing data sources. + + **Note: This feature requires enabling the knowledgebase enhancements feature + preview flag.** + """ + + chunking_options: DatasourceChunkingOptions + """Configuration options for the chunking algorithm. + + **Note: This feature requires enabling the knowledgebase enhancements feature + preview flag.** + """ + dropbox_data_source: DatasourceDropboxDataSource """Dropbox Data Source""" diff --git a/src/gradient/types/knowledge_bases/__init__.py b/src/gradient/types/knowledge_bases/__init__.py index a8ce2cc7..e7b88be8 100644 --- a/src/gradient/types/knowledge_bases/__init__.py +++ b/src/gradient/types/knowledge_bases/__init__.py @@ -10,12 +10,14 @@ from .indexing_job_list_params import IndexingJobListParams as IndexingJobListParams from .data_source_create_params import DataSourceCreateParams as DataSourceCreateParams from .data_source_list_response import DataSourceListResponse as DataSourceListResponse +from .data_source_update_params import DataSourceUpdateParams as DataSourceUpdateParams from .indexing_job_create_params import IndexingJobCreateParams as IndexingJobCreateParams from .indexing_job_list_response import IndexingJobListResponse as IndexingJobListResponse from .api_file_upload_data_source import APIFileUploadDataSource as APIFileUploadDataSource from .api_web_crawler_data_source import APIWebCrawlerDataSource as APIWebCrawlerDataSource from .data_source_create_response import DataSourceCreateResponse as DataSourceCreateResponse from .data_source_delete_response import DataSourceDeleteResponse as DataSourceDeleteResponse +from .data_source_update_response import DataSourceUpdateResponse as DataSourceUpdateResponse from .api_spaces_data_source_param import APISpacesDataSourceParam as APISpacesDataSourceParam from .indexing_job_create_response import IndexingJobCreateResponse as IndexingJobCreateResponse from .api_knowledge_base_data_source import APIKnowledgeBaseDataSource as APIKnowledgeBaseDataSource diff --git a/src/gradient/types/knowledge_bases/api_knowledge_base_data_source.py b/src/gradient/types/knowledge_bases/api_knowledge_base_data_source.py index b73e325e..ef5db1a5 100644 --- a/src/gradient/types/knowledge_bases/api_knowledge_base_data_source.py +++ b/src/gradient/types/knowledge_bases/api_knowledge_base_data_source.py @@ -2,6 +2,7 @@ from typing import Optional from datetime import datetime +from typing_extensions import Literal from ..._models import BaseModel from .api_spaces_data_source import APISpacesDataSource @@ -9,7 +10,13 @@ from .api_file_upload_data_source import APIFileUploadDataSource from .api_web_crawler_data_source import APIWebCrawlerDataSource -__all__ = ["APIKnowledgeBaseDataSource", "AwsDataSource", "DropboxDataSource", "GoogleDriveDataSource"] +__all__ = [ + "APIKnowledgeBaseDataSource", + "AwsDataSource", + "ChunkingOptions", + "DropboxDataSource", + "GoogleDriveDataSource", +] class AwsDataSource(BaseModel): @@ -24,6 +31,25 @@ class AwsDataSource(BaseModel): """Region of bucket""" +class ChunkingOptions(BaseModel): + """Configuration options for the chunking algorithm. + + **Note: This feature requires enabling the knowledgebase enhancements feature preview flag.** + """ + + child_chunk_size: Optional[int] = None + """Hierarchical options""" + + max_chunk_size: Optional[int] = None + """Section_Based and Fixed_Length options""" + + parent_chunk_size: Optional[int] = None + """Hierarchical options""" + + semantic_threshold: Optional[float] = None + """Semantic options""" + + class DropboxDataSource(BaseModel): """Dropbox Data Source for Display""" @@ -48,6 +74,28 @@ class APIKnowledgeBaseDataSource(BaseModel): bucket_name: Optional[str] = None """Name of storage bucket - Deprecated, moved to data_source_details""" + chunking_algorithm: Optional[ + Literal[ + "CHUNKING_ALGORITHM_UNKNOWN", + "CHUNKING_ALGORITHM_SECTION_BASED", + "CHUNKING_ALGORITHM_HIERARCHICAL", + "CHUNKING_ALGORITHM_SEMANTIC", + "CHUNKING_ALGORITHM_FIXED_LENGTH", + ] + ] = None + """The chunking algorithm to use for processing data sources. + + **Note: This feature requires enabling the knowledgebase enhancements feature + preview flag.** + """ + + chunking_options: Optional[ChunkingOptions] = None + """Configuration options for the chunking algorithm. + + **Note: This feature requires enabling the knowledgebase enhancements feature + preview flag.** + """ + created_at: Optional[datetime] = None """Creation date / time""" diff --git a/src/gradient/types/knowledge_bases/data_source_create_params.py b/src/gradient/types/knowledge_bases/data_source_create_params.py index ac3aa93c..bc65e42a 100644 --- a/src/gradient/types/knowledge_bases/data_source_create_params.py +++ b/src/gradient/types/knowledge_bases/data_source_create_params.py @@ -2,20 +2,40 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import Literal, Annotated, TypedDict from ..._utils import PropertyInfo from .aws_data_source_param import AwsDataSourceParam from .api_spaces_data_source_param import APISpacesDataSourceParam from .api_web_crawler_data_source_param import APIWebCrawlerDataSourceParam -__all__ = ["DataSourceCreateParams"] +__all__ = ["DataSourceCreateParams", "ChunkingOptions"] class DataSourceCreateParams(TypedDict, total=False): aws_data_source: AwsDataSourceParam """AWS S3 Data Source""" + chunking_algorithm: Literal[ + "CHUNKING_ALGORITHM_UNKNOWN", + "CHUNKING_ALGORITHM_SECTION_BASED", + "CHUNKING_ALGORITHM_HIERARCHICAL", + "CHUNKING_ALGORITHM_SEMANTIC", + "CHUNKING_ALGORITHM_FIXED_LENGTH", + ] + """The chunking algorithm to use for processing data sources. + + **Note: This feature requires enabling the knowledgebase enhancements feature + preview flag.** + """ + + chunking_options: ChunkingOptions + """Configuration options for the chunking algorithm. + + **Note: This feature requires enabling the knowledgebase enhancements feature + preview flag.** + """ + body_knowledge_base_uuid: Annotated[str, PropertyInfo(alias="knowledge_base_uuid")] """Knowledge base id""" @@ -24,3 +44,22 @@ class DataSourceCreateParams(TypedDict, total=False): web_crawler_data_source: APIWebCrawlerDataSourceParam """WebCrawlerDataSource""" + + +class ChunkingOptions(TypedDict, total=False): + """Configuration options for the chunking algorithm. + + **Note: This feature requires enabling the knowledgebase enhancements feature preview flag.** + """ + + child_chunk_size: int + """Hierarchical options""" + + max_chunk_size: int + """Section_Based and Fixed_Length options""" + + parent_chunk_size: int + """Hierarchical options""" + + semantic_threshold: float + """Semantic options""" diff --git a/src/gradient/types/knowledge_bases/data_source_update_params.py b/src/gradient/types/knowledge_bases/data_source_update_params.py new file mode 100644 index 00000000..ffcdf95b --- /dev/null +++ b/src/gradient/types/knowledge_bases/data_source_update_params.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["DataSourceUpdateParams", "ChunkingOptions"] + + +class DataSourceUpdateParams(TypedDict, total=False): + path_knowledge_base_uuid: Required[Annotated[str, PropertyInfo(alias="knowledge_base_uuid")]] + + chunking_algorithm: Literal[ + "CHUNKING_ALGORITHM_UNKNOWN", + "CHUNKING_ALGORITHM_SECTION_BASED", + "CHUNKING_ALGORITHM_HIERARCHICAL", + "CHUNKING_ALGORITHM_SEMANTIC", + "CHUNKING_ALGORITHM_FIXED_LENGTH", + ] + """The chunking algorithm to use for processing data sources. + + **Note: This feature requires enabling the knowledgebase enhancements feature + preview flag.** + """ + + chunking_options: ChunkingOptions + """Configuration options for the chunking algorithm. + + **Note: This feature requires enabling the knowledgebase enhancements feature + preview flag.** + """ + + body_data_source_uuid: Annotated[str, PropertyInfo(alias="data_source_uuid")] + """Data Source ID (Path Parameter)""" + + body_knowledge_base_uuid: Annotated[str, PropertyInfo(alias="knowledge_base_uuid")] + """Knowledge Base ID (Path Parameter)""" + + +class ChunkingOptions(TypedDict, total=False): + """Configuration options for the chunking algorithm. + + **Note: This feature requires enabling the knowledgebase enhancements feature preview flag.** + """ + + child_chunk_size: int + """Hierarchical options""" + + max_chunk_size: int + """Section_Based and Fixed_Length options""" + + parent_chunk_size: int + """Hierarchical options""" + + semantic_threshold: float + """Semantic options""" diff --git a/src/gradient/types/knowledge_bases/data_source_update_response.py b/src/gradient/types/knowledge_bases/data_source_update_response.py new file mode 100644 index 00000000..31484137 --- /dev/null +++ b/src/gradient/types/knowledge_bases/data_source_update_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .api_knowledge_base_data_source import APIKnowledgeBaseDataSource + +__all__ = ["DataSourceUpdateResponse"] + + +class DataSourceUpdateResponse(BaseModel): + """ + Update a data source of a knowledge base with change in chunking algorithm/options + """ + + knowledge_base_data_source: Optional[APIKnowledgeBaseDataSource] = None + """Data Source configuration for Knowledge Bases""" diff --git a/src/gradient/types/response_create_params.py b/src/gradient/types/response_create_params.py new file mode 100644 index 00000000..9b870f3c --- /dev/null +++ b/src/gradient/types/response_create_params.py @@ -0,0 +1,331 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, List, Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from .._types import SequenceNotStr + +__all__ = [ + "ResponseCreateParamsBase", + "InputUnionMember1", + "InputUnionMember1UnionMember0", + "InputUnionMember1UnionMember0Content", + "InputUnionMember1UnionMember1", + "InputUnionMember1UnionMember1ContentUnionMember1", + "InputUnionMember1UnionMember1ContentUnionMember1UnionMember0", + "InputUnionMember1UnionMember1ToolCall", + "InputUnionMember1UnionMember1ToolCallFunction", + "StreamOptions", + "ToolChoice", + "ToolChoiceChatCompletionNamedToolChoice", + "ToolChoiceChatCompletionNamedToolChoiceFunction", + "Tool", + "ResponseCreateParamsNonStreaming", + "ResponseCreateParamsStreaming", +] + + +class ResponseCreateParamsBase(TypedDict, total=False): + input: Required[Union[str, Iterable[InputUnionMember1]]] + """The input text prompt or conversation history. + + Can be a string or an array of message objects for conversation context. + """ + + model: Required[str] + """Model ID used to generate the response. Must be a VLLM model.""" + + instructions: Optional[str] + """System-level instructions for the model. + + This sets the behavior and context for the response generation. + """ + + max_output_tokens: Optional[int] + """Maximum number of tokens to generate in the response. + + If not specified, the model will use a default value. + """ + + max_tokens: Optional[int] + """The maximum number of tokens that can be generated in the completion. + + Alias for max_output_tokens for compatibility. + """ + + metadata: Optional[Dict[str, str]] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + modalities: Optional[List[Literal["text"]]] + """Specifies the output types the model should generate. + + For text-to-text, this should be ["text"]. + """ + + parallel_tool_calls: Optional[bool] + """Whether to enable parallel tool calls. + + When true, the model can make multiple tool calls in parallel. + """ + + stop: Union[Optional[str], SequenceNotStr[str], None] + """Up to 4 sequences where the API will stop generating further tokens. + + The returned text will not contain the stop sequence. + """ + + stream_options: Optional[StreamOptions] + """Options for streaming response. Only set this when you set `stream: true`.""" + + temperature: Optional[float] + """What sampling temperature to use, between 0 and 2. + + Higher values like 0.8 will make the output more random, while lower values like + 0.2 will make it more focused and deterministic. We generally recommend altering + this or `top_p` but not both. + """ + + tool_choice: ToolChoice + """ + Controls which (if any) tool is called by the model. `none` means the model will + not call any tool and instead generates a message. `auto` means the model can + pick between generating a message or calling one or more tools. `required` means + the model must call one or more tools. Specifying a particular tool via + `{"type": "function", "function": {"name": "my_function"}}` forces the model to + call that tool. + + `none` is the default when no tools are present. `auto` is the default if tools + are present. + """ + + tools: Iterable[Tool] + """A list of tools the model may call. + + Currently, only functions are supported as a tool. Uses Responses API format + (with `name`, `description`, `parameters` at top level). + """ + + top_p: Optional[float] + """ + An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 + means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or `temperature` but not both. + """ + + user: str + """ + A unique identifier representing your end-user, which can help DigitalOcean to + monitor and detect abuse. + """ + + +class InputUnionMember1UnionMember0ContentTyped(TypedDict, total=False): + text: str + """The reasoning text content""" + + type: Literal["reasoning_text"] + """The type of content""" + + +InputUnionMember1UnionMember0Content: TypeAlias = Union[InputUnionMember1UnionMember0ContentTyped, Dict[str, object]] + + +class InputUnionMember1UnionMember0Typed(TypedDict, total=False): + type: Required[Literal["function_call", "function_call_output", "reasoning"]] + """ + The type of input item (must be function_call, function_call_output, or + reasoning) + """ + + id: str + """The unique ID of the reasoning item (optional for reasoning)""" + + arguments: str + """JSON string of function arguments (required for function_call)""" + + call_id: str + """The call ID (required for function_call and function_call_output)""" + + content: Optional[Iterable[InputUnionMember1UnionMember0Content]] + """Array of reasoning content parts (optional for reasoning, can be null)""" + + encrypted_content: Optional[str] + """Encrypted content (optional)""" + + name: str + """The function name (required for function_call)""" + + output: str + """JSON string of function output (required for function_call_output)""" + + status: Optional[str] + """Status of the item (optional, can be null)""" + + summary: Iterable[object] + """Summary of the reasoning (optional for reasoning)""" + + +InputUnionMember1UnionMember0: TypeAlias = Union[InputUnionMember1UnionMember0Typed, Dict[str, object]] + + +class InputUnionMember1UnionMember1ContentUnionMember1UnionMember0(TypedDict, total=False): + text: Required[str] + """The text content""" + + type: Required[Literal["input_text"]] + """The type of content part""" + + +InputUnionMember1UnionMember1ContentUnionMember1: TypeAlias = Union[ + InputUnionMember1UnionMember1ContentUnionMember1UnionMember0, Dict[str, object] +] + + +class InputUnionMember1UnionMember1ToolCallFunction(TypedDict, total=False): + """The function that the model called.""" + + arguments: Required[str] + """ + The arguments to call the function with, as generated by the model in JSON + format. Note that the model does not always generate valid JSON, and may + hallucinate parameters not defined by your function schema. Validate the + arguments in your code before calling your function. + """ + + name: Required[str] + """The name of the function to call.""" + + +class InputUnionMember1UnionMember1ToolCall(TypedDict, total=False): + id: Required[str] + """The ID of the tool call.""" + + function: Required[InputUnionMember1UnionMember1ToolCallFunction] + """The function that the model called.""" + + type: Required[Literal["function"]] + """The type of the tool. Currently, only `function` is supported.""" + + +class InputUnionMember1UnionMember1Typed(TypedDict, total=False): + content: Required[Union[str, Iterable[InputUnionMember1UnionMember1ContentUnionMember1]]] + """The content of the message (string or content parts array)""" + + role: Literal["user", "assistant", "system", "tool", "developer"] + """The role of the message author""" + + tool_call_id: str + """Tool call ID that this message is responding to (required for tool role)""" + + tool_calls: Iterable[InputUnionMember1UnionMember1ToolCall] + """Tool calls made by the assistant (for assistant role messages)""" + + type: Literal["message"] + """Optional type identifier for message items (used by some clients like Codex)""" + + +InputUnionMember1UnionMember1: TypeAlias = Union[InputUnionMember1UnionMember1Typed, Dict[str, object]] + +InputUnionMember1: TypeAlias = Union[InputUnionMember1UnionMember0, InputUnionMember1UnionMember1] + + +class StreamOptions(TypedDict, total=False): + """Options for streaming response. Only set this when you set `stream: true`.""" + + include_usage: bool + """If set, an additional chunk will be streamed before the `data: [DONE]` message. + + The `usage` field on this chunk shows the token usage statistics for the entire + request, and the `choices` field will always be an empty array. + + All other chunks will also include a `usage` field, but with a null value. + **NOTE:** If the stream is interrupted, you may not receive the final usage + chunk which contains the total token usage for the request. + """ + + +class ToolChoiceChatCompletionNamedToolChoiceFunction(TypedDict, total=False): + name: Required[str] + """The name of the function to call.""" + + +class ToolChoiceChatCompletionNamedToolChoice(TypedDict, total=False): + """Specifies a tool the model should use. + + Use to force the model to call a specific function. + """ + + function: Required[ToolChoiceChatCompletionNamedToolChoiceFunction] + + type: Required[Literal["function"]] + """The type of the tool. Currently, only `function` is supported.""" + + +ToolChoice: TypeAlias = Union[Literal["none", "auto", "required"], ToolChoiceChatCompletionNamedToolChoice] + + +class Tool(TypedDict, total=False): + """Tool definition for Responses API (flat format). + + This format is used by VLLM's Responses API where name, description, and parameters are at the top level of the tool object. + """ + + type: Required[Literal["function", "web_search", "web_search_2025_08_26"]] + """The type of the tool. + + Supported values are `function` (custom tools), `web_search`, and + `web_search_2025_08_26` (built-in web search). + """ + + description: str + """ + A description of what the function does, used by the model to choose when and + how to call the function. + """ + + name: str + """The name of the function to be called. + + Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length + of 64. + """ + + parameters: Dict[str, object] + """The parameters the functions accepts, described as a JSON Schema object. + + See the [guide](/docs/guides/function-calling) for examples, and the + [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for + documentation about the format. + + Omitting `parameters` defines a function with an empty parameter list. + """ + + +class ResponseCreateParamsNonStreaming(ResponseCreateParamsBase, total=False): + stream: Optional[Literal[False]] + """ + If set to true, the model response data will be streamed to the client as it is + generated using server-sent events. + """ + + +class ResponseCreateParamsStreaming(ResponseCreateParamsBase): + stream: Required[Literal[True]] + """ + If set to true, the model response data will be streamed to the client as it is + generated using server-sent events. + """ + + +ResponseCreateParams = Union[ResponseCreateParamsNonStreaming, ResponseCreateParamsStreaming] diff --git a/src/gradient/types/shared/__init__.py b/src/gradient/types/shared/__init__.py index 4fb2986a..272092b7 100644 --- a/src/gradient/types/shared/__init__.py +++ b/src/gradient/types/shared/__init__.py @@ -26,7 +26,9 @@ from .chat_completion_chunk import ChatCompletionChunk as ChatCompletionChunk from .image_gen_stream_event import ImageGenStreamEvent as ImageGenStreamEvent from .subscription_tier_base import SubscriptionTierBase as SubscriptionTierBase +from .create_response_response import CreateResponseResponse as CreateResponseResponse from .image_gen_completed_event import ImageGenCompletedEvent as ImageGenCompletedEvent from .droplet_next_backup_window import DropletNextBackupWindow as DropletNextBackupWindow from .chat_completion_token_logprob import ChatCompletionTokenLogprob as ChatCompletionTokenLogprob from .image_gen_partial_image_event import ImageGenPartialImageEvent as ImageGenPartialImageEvent +from .create_response_stream_response import CreateResponseStreamResponse as CreateResponseStreamResponse diff --git a/src/gradient/types/shared/completion_usage.py b/src/gradient/types/shared/completion_usage.py index 79ce64ee..596bd045 100644 --- a/src/gradient/types/shared/completion_usage.py +++ b/src/gradient/types/shared/completion_usage.py @@ -2,12 +2,31 @@ from ..._models import BaseModel -__all__ = ["CompletionUsage"] +__all__ = ["CompletionUsage", "CacheCreation"] + + +class CacheCreation(BaseModel): + """Breakdown of prompt tokens written to cache.""" + + ephemeral_1h_input_tokens: int + """Number of prompt tokens written to 1h cache.""" + + ephemeral_5m_input_tokens: int + """Number of prompt tokens written to 5m cache.""" class CompletionUsage(BaseModel): """Usage statistics for the completion request.""" + cache_created_input_tokens: int + """Number of prompt tokens written to cache.""" + + cache_creation: CacheCreation + """Breakdown of prompt tokens written to cache.""" + + cache_read_input_tokens: int + """Number of prompt tokens read from cache.""" + completion_tokens: int """Number of tokens in the generated completion.""" diff --git a/src/gradient/types/shared/create_response_response.py b/src/gradient/types/shared/create_response_response.py new file mode 100644 index 00000000..61dbb155 --- /dev/null +++ b/src/gradient/types/shared/create_response_response.py @@ -0,0 +1,332 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import builtins +from typing import Dict, List, Union, Optional +from typing_extensions import Literal, TypeAlias + +from ..._models import BaseModel +from .chat_completion_token_logprob import ChatCompletionTokenLogprob + +__all__ = [ + "CreateResponseResponse", + "Usage", + "UsageInputTokensDetails", + "UsageOutputTokensDetails", + "Choice", + "ChoiceMessage", + "ChoiceMessageToolCall", + "ChoiceMessageToolCallFunction", + "ChoiceLogprobs", + "Output", + "OutputUnionMember0", + "OutputUnionMember1", + "OutputUnionMember2", + "OutputUnionMember2Content", + "Tool", +] + + +class UsageInputTokensDetails(BaseModel): + """A detailed breakdown of the input tokens.""" + + cached_tokens: int + """The number of tokens that were retrieved from the cache. + + [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + """ + + +class UsageOutputTokensDetails(BaseModel): + """A detailed breakdown of the output tokens.""" + + reasoning_tokens: int + """The number of reasoning tokens.""" + + tool_output_tokens: int + """The number of tool output tokens.""" + + +class Usage(BaseModel): + """ + Detailed token usage statistics for the request, including input/output token counts and detailed breakdowns. + """ + + input_tokens: int + """The number of input tokens.""" + + input_tokens_details: UsageInputTokensDetails + """A detailed breakdown of the input tokens.""" + + output_tokens: int + """The number of output tokens.""" + + output_tokens_details: UsageOutputTokensDetails + """A detailed breakdown of the output tokens.""" + + total_tokens: int + """The total number of tokens used.""" + + +class ChoiceMessageToolCallFunction(BaseModel): + """The function that the model called.""" + + arguments: str + """ + The arguments to call the function with, as generated by the model in JSON + format. Note that the model does not always generate valid JSON, and may + hallucinate parameters not defined by your function schema. Validate the + arguments in your code before calling your function. + """ + + name: str + """The name of the function to call.""" + + +class ChoiceMessageToolCall(BaseModel): + id: str + """The ID of the tool call.""" + + function: ChoiceMessageToolCallFunction + """The function that the model called.""" + + type: Literal["function"] + """The type of the tool. Currently, only `function` is supported.""" + + +class ChoiceMessage(BaseModel): + """The generated message response.""" + + content: Optional[str] = None + """The generated text content.""" + + role: Optional[Literal["assistant"]] = None + """The role of the message author, which is always `assistant`.""" + + tool_calls: Optional[List[ChoiceMessageToolCall]] = None + """The tool calls generated by the model, such as function calls.""" + + +class ChoiceLogprobs(BaseModel): + """Log probability information for the choice. + + Only present if logprobs was requested in the request. + """ + + content: Optional[List[ChatCompletionTokenLogprob]] = None + """A list of message content tokens with log probability information.""" + + +class Choice(BaseModel): + finish_reason: Literal["stop", "length", "tool_calls", "content_filter"] + """The reason the model stopped generating tokens. + + This will be `stop` if the model hit a natural stop point or a provided stop + sequence, `length` if the maximum number of tokens specified in the request was + reached, or `tool_calls` if the model called a tool. + """ + + index: int + """The index of the choice in the list of choices.""" + + message: ChoiceMessage + """The generated message response.""" + + logprobs: Optional[ChoiceLogprobs] = None + """Log probability information for the choice. + + Only present if logprobs was requested in the request. + """ + + +class OutputUnionMember0(BaseModel): + arguments: str + """JSON string of function arguments""" + + call_id: str + """The unique ID of the function tool call""" + + name: str + """The name of the function to call""" + + type: Literal["function_call"] + """The type of output item""" + + id: Optional[str] = None + """The unique ID of the function tool call (same as call_id)""" + + encrypted_content: Optional[str] = None + """Encrypted content (optional)""" + + status: Optional[str] = None + """Status of the item (optional, can be null)""" + + +class OutputUnionMember1(BaseModel): + text: str + """The text content""" + + type: Literal["text"] + """The type of output item""" + + +class OutputUnionMember2Content(BaseModel): + text: str + """The reasoning text content""" + + type: Literal["reasoning_text"] + """The type of content""" + + +class OutputUnionMember2(BaseModel): + id: str + """The unique ID of the reasoning item""" + + content: List[OutputUnionMember2Content] + """Array of reasoning content parts""" + + summary: List[object] + """Summary of the reasoning (usually empty)""" + + type: Literal["reasoning"] + """The type of output item""" + + encrypted_content: Optional[str] = None + """Encrypted content (optional)""" + + status: Optional[str] = None + """Status of the item (optional, can be null)""" + + +Output: TypeAlias = Union[OutputUnionMember0, OutputUnionMember1, OutputUnionMember2] + + +class Tool(BaseModel): + """Tool definition for Responses API (flat format). + + This format is used by VLLM's Responses API where name, description, and parameters are at the top level of the tool object. + """ + + type: Literal["function", "web_search", "web_search_2025_08_26"] + """The type of the tool. + + Supported values are `function` (custom tools), `web_search`, and + `web_search_2025_08_26` (built-in web search). + """ + + description: Optional[str] = None + """ + A description of what the function does, used by the model to choose when and + how to call the function. + """ + + name: Optional[str] = None + """The name of the function to be called. + + Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length + of 64. + """ + + parameters: Optional[Dict[str, object]] = None + """The parameters the functions accepts, described as a JSON Schema object. + + See the [guide](/docs/guides/function-calling) for examples, and the + [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for + documentation about the format. + + Omitting `parameters` defines a function with an empty parameter list. + """ + + +class CreateResponseResponse(BaseModel): + """ + Represents a text-to-text response returned by the model, based on the provided input. VLLM models only. + """ + + id: str + """A unique identifier for the response.""" + + created: int + """The Unix timestamp (in seconds) of when the response was created.""" + + model: str + """The model used to generate the response.""" + + object: Literal["response"] + """The object type, which is always `response`.""" + + usage: Usage + """ + Detailed token usage statistics for the request, including input/output token + counts and detailed breakdowns. + """ + + background: Optional[bool] = None + """Whether the request was processed in the background""" + + choices: Optional[List[Choice]] = None + """A list of response choices. + + Can be more than one if `n` is greater than 1. Optional - Responses API + primarily uses the output array. + """ + + input_messages: Optional[List[builtins.object]] = None + """Input messages (if applicable)""" + + max_output_tokens: Optional[int] = None + """Maximum output tokens setting""" + + max_tool_calls: Optional[int] = None + """Maximum tool calls setting""" + + output: Optional[List[Output]] = None + """An array of content items generated by the model. + + This includes text content, function calls, reasoning items, and other output + types. Use this field for Responses API compatibility. + """ + + output_messages: Optional[List[builtins.object]] = None + """Output messages (if applicable)""" + + parallel_tool_calls: Optional[bool] = None + """Whether parallel tool calls are enabled""" + + previous_response_id: Optional[str] = None + """Previous response ID (for multi-turn conversations)""" + + prompt: Optional[str] = None + """Prompt used for the response""" + + reasoning: Optional[str] = None + """Reasoning content""" + + service_tier: Optional[str] = None + """Service tier used""" + + status: Optional[str] = None + """Status of the response""" + + temperature: Optional[float] = None + """Temperature setting used for the response""" + + text: Optional[str] = None + """Text content""" + + tool_choice: Optional[str] = None + """Tool choice setting used for the response""" + + tools: Optional[List[Tool]] = None + """Tools available for the response""" + + top_logprobs: Optional[int] = None + """Top logprobs setting""" + + top_p: Optional[float] = None + """Top-p setting used for the response""" + + truncation: Optional[str] = None + """Truncation setting""" + + user: Optional[str] = None + """User identifier""" diff --git a/src/gradient/types/shared/create_response_stream_response.py b/src/gradient/types/shared/create_response_stream_response.py new file mode 100644 index 00000000..ef0230c8 --- /dev/null +++ b/src/gradient/types/shared/create_response_stream_response.py @@ -0,0 +1,139 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from .completion_usage import CompletionUsage +from .chat_completion_token_logprob import ChatCompletionTokenLogprob + +__all__ = [ + "CreateResponseStreamResponse", + "Choice", + "ChoiceDelta", + "ChoiceDeltaToolCall", + "ChoiceDeltaToolCallFunction", + "ChoiceLogprobs", +] + + +class ChoiceDeltaToolCallFunction(BaseModel): + """The function that the model called.""" + + arguments: str + """ + The arguments to call the function with, as generated by the model in JSON + format. Note that the model does not always generate valid JSON, and may + hallucinate parameters not defined by your function schema. Validate the + arguments in your code before calling your function. + """ + + name: str + """The name of the function to call.""" + + +class ChoiceDeltaToolCall(BaseModel): + id: str + """The ID of the tool call.""" + + function: ChoiceDeltaToolCallFunction + """The function that the model called.""" + + type: Literal["function"] + """The type of the tool. Currently, only `function` is supported.""" + + +class ChoiceDelta(BaseModel): + """A chunk of the response message generated by the model.""" + + content: Optional[str] = None + """The contents of the chunk message. + + Can be null for chunks with tool calls or other non-text content. + """ + + reasoning_content: Optional[str] = None + """The reasoning content generated by the model. + + Only present when the model generates reasoning text. + """ + + role: Optional[Literal["assistant"]] = None + """The role of the message author. Only present in the first chunk.""" + + tool_calls: Optional[List[ChoiceDeltaToolCall]] = None + """The tool calls generated by the model, such as function calls. + + Only present when the model decides to call a tool. + """ + + +class ChoiceLogprobs(BaseModel): + """Log probability information for the choice. + + Only present if logprobs was requested in the request. + """ + + content: Optional[List[ChatCompletionTokenLogprob]] = None + """A list of message content tokens with log probability information.""" + + +class Choice(BaseModel): + delta: ChoiceDelta + """A chunk of the response message generated by the model.""" + + index: int + """The index of the choice in the list of choices.""" + + finish_reason: Optional[Literal["stop", "length", "tool_calls", "content_filter"]] = None + """The reason the model stopped generating tokens. + + This will be `stop` if the model hit a natural stop point or a provided stop + sequence, `length` if the maximum number of tokens specified in the request was + reached, or `tool_calls` if the model called a tool. Only present in the final + chunk. + """ + + logprobs: Optional[ChoiceLogprobs] = None + """Log probability information for the choice. + + Only present if logprobs was requested in the request. + """ + + +class CreateResponseStreamResponse(BaseModel): + """ + Represents a streamed chunk of a text-to-text response returned by the model, based on the provided input. VLLM models only. + """ + + id: str + """A unique identifier for the response. Each chunk has the same ID.""" + + choices: List[Choice] + """A list of response choice chunks. + + Can contain more than one element if `n` is greater than 1. Can also be empty + for the last chunk if you set `stream_options: {"include_usage": true}`. + """ + + created: int + """The Unix timestamp (in seconds) of when the response was created. + + Each chunk has the same timestamp. + """ + + model: str + """The model used to generate the response.""" + + object: Literal["response.chunk"] + """The object type, which is always `response.chunk`.""" + + usage: Optional[CompletionUsage] = None + """ + An optional field that will only be present when you set + `stream_options: {"include_usage": true}` in your request. When present, it + contains a null value **except for the last chunk** which contains the token + usage statistics for the entire request. **NOTE:** If the stream is interrupted + or cancelled, you may not receive the final usage chunk which contains the total + token usage for the request. + """ diff --git a/tests/api_resources/agents/test_evaluation_datasets.py b/tests/api_resources/agents/test_evaluation_datasets.py index 64dceb03..5093660e 100644 --- a/tests/api_resources/agents/test_evaluation_datasets.py +++ b/tests/api_resources/agents/test_evaluation_datasets.py @@ -30,6 +30,7 @@ def test_method_create(self, client: Gradient) -> None: @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: evaluation_dataset = client.agents.evaluation_datasets.create( + dataset_type="EVALUATION_DATASET_TYPE_UNKNOWN", file_upload_dataset={ "original_file_name": "example name", "size_in_bytes": "12345", @@ -126,6 +127,7 @@ async def test_method_create(self, async_client: AsyncGradient) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: evaluation_dataset = await async_client.agents.evaluation_datasets.create( + dataset_type="EVALUATION_DATASET_TYPE_UNKNOWN", file_upload_dataset={ "original_file_name": "example name", "size_in_bytes": "12345", diff --git a/tests/api_resources/agents/test_evaluation_runs.py b/tests/api_resources/agents/test_evaluation_runs.py index c6acaf82..8fdfe2cd 100644 --- a/tests/api_resources/agents/test_evaluation_runs.py +++ b/tests/api_resources/agents/test_evaluation_runs.py @@ -32,6 +32,7 @@ def test_method_create(self, client: Gradient) -> None: @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: evaluation_run = client.agents.evaluation_runs.create( + agent_deployment_names=["example string"], agent_uuids=["example string"], run_name="Evaluation Run Name", test_case_uuid='"12345678-1234-1234-1234-123456789012"', @@ -216,6 +217,7 @@ async def test_method_create(self, async_client: AsyncGradient) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: evaluation_run = await async_client.agents.evaluation_runs.create( + agent_deployment_names=["example string"], agent_uuids=["example string"], run_name="Evaluation Run Name", test_case_uuid='"12345678-1234-1234-1234-123456789012"', diff --git a/tests/api_resources/agents/test_evaluation_test_cases.py b/tests/api_resources/agents/test_evaluation_test_cases.py index 7cd0a07e..a8942239 100644 --- a/tests/api_resources/agents/test_evaluation_test_cases.py +++ b/tests/api_resources/agents/test_evaluation_test_cases.py @@ -33,6 +33,7 @@ def test_method_create(self, client: Gradient) -> None: @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: evaluation_test_case = client.agents.evaluation_test_cases.create( + agent_workspace_name="example name", dataset_uuid="123e4567-e89b-12d3-a456-426614174000", description="example string", metrics=["example string"], @@ -278,6 +279,7 @@ async def test_method_create(self, async_client: AsyncGradient) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: evaluation_test_case = await async_client.agents.evaluation_test_cases.create( + agent_workspace_name="example name", dataset_uuid="123e4567-e89b-12d3-a456-426614174000", description="example string", metrics=["example string"], diff --git a/tests/api_resources/apps/__init__.py b/tests/api_resources/apps/__init__.py new file mode 100644 index 00000000..fd8019a9 --- /dev/null +++ b/tests/api_resources/apps/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/apps/test_job_invocations.py b/tests/api_resources/apps/test_job_invocations.py new file mode 100644 index 00000000..a7cb68df --- /dev/null +++ b/tests/api_resources/apps/test_job_invocations.py @@ -0,0 +1,148 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gradient import Gradient, AsyncGradient +from tests.utils import assert_matches_type +from gradient.types.apps import JobInvocationCancelResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestJobInvocations: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_cancel(self, client: Gradient) -> None: + job_invocation = client.apps.job_invocations.cancel( + job_invocation_id="123e4567-e89b-12d3-a456-426", + app_id="4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf", + ) + assert_matches_type(JobInvocationCancelResponse, job_invocation, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_cancel_with_all_params(self, client: Gradient) -> None: + job_invocation = client.apps.job_invocations.cancel( + job_invocation_id="123e4567-e89b-12d3-a456-426", + app_id="4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf", + job_name="job_name", + ) + assert_matches_type(JobInvocationCancelResponse, job_invocation, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_cancel(self, client: Gradient) -> None: + response = client.apps.job_invocations.with_raw_response.cancel( + job_invocation_id="123e4567-e89b-12d3-a456-426", + app_id="4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + job_invocation = response.parse() + assert_matches_type(JobInvocationCancelResponse, job_invocation, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_cancel(self, client: Gradient) -> None: + with client.apps.job_invocations.with_streaming_response.cancel( + job_invocation_id="123e4567-e89b-12d3-a456-426", + app_id="4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + job_invocation = response.parse() + assert_matches_type(JobInvocationCancelResponse, job_invocation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_path_params_cancel(self, client: Gradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + client.apps.job_invocations.with_raw_response.cancel( + job_invocation_id="123e4567-e89b-12d3-a456-426", + app_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_invocation_id` but received ''"): + client.apps.job_invocations.with_raw_response.cancel( + job_invocation_id="", + app_id="4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf", + ) + + +class TestAsyncJobInvocations: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_cancel(self, async_client: AsyncGradient) -> None: + job_invocation = await async_client.apps.job_invocations.cancel( + job_invocation_id="123e4567-e89b-12d3-a456-426", + app_id="4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf", + ) + assert_matches_type(JobInvocationCancelResponse, job_invocation, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_cancel_with_all_params(self, async_client: AsyncGradient) -> None: + job_invocation = await async_client.apps.job_invocations.cancel( + job_invocation_id="123e4567-e89b-12d3-a456-426", + app_id="4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf", + job_name="job_name", + ) + assert_matches_type(JobInvocationCancelResponse, job_invocation, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_cancel(self, async_client: AsyncGradient) -> None: + response = await async_client.apps.job_invocations.with_raw_response.cancel( + job_invocation_id="123e4567-e89b-12d3-a456-426", + app_id="4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + job_invocation = await response.parse() + assert_matches_type(JobInvocationCancelResponse, job_invocation, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_cancel(self, async_client: AsyncGradient) -> None: + async with async_client.apps.job_invocations.with_streaming_response.cancel( + job_invocation_id="123e4567-e89b-12d3-a456-426", + app_id="4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + job_invocation = await response.parse() + assert_matches_type(JobInvocationCancelResponse, job_invocation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_path_params_cancel(self, async_client: AsyncGradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + await async_client.apps.job_invocations.with_raw_response.cancel( + job_invocation_id="123e4567-e89b-12d3-a456-426", + app_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `job_invocation_id` but received ''"): + await async_client.apps.job_invocations.with_raw_response.cancel( + job_invocation_id="", + app_id="4f6c71e2-1e90-4762-9fee-6cc4a0a9f2cf", + ) diff --git a/tests/api_resources/gpu_droplets/test_images.py b/tests/api_resources/gpu_droplets/test_images.py index 4c4146e2..480f94a5 100644 --- a/tests/api_resources/gpu_droplets/test_images.py +++ b/tests/api_resources/gpu_droplets/test_images.py @@ -32,9 +32,9 @@ def test_method_create(self, client: Gradient) -> None: @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: image = client.gpu_droplets.images.create( - description=" ", + description="Cloud-optimized image w/ small footprint", distribution="Ubuntu", - name="Nifty New Snapshot", + name="ubuntu-18.04-minimal", region="nyc3", tags=["base-image", "prod"], url="http://cloud-images.ubuntu.com/minimal/releases/bionic/release/ubuntu-18.04-minimal-cloudimg-amd64.img", @@ -232,9 +232,9 @@ async def test_method_create(self, async_client: AsyncGradient) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: image = await async_client.gpu_droplets.images.create( - description=" ", + description="Cloud-optimized image w/ small footprint", distribution="Ubuntu", - name="Nifty New Snapshot", + name="ubuntu-18.04-minimal", region="nyc3", tags=["base-image", "prod"], url="http://cloud-images.ubuntu.com/minimal/releases/bionic/release/ubuntu-18.04-minimal-cloudimg-amd64.img", diff --git a/tests/api_resources/knowledge_bases/test_data_sources.py b/tests/api_resources/knowledge_bases/test_data_sources.py index ca721d93..d28fd409 100644 --- a/tests/api_resources/knowledge_bases/test_data_sources.py +++ b/tests/api_resources/knowledge_bases/test_data_sources.py @@ -13,6 +13,7 @@ DataSourceListResponse, DataSourceCreateResponse, DataSourceDeleteResponse, + DataSourceUpdateResponse, DataSourceCreatePresignedURLsResponse, ) @@ -42,6 +43,13 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: "region": "example string", "secret_key": "example string", }, + chunking_algorithm="CHUNKING_ALGORITHM_SECTION_BASED", + chunking_options={ + "child_chunk_size": 350, + "max_chunk_size": 750, + "parent_chunk_size": 1000, + "semantic_threshold": 0.5, + }, body_knowledge_base_uuid='"12345678-1234-1234-1234-123456789012"', spaces_data_source={ "bucket_name": "example name", @@ -93,6 +101,78 @@ def test_path_params_create(self, client: Gradient) -> None: path_knowledge_base_uuid="", ) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update(self, client: Gradient) -> None: + data_source = client.knowledge_bases.data_sources.update( + path_data_source_uuid="123e4567-e89b-12d3-a456-426614174000", + path_knowledge_base_uuid="123e4567-e89b-12d3-a456-426614174000", + ) + assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_update_with_all_params(self, client: Gradient) -> None: + data_source = client.knowledge_bases.data_sources.update( + path_data_source_uuid="123e4567-e89b-12d3-a456-426614174000", + path_knowledge_base_uuid="123e4567-e89b-12d3-a456-426614174000", + chunking_algorithm="CHUNKING_ALGORITHM_SECTION_BASED", + chunking_options={ + "child_chunk_size": 350, + "max_chunk_size": 750, + "parent_chunk_size": 1000, + "semantic_threshold": 0.5, + }, + body_data_source_uuid="98765432-1234-1234-1234-123456789012", + body_knowledge_base_uuid="12345678-1234-1234-1234-123456789012", + ) + assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_update(self, client: Gradient) -> None: + response = client.knowledge_bases.data_sources.with_raw_response.update( + path_data_source_uuid="123e4567-e89b-12d3-a456-426614174000", + path_knowledge_base_uuid="123e4567-e89b-12d3-a456-426614174000", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + data_source = response.parse() + assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_update(self, client: Gradient) -> None: + with client.knowledge_bases.data_sources.with_streaming_response.update( + path_data_source_uuid="123e4567-e89b-12d3-a456-426614174000", + path_knowledge_base_uuid="123e4567-e89b-12d3-a456-426614174000", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + data_source = response.parse() + assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_path_params_update(self, client: Gradient) -> None: + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `path_knowledge_base_uuid` but received ''" + ): + client.knowledge_bases.data_sources.with_raw_response.update( + path_data_source_uuid="123e4567-e89b-12d3-a456-426614174000", + path_knowledge_base_uuid="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_data_source_uuid` but received ''"): + client.knowledge_bases.data_sources.with_raw_response.update( + path_data_source_uuid="", + path_knowledge_base_uuid="123e4567-e89b-12d3-a456-426614174000", + ) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: @@ -264,6 +344,13 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) "region": "example string", "secret_key": "example string", }, + chunking_algorithm="CHUNKING_ALGORITHM_SECTION_BASED", + chunking_options={ + "child_chunk_size": 350, + "max_chunk_size": 750, + "parent_chunk_size": 1000, + "semantic_threshold": 0.5, + }, body_knowledge_base_uuid='"12345678-1234-1234-1234-123456789012"', spaces_data_source={ "bucket_name": "example name", @@ -315,6 +402,78 @@ async def test_path_params_create(self, async_client: AsyncGradient) -> None: path_knowledge_base_uuid="", ) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update(self, async_client: AsyncGradient) -> None: + data_source = await async_client.knowledge_bases.data_sources.update( + path_data_source_uuid="123e4567-e89b-12d3-a456-426614174000", + path_knowledge_base_uuid="123e4567-e89b-12d3-a456-426614174000", + ) + assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncGradient) -> None: + data_source = await async_client.knowledge_bases.data_sources.update( + path_data_source_uuid="123e4567-e89b-12d3-a456-426614174000", + path_knowledge_base_uuid="123e4567-e89b-12d3-a456-426614174000", + chunking_algorithm="CHUNKING_ALGORITHM_SECTION_BASED", + chunking_options={ + "child_chunk_size": 350, + "max_chunk_size": 750, + "parent_chunk_size": 1000, + "semantic_threshold": 0.5, + }, + body_data_source_uuid="98765432-1234-1234-1234-123456789012", + body_knowledge_base_uuid="12345678-1234-1234-1234-123456789012", + ) + assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_update(self, async_client: AsyncGradient) -> None: + response = await async_client.knowledge_bases.data_sources.with_raw_response.update( + path_data_source_uuid="123e4567-e89b-12d3-a456-426614174000", + path_knowledge_base_uuid="123e4567-e89b-12d3-a456-426614174000", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + data_source = await response.parse() + assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_update(self, async_client: AsyncGradient) -> None: + async with async_client.knowledge_bases.data_sources.with_streaming_response.update( + path_data_source_uuid="123e4567-e89b-12d3-a456-426614174000", + path_knowledge_base_uuid="123e4567-e89b-12d3-a456-426614174000", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + data_source = await response.parse() + assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_path_params_update(self, async_client: AsyncGradient) -> None: + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `path_knowledge_base_uuid` but received ''" + ): + await async_client.knowledge_bases.data_sources.with_raw_response.update( + path_data_source_uuid="123e4567-e89b-12d3-a456-426614174000", + path_knowledge_base_uuid="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_data_source_uuid` but received ''"): + await async_client.knowledge_bases.data_sources.with_raw_response.update( + path_data_source_uuid="", + path_knowledge_base_uuid="123e4567-e89b-12d3-a456-426614174000", + ) + @pytest.mark.skip(reason="Prism tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: diff --git a/tests/api_resources/test_billing.py b/tests/api_resources/test_billing.py new file mode 100644 index 00000000..59181b15 --- /dev/null +++ b/tests/api_resources/test_billing.py @@ -0,0 +1,177 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gradient import Gradient, AsyncGradient +from tests.utils import assert_matches_type +from gradient.types import BillingListInsightsResponse +from gradient._utils import parse_date + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestBilling: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_insights(self, client: Gradient) -> None: + billing = client.billing.list_insights( + end_date=parse_date("2025-01-31"), + account_urn="do:team:12345678-1234-1234-1234-123456789012", + start_date=parse_date("2025-01-01"), + ) + assert_matches_type(BillingListInsightsResponse, billing, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_list_insights_with_all_params(self, client: Gradient) -> None: + billing = client.billing.list_insights( + end_date=parse_date("2025-01-31"), + account_urn="do:team:12345678-1234-1234-1234-123456789012", + start_date=parse_date("2025-01-01"), + page=1, + per_page=1, + ) + assert_matches_type(BillingListInsightsResponse, billing, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_list_insights(self, client: Gradient) -> None: + response = client.billing.with_raw_response.list_insights( + end_date=parse_date("2025-01-31"), + account_urn="do:team:12345678-1234-1234-1234-123456789012", + start_date=parse_date("2025-01-01"), + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + billing = response.parse() + assert_matches_type(BillingListInsightsResponse, billing, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_list_insights(self, client: Gradient) -> None: + with client.billing.with_streaming_response.list_insights( + end_date=parse_date("2025-01-31"), + account_urn="do:team:12345678-1234-1234-1234-123456789012", + start_date=parse_date("2025-01-01"), + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + billing = response.parse() + assert_matches_type(BillingListInsightsResponse, billing, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_path_params_list_insights(self, client: Gradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_urn` but received ''"): + client.billing.with_raw_response.list_insights( + end_date=parse_date("2025-01-31"), + account_urn="", + start_date=parse_date("2025-01-01"), + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `start_date` but received ''"): + client.billing.with_raw_response.list_insights( + end_date=parse_date("2025-01-31"), + account_urn="do:team:12345678-1234-1234-1234-123456789012", + start_date="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `end_date` but received ''"): + client.billing.with_raw_response.list_insights( + end_date="", + account_urn="do:team:12345678-1234-1234-1234-123456789012", + start_date=parse_date("2025-01-01"), + ) + + +class TestAsyncBilling: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_insights(self, async_client: AsyncGradient) -> None: + billing = await async_client.billing.list_insights( + end_date=parse_date("2025-01-31"), + account_urn="do:team:12345678-1234-1234-1234-123456789012", + start_date=parse_date("2025-01-01"), + ) + assert_matches_type(BillingListInsightsResponse, billing, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_list_insights_with_all_params(self, async_client: AsyncGradient) -> None: + billing = await async_client.billing.list_insights( + end_date=parse_date("2025-01-31"), + account_urn="do:team:12345678-1234-1234-1234-123456789012", + start_date=parse_date("2025-01-01"), + page=1, + per_page=1, + ) + assert_matches_type(BillingListInsightsResponse, billing, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_list_insights(self, async_client: AsyncGradient) -> None: + response = await async_client.billing.with_raw_response.list_insights( + end_date=parse_date("2025-01-31"), + account_urn="do:team:12345678-1234-1234-1234-123456789012", + start_date=parse_date("2025-01-01"), + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + billing = await response.parse() + assert_matches_type(BillingListInsightsResponse, billing, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_list_insights(self, async_client: AsyncGradient) -> None: + async with async_client.billing.with_streaming_response.list_insights( + end_date=parse_date("2025-01-31"), + account_urn="do:team:12345678-1234-1234-1234-123456789012", + start_date=parse_date("2025-01-01"), + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + billing = await response.parse() + assert_matches_type(BillingListInsightsResponse, billing, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_path_params_list_insights(self, async_client: AsyncGradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_urn` but received ''"): + await async_client.billing.with_raw_response.list_insights( + end_date=parse_date("2025-01-31"), + account_urn="", + start_date=parse_date("2025-01-01"), + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `start_date` but received ''"): + await async_client.billing.with_raw_response.list_insights( + end_date=parse_date("2025-01-31"), + account_urn="do:team:12345678-1234-1234-1234-123456789012", + start_date="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `end_date` but received ''"): + await async_client.billing.with_raw_response.list_insights( + end_date="", + account_urn="do:team:12345678-1234-1234-1234-123456789012", + start_date=parse_date("2025-01-01"), + ) diff --git a/tests/api_resources/test_knowledge_bases.py b/tests/api_resources/test_knowledge_bases.py index 632951b4..9ce9785d 100644 --- a/tests/api_resources/test_knowledge_bases.py +++ b/tests/api_resources/test_knowledge_bases.py @@ -46,6 +46,13 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: }, "bucket_name": "example name", "bucket_region": "example string", + "chunking_algorithm": "CHUNKING_ALGORITHM_SECTION_BASED", + "chunking_options": { + "child_chunk_size": 350, + "max_chunk_size": 750, + "parent_chunk_size": 1000, + "semantic_threshold": 0.5, + }, "dropbox_data_source": { "folder": "example string", "refresh_token": "example string", @@ -447,6 +454,13 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) }, "bucket_name": "example name", "bucket_region": "example string", + "chunking_algorithm": "CHUNKING_ALGORITHM_SECTION_BASED", + "chunking_options": { + "child_chunk_size": 350, + "max_chunk_size": 750, + "parent_chunk_size": 1000, + "semantic_threshold": 0.5, + }, "dropbox_data_source": { "folder": "example string", "refresh_token": "example string", diff --git a/tests/api_resources/test_responses.py b/tests/api_resources/test_responses.py new file mode 100644 index 00000000..0d8d7acf --- /dev/null +++ b/tests/api_resources/test_responses.py @@ -0,0 +1,296 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from gradient import Gradient, AsyncGradient +from tests.utils import assert_matches_type +from gradient.types.shared import CreateResponseResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestResponses: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_overload_1(self, client: Gradient) -> None: + response = client.responses.create( + input="Tell me a three-sentence bedtime story about a unicorn.", + model="llama3-8b-instruct", + ) + assert_matches_type(CreateResponseResponse, response, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_with_all_params_overload_1(self, client: Gradient) -> None: + response = client.responses.create( + input="Tell me a three-sentence bedtime story about a unicorn.", + model="llama3-8b-instruct", + instructions="You are a helpful assistant.", + max_output_tokens=1024, + max_tokens=1024, + metadata={"foo": "string"}, + modalities=["text"], + parallel_tool_calls=True, + stop="\n", + stream=False, + stream_options={"include_usage": True}, + temperature=1, + tool_choice="none", + tools=[ + { + "type": "function", + "description": "description", + "name": "name", + "parameters": {"foo": "bar"}, + } + ], + top_p=1, + user="user-1234", + ) + assert_matches_type(CreateResponseResponse, response, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create_overload_1(self, client: Gradient) -> None: + http_response = client.responses.with_raw_response.create( + input="Tell me a three-sentence bedtime story about a unicorn.", + model="llama3-8b-instruct", + ) + + assert http_response.is_closed is True + assert http_response.http_request.headers.get("X-Stainless-Lang") == "python" + response = http_response.parse() + assert_matches_type(CreateResponseResponse, response, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create_overload_1(self, client: Gradient) -> None: + with client.responses.with_streaming_response.create( + input="Tell me a three-sentence bedtime story about a unicorn.", + model="llama3-8b-instruct", + ) as http_response: + assert not http_response.is_closed + assert http_response.http_request.headers.get("X-Stainless-Lang") == "python" + + response = http_response.parse() + assert_matches_type(CreateResponseResponse, response, path=["response"]) + + assert cast(Any, http_response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_overload_2(self, client: Gradient) -> None: + response_stream = client.responses.create( + input="Tell me a three-sentence bedtime story about a unicorn.", + model="llama3-8b-instruct", + stream=True, + ) + response_stream.response.close() + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_create_with_all_params_overload_2(self, client: Gradient) -> None: + response_stream = client.responses.create( + input="Tell me a three-sentence bedtime story about a unicorn.", + model="llama3-8b-instruct", + stream=True, + instructions="You are a helpful assistant.", + max_output_tokens=1024, + max_tokens=1024, + metadata={"foo": "string"}, + modalities=["text"], + parallel_tool_calls=True, + stop="\n", + stream_options={"include_usage": True}, + temperature=1, + tool_choice="none", + tools=[ + { + "type": "function", + "description": "description", + "name": "name", + "parameters": {"foo": "bar"}, + } + ], + top_p=1, + user="user-1234", + ) + response_stream.response.close() + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_create_overload_2(self, client: Gradient) -> None: + response = client.responses.with_raw_response.create( + input="Tell me a three-sentence bedtime story about a unicorn.", + model="llama3-8b-instruct", + stream=True, + ) + + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + stream = response.parse() + stream.close() + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_create_overload_2(self, client: Gradient) -> None: + with client.responses.with_streaming_response.create( + input="Tell me a three-sentence bedtime story about a unicorn.", + model="llama3-8b-instruct", + stream=True, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + stream = response.parse() + stream.close() + + assert cast(Any, response.is_closed) is True + + +class TestAsyncResponses: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_overload_1(self, async_client: AsyncGradient) -> None: + response = await async_client.responses.create( + input="Tell me a three-sentence bedtime story about a unicorn.", + model="llama3-8b-instruct", + ) + assert_matches_type(CreateResponseResponse, response, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGradient) -> None: + response = await async_client.responses.create( + input="Tell me a three-sentence bedtime story about a unicorn.", + model="llama3-8b-instruct", + instructions="You are a helpful assistant.", + max_output_tokens=1024, + max_tokens=1024, + metadata={"foo": "string"}, + modalities=["text"], + parallel_tool_calls=True, + stop="\n", + stream=False, + stream_options={"include_usage": True}, + temperature=1, + tool_choice="none", + tools=[ + { + "type": "function", + "description": "description", + "name": "name", + "parameters": {"foo": "bar"}, + } + ], + top_p=1, + user="user-1234", + ) + assert_matches_type(CreateResponseResponse, response, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create_overload_1(self, async_client: AsyncGradient) -> None: + http_response = await async_client.responses.with_raw_response.create( + input="Tell me a three-sentence bedtime story about a unicorn.", + model="llama3-8b-instruct", + ) + + assert http_response.is_closed is True + assert http_response.http_request.headers.get("X-Stainless-Lang") == "python" + response = await http_response.parse() + assert_matches_type(CreateResponseResponse, response, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create_overload_1(self, async_client: AsyncGradient) -> None: + async with async_client.responses.with_streaming_response.create( + input="Tell me a three-sentence bedtime story about a unicorn.", + model="llama3-8b-instruct", + ) as http_response: + assert not http_response.is_closed + assert http_response.http_request.headers.get("X-Stainless-Lang") == "python" + + response = await http_response.parse() + assert_matches_type(CreateResponseResponse, response, path=["response"]) + + assert cast(Any, http_response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_overload_2(self, async_client: AsyncGradient) -> None: + response_stream = await async_client.responses.create( + input="Tell me a three-sentence bedtime story about a unicorn.", + model="llama3-8b-instruct", + stream=True, + ) + await response_stream.response.aclose() + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGradient) -> None: + response_stream = await async_client.responses.create( + input="Tell me a three-sentence bedtime story about a unicorn.", + model="llama3-8b-instruct", + stream=True, + instructions="You are a helpful assistant.", + max_output_tokens=1024, + max_tokens=1024, + metadata={"foo": "string"}, + modalities=["text"], + parallel_tool_calls=True, + stop="\n", + stream_options={"include_usage": True}, + temperature=1, + tool_choice="none", + tools=[ + { + "type": "function", + "description": "description", + "name": "name", + "parameters": {"foo": "bar"}, + } + ], + top_p=1, + user="user-1234", + ) + await response_stream.response.aclose() + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) -> None: + response = await async_client.responses.with_raw_response.create( + input="Tell me a three-sentence bedtime story about a unicorn.", + model="llama3-8b-instruct", + stream=True, + ) + + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + stream = await response.parse() + await stream.close() + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_create_overload_2(self, async_client: AsyncGradient) -> None: + async with async_client.responses.with_streaming_response.create( + input="Tell me a three-sentence bedtime story about a unicorn.", + model="llama3-8b-instruct", + stream=True, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + stream = await response.parse() + await stream.close() + + assert cast(Any, response.is_closed) is True diff --git a/tests/test_client.py b/tests/test_client.py index c78fa9f8..d5f1bbe6 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -8,10 +8,11 @@ import json import asyncio import inspect +import dataclasses import tracemalloc -from typing import Any, Union, cast +from typing import Any, Union, TypeVar, Callable, Iterable, Iterator, Optional, Coroutine, cast from unittest import mock -from typing_extensions import Literal +from typing_extensions import Literal, AsyncIterator, override import httpx import pytest @@ -41,6 +42,7 @@ from .utils import update_env +T = TypeVar("T") base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") access_token = "My Access Token" model_access_key = "My Model Access Key" @@ -57,6 +59,57 @@ def _low_retry_timeout(*_args: Any, **_kwargs: Any) -> float: return 0.1 +def mirror_request_content(request: httpx.Request) -> httpx.Response: + return httpx.Response(200, content=request.content) + + +# note: we can't use the httpx.MockTransport class as it consumes the request +# body itself, which means we can't test that the body is read lazily +class MockTransport(httpx.BaseTransport, httpx.AsyncBaseTransport): + def __init__( + self, + handler: Callable[[httpx.Request], httpx.Response] + | Callable[[httpx.Request], Coroutine[Any, Any, httpx.Response]], + ) -> None: + self.handler = handler + + @override + def handle_request( + self, + request: httpx.Request, + ) -> httpx.Response: + assert not inspect.iscoroutinefunction(self.handler), "handler must not be a coroutine function" + assert inspect.isfunction(self.handler), "handler must be a function" + return self.handler(request) + + @override + async def handle_async_request( + self, + request: httpx.Request, + ) -> httpx.Response: + assert inspect.iscoroutinefunction(self.handler), "handler must be a coroutine function" + return await self.handler(request) + + +@dataclasses.dataclass +class Counter: + value: int = 0 + + +def _make_sync_iterator(iterable: Iterable[T], counter: Optional[Counter] = None) -> Iterator[T]: + for item in iterable: + if counter: + counter.value += 1 + yield item + + +async def _make_async_iterator(iterable: Iterable[T], counter: Optional[Counter] = None) -> AsyncIterator[T]: + for item in iterable: + if counter: + counter.value += 1 + yield item + + def _get_open_connections(client: Gradient | AsyncGradient) -> int: transport = client._client._transport assert isinstance(transport, httpx.HTTPTransport) or isinstance(transport, httpx.AsyncHTTPTransport) @@ -607,6 +660,70 @@ def test_multipart_repeating_array(self, client: Gradient) -> None: b"", ] + @pytest.mark.respx(base_url=base_url) + def test_binary_content_upload(self, respx_mock: MockRouter, client: Gradient) -> None: + respx_mock.post("/upload").mock(side_effect=mirror_request_content) + + file_content = b"Hello, this is a test file." + + response = client.post( + "/upload", + content=file_content, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + + def test_binary_content_upload_with_iterator(self) -> None: + file_content = b"Hello, this is a test file." + counter = Counter() + iterator = _make_sync_iterator([file_content], counter=counter) + + def mock_handler(request: httpx.Request) -> httpx.Response: + assert counter.value == 0, "the request body should not have been read" + return httpx.Response(200, content=request.read()) + + with Gradient( + base_url=base_url, + access_token=access_token, + _strict_response_validation=True, + http_client=httpx.Client(transport=MockTransport(handler=mock_handler)), + ) as client: + response = client.post( + "/upload", + content=iterator, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + assert counter.value == 1 + + @pytest.mark.respx(base_url=base_url) + def test_binary_content_upload_with_body_is_deprecated(self, respx_mock: MockRouter, client: Gradient) -> None: + respx_mock.post("/upload").mock(side_effect=mirror_request_content) + + file_content = b"Hello, this is a test file." + + with pytest.deprecated_call( + match="Passing raw bytes as `body` is deprecated and will be removed in a future version. Please pass raw bytes via the `content` parameter instead." + ): + response = client.post( + "/upload", + body=file_content, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + @pytest.mark.respx(base_url=base_url) def test_basic_union_response(self, respx_mock: MockRouter, client: Gradient) -> None: class Model1(BaseModel): @@ -1648,6 +1765,72 @@ def test_multipart_repeating_array(self, async_client: AsyncGradient) -> None: b"", ] + @pytest.mark.respx(base_url=base_url) + async def test_binary_content_upload(self, respx_mock: MockRouter, async_client: AsyncGradient) -> None: + respx_mock.post("/upload").mock(side_effect=mirror_request_content) + + file_content = b"Hello, this is a test file." + + response = await async_client.post( + "/upload", + content=file_content, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + + async def test_binary_content_upload_with_asynciterator(self) -> None: + file_content = b"Hello, this is a test file." + counter = Counter() + iterator = _make_async_iterator([file_content], counter=counter) + + async def mock_handler(request: httpx.Request) -> httpx.Response: + assert counter.value == 0, "the request body should not have been read" + return httpx.Response(200, content=await request.aread()) + + async with AsyncGradient( + base_url=base_url, + access_token=access_token, + _strict_response_validation=True, + http_client=httpx.AsyncClient(transport=MockTransport(handler=mock_handler)), + ) as client: + response = await client.post( + "/upload", + content=iterator, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + assert counter.value == 1 + + @pytest.mark.respx(base_url=base_url) + async def test_binary_content_upload_with_body_is_deprecated( + self, respx_mock: MockRouter, async_client: AsyncGradient + ) -> None: + respx_mock.post("/upload").mock(side_effect=mirror_request_content) + + file_content = b"Hello, this is a test file." + + with pytest.deprecated_call( + match="Passing raw bytes as `body` is deprecated and will be removed in a future version. Please pass raw bytes via the `content` parameter instead." + ): + response = await async_client.post( + "/upload", + body=file_content, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + @pytest.mark.respx(base_url=base_url) async def test_basic_union_response(self, respx_mock: MockRouter, async_client: AsyncGradient) -> None: class Model1(BaseModel): diff --git a/tests/test_utils/test_json.py b/tests/test_utils/test_json.py new file mode 100644 index 00000000..4ba6d83c --- /dev/null +++ b/tests/test_utils/test_json.py @@ -0,0 +1,126 @@ +from __future__ import annotations + +import datetime +from typing import Union + +import pydantic + +from gradient import _compat +from gradient._utils._json import openapi_dumps + + +class TestOpenapiDumps: + def test_basic(self) -> None: + data = {"key": "value", "number": 42} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"key":"value","number":42}' + + def test_datetime_serialization(self) -> None: + dt = datetime.datetime(2023, 1, 1, 12, 0, 0) + data = {"datetime": dt} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"datetime":"2023-01-01T12:00:00"}' + + def test_pydantic_model_serialization(self) -> None: + class User(pydantic.BaseModel): + first_name: str + last_name: str + age: int + + model_instance = User(first_name="John", last_name="Kramer", age=83) + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"first_name":"John","last_name":"Kramer","age":83}}' + + def test_pydantic_model_with_default_values(self) -> None: + class User(pydantic.BaseModel): + name: str + role: str = "user" + active: bool = True + score: int = 0 + + model_instance = User(name="Alice") + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Alice"}}' + + def test_pydantic_model_with_default_values_overridden(self) -> None: + class User(pydantic.BaseModel): + name: str + role: str = "user" + active: bool = True + + model_instance = User(name="Bob", role="admin", active=False) + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Bob","role":"admin","active":false}}' + + def test_pydantic_model_with_alias(self) -> None: + class User(pydantic.BaseModel): + first_name: str = pydantic.Field(alias="firstName") + last_name: str = pydantic.Field(alias="lastName") + + model_instance = User(firstName="John", lastName="Doe") + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"firstName":"John","lastName":"Doe"}}' + + def test_pydantic_model_with_alias_and_default(self) -> None: + class User(pydantic.BaseModel): + user_name: str = pydantic.Field(alias="userName") + user_role: str = pydantic.Field(default="member", alias="userRole") + is_active: bool = pydantic.Field(default=True, alias="isActive") + + model_instance = User(userName="charlie") + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"userName":"charlie"}}' + + model_with_overrides = User(userName="diana", userRole="admin", isActive=False) + data = {"model": model_with_overrides} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"userName":"diana","userRole":"admin","isActive":false}}' + + def test_pydantic_model_with_nested_models_and_defaults(self) -> None: + class Address(pydantic.BaseModel): + street: str + city: str = "Unknown" + + class User(pydantic.BaseModel): + name: str + address: Address + verified: bool = False + + if _compat.PYDANTIC_V1: + # to handle forward references in Pydantic v1 + User.update_forward_refs(**locals()) # type: ignore[reportDeprecated] + + address = Address(street="123 Main St") + user = User(name="Diana", address=address) + data = {"user": user} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"user":{"name":"Diana","address":{"street":"123 Main St"}}}' + + address_with_city = Address(street="456 Oak Ave", city="Boston") + user_verified = User(name="Eve", address=address_with_city, verified=True) + data = {"user": user_verified} + json_bytes = openapi_dumps(data) + assert ( + json_bytes == b'{"user":{"name":"Eve","address":{"street":"456 Oak Ave","city":"Boston"},"verified":true}}' + ) + + def test_pydantic_model_with_optional_fields(self) -> None: + class User(pydantic.BaseModel): + name: str + email: Union[str, None] + phone: Union[str, None] + + model_with_none = User(name="Eve", email=None, phone=None) + data = {"model": model_with_none} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Eve","email":null,"phone":null}}' + + model_with_values = User(name="Frank", email="frank@example.com", phone=None) + data = {"model": model_with_values} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Frank","email":"frank@example.com","phone":null}}' From 05b67eedd828cfb8bf6abeb47dd73f348ec8eb08 Mon Sep 17 00:00:00 2001 From: rushitat Date: Wed, 11 Feb 2026 15:46:31 -0800 Subject: [PATCH 67/96] Fix lint --- src/gradient/_base_client.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/gradient/_base_client.py b/src/gradient/_base_client.py index e2135952..ca3db359 100644 --- a/src/gradient/_base_client.py +++ b/src/gradient/_base_client.py @@ -62,7 +62,7 @@ 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 +from ._compat import PYDANTIC_V1, model_copy from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type from ._response import ( APIResponse, @@ -486,17 +486,17 @@ def _build_request( ) -> httpx.Request: if log.isEnabledFor(logging.DEBUG): log.debug( - "Request options: %s", - model_dump( - options, - exclude_unset=True, - # Pydantic v1 can't dump every type we support in content, so we exclude it for now. - exclude={ - "content", - } - if PYDANTIC_V1 - else {}, - ), + "Request options", + # model_dump( + # options, + # exclude_unset=True, + # # Pydantic v1 can't dump every type we support in content, so we exclude it for now. + # exclude={ + # "content", + # } + # if PYDANTIC_V1 + # else {}, + # ), ) kwargs: dict[str, Any] = {} From 67b95da0c8e166beb8aea926665cce12981f82d7 Mon Sep 17 00:00:00 2001 From: rushitat Date: Wed, 11 Feb 2026 22:09:46 -0800 Subject: [PATCH 68/96] responses --- src/gradient/resources/responses.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gradient/resources/responses.py b/src/gradient/resources/responses.py index a342a78d..d0892fa9 100644 --- a/src/gradient/resources/responses.py +++ b/src/gradient/resources/responses.py @@ -392,7 +392,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CreateResponseResponse | Stream[CreateResponseStreamResponse]: return self._post( - "/responses", + "/responses" if self._client._base_url_overridden else f"{self._client.inference_endpoint}/v1/responses", body=maybe_transform( { "input": input, @@ -791,7 +791,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CreateResponseResponse | AsyncStream[CreateResponseStreamResponse]: return await self._post( - "/responses", + "/responses" if self._client._base_url_overridden else f"{self._client.inference_endpoint}/v1/responses", body=await async_maybe_transform( { "input": input, From 4aeedb0f4263798ac4033589a6f6e2af5f7ec842 Mon Sep 17 00:00:00 2001 From: rushitat Date: Thu, 12 Feb 2026 08:47:37 -0800 Subject: [PATCH 69/96] Add TYPE_CHECKING imports for GPUDropletsResource in _client --- src/gradient/_client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gradient/_client.py b/src/gradient/_client.py index 18ef0c7a..a0fc87b2 100644 --- a/src/gradient/_client.py +++ b/src/gradient/_client.py @@ -64,6 +64,7 @@ KnowledgeBasesResource, AsyncKnowledgeBasesResource, ) + from .resources.gpu_droplets import GPUDropletsResource, AsyncGPUDropletsResource __all__ = [ "Timeout", From b648b87278e0a80c8a5d76a81c2256da48b9044b Mon Sep 17 00:00:00 2001 From: rushitat Date: Thu, 12 Feb 2026 08:50:35 -0800 Subject: [PATCH 70/96] Fix Lint --- src/gradient/_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gradient/_client.py b/src/gradient/_client.py index a0fc87b2..42867c7d 100644 --- a/src/gradient/_client.py +++ b/src/gradient/_client.py @@ -56,6 +56,7 @@ from .resources.apps.apps import AppsResource, AsyncAppsResource from .resources.chat.chat import ChatResource, AsyncChatResource from .resources.responses import ResponsesResource, AsyncResponsesResource + from .resources.gpu_droplets import GPUDropletsResource, AsyncGPUDropletsResource from .resources.agents.agents import AgentsResource, AsyncAgentsResource from .resources.models.models import ModelsResource, AsyncModelsResource from .resources.databases.databases import DatabasesResource, AsyncDatabasesResource @@ -64,7 +65,6 @@ KnowledgeBasesResource, AsyncKnowledgeBasesResource, ) - from .resources.gpu_droplets import GPUDropletsResource, AsyncGPUDropletsResource __all__ = [ "Timeout", From 6ae89a292eec514d3701783e0f93eaf110cc5c35 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Feb 2026 18:29:26 +0000 Subject: [PATCH 71/96] release: 3.11.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 18 ++++++++++++++++++ pyproject.toml | 2 +- src/gradient/_version.py | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index cc4da81f..940f2ca3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.10.1" + ".": "3.11.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index a82ede75..e9caf7e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## 3.11.0 (2026-02-17) + +Full Changelog: [v3.10.1...v3.11.0](https://github.com/digitalocean/gradient-python/compare/v3.10.1...v3.11.0) + +### Features + +* **api:** api update ([f67228f](https://github.com/digitalocean/gradient-python/commit/f67228f0bd8de96342d15b1b7c3096e4b03c7aaa)) + + +### Bug Fixes + +* **client:** loosen auth header validation ([bf5fa9f](https://github.com/digitalocean/gradient-python/commit/bf5fa9f93b6443ac0b41d5fa134aab8ee12cfbc3)) + + +### Chores + +* **internal:** codegen related update ([07eeda8](https://github.com/digitalocean/gradient-python/commit/07eeda8ae3e1c7bdfe3fcc51a8786f35682f4c3f)) + ## 3.10.1 (2025-12-19) Full Changelog: [v3.10.0...v3.10.1](https://github.com/digitalocean/gradient-python/compare/v3.10.0...v3.10.1) diff --git a/pyproject.toml b/pyproject.toml index 5d4e9ebe..3295b4c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gradient" -version = "3.10.1" +version = "3.11.0" description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gradient/_version.py b/src/gradient/_version.py index f1eb0021..07c427f5 100644 --- a/src/gradient/_version.py +++ b/src/gradient/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gradient" -__version__ = "3.10.1" # x-release-please-version +__version__ = "3.11.0" # x-release-please-version From b8b49f55ba63f289ee86e8e8c1164d362ea53c17 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2026 16:40:34 +0000 Subject: [PATCH 72/96] feat(client): add support for binary request streaming --- src/gradient/_base_client.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gradient/_base_client.py b/src/gradient/_base_client.py index ca3db359..4ddc8392 100644 --- a/src/gradient/_base_client.py +++ b/src/gradient/_base_client.py @@ -486,17 +486,17 @@ def _build_request( ) -> httpx.Request: if log.isEnabledFor(logging.DEBUG): log.debug( - "Request options", - # model_dump( - # options, - # exclude_unset=True, - # # Pydantic v1 can't dump every type we support in content, so we exclude it for now. - # exclude={ - # "content", - # } - # if PYDANTIC_V1 - # else {}, - # ), + "Request options: %s", + model_dump( + options, + exclude_unset=True, + # Pydantic v1 can't dump every type we support in content, so we exclude it for now. + exclude={ + "content", + } + if PYDANTIC_V1 + else {}, + ), ) kwargs: dict[str, Any] = {} From 6626eb70c7eb74b5414bcdf8b2e772bef8770744 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2026 16:44:56 +0000 Subject: [PATCH 73/96] feat(api): responses --- .stats.yml | 2 +- api.md | 12 + src/gradient/types/__init__.py | 1 + .../types/response_create_response.py | 332 ++++++++++++++++++ 4 files changed, 346 insertions(+), 1 deletion(-) create mode 100644 src/gradient/types/response_create_response.py diff --git a/.stats.yml b/.stats.yml index 0d591538..105ad90e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-2344b44246a44d39ad5b74d3077bd2958745aad67feb15970756532fa0b3f9d6.yml openapi_spec_hash: a1913979235ce152a8dc380fabe5362e -config_hash: 6c9a04f3cc5dd88e1e4f0ae42d98ba9a +config_hash: 3302f40607e596148c9ac7706346a858 diff --git a/api.md b/api.md index 45e4eaeb..606ed40c 100644 --- a/api.md +++ b/api.md @@ -1075,3 +1075,15 @@ from gradient.types import BillingListInsightsResponse Methods: - client.billing.list_insights(end_date, \*, account_urn, start_date, \*\*params) -> BillingListInsightsResponse + +# Responses + +Types: + +```python +from gradient.types import ResponseCreateResponse +``` + +Methods: + +- client.responses.create(\*\*params) -> ResponseCreateResponse diff --git a/src/gradient/types/__init__.py b/src/gradient/types/__init__.py index fc2907b2..9e897482 100644 --- a/src/gradient/types/__init__.py +++ b/src/gradient/types/__init__.py @@ -84,6 +84,7 @@ from .api_openai_api_key_info import APIOpenAIAPIKeyInfo as APIOpenAIAPIKeyInfo from .gpu_droplet_list_params import GPUDropletListParams as GPUDropletListParams from .image_generate_response import ImageGenerateResponse as ImageGenerateResponse +from .response_create_response import ResponseCreateResponse as ResponseCreateResponse from .api_deployment_visibility import APIDeploymentVisibility as APIDeploymentVisibility from .gpu_droplet_create_params import GPUDropletCreateParams as GPUDropletCreateParams from .gpu_droplet_list_response import GPUDropletListResponse as GPUDropletListResponse diff --git a/src/gradient/types/response_create_response.py b/src/gradient/types/response_create_response.py new file mode 100644 index 00000000..0dfe2a4a --- /dev/null +++ b/src/gradient/types/response_create_response.py @@ -0,0 +1,332 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import builtins +from typing import Dict, List, Union, Optional +from typing_extensions import Literal, TypeAlias + +from .._models import BaseModel +from .shared.chat_completion_token_logprob import ChatCompletionTokenLogprob + +__all__ = [ + "ResponseCreateResponse", + "Usage", + "UsageInputTokensDetails", + "UsageOutputTokensDetails", + "Choice", + "ChoiceMessage", + "ChoiceMessageToolCall", + "ChoiceMessageToolCallFunction", + "ChoiceLogprobs", + "Output", + "OutputUnionMember0", + "OutputUnionMember1", + "OutputUnionMember2", + "OutputUnionMember2Content", + "Tool", +] + + +class UsageInputTokensDetails(BaseModel): + """A detailed breakdown of the input tokens.""" + + cached_tokens: int + """The number of tokens that were retrieved from the cache. + + [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + """ + + +class UsageOutputTokensDetails(BaseModel): + """A detailed breakdown of the output tokens.""" + + reasoning_tokens: int + """The number of reasoning tokens.""" + + tool_output_tokens: int + """The number of tool output tokens.""" + + +class Usage(BaseModel): + """ + Detailed token usage statistics for the request, including input/output token counts and detailed breakdowns. + """ + + input_tokens: int + """The number of input tokens.""" + + input_tokens_details: UsageInputTokensDetails + """A detailed breakdown of the input tokens.""" + + output_tokens: int + """The number of output tokens.""" + + output_tokens_details: UsageOutputTokensDetails + """A detailed breakdown of the output tokens.""" + + total_tokens: int + """The total number of tokens used.""" + + +class ChoiceMessageToolCallFunction(BaseModel): + """The function that the model called.""" + + arguments: str + """ + The arguments to call the function with, as generated by the model in JSON + format. Note that the model does not always generate valid JSON, and may + hallucinate parameters not defined by your function schema. Validate the + arguments in your code before calling your function. + """ + + name: str + """The name of the function to call.""" + + +class ChoiceMessageToolCall(BaseModel): + id: str + """The ID of the tool call.""" + + function: ChoiceMessageToolCallFunction + """The function that the model called.""" + + type: Literal["function"] + """The type of the tool. Currently, only `function` is supported.""" + + +class ChoiceMessage(BaseModel): + """The generated message response.""" + + content: Optional[str] = None + """The generated text content.""" + + role: Optional[Literal["assistant"]] = None + """The role of the message author, which is always `assistant`.""" + + tool_calls: Optional[List[ChoiceMessageToolCall]] = None + """The tool calls generated by the model, such as function calls.""" + + +class ChoiceLogprobs(BaseModel): + """Log probability information for the choice. + + Only present if logprobs was requested in the request. + """ + + content: Optional[List[ChatCompletionTokenLogprob]] = None + """A list of message content tokens with log probability information.""" + + +class Choice(BaseModel): + finish_reason: Literal["stop", "length", "tool_calls", "content_filter"] + """The reason the model stopped generating tokens. + + This will be `stop` if the model hit a natural stop point or a provided stop + sequence, `length` if the maximum number of tokens specified in the request was + reached, or `tool_calls` if the model called a tool. + """ + + index: int + """The index of the choice in the list of choices.""" + + message: ChoiceMessage + """The generated message response.""" + + logprobs: Optional[ChoiceLogprobs] = None + """Log probability information for the choice. + + Only present if logprobs was requested in the request. + """ + + +class OutputUnionMember0(BaseModel): + arguments: str + """JSON string of function arguments""" + + call_id: str + """The unique ID of the function tool call""" + + name: str + """The name of the function to call""" + + type: Literal["function_call"] + """The type of output item""" + + id: Optional[str] = None + """The unique ID of the function tool call (same as call_id)""" + + encrypted_content: Optional[str] = None + """Encrypted content (optional)""" + + status: Optional[str] = None + """Status of the item (optional, can be null)""" + + +class OutputUnionMember1(BaseModel): + text: str + """The text content""" + + type: Literal["text"] + """The type of output item""" + + +class OutputUnionMember2Content(BaseModel): + text: str + """The reasoning text content""" + + type: Literal["reasoning_text"] + """The type of content""" + + +class OutputUnionMember2(BaseModel): + id: str + """The unique ID of the reasoning item""" + + content: List[OutputUnionMember2Content] + """Array of reasoning content parts""" + + summary: List[object] + """Summary of the reasoning (usually empty)""" + + type: Literal["reasoning"] + """The type of output item""" + + encrypted_content: Optional[str] = None + """Encrypted content (optional)""" + + status: Optional[str] = None + """Status of the item (optional, can be null)""" + + +Output: TypeAlias = Union[OutputUnionMember0, OutputUnionMember1, OutputUnionMember2] + + +class Tool(BaseModel): + """Tool definition for Responses API (flat format). + + This format is used by VLLM's Responses API where name, description, and parameters are at the top level of the tool object. + """ + + type: Literal["function", "web_search", "web_search_2025_08_26"] + """The type of the tool. + + Supported values are `function` (custom tools), `web_search`, and + `web_search_2025_08_26` (built-in web search). + """ + + description: Optional[str] = None + """ + A description of what the function does, used by the model to choose when and + how to call the function. + """ + + name: Optional[str] = None + """The name of the function to be called. + + Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length + of 64. + """ + + parameters: Optional[Dict[str, object]] = None + """The parameters the functions accepts, described as a JSON Schema object. + + See the [guide](/docs/guides/function-calling) for examples, and the + [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for + documentation about the format. + + Omitting `parameters` defines a function with an empty parameter list. + """ + + +class ResponseCreateResponse(BaseModel): + """ + Represents a text-to-text response returned by the model, based on the provided input. VLLM models only. + """ + + id: str + """A unique identifier for the response.""" + + created: int + """The Unix timestamp (in seconds) of when the response was created.""" + + model: str + """The model used to generate the response.""" + + object: Literal["response"] + """The object type, which is always `response`.""" + + usage: Usage + """ + Detailed token usage statistics for the request, including input/output token + counts and detailed breakdowns. + """ + + background: Optional[bool] = None + """Whether the request was processed in the background""" + + choices: Optional[List[Choice]] = None + """A list of response choices. + + Can be more than one if `n` is greater than 1. Optional - Responses API + primarily uses the output array. + """ + + input_messages: Optional[List[builtins.object]] = None + """Input messages (if applicable)""" + + max_output_tokens: Optional[int] = None + """Maximum output tokens setting""" + + max_tool_calls: Optional[int] = None + """Maximum tool calls setting""" + + output: Optional[List[Output]] = None + """An array of content items generated by the model. + + This includes text content, function calls, reasoning items, and other output + types. Use this field for Responses API compatibility. + """ + + output_messages: Optional[List[builtins.object]] = None + """Output messages (if applicable)""" + + parallel_tool_calls: Optional[bool] = None + """Whether parallel tool calls are enabled""" + + previous_response_id: Optional[str] = None + """Previous response ID (for multi-turn conversations)""" + + prompt: Optional[str] = None + """Prompt used for the response""" + + reasoning: Optional[str] = None + """Reasoning content""" + + service_tier: Optional[str] = None + """Service tier used""" + + status: Optional[str] = None + """Status of the response""" + + temperature: Optional[float] = None + """Temperature setting used for the response""" + + text: Optional[str] = None + """Text content""" + + tool_choice: Optional[str] = None + """Tool choice setting used for the response""" + + tools: Optional[List[Tool]] = None + """Tools available for the response""" + + top_logprobs: Optional[int] = None + """Top logprobs setting""" + + top_p: Optional[float] = None + """Top-p setting used for the response""" + + truncation: Optional[str] = None + """Truncation setting""" + + user: Optional[str] = None + """User identifier""" From 1fb9faa10500cdc6e97d93fa8d5c20749cd384f2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Feb 2026 22:54:31 +0000 Subject: [PATCH 74/96] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 105ad90e..579c9fc7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-2344b44246a44d39ad5b74d3077bd2958745aad67feb15970756532fa0b3f9d6.yml openapi_spec_hash: a1913979235ce152a8dc380fabe5362e -config_hash: 3302f40607e596148c9ac7706346a858 +config_hash: 3c7741f27a23621a5a8e3cae5610088d From e74f70d73e4046b6aae1fe9db137d66189fb1eb6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 19:41:30 +0000 Subject: [PATCH 75/96] chore: format all `api.md` files --- src/gradient/_base_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gradient/_base_client.py b/src/gradient/_base_client.py index 4ddc8392..e2135952 100644 --- a/src/gradient/_base_client.py +++ b/src/gradient/_base_client.py @@ -62,7 +62,7 @@ not_given, ) from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping -from ._compat import PYDANTIC_V1, model_copy +from ._compat import PYDANTIC_V1, model_copy, model_dump from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type from ._response import ( APIResponse, From a51db917b71ed39757a42a87ad509f7ad3fbc5ae Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Feb 2026 21:13:15 +0000 Subject: [PATCH 76/96] feat(api): manual updates --- .stats.yml | 2 +- api.md | 12 - src/gradient/_base_client.py | 24 +- src/gradient/types/__init__.py | 1 - .../types/response_create_response.py | 332 ------------------ 5 files changed, 13 insertions(+), 358 deletions(-) delete mode 100644 src/gradient/types/response_create_response.py diff --git a/.stats.yml b/.stats.yml index 579c9fc7..0d591538 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-2344b44246a44d39ad5b74d3077bd2958745aad67feb15970756532fa0b3f9d6.yml openapi_spec_hash: a1913979235ce152a8dc380fabe5362e -config_hash: 3c7741f27a23621a5a8e3cae5610088d +config_hash: 6c9a04f3cc5dd88e1e4f0ae42d98ba9a diff --git a/api.md b/api.md index 606ed40c..45e4eaeb 100644 --- a/api.md +++ b/api.md @@ -1075,15 +1075,3 @@ from gradient.types import BillingListInsightsResponse Methods: - client.billing.list_insights(end_date, \*, account_urn, start_date, \*\*params) -> BillingListInsightsResponse - -# Responses - -Types: - -```python -from gradient.types import ResponseCreateResponse -``` - -Methods: - -- client.responses.create(\*\*params) -> ResponseCreateResponse diff --git a/src/gradient/_base_client.py b/src/gradient/_base_client.py index e2135952..ca3db359 100644 --- a/src/gradient/_base_client.py +++ b/src/gradient/_base_client.py @@ -62,7 +62,7 @@ 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 +from ._compat import PYDANTIC_V1, model_copy from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type from ._response import ( APIResponse, @@ -486,17 +486,17 @@ def _build_request( ) -> httpx.Request: if log.isEnabledFor(logging.DEBUG): log.debug( - "Request options: %s", - model_dump( - options, - exclude_unset=True, - # Pydantic v1 can't dump every type we support in content, so we exclude it for now. - exclude={ - "content", - } - if PYDANTIC_V1 - else {}, - ), + "Request options", + # model_dump( + # options, + # exclude_unset=True, + # # Pydantic v1 can't dump every type we support in content, so we exclude it for now. + # exclude={ + # "content", + # } + # if PYDANTIC_V1 + # else {}, + # ), ) kwargs: dict[str, Any] = {} diff --git a/src/gradient/types/__init__.py b/src/gradient/types/__init__.py index 9e897482..fc2907b2 100644 --- a/src/gradient/types/__init__.py +++ b/src/gradient/types/__init__.py @@ -84,7 +84,6 @@ from .api_openai_api_key_info import APIOpenAIAPIKeyInfo as APIOpenAIAPIKeyInfo from .gpu_droplet_list_params import GPUDropletListParams as GPUDropletListParams from .image_generate_response import ImageGenerateResponse as ImageGenerateResponse -from .response_create_response import ResponseCreateResponse as ResponseCreateResponse from .api_deployment_visibility import APIDeploymentVisibility as APIDeploymentVisibility from .gpu_droplet_create_params import GPUDropletCreateParams as GPUDropletCreateParams from .gpu_droplet_list_response import GPUDropletListResponse as GPUDropletListResponse diff --git a/src/gradient/types/response_create_response.py b/src/gradient/types/response_create_response.py deleted file mode 100644 index 0dfe2a4a..00000000 --- a/src/gradient/types/response_create_response.py +++ /dev/null @@ -1,332 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import builtins -from typing import Dict, List, Union, Optional -from typing_extensions import Literal, TypeAlias - -from .._models import BaseModel -from .shared.chat_completion_token_logprob import ChatCompletionTokenLogprob - -__all__ = [ - "ResponseCreateResponse", - "Usage", - "UsageInputTokensDetails", - "UsageOutputTokensDetails", - "Choice", - "ChoiceMessage", - "ChoiceMessageToolCall", - "ChoiceMessageToolCallFunction", - "ChoiceLogprobs", - "Output", - "OutputUnionMember0", - "OutputUnionMember1", - "OutputUnionMember2", - "OutputUnionMember2Content", - "Tool", -] - - -class UsageInputTokensDetails(BaseModel): - """A detailed breakdown of the input tokens.""" - - cached_tokens: int - """The number of tokens that were retrieved from the cache. - - [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). - """ - - -class UsageOutputTokensDetails(BaseModel): - """A detailed breakdown of the output tokens.""" - - reasoning_tokens: int - """The number of reasoning tokens.""" - - tool_output_tokens: int - """The number of tool output tokens.""" - - -class Usage(BaseModel): - """ - Detailed token usage statistics for the request, including input/output token counts and detailed breakdowns. - """ - - input_tokens: int - """The number of input tokens.""" - - input_tokens_details: UsageInputTokensDetails - """A detailed breakdown of the input tokens.""" - - output_tokens: int - """The number of output tokens.""" - - output_tokens_details: UsageOutputTokensDetails - """A detailed breakdown of the output tokens.""" - - total_tokens: int - """The total number of tokens used.""" - - -class ChoiceMessageToolCallFunction(BaseModel): - """The function that the model called.""" - - arguments: str - """ - The arguments to call the function with, as generated by the model in JSON - format. Note that the model does not always generate valid JSON, and may - hallucinate parameters not defined by your function schema. Validate the - arguments in your code before calling your function. - """ - - name: str - """The name of the function to call.""" - - -class ChoiceMessageToolCall(BaseModel): - id: str - """The ID of the tool call.""" - - function: ChoiceMessageToolCallFunction - """The function that the model called.""" - - type: Literal["function"] - """The type of the tool. Currently, only `function` is supported.""" - - -class ChoiceMessage(BaseModel): - """The generated message response.""" - - content: Optional[str] = None - """The generated text content.""" - - role: Optional[Literal["assistant"]] = None - """The role of the message author, which is always `assistant`.""" - - tool_calls: Optional[List[ChoiceMessageToolCall]] = None - """The tool calls generated by the model, such as function calls.""" - - -class ChoiceLogprobs(BaseModel): - """Log probability information for the choice. - - Only present if logprobs was requested in the request. - """ - - content: Optional[List[ChatCompletionTokenLogprob]] = None - """A list of message content tokens with log probability information.""" - - -class Choice(BaseModel): - finish_reason: Literal["stop", "length", "tool_calls", "content_filter"] - """The reason the model stopped generating tokens. - - This will be `stop` if the model hit a natural stop point or a provided stop - sequence, `length` if the maximum number of tokens specified in the request was - reached, or `tool_calls` if the model called a tool. - """ - - index: int - """The index of the choice in the list of choices.""" - - message: ChoiceMessage - """The generated message response.""" - - logprobs: Optional[ChoiceLogprobs] = None - """Log probability information for the choice. - - Only present if logprobs was requested in the request. - """ - - -class OutputUnionMember0(BaseModel): - arguments: str - """JSON string of function arguments""" - - call_id: str - """The unique ID of the function tool call""" - - name: str - """The name of the function to call""" - - type: Literal["function_call"] - """The type of output item""" - - id: Optional[str] = None - """The unique ID of the function tool call (same as call_id)""" - - encrypted_content: Optional[str] = None - """Encrypted content (optional)""" - - status: Optional[str] = None - """Status of the item (optional, can be null)""" - - -class OutputUnionMember1(BaseModel): - text: str - """The text content""" - - type: Literal["text"] - """The type of output item""" - - -class OutputUnionMember2Content(BaseModel): - text: str - """The reasoning text content""" - - type: Literal["reasoning_text"] - """The type of content""" - - -class OutputUnionMember2(BaseModel): - id: str - """The unique ID of the reasoning item""" - - content: List[OutputUnionMember2Content] - """Array of reasoning content parts""" - - summary: List[object] - """Summary of the reasoning (usually empty)""" - - type: Literal["reasoning"] - """The type of output item""" - - encrypted_content: Optional[str] = None - """Encrypted content (optional)""" - - status: Optional[str] = None - """Status of the item (optional, can be null)""" - - -Output: TypeAlias = Union[OutputUnionMember0, OutputUnionMember1, OutputUnionMember2] - - -class Tool(BaseModel): - """Tool definition for Responses API (flat format). - - This format is used by VLLM's Responses API where name, description, and parameters are at the top level of the tool object. - """ - - type: Literal["function", "web_search", "web_search_2025_08_26"] - """The type of the tool. - - Supported values are `function` (custom tools), `web_search`, and - `web_search_2025_08_26` (built-in web search). - """ - - description: Optional[str] = None - """ - A description of what the function does, used by the model to choose when and - how to call the function. - """ - - name: Optional[str] = None - """The name of the function to be called. - - Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length - of 64. - """ - - parameters: Optional[Dict[str, object]] = None - """The parameters the functions accepts, described as a JSON Schema object. - - See the [guide](/docs/guides/function-calling) for examples, and the - [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for - documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - """ - - -class ResponseCreateResponse(BaseModel): - """ - Represents a text-to-text response returned by the model, based on the provided input. VLLM models only. - """ - - id: str - """A unique identifier for the response.""" - - created: int - """The Unix timestamp (in seconds) of when the response was created.""" - - model: str - """The model used to generate the response.""" - - object: Literal["response"] - """The object type, which is always `response`.""" - - usage: Usage - """ - Detailed token usage statistics for the request, including input/output token - counts and detailed breakdowns. - """ - - background: Optional[bool] = None - """Whether the request was processed in the background""" - - choices: Optional[List[Choice]] = None - """A list of response choices. - - Can be more than one if `n` is greater than 1. Optional - Responses API - primarily uses the output array. - """ - - input_messages: Optional[List[builtins.object]] = None - """Input messages (if applicable)""" - - max_output_tokens: Optional[int] = None - """Maximum output tokens setting""" - - max_tool_calls: Optional[int] = None - """Maximum tool calls setting""" - - output: Optional[List[Output]] = None - """An array of content items generated by the model. - - This includes text content, function calls, reasoning items, and other output - types. Use this field for Responses API compatibility. - """ - - output_messages: Optional[List[builtins.object]] = None - """Output messages (if applicable)""" - - parallel_tool_calls: Optional[bool] = None - """Whether parallel tool calls are enabled""" - - previous_response_id: Optional[str] = None - """Previous response ID (for multi-turn conversations)""" - - prompt: Optional[str] = None - """Prompt used for the response""" - - reasoning: Optional[str] = None - """Reasoning content""" - - service_tier: Optional[str] = None - """Service tier used""" - - status: Optional[str] = None - """Status of the response""" - - temperature: Optional[float] = None - """Temperature setting used for the response""" - - text: Optional[str] = None - """Text content""" - - tool_choice: Optional[str] = None - """Tool choice setting used for the response""" - - tools: Optional[List[Tool]] = None - """Tools available for the response""" - - top_logprobs: Optional[int] = None - """Top logprobs setting""" - - top_p: Optional[float] = None - """Top-p setting used for the response""" - - truncation: Optional[str] = None - """Truncation setting""" - - user: Optional[str] = None - """User identifier""" From ddf2217a79b1c912bebd83f8153f92e9bbd86ecd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Feb 2026 16:03:13 +0000 Subject: [PATCH 77/96] chore(internal): remove mock server code --- scripts/mock | 41 ----------------------------------------- scripts/test | 46 ---------------------------------------------- 2 files changed, 87 deletions(-) delete mode 100755 scripts/mock diff --git a/scripts/mock b/scripts/mock deleted file mode 100755 index 0b28f6ea..00000000 --- a/scripts/mock +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash - -set -e - -cd "$(dirname "$0")/.." - -if [[ -n "$1" && "$1" != '--'* ]]; then - URL="$1" - shift -else - URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)" -fi - -# Check if the URL is empty -if [ -z "$URL" ]; then - echo "Error: No OpenAPI spec path/url provided or found in .stats.yml" - exit 1 -fi - -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.15.0 -- prism mock "$URL" &> .prism.log & - - # Wait for server to come online - echo -n "Waiting for server" - while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do - echo -n "." - sleep 0.1 - done - - if grep -q "✖ fatal" ".prism.log"; then - cat .prism.log - exit 1 - fi - - echo -else - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" -fi diff --git a/scripts/test b/scripts/test index 4aa8fd64..1012c870 100755 --- a/scripts/test +++ b/scripts/test @@ -4,53 +4,7 @@ set -e cd "$(dirname "$0")/.." -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[0;33m' -NC='\033[0m' # No Color -function prism_is_running() { - curl --silent "http://localhost:4010" >/dev/null 2>&1 -} - -kill_server_on_port() { - pids=$(lsof -t -i tcp:"$1" || echo "") - if [ "$pids" != "" ]; then - kill "$pids" - echo "Stopped $pids." - fi -} - -function is_overriding_api_base_url() { - [ -n "$TEST_API_BASE_URL" ] -} - -if ! is_overriding_api_base_url && ! prism_is_running ; then - # When we exit this script, make sure to kill the background mock server process - trap 'kill_server_on_port 4010' EXIT - - # Start the dev server - ./scripts/mock --daemon -fi - -if is_overriding_api_base_url ; then - echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" - echo -elif ! prism_is_running ; then - echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" - echo -e "running against your OpenAPI spec." - echo - 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=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" - echo - - exit 1 -else - echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" - echo -fi export DEFER_PYDANTIC_BUILD=false From 07b974b82e747455f5e954804cda5239be4f17bb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Feb 2026 16:33:08 +0000 Subject: [PATCH 78/96] chore: update mock server docs --- CONTRIBUTING.md | 7 - .../agents/chat/test_completions.py | 32 +-- .../evaluation_metrics/anthropic/test_keys.py | 104 ++++----- .../evaluation_metrics/oauth2/test_dropbox.py | 16 +- .../evaluation_metrics/openai/test_keys.py | 104 ++++----- .../agents/evaluation_metrics/test_oauth2.py | 16 +- .../test_scheduled_indexing.py | 48 ++--- .../evaluation_metrics/test_workspaces.py | 96 ++++----- .../workspaces/test_agents.py | 40 ++-- tests/api_resources/agents/test_api_keys.py | 92 ++++---- .../agents/test_evaluation_datasets.py | 32 +-- .../agents/test_evaluation_metrics.py | 28 +-- .../agents/test_evaluation_runs.py | 68 +++--- .../agents/test_evaluation_test_cases.py | 88 ++++---- tests/api_resources/agents/test_functions.py | 56 ++--- .../agents/test_knowledge_bases.py | 48 ++--- tests/api_resources/agents/test_routes.py | 72 +++---- tests/api_resources/agents/test_versions.py | 40 ++-- .../apps/test_job_invocations.py | 20 +- tests/api_resources/chat/test_completions.py | 32 +-- .../databases/schema_registry/test_config.py | 64 +++--- .../gpu_droplets/account/test_keys.py | 68 +++--- .../gpu_droplets/firewalls/test_droplets.py | 32 +-- .../gpu_droplets/firewalls/test_rules.py | 40 ++-- .../gpu_droplets/firewalls/test_tags.py | 32 +-- .../gpu_droplets/floating_ips/test_actions.py | 64 +++--- .../gpu_droplets/images/test_actions.py | 48 ++--- .../load_balancers/test_droplets.py | 32 +-- .../load_balancers/test_forwarding_rules.py | 32 +-- .../gpu_droplets/test_actions.py | 200 +++++++++--------- .../gpu_droplets/test_autoscale.py | 140 ++++++------ .../gpu_droplets/test_backups.py | 56 ++--- .../test_destroy_with_associated_resources.py | 64 +++--- .../gpu_droplets/test_firewalls.py | 84 ++++---- .../gpu_droplets/test_floating_ips.py | 76 +++---- .../api_resources/gpu_droplets/test_images.py | 72 +++---- .../gpu_droplets/test_load_balancers.py | 136 ++++++------ .../api_resources/gpu_droplets/test_sizes.py | 16 +- .../gpu_droplets/test_snapshots.py | 40 ++-- .../gpu_droplets/test_volumes.py | 96 ++++----- .../gpu_droplets/volumes/test_actions.py | 132 ++++++------ .../gpu_droplets/volumes/test_snapshots.py | 72 +++---- .../api_resources/inference/test_api_keys.py | 84 ++++---- .../knowledge_bases/test_data_sources.py | 92 ++++---- .../knowledge_bases/test_indexing_jobs.py | 100 ++++----- .../models/providers/test_anthropic.py | 104 ++++----- .../models/providers/test_openai.py | 104 ++++----- tests/api_resources/nfs/test_snapshots.py | 48 ++--- tests/api_resources/test_agents.py | 124 +++++------ tests/api_resources/test_billing.py | 20 +- tests/api_resources/test_gpu_droplets.py | 144 ++++++------- tests/api_resources/test_images.py | 32 +-- tests/api_resources/test_knowledge_bases.py | 100 ++++----- tests/api_resources/test_models.py | 16 +- tests/api_resources/test_nfs.py | 136 ++++++------ tests/api_resources/test_regions.py | 16 +- tests/api_resources/test_responses.py | 32 +-- tests/api_resources/test_retrieve.py | 20 +- 58 files changed, 1900 insertions(+), 1907 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 140a090b..670e32c7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -85,13 +85,6 @@ $ pip install ./path-to-wheel-file.whl ## Running tests -Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. - -```sh -# you will need npm installed -$ npx prism mock path/to/your/openapi.yml -``` - ```sh $ ./scripts/test ``` diff --git a/tests/api_resources/agents/chat/test_completions.py b/tests/api_resources/agents/chat/test_completions.py index a0df0e6f..30d797ff 100644 --- a/tests/api_resources/agents/chat/test_completions.py +++ b/tests/api_resources/agents/chat/test_completions.py @@ -17,7 +17,7 @@ class TestCompletions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_overload_1(self, client: Gradient) -> None: completion = client.agents.chat.completions.create( @@ -31,7 +31,7 @@ def test_method_create_overload_1(self, client: Gradient) -> None: ) assert_matches_type(CompletionCreateResponse, completion, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params_overload_1(self, client: Gradient) -> None: completion = client.agents.chat.completions.create( @@ -71,7 +71,7 @@ def test_method_create_with_all_params_overload_1(self, client: Gradient) -> Non ) assert_matches_type(CompletionCreateResponse, completion, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_overload_1(self, client: Gradient) -> None: response = client.agents.chat.completions.with_raw_response.create( @@ -89,7 +89,7 @@ def test_raw_response_create_overload_1(self, client: Gradient) -> None: completion = response.parse() assert_matches_type(CompletionCreateResponse, completion, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_overload_1(self, client: Gradient) -> None: with client.agents.chat.completions.with_streaming_response.create( @@ -109,7 +109,7 @@ def test_streaming_response_create_overload_1(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_overload_2(self, client: Gradient) -> None: completion_stream = client.agents.chat.completions.create( @@ -124,7 +124,7 @@ def test_method_create_overload_2(self, client: Gradient) -> None: ) completion_stream.response.close() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params_overload_2(self, client: Gradient) -> None: completion_stream = client.agents.chat.completions.create( @@ -164,7 +164,7 @@ def test_method_create_with_all_params_overload_2(self, client: Gradient) -> Non ) completion_stream.response.close() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_overload_2(self, client: Gradient) -> None: response = client.agents.chat.completions.with_raw_response.create( @@ -182,7 +182,7 @@ def test_raw_response_create_overload_2(self, client: Gradient) -> None: stream = response.parse() stream.close() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_overload_2(self, client: Gradient) -> None: with client.agents.chat.completions.with_streaming_response.create( @@ -212,7 +212,7 @@ class TestAsyncCompletions: ids=["loose", "strict", "aiohttp"], ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_overload_1(self, async_client: AsyncGradient) -> None: completion = await async_client.agents.chat.completions.create( @@ -226,7 +226,7 @@ async def test_method_create_overload_1(self, async_client: AsyncGradient) -> No ) assert_matches_type(CompletionCreateResponse, completion, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGradient) -> None: completion = await async_client.agents.chat.completions.create( @@ -266,7 +266,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn ) assert_matches_type(CompletionCreateResponse, completion, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncGradient) -> None: response = await async_client.agents.chat.completions.with_raw_response.create( @@ -284,7 +284,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncGradient) completion = await response.parse() assert_matches_type(CompletionCreateResponse, completion, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncGradient) -> None: async with async_client.agents.chat.completions.with_streaming_response.create( @@ -304,7 +304,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncGra assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_overload_2(self, async_client: AsyncGradient) -> None: completion_stream = await async_client.agents.chat.completions.create( @@ -319,7 +319,7 @@ async def test_method_create_overload_2(self, async_client: AsyncGradient) -> No ) await completion_stream.response.aclose() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGradient) -> None: completion_stream = await async_client.agents.chat.completions.create( @@ -359,7 +359,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn ) await completion_stream.response.aclose() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) -> None: response = await async_client.agents.chat.completions.with_raw_response.create( @@ -377,7 +377,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) stream = await response.parse() await stream.close() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncGradient) -> None: async with async_client.agents.chat.completions.with_streaming_response.create( diff --git a/tests/api_resources/agents/evaluation_metrics/anthropic/test_keys.py b/tests/api_resources/agents/evaluation_metrics/anthropic/test_keys.py index 5028698c..3cb43489 100644 --- a/tests/api_resources/agents/evaluation_metrics/anthropic/test_keys.py +++ b/tests/api_resources/agents/evaluation_metrics/anthropic/test_keys.py @@ -24,13 +24,13 @@ class TestKeys: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.anthropic.keys.create() assert_matches_type(KeyCreateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.anthropic.keys.create( @@ -39,7 +39,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(KeyCreateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.anthropic.keys.with_raw_response.create() @@ -49,7 +49,7 @@ def test_raw_response_create(self, client: Gradient) -> None: key = response.parse() assert_matches_type(KeyCreateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.agents.evaluation_metrics.anthropic.keys.with_streaming_response.create() as response: @@ -61,7 +61,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.anthropic.keys.retrieve( @@ -69,7 +69,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(KeyRetrieveResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.anthropic.keys.with_raw_response.retrieve( @@ -81,7 +81,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: key = response.parse() assert_matches_type(KeyRetrieveResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.agents.evaluation_metrics.anthropic.keys.with_streaming_response.retrieve( @@ -95,7 +95,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_uuid` but received ''"): @@ -103,7 +103,7 @@ def test_path_params_retrieve(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.anthropic.keys.update( @@ -111,7 +111,7 @@ def test_method_update(self, client: Gradient) -> None: ) assert_matches_type(KeyUpdateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.anthropic.keys.update( @@ -122,7 +122,7 @@ def test_method_update_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(KeyUpdateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.anthropic.keys.with_raw_response.update( @@ -134,7 +134,7 @@ def test_raw_response_update(self, client: Gradient) -> None: key = response.parse() assert_matches_type(KeyUpdateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gradient) -> None: with client.agents.evaluation_metrics.anthropic.keys.with_streaming_response.update( @@ -148,7 +148,7 @@ def test_streaming_response_update(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_api_key_uuid` but received ''"): @@ -156,13 +156,13 @@ def test_path_params_update(self, client: Gradient) -> None: path_api_key_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.anthropic.keys.list() assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.anthropic.keys.list( @@ -171,7 +171,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.anthropic.keys.with_raw_response.list() @@ -181,7 +181,7 @@ def test_raw_response_list(self, client: Gradient) -> None: key = response.parse() assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.agents.evaluation_metrics.anthropic.keys.with_streaming_response.list() as response: @@ -193,7 +193,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.anthropic.keys.delete( @@ -201,7 +201,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert_matches_type(KeyDeleteResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.anthropic.keys.with_raw_response.delete( @@ -213,7 +213,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: key = response.parse() assert_matches_type(KeyDeleteResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.agents.evaluation_metrics.anthropic.keys.with_streaming_response.delete( @@ -227,7 +227,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_uuid` but received ''"): @@ -235,7 +235,7 @@ def test_path_params_delete(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_agents(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.anthropic.keys.list_agents( @@ -243,7 +243,7 @@ def test_method_list_agents(self, client: Gradient) -> None: ) assert_matches_type(KeyListAgentsResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_agents_with_all_params(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.anthropic.keys.list_agents( @@ -253,7 +253,7 @@ def test_method_list_agents_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(KeyListAgentsResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_agents(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.anthropic.keys.with_raw_response.list_agents( @@ -265,7 +265,7 @@ def test_raw_response_list_agents(self, client: Gradient) -> None: key = response.parse() assert_matches_type(KeyListAgentsResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_agents(self, client: Gradient) -> None: with client.agents.evaluation_metrics.anthropic.keys.with_streaming_response.list_agents( @@ -279,7 +279,7 @@ def test_streaming_response_list_agents(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_list_agents(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): @@ -293,13 +293,13 @@ class TestAsyncKeys: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.anthropic.keys.create() assert_matches_type(KeyCreateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.anthropic.keys.create( @@ -308,7 +308,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(KeyCreateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.anthropic.keys.with_raw_response.create() @@ -318,7 +318,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: key = await response.parse() assert_matches_type(KeyCreateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.anthropic.keys.with_streaming_response.create() as response: @@ -330,7 +330,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.anthropic.keys.retrieve( @@ -338,7 +338,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(KeyRetrieveResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.anthropic.keys.with_raw_response.retrieve( @@ -350,7 +350,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: key = await response.parse() assert_matches_type(KeyRetrieveResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.anthropic.keys.with_streaming_response.retrieve( @@ -364,7 +364,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_uuid` but received ''"): @@ -372,7 +372,7 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.anthropic.keys.update( @@ -380,7 +380,7 @@ async def test_method_update(self, async_client: AsyncGradient) -> None: ) assert_matches_type(KeyUpdateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.anthropic.keys.update( @@ -391,7 +391,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(KeyUpdateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.anthropic.keys.with_raw_response.update( @@ -403,7 +403,7 @@ async def test_raw_response_update(self, async_client: AsyncGradient) -> None: key = await response.parse() assert_matches_type(KeyUpdateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.anthropic.keys.with_streaming_response.update( @@ -417,7 +417,7 @@ async def test_streaming_response_update(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_api_key_uuid` but received ''"): @@ -425,13 +425,13 @@ async def test_path_params_update(self, async_client: AsyncGradient) -> None: path_api_key_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.anthropic.keys.list() assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.anthropic.keys.list( @@ -440,7 +440,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.anthropic.keys.with_raw_response.list() @@ -450,7 +450,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: key = await response.parse() assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.anthropic.keys.with_streaming_response.list() as response: @@ -462,7 +462,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.anthropic.keys.delete( @@ -470,7 +470,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert_matches_type(KeyDeleteResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.anthropic.keys.with_raw_response.delete( @@ -482,7 +482,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: key = await response.parse() assert_matches_type(KeyDeleteResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.anthropic.keys.with_streaming_response.delete( @@ -496,7 +496,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_uuid` but received ''"): @@ -504,7 +504,7 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_agents(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.anthropic.keys.list_agents( @@ -512,7 +512,7 @@ async def test_method_list_agents(self, async_client: AsyncGradient) -> None: ) assert_matches_type(KeyListAgentsResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_agents_with_all_params(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.anthropic.keys.list_agents( @@ -522,7 +522,7 @@ async def test_method_list_agents_with_all_params(self, async_client: AsyncGradi ) assert_matches_type(KeyListAgentsResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_agents(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.anthropic.keys.with_raw_response.list_agents( @@ -534,7 +534,7 @@ async def test_raw_response_list_agents(self, async_client: AsyncGradient) -> No key = await response.parse() assert_matches_type(KeyListAgentsResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_agents(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.anthropic.keys.with_streaming_response.list_agents( @@ -548,7 +548,7 @@ async def test_streaming_response_list_agents(self, async_client: AsyncGradient) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_list_agents(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): diff --git a/tests/api_resources/agents/evaluation_metrics/oauth2/test_dropbox.py b/tests/api_resources/agents/evaluation_metrics/oauth2/test_dropbox.py index 417bb3b1..64aea805 100644 --- a/tests/api_resources/agents/evaluation_metrics/oauth2/test_dropbox.py +++ b/tests/api_resources/agents/evaluation_metrics/oauth2/test_dropbox.py @@ -17,13 +17,13 @@ class TestDropbox: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_tokens(self, client: Gradient) -> None: dropbox = client.agents.evaluation_metrics.oauth2.dropbox.create_tokens() assert_matches_type(DropboxCreateTokensResponse, dropbox, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_tokens_with_all_params(self, client: Gradient) -> None: dropbox = client.agents.evaluation_metrics.oauth2.dropbox.create_tokens( @@ -32,7 +32,7 @@ def test_method_create_tokens_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(DropboxCreateTokensResponse, dropbox, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_tokens(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.oauth2.dropbox.with_raw_response.create_tokens() @@ -42,7 +42,7 @@ def test_raw_response_create_tokens(self, client: Gradient) -> None: dropbox = response.parse() assert_matches_type(DropboxCreateTokensResponse, dropbox, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_tokens(self, client: Gradient) -> None: with client.agents.evaluation_metrics.oauth2.dropbox.with_streaming_response.create_tokens() as response: @@ -60,13 +60,13 @@ class TestAsyncDropbox: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_tokens(self, async_client: AsyncGradient) -> None: dropbox = await async_client.agents.evaluation_metrics.oauth2.dropbox.create_tokens() assert_matches_type(DropboxCreateTokensResponse, dropbox, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_tokens_with_all_params(self, async_client: AsyncGradient) -> None: dropbox = await async_client.agents.evaluation_metrics.oauth2.dropbox.create_tokens( @@ -75,7 +75,7 @@ async def test_method_create_tokens_with_all_params(self, async_client: AsyncGra ) assert_matches_type(DropboxCreateTokensResponse, dropbox, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_tokens(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.oauth2.dropbox.with_raw_response.create_tokens() @@ -85,7 +85,7 @@ async def test_raw_response_create_tokens(self, async_client: AsyncGradient) -> dropbox = await response.parse() assert_matches_type(DropboxCreateTokensResponse, dropbox, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_tokens(self, async_client: AsyncGradient) -> None: async with ( diff --git a/tests/api_resources/agents/evaluation_metrics/openai/test_keys.py b/tests/api_resources/agents/evaluation_metrics/openai/test_keys.py index 7da165c2..475c52f8 100644 --- a/tests/api_resources/agents/evaluation_metrics/openai/test_keys.py +++ b/tests/api_resources/agents/evaluation_metrics/openai/test_keys.py @@ -24,13 +24,13 @@ class TestKeys: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.openai.keys.create() assert_matches_type(KeyCreateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.openai.keys.create( @@ -39,7 +39,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(KeyCreateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.openai.keys.with_raw_response.create() @@ -49,7 +49,7 @@ def test_raw_response_create(self, client: Gradient) -> None: key = response.parse() assert_matches_type(KeyCreateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.agents.evaluation_metrics.openai.keys.with_streaming_response.create() as response: @@ -61,7 +61,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.openai.keys.retrieve( @@ -69,7 +69,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(KeyRetrieveResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.openai.keys.with_raw_response.retrieve( @@ -81,7 +81,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: key = response.parse() assert_matches_type(KeyRetrieveResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.agents.evaluation_metrics.openai.keys.with_streaming_response.retrieve( @@ -95,7 +95,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_uuid` but received ''"): @@ -103,7 +103,7 @@ def test_path_params_retrieve(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.openai.keys.update( @@ -111,7 +111,7 @@ def test_method_update(self, client: Gradient) -> None: ) assert_matches_type(KeyUpdateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.openai.keys.update( @@ -122,7 +122,7 @@ def test_method_update_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(KeyUpdateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.openai.keys.with_raw_response.update( @@ -134,7 +134,7 @@ def test_raw_response_update(self, client: Gradient) -> None: key = response.parse() assert_matches_type(KeyUpdateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gradient) -> None: with client.agents.evaluation_metrics.openai.keys.with_streaming_response.update( @@ -148,7 +148,7 @@ def test_streaming_response_update(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_api_key_uuid` but received ''"): @@ -156,13 +156,13 @@ def test_path_params_update(self, client: Gradient) -> None: path_api_key_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.openai.keys.list() assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.openai.keys.list( @@ -171,7 +171,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.openai.keys.with_raw_response.list() @@ -181,7 +181,7 @@ def test_raw_response_list(self, client: Gradient) -> None: key = response.parse() assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.agents.evaluation_metrics.openai.keys.with_streaming_response.list() as response: @@ -193,7 +193,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.openai.keys.delete( @@ -201,7 +201,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert_matches_type(KeyDeleteResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.openai.keys.with_raw_response.delete( @@ -213,7 +213,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: key = response.parse() assert_matches_type(KeyDeleteResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.agents.evaluation_metrics.openai.keys.with_streaming_response.delete( @@ -227,7 +227,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_uuid` but received ''"): @@ -235,7 +235,7 @@ def test_path_params_delete(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_agents(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.openai.keys.list_agents( @@ -243,7 +243,7 @@ def test_method_list_agents(self, client: Gradient) -> None: ) assert_matches_type(KeyListAgentsResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_agents_with_all_params(self, client: Gradient) -> None: key = client.agents.evaluation_metrics.openai.keys.list_agents( @@ -253,7 +253,7 @@ def test_method_list_agents_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(KeyListAgentsResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_agents(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.openai.keys.with_raw_response.list_agents( @@ -265,7 +265,7 @@ def test_raw_response_list_agents(self, client: Gradient) -> None: key = response.parse() assert_matches_type(KeyListAgentsResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_agents(self, client: Gradient) -> None: with client.agents.evaluation_metrics.openai.keys.with_streaming_response.list_agents( @@ -279,7 +279,7 @@ def test_streaming_response_list_agents(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_list_agents(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): @@ -293,13 +293,13 @@ class TestAsyncKeys: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.openai.keys.create() assert_matches_type(KeyCreateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.openai.keys.create( @@ -308,7 +308,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(KeyCreateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.openai.keys.with_raw_response.create() @@ -318,7 +318,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: key = await response.parse() assert_matches_type(KeyCreateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.openai.keys.with_streaming_response.create() as response: @@ -330,7 +330,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.openai.keys.retrieve( @@ -338,7 +338,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(KeyRetrieveResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.openai.keys.with_raw_response.retrieve( @@ -350,7 +350,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: key = await response.parse() assert_matches_type(KeyRetrieveResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.openai.keys.with_streaming_response.retrieve( @@ -364,7 +364,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_uuid` but received ''"): @@ -372,7 +372,7 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.openai.keys.update( @@ -380,7 +380,7 @@ async def test_method_update(self, async_client: AsyncGradient) -> None: ) assert_matches_type(KeyUpdateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.openai.keys.update( @@ -391,7 +391,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(KeyUpdateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.openai.keys.with_raw_response.update( @@ -403,7 +403,7 @@ async def test_raw_response_update(self, async_client: AsyncGradient) -> None: key = await response.parse() assert_matches_type(KeyUpdateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.openai.keys.with_streaming_response.update( @@ -417,7 +417,7 @@ async def test_streaming_response_update(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_api_key_uuid` but received ''"): @@ -425,13 +425,13 @@ async def test_path_params_update(self, async_client: AsyncGradient) -> None: path_api_key_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.openai.keys.list() assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.openai.keys.list( @@ -440,7 +440,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.openai.keys.with_raw_response.list() @@ -450,7 +450,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: key = await response.parse() assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.openai.keys.with_streaming_response.list() as response: @@ -462,7 +462,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.openai.keys.delete( @@ -470,7 +470,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert_matches_type(KeyDeleteResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.openai.keys.with_raw_response.delete( @@ -482,7 +482,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: key = await response.parse() assert_matches_type(KeyDeleteResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.openai.keys.with_streaming_response.delete( @@ -496,7 +496,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_uuid` but received ''"): @@ -504,7 +504,7 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_agents(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.openai.keys.list_agents( @@ -512,7 +512,7 @@ async def test_method_list_agents(self, async_client: AsyncGradient) -> None: ) assert_matches_type(KeyListAgentsResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_agents_with_all_params(self, async_client: AsyncGradient) -> None: key = await async_client.agents.evaluation_metrics.openai.keys.list_agents( @@ -522,7 +522,7 @@ async def test_method_list_agents_with_all_params(self, async_client: AsyncGradi ) assert_matches_type(KeyListAgentsResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_agents(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.openai.keys.with_raw_response.list_agents( @@ -534,7 +534,7 @@ async def test_raw_response_list_agents(self, async_client: AsyncGradient) -> No key = await response.parse() assert_matches_type(KeyListAgentsResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_agents(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.openai.keys.with_streaming_response.list_agents( @@ -548,7 +548,7 @@ async def test_streaming_response_list_agents(self, async_client: AsyncGradient) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_list_agents(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): diff --git a/tests/api_resources/agents/evaluation_metrics/test_oauth2.py b/tests/api_resources/agents/evaluation_metrics/test_oauth2.py index f247d94f..10137439 100644 --- a/tests/api_resources/agents/evaluation_metrics/test_oauth2.py +++ b/tests/api_resources/agents/evaluation_metrics/test_oauth2.py @@ -17,13 +17,13 @@ class TestOauth2: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_generate_url(self, client: Gradient) -> None: oauth2 = client.agents.evaluation_metrics.oauth2.generate_url() assert_matches_type(Oauth2GenerateURLResponse, oauth2, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_generate_url_with_all_params(self, client: Gradient) -> None: oauth2 = client.agents.evaluation_metrics.oauth2.generate_url( @@ -32,7 +32,7 @@ def test_method_generate_url_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(Oauth2GenerateURLResponse, oauth2, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_generate_url(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.oauth2.with_raw_response.generate_url() @@ -42,7 +42,7 @@ def test_raw_response_generate_url(self, client: Gradient) -> None: oauth2 = response.parse() assert_matches_type(Oauth2GenerateURLResponse, oauth2, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_generate_url(self, client: Gradient) -> None: with client.agents.evaluation_metrics.oauth2.with_streaming_response.generate_url() as response: @@ -60,13 +60,13 @@ class TestAsyncOauth2: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_generate_url(self, async_client: AsyncGradient) -> None: oauth2 = await async_client.agents.evaluation_metrics.oauth2.generate_url() assert_matches_type(Oauth2GenerateURLResponse, oauth2, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_generate_url_with_all_params(self, async_client: AsyncGradient) -> None: oauth2 = await async_client.agents.evaluation_metrics.oauth2.generate_url( @@ -75,7 +75,7 @@ async def test_method_generate_url_with_all_params(self, async_client: AsyncGrad ) assert_matches_type(Oauth2GenerateURLResponse, oauth2, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_generate_url(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.oauth2.with_raw_response.generate_url() @@ -85,7 +85,7 @@ async def test_raw_response_generate_url(self, async_client: AsyncGradient) -> N oauth2 = await response.parse() assert_matches_type(Oauth2GenerateURLResponse, oauth2, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_generate_url(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.oauth2.with_streaming_response.generate_url() as response: diff --git a/tests/api_resources/agents/evaluation_metrics/test_scheduled_indexing.py b/tests/api_resources/agents/evaluation_metrics/test_scheduled_indexing.py index 388e06c9..788b758a 100644 --- a/tests/api_resources/agents/evaluation_metrics/test_scheduled_indexing.py +++ b/tests/api_resources/agents/evaluation_metrics/test_scheduled_indexing.py @@ -21,13 +21,13 @@ class TestScheduledIndexing: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: scheduled_indexing = client.agents.evaluation_metrics.scheduled_indexing.create() assert_matches_type(ScheduledIndexingCreateResponse, scheduled_indexing, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: scheduled_indexing = client.agents.evaluation_metrics.scheduled_indexing.create( @@ -37,7 +37,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(ScheduledIndexingCreateResponse, scheduled_indexing, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.scheduled_indexing.with_raw_response.create() @@ -47,7 +47,7 @@ def test_raw_response_create(self, client: Gradient) -> None: scheduled_indexing = response.parse() assert_matches_type(ScheduledIndexingCreateResponse, scheduled_indexing, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.agents.evaluation_metrics.scheduled_indexing.with_streaming_response.create() as response: @@ -59,7 +59,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: scheduled_indexing = client.agents.evaluation_metrics.scheduled_indexing.retrieve( @@ -67,7 +67,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(ScheduledIndexingRetrieveResponse, scheduled_indexing, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.scheduled_indexing.with_raw_response.retrieve( @@ -79,7 +79,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: scheduled_indexing = response.parse() assert_matches_type(ScheduledIndexingRetrieveResponse, scheduled_indexing, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.agents.evaluation_metrics.scheduled_indexing.with_streaming_response.retrieve( @@ -93,7 +93,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `knowledge_base_uuid` but received ''"): @@ -101,7 +101,7 @@ def test_path_params_retrieve(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: scheduled_indexing = client.agents.evaluation_metrics.scheduled_indexing.delete( @@ -109,7 +109,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert_matches_type(ScheduledIndexingDeleteResponse, scheduled_indexing, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.scheduled_indexing.with_raw_response.delete( @@ -121,7 +121,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: scheduled_indexing = response.parse() assert_matches_type(ScheduledIndexingDeleteResponse, scheduled_indexing, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.agents.evaluation_metrics.scheduled_indexing.with_streaming_response.delete( @@ -135,7 +135,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): @@ -149,13 +149,13 @@ class TestAsyncScheduledIndexing: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: scheduled_indexing = await async_client.agents.evaluation_metrics.scheduled_indexing.create() assert_matches_type(ScheduledIndexingCreateResponse, scheduled_indexing, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: scheduled_indexing = await async_client.agents.evaluation_metrics.scheduled_indexing.create( @@ -165,7 +165,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(ScheduledIndexingCreateResponse, scheduled_indexing, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.scheduled_indexing.with_raw_response.create() @@ -175,7 +175,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: scheduled_indexing = await response.parse() assert_matches_type(ScheduledIndexingCreateResponse, scheduled_indexing, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with ( @@ -189,7 +189,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: scheduled_indexing = await async_client.agents.evaluation_metrics.scheduled_indexing.retrieve( @@ -197,7 +197,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(ScheduledIndexingRetrieveResponse, scheduled_indexing, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.scheduled_indexing.with_raw_response.retrieve( @@ -209,7 +209,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: scheduled_indexing = await response.parse() assert_matches_type(ScheduledIndexingRetrieveResponse, scheduled_indexing, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.scheduled_indexing.with_streaming_response.retrieve( @@ -223,7 +223,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `knowledge_base_uuid` but received ''"): @@ -231,7 +231,7 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: scheduled_indexing = await async_client.agents.evaluation_metrics.scheduled_indexing.delete( @@ -239,7 +239,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert_matches_type(ScheduledIndexingDeleteResponse, scheduled_indexing, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.scheduled_indexing.with_raw_response.delete( @@ -251,7 +251,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: scheduled_indexing = await response.parse() assert_matches_type(ScheduledIndexingDeleteResponse, scheduled_indexing, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.scheduled_indexing.with_streaming_response.delete( @@ -265,7 +265,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): diff --git a/tests/api_resources/agents/evaluation_metrics/test_workspaces.py b/tests/api_resources/agents/evaluation_metrics/test_workspaces.py index 4f85212d..3493f322 100644 --- a/tests/api_resources/agents/evaluation_metrics/test_workspaces.py +++ b/tests/api_resources/agents/evaluation_metrics/test_workspaces.py @@ -24,13 +24,13 @@ class TestWorkspaces: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: workspace = client.agents.evaluation_metrics.workspaces.create() assert_matches_type(WorkspaceCreateResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: workspace = client.agents.evaluation_metrics.workspaces.create( @@ -40,7 +40,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(WorkspaceCreateResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.workspaces.with_raw_response.create() @@ -50,7 +50,7 @@ def test_raw_response_create(self, client: Gradient) -> None: workspace = response.parse() assert_matches_type(WorkspaceCreateResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.agents.evaluation_metrics.workspaces.with_streaming_response.create() as response: @@ -62,7 +62,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: workspace = client.agents.evaluation_metrics.workspaces.retrieve( @@ -70,7 +70,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(WorkspaceRetrieveResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.workspaces.with_raw_response.retrieve( @@ -82,7 +82,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: workspace = response.parse() assert_matches_type(WorkspaceRetrieveResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.agents.evaluation_metrics.workspaces.with_streaming_response.retrieve( @@ -96,7 +96,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `workspace_uuid` but received ''"): @@ -104,7 +104,7 @@ def test_path_params_retrieve(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gradient) -> None: workspace = client.agents.evaluation_metrics.workspaces.update( @@ -112,7 +112,7 @@ def test_method_update(self, client: Gradient) -> None: ) assert_matches_type(WorkspaceUpdateResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gradient) -> None: workspace = client.agents.evaluation_metrics.workspaces.update( @@ -123,7 +123,7 @@ def test_method_update_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(WorkspaceUpdateResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.workspaces.with_raw_response.update( @@ -135,7 +135,7 @@ def test_raw_response_update(self, client: Gradient) -> None: workspace = response.parse() assert_matches_type(WorkspaceUpdateResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gradient) -> None: with client.agents.evaluation_metrics.workspaces.with_streaming_response.update( @@ -149,7 +149,7 @@ def test_streaming_response_update(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_workspace_uuid` but received ''"): @@ -157,13 +157,13 @@ def test_path_params_update(self, client: Gradient) -> None: path_workspace_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: workspace = client.agents.evaluation_metrics.workspaces.list() assert_matches_type(WorkspaceListResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.workspaces.with_raw_response.list() @@ -173,7 +173,7 @@ def test_raw_response_list(self, client: Gradient) -> None: workspace = response.parse() assert_matches_type(WorkspaceListResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.agents.evaluation_metrics.workspaces.with_streaming_response.list() as response: @@ -185,7 +185,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: workspace = client.agents.evaluation_metrics.workspaces.delete( @@ -193,7 +193,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert_matches_type(WorkspaceDeleteResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.workspaces.with_raw_response.delete( @@ -205,7 +205,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: workspace = response.parse() assert_matches_type(WorkspaceDeleteResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.agents.evaluation_metrics.workspaces.with_streaming_response.delete( @@ -219,7 +219,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `workspace_uuid` but received ''"): @@ -227,7 +227,7 @@ def test_path_params_delete(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_evaluation_test_cases(self, client: Gradient) -> None: workspace = client.agents.evaluation_metrics.workspaces.list_evaluation_test_cases( @@ -235,7 +235,7 @@ def test_method_list_evaluation_test_cases(self, client: Gradient) -> None: ) assert_matches_type(WorkspaceListEvaluationTestCasesResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_evaluation_test_cases(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.workspaces.with_raw_response.list_evaluation_test_cases( @@ -247,7 +247,7 @@ def test_raw_response_list_evaluation_test_cases(self, client: Gradient) -> None workspace = response.parse() assert_matches_type(WorkspaceListEvaluationTestCasesResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_evaluation_test_cases(self, client: Gradient) -> None: with client.agents.evaluation_metrics.workspaces.with_streaming_response.list_evaluation_test_cases( @@ -261,7 +261,7 @@ def test_streaming_response_list_evaluation_test_cases(self, client: Gradient) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_list_evaluation_test_cases(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `workspace_uuid` but received ''"): @@ -275,13 +275,13 @@ class TestAsyncWorkspaces: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: workspace = await async_client.agents.evaluation_metrics.workspaces.create() assert_matches_type(WorkspaceCreateResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: workspace = await async_client.agents.evaluation_metrics.workspaces.create( @@ -291,7 +291,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(WorkspaceCreateResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.workspaces.with_raw_response.create() @@ -301,7 +301,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: workspace = await response.parse() assert_matches_type(WorkspaceCreateResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.workspaces.with_streaming_response.create() as response: @@ -313,7 +313,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: workspace = await async_client.agents.evaluation_metrics.workspaces.retrieve( @@ -321,7 +321,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(WorkspaceRetrieveResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.workspaces.with_raw_response.retrieve( @@ -333,7 +333,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: workspace = await response.parse() assert_matches_type(WorkspaceRetrieveResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.workspaces.with_streaming_response.retrieve( @@ -347,7 +347,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `workspace_uuid` but received ''"): @@ -355,7 +355,7 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGradient) -> None: workspace = await async_client.agents.evaluation_metrics.workspaces.update( @@ -363,7 +363,7 @@ async def test_method_update(self, async_client: AsyncGradient) -> None: ) assert_matches_type(WorkspaceUpdateResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGradient) -> None: workspace = await async_client.agents.evaluation_metrics.workspaces.update( @@ -374,7 +374,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(WorkspaceUpdateResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.workspaces.with_raw_response.update( @@ -386,7 +386,7 @@ async def test_raw_response_update(self, async_client: AsyncGradient) -> None: workspace = await response.parse() assert_matches_type(WorkspaceUpdateResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.workspaces.with_streaming_response.update( @@ -400,7 +400,7 @@ async def test_streaming_response_update(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_workspace_uuid` but received ''"): @@ -408,13 +408,13 @@ async def test_path_params_update(self, async_client: AsyncGradient) -> None: path_workspace_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: workspace = await async_client.agents.evaluation_metrics.workspaces.list() assert_matches_type(WorkspaceListResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.workspaces.with_raw_response.list() @@ -424,7 +424,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: workspace = await response.parse() assert_matches_type(WorkspaceListResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.workspaces.with_streaming_response.list() as response: @@ -436,7 +436,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: workspace = await async_client.agents.evaluation_metrics.workspaces.delete( @@ -444,7 +444,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert_matches_type(WorkspaceDeleteResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.workspaces.with_raw_response.delete( @@ -456,7 +456,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: workspace = await response.parse() assert_matches_type(WorkspaceDeleteResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.workspaces.with_streaming_response.delete( @@ -470,7 +470,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `workspace_uuid` but received ''"): @@ -478,7 +478,7 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_evaluation_test_cases(self, async_client: AsyncGradient) -> None: workspace = await async_client.agents.evaluation_metrics.workspaces.list_evaluation_test_cases( @@ -486,7 +486,7 @@ async def test_method_list_evaluation_test_cases(self, async_client: AsyncGradie ) assert_matches_type(WorkspaceListEvaluationTestCasesResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_evaluation_test_cases(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.workspaces.with_raw_response.list_evaluation_test_cases( @@ -498,7 +498,7 @@ async def test_raw_response_list_evaluation_test_cases(self, async_client: Async workspace = await response.parse() assert_matches_type(WorkspaceListEvaluationTestCasesResponse, workspace, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_evaluation_test_cases(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.workspaces.with_streaming_response.list_evaluation_test_cases( @@ -512,7 +512,7 @@ async def test_streaming_response_list_evaluation_test_cases(self, async_client: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_list_evaluation_test_cases(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `workspace_uuid` but received ''"): diff --git a/tests/api_resources/agents/evaluation_metrics/workspaces/test_agents.py b/tests/api_resources/agents/evaluation_metrics/workspaces/test_agents.py index 4154843c..33166f69 100644 --- a/tests/api_resources/agents/evaluation_metrics/workspaces/test_agents.py +++ b/tests/api_resources/agents/evaluation_metrics/workspaces/test_agents.py @@ -20,7 +20,7 @@ class TestAgents: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: agent = client.agents.evaluation_metrics.workspaces.agents.list( @@ -28,7 +28,7 @@ def test_method_list(self, client: Gradient) -> None: ) assert_matches_type(AgentListResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: agent = client.agents.evaluation_metrics.workspaces.agents.list( @@ -39,7 +39,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(AgentListResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.workspaces.agents.with_raw_response.list( @@ -51,7 +51,7 @@ def test_raw_response_list(self, client: Gradient) -> None: agent = response.parse() assert_matches_type(AgentListResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.agents.evaluation_metrics.workspaces.agents.with_streaming_response.list( @@ -65,7 +65,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_list(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `workspace_uuid` but received ''"): @@ -73,7 +73,7 @@ def test_path_params_list(self, client: Gradient) -> None: workspace_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_move(self, client: Gradient) -> None: agent = client.agents.evaluation_metrics.workspaces.agents.move( @@ -81,7 +81,7 @@ def test_method_move(self, client: Gradient) -> None: ) assert_matches_type(AgentMoveResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_move_with_all_params(self, client: Gradient) -> None: agent = client.agents.evaluation_metrics.workspaces.agents.move( @@ -91,7 +91,7 @@ def test_method_move_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(AgentMoveResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_move(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.workspaces.agents.with_raw_response.move( @@ -103,7 +103,7 @@ def test_raw_response_move(self, client: Gradient) -> None: agent = response.parse() assert_matches_type(AgentMoveResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_move(self, client: Gradient) -> None: with client.agents.evaluation_metrics.workspaces.agents.with_streaming_response.move( @@ -117,7 +117,7 @@ def test_streaming_response_move(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_move(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_workspace_uuid` but received ''"): @@ -131,7 +131,7 @@ class TestAsyncAgents: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: agent = await async_client.agents.evaluation_metrics.workspaces.agents.list( @@ -139,7 +139,7 @@ async def test_method_list(self, async_client: AsyncGradient) -> None: ) assert_matches_type(AgentListResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: agent = await async_client.agents.evaluation_metrics.workspaces.agents.list( @@ -150,7 +150,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(AgentListResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.workspaces.agents.with_raw_response.list( @@ -162,7 +162,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: agent = await response.parse() assert_matches_type(AgentListResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.workspaces.agents.with_streaming_response.list( @@ -176,7 +176,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_list(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `workspace_uuid` but received ''"): @@ -184,7 +184,7 @@ async def test_path_params_list(self, async_client: AsyncGradient) -> None: workspace_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_move(self, async_client: AsyncGradient) -> None: agent = await async_client.agents.evaluation_metrics.workspaces.agents.move( @@ -192,7 +192,7 @@ async def test_method_move(self, async_client: AsyncGradient) -> None: ) assert_matches_type(AgentMoveResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_move_with_all_params(self, async_client: AsyncGradient) -> None: agent = await async_client.agents.evaluation_metrics.workspaces.agents.move( @@ -202,7 +202,7 @@ async def test_method_move_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(AgentMoveResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_move(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.workspaces.agents.with_raw_response.move( @@ -214,7 +214,7 @@ async def test_raw_response_move(self, async_client: AsyncGradient) -> None: agent = await response.parse() assert_matches_type(AgentMoveResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_move(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.workspaces.agents.with_streaming_response.move( @@ -228,7 +228,7 @@ async def test_streaming_response_move(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_move(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_workspace_uuid` but received ''"): diff --git a/tests/api_resources/agents/test_api_keys.py b/tests/api_resources/agents/test_api_keys.py index dbb19890..438f97b9 100644 --- a/tests/api_resources/agents/test_api_keys.py +++ b/tests/api_resources/agents/test_api_keys.py @@ -23,7 +23,7 @@ class TestAPIKeys: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: api_key = client.agents.api_keys.create( @@ -31,7 +31,7 @@ def test_method_create(self, client: Gradient) -> None: ) assert_matches_type(APIKeyCreateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: api_key = client.agents.api_keys.create( @@ -41,7 +41,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(APIKeyCreateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.agents.api_keys.with_raw_response.create( @@ -53,7 +53,7 @@ def test_raw_response_create(self, client: Gradient) -> None: api_key = response.parse() assert_matches_type(APIKeyCreateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.agents.api_keys.with_streaming_response.create( @@ -67,7 +67,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_create(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_agent_uuid` but received ''"): @@ -75,7 +75,7 @@ def test_path_params_create(self, client: Gradient) -> None: path_agent_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gradient) -> None: api_key = client.agents.api_keys.update( @@ -84,7 +84,7 @@ def test_method_update(self, client: Gradient) -> None: ) assert_matches_type(APIKeyUpdateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gradient) -> None: api_key = client.agents.api_keys.update( @@ -96,7 +96,7 @@ def test_method_update_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(APIKeyUpdateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gradient) -> None: response = client.agents.api_keys.with_raw_response.update( @@ -109,7 +109,7 @@ def test_raw_response_update(self, client: Gradient) -> None: api_key = response.parse() assert_matches_type(APIKeyUpdateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gradient) -> None: with client.agents.api_keys.with_streaming_response.update( @@ -124,7 +124,7 @@ def test_streaming_response_update(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_agent_uuid` but received ''"): @@ -139,7 +139,7 @@ def test_path_params_update(self, client: Gradient) -> None: path_agent_uuid='"123e4567-e89b-12d3-a456-426614174000"', ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: api_key = client.agents.api_keys.list( @@ -147,7 +147,7 @@ def test_method_list(self, client: Gradient) -> None: ) assert_matches_type(APIKeyListResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: api_key = client.agents.api_keys.list( @@ -157,7 +157,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(APIKeyListResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.agents.api_keys.with_raw_response.list( @@ -169,7 +169,7 @@ def test_raw_response_list(self, client: Gradient) -> None: api_key = response.parse() assert_matches_type(APIKeyListResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.agents.api_keys.with_streaming_response.list( @@ -183,7 +183,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_list(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `agent_uuid` but received ''"): @@ -191,7 +191,7 @@ def test_path_params_list(self, client: Gradient) -> None: agent_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: api_key = client.agents.api_keys.delete( @@ -200,7 +200,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert_matches_type(APIKeyDeleteResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.agents.api_keys.with_raw_response.delete( @@ -213,7 +213,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: api_key = response.parse() assert_matches_type(APIKeyDeleteResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.agents.api_keys.with_streaming_response.delete( @@ -228,7 +228,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `agent_uuid` but received ''"): @@ -243,7 +243,7 @@ def test_path_params_delete(self, client: Gradient) -> None: agent_uuid='"123e4567-e89b-12d3-a456-426614174000"', ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_regenerate(self, client: Gradient) -> None: api_key = client.agents.api_keys.regenerate( @@ -252,7 +252,7 @@ def test_method_regenerate(self, client: Gradient) -> None: ) assert_matches_type(APIKeyRegenerateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_regenerate(self, client: Gradient) -> None: response = client.agents.api_keys.with_raw_response.regenerate( @@ -265,7 +265,7 @@ def test_raw_response_regenerate(self, client: Gradient) -> None: api_key = response.parse() assert_matches_type(APIKeyRegenerateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_regenerate(self, client: Gradient) -> None: with client.agents.api_keys.with_streaming_response.regenerate( @@ -280,7 +280,7 @@ def test_streaming_response_regenerate(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_regenerate(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `agent_uuid` but received ''"): @@ -301,7 +301,7 @@ class TestAsyncAPIKeys: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: api_key = await async_client.agents.api_keys.create( @@ -309,7 +309,7 @@ async def test_method_create(self, async_client: AsyncGradient) -> None: ) assert_matches_type(APIKeyCreateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: api_key = await async_client.agents.api_keys.create( @@ -319,7 +319,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(APIKeyCreateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.agents.api_keys.with_raw_response.create( @@ -331,7 +331,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: api_key = await response.parse() assert_matches_type(APIKeyCreateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with async_client.agents.api_keys.with_streaming_response.create( @@ -345,7 +345,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_create(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_agent_uuid` but received ''"): @@ -353,7 +353,7 @@ async def test_path_params_create(self, async_client: AsyncGradient) -> None: path_agent_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGradient) -> None: api_key = await async_client.agents.api_keys.update( @@ -362,7 +362,7 @@ async def test_method_update(self, async_client: AsyncGradient) -> None: ) assert_matches_type(APIKeyUpdateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGradient) -> None: api_key = await async_client.agents.api_keys.update( @@ -374,7 +374,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(APIKeyUpdateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGradient) -> None: response = await async_client.agents.api_keys.with_raw_response.update( @@ -387,7 +387,7 @@ async def test_raw_response_update(self, async_client: AsyncGradient) -> None: api_key = await response.parse() assert_matches_type(APIKeyUpdateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGradient) -> None: async with async_client.agents.api_keys.with_streaming_response.update( @@ -402,7 +402,7 @@ async def test_streaming_response_update(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_agent_uuid` but received ''"): @@ -417,7 +417,7 @@ async def test_path_params_update(self, async_client: AsyncGradient) -> None: path_agent_uuid='"123e4567-e89b-12d3-a456-426614174000"', ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: api_key = await async_client.agents.api_keys.list( @@ -425,7 +425,7 @@ async def test_method_list(self, async_client: AsyncGradient) -> None: ) assert_matches_type(APIKeyListResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: api_key = await async_client.agents.api_keys.list( @@ -435,7 +435,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(APIKeyListResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.agents.api_keys.with_raw_response.list( @@ -447,7 +447,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: api_key = await response.parse() assert_matches_type(APIKeyListResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.agents.api_keys.with_streaming_response.list( @@ -461,7 +461,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_list(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `agent_uuid` but received ''"): @@ -469,7 +469,7 @@ async def test_path_params_list(self, async_client: AsyncGradient) -> None: agent_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: api_key = await async_client.agents.api_keys.delete( @@ -478,7 +478,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert_matches_type(APIKeyDeleteResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.agents.api_keys.with_raw_response.delete( @@ -491,7 +491,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: api_key = await response.parse() assert_matches_type(APIKeyDeleteResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.agents.api_keys.with_streaming_response.delete( @@ -506,7 +506,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `agent_uuid` but received ''"): @@ -521,7 +521,7 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: agent_uuid='"123e4567-e89b-12d3-a456-426614174000"', ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_regenerate(self, async_client: AsyncGradient) -> None: api_key = await async_client.agents.api_keys.regenerate( @@ -530,7 +530,7 @@ async def test_method_regenerate(self, async_client: AsyncGradient) -> None: ) assert_matches_type(APIKeyRegenerateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_regenerate(self, async_client: AsyncGradient) -> None: response = await async_client.agents.api_keys.with_raw_response.regenerate( @@ -543,7 +543,7 @@ async def test_raw_response_regenerate(self, async_client: AsyncGradient) -> Non api_key = await response.parse() assert_matches_type(APIKeyRegenerateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_regenerate(self, async_client: AsyncGradient) -> None: async with async_client.agents.api_keys.with_streaming_response.regenerate( @@ -558,7 +558,7 @@ async def test_streaming_response_regenerate(self, async_client: AsyncGradient) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_regenerate(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `agent_uuid` but received ''"): diff --git a/tests/api_resources/agents/test_evaluation_datasets.py b/tests/api_resources/agents/test_evaluation_datasets.py index 5093660e..3ab8adb8 100644 --- a/tests/api_resources/agents/test_evaluation_datasets.py +++ b/tests/api_resources/agents/test_evaluation_datasets.py @@ -20,13 +20,13 @@ class TestEvaluationDatasets: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: evaluation_dataset = client.agents.evaluation_datasets.create() assert_matches_type(EvaluationDatasetCreateResponse, evaluation_dataset, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: evaluation_dataset = client.agents.evaluation_datasets.create( @@ -40,7 +40,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(EvaluationDatasetCreateResponse, evaluation_dataset, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.agents.evaluation_datasets.with_raw_response.create() @@ -50,7 +50,7 @@ def test_raw_response_create(self, client: Gradient) -> None: evaluation_dataset = response.parse() assert_matches_type(EvaluationDatasetCreateResponse, evaluation_dataset, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.agents.evaluation_datasets.with_streaming_response.create() as response: @@ -62,7 +62,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_file_upload_presigned_urls(self, client: Gradient) -> None: evaluation_dataset = client.agents.evaluation_datasets.create_file_upload_presigned_urls() @@ -70,7 +70,7 @@ def test_method_create_file_upload_presigned_urls(self, client: Gradient) -> Non EvaluationDatasetCreateFileUploadPresignedURLsResponse, evaluation_dataset, path=["response"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_file_upload_presigned_urls_with_all_params(self, client: Gradient) -> None: evaluation_dataset = client.agents.evaluation_datasets.create_file_upload_presigned_urls( @@ -85,7 +85,7 @@ def test_method_create_file_upload_presigned_urls_with_all_params(self, client: EvaluationDatasetCreateFileUploadPresignedURLsResponse, evaluation_dataset, path=["response"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_file_upload_presigned_urls(self, client: Gradient) -> None: response = client.agents.evaluation_datasets.with_raw_response.create_file_upload_presigned_urls() @@ -97,7 +97,7 @@ def test_raw_response_create_file_upload_presigned_urls(self, client: Gradient) EvaluationDatasetCreateFileUploadPresignedURLsResponse, evaluation_dataset, path=["response"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_file_upload_presigned_urls(self, client: Gradient) -> None: with client.agents.evaluation_datasets.with_streaming_response.create_file_upload_presigned_urls() as response: @@ -117,13 +117,13 @@ class TestAsyncEvaluationDatasets: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: evaluation_dataset = await async_client.agents.evaluation_datasets.create() assert_matches_type(EvaluationDatasetCreateResponse, evaluation_dataset, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: evaluation_dataset = await async_client.agents.evaluation_datasets.create( @@ -137,7 +137,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(EvaluationDatasetCreateResponse, evaluation_dataset, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_datasets.with_raw_response.create() @@ -147,7 +147,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: evaluation_dataset = await response.parse() assert_matches_type(EvaluationDatasetCreateResponse, evaluation_dataset, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_datasets.with_streaming_response.create() as response: @@ -159,7 +159,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_file_upload_presigned_urls(self, async_client: AsyncGradient) -> None: evaluation_dataset = await async_client.agents.evaluation_datasets.create_file_upload_presigned_urls() @@ -167,7 +167,7 @@ async def test_method_create_file_upload_presigned_urls(self, async_client: Asyn EvaluationDatasetCreateFileUploadPresignedURLsResponse, evaluation_dataset, path=["response"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_file_upload_presigned_urls_with_all_params(self, async_client: AsyncGradient) -> None: evaluation_dataset = await async_client.agents.evaluation_datasets.create_file_upload_presigned_urls( @@ -182,7 +182,7 @@ async def test_method_create_file_upload_presigned_urls_with_all_params(self, as EvaluationDatasetCreateFileUploadPresignedURLsResponse, evaluation_dataset, path=["response"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_file_upload_presigned_urls(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_datasets.with_raw_response.create_file_upload_presigned_urls() @@ -194,7 +194,7 @@ async def test_raw_response_create_file_upload_presigned_urls(self, async_client EvaluationDatasetCreateFileUploadPresignedURLsResponse, evaluation_dataset, path=["response"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_file_upload_presigned_urls(self, async_client: AsyncGradient) -> None: async with ( diff --git a/tests/api_resources/agents/test_evaluation_metrics.py b/tests/api_resources/agents/test_evaluation_metrics.py index 088353bb..e27b820d 100644 --- a/tests/api_resources/agents/test_evaluation_metrics.py +++ b/tests/api_resources/agents/test_evaluation_metrics.py @@ -20,13 +20,13 @@ class TestEvaluationMetrics: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: evaluation_metric = client.agents.evaluation_metrics.list() assert_matches_type(EvaluationMetricListResponse, evaluation_metric, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.with_raw_response.list() @@ -36,7 +36,7 @@ def test_raw_response_list(self, client: Gradient) -> None: evaluation_metric = response.parse() assert_matches_type(EvaluationMetricListResponse, evaluation_metric, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.agents.evaluation_metrics.with_streaming_response.list() as response: @@ -48,13 +48,13 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_regions(self, client: Gradient) -> None: evaluation_metric = client.agents.evaluation_metrics.list_regions() assert_matches_type(EvaluationMetricListRegionsResponse, evaluation_metric, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_regions_with_all_params(self, client: Gradient) -> None: evaluation_metric = client.agents.evaluation_metrics.list_regions( @@ -63,7 +63,7 @@ def test_method_list_regions_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(EvaluationMetricListRegionsResponse, evaluation_metric, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_regions(self, client: Gradient) -> None: response = client.agents.evaluation_metrics.with_raw_response.list_regions() @@ -73,7 +73,7 @@ def test_raw_response_list_regions(self, client: Gradient) -> None: evaluation_metric = response.parse() assert_matches_type(EvaluationMetricListRegionsResponse, evaluation_metric, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_regions(self, client: Gradient) -> None: with client.agents.evaluation_metrics.with_streaming_response.list_regions() as response: @@ -91,13 +91,13 @@ class TestAsyncEvaluationMetrics: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: evaluation_metric = await async_client.agents.evaluation_metrics.list() assert_matches_type(EvaluationMetricListResponse, evaluation_metric, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.with_raw_response.list() @@ -107,7 +107,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: evaluation_metric = await response.parse() assert_matches_type(EvaluationMetricListResponse, evaluation_metric, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.with_streaming_response.list() as response: @@ -119,13 +119,13 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_regions(self, async_client: AsyncGradient) -> None: evaluation_metric = await async_client.agents.evaluation_metrics.list_regions() assert_matches_type(EvaluationMetricListRegionsResponse, evaluation_metric, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_regions_with_all_params(self, async_client: AsyncGradient) -> None: evaluation_metric = await async_client.agents.evaluation_metrics.list_regions( @@ -134,7 +134,7 @@ async def test_method_list_regions_with_all_params(self, async_client: AsyncGrad ) assert_matches_type(EvaluationMetricListRegionsResponse, evaluation_metric, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_regions(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_metrics.with_raw_response.list_regions() @@ -144,7 +144,7 @@ async def test_raw_response_list_regions(self, async_client: AsyncGradient) -> N evaluation_metric = await response.parse() assert_matches_type(EvaluationMetricListRegionsResponse, evaluation_metric, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_regions(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_metrics.with_streaming_response.list_regions() as response: diff --git a/tests/api_resources/agents/test_evaluation_runs.py b/tests/api_resources/agents/test_evaluation_runs.py index 8fdfe2cd..faefa31b 100644 --- a/tests/api_resources/agents/test_evaluation_runs.py +++ b/tests/api_resources/agents/test_evaluation_runs.py @@ -22,13 +22,13 @@ class TestEvaluationRuns: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: evaluation_run = client.agents.evaluation_runs.create() assert_matches_type(EvaluationRunCreateResponse, evaluation_run, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: evaluation_run = client.agents.evaluation_runs.create( @@ -39,7 +39,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(EvaluationRunCreateResponse, evaluation_run, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.agents.evaluation_runs.with_raw_response.create() @@ -49,7 +49,7 @@ def test_raw_response_create(self, client: Gradient) -> None: evaluation_run = response.parse() assert_matches_type(EvaluationRunCreateResponse, evaluation_run, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.agents.evaluation_runs.with_streaming_response.create() as response: @@ -61,7 +61,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: evaluation_run = client.agents.evaluation_runs.retrieve( @@ -69,7 +69,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(EvaluationRunRetrieveResponse, evaluation_run, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.agents.evaluation_runs.with_raw_response.retrieve( @@ -81,7 +81,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: evaluation_run = response.parse() assert_matches_type(EvaluationRunRetrieveResponse, evaluation_run, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.agents.evaluation_runs.with_streaming_response.retrieve( @@ -95,7 +95,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `evaluation_run_uuid` but received ''"): @@ -103,7 +103,7 @@ def test_path_params_retrieve(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_results(self, client: Gradient) -> None: evaluation_run = client.agents.evaluation_runs.list_results( @@ -111,7 +111,7 @@ def test_method_list_results(self, client: Gradient) -> None: ) assert_matches_type(EvaluationRunListResultsResponse, evaluation_run, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_results_with_all_params(self, client: Gradient) -> None: evaluation_run = client.agents.evaluation_runs.list_results( @@ -121,7 +121,7 @@ def test_method_list_results_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(EvaluationRunListResultsResponse, evaluation_run, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_results(self, client: Gradient) -> None: response = client.agents.evaluation_runs.with_raw_response.list_results( @@ -133,7 +133,7 @@ def test_raw_response_list_results(self, client: Gradient) -> None: evaluation_run = response.parse() assert_matches_type(EvaluationRunListResultsResponse, evaluation_run, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_results(self, client: Gradient) -> None: with client.agents.evaluation_runs.with_streaming_response.list_results( @@ -147,7 +147,7 @@ def test_streaming_response_list_results(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_list_results(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `evaluation_run_uuid` but received ''"): @@ -155,7 +155,7 @@ def test_path_params_list_results(self, client: Gradient) -> None: evaluation_run_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_results(self, client: Gradient) -> None: evaluation_run = client.agents.evaluation_runs.retrieve_results( @@ -164,7 +164,7 @@ def test_method_retrieve_results(self, client: Gradient) -> None: ) assert_matches_type(EvaluationRunRetrieveResultsResponse, evaluation_run, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve_results(self, client: Gradient) -> None: response = client.agents.evaluation_runs.with_raw_response.retrieve_results( @@ -177,7 +177,7 @@ def test_raw_response_retrieve_results(self, client: Gradient) -> None: evaluation_run = response.parse() assert_matches_type(EvaluationRunRetrieveResultsResponse, evaluation_run, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve_results(self, client: Gradient) -> None: with client.agents.evaluation_runs.with_streaming_response.retrieve_results( @@ -192,7 +192,7 @@ def test_streaming_response_retrieve_results(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve_results(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `evaluation_run_uuid` but received ''"): @@ -207,13 +207,13 @@ class TestAsyncEvaluationRuns: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: evaluation_run = await async_client.agents.evaluation_runs.create() assert_matches_type(EvaluationRunCreateResponse, evaluation_run, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: evaluation_run = await async_client.agents.evaluation_runs.create( @@ -224,7 +224,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(EvaluationRunCreateResponse, evaluation_run, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_runs.with_raw_response.create() @@ -234,7 +234,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: evaluation_run = await response.parse() assert_matches_type(EvaluationRunCreateResponse, evaluation_run, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_runs.with_streaming_response.create() as response: @@ -246,7 +246,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: evaluation_run = await async_client.agents.evaluation_runs.retrieve( @@ -254,7 +254,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(EvaluationRunRetrieveResponse, evaluation_run, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_runs.with_raw_response.retrieve( @@ -266,7 +266,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: evaluation_run = await response.parse() assert_matches_type(EvaluationRunRetrieveResponse, evaluation_run, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_runs.with_streaming_response.retrieve( @@ -280,7 +280,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `evaluation_run_uuid` but received ''"): @@ -288,7 +288,7 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_results(self, async_client: AsyncGradient) -> None: evaluation_run = await async_client.agents.evaluation_runs.list_results( @@ -296,7 +296,7 @@ async def test_method_list_results(self, async_client: AsyncGradient) -> None: ) assert_matches_type(EvaluationRunListResultsResponse, evaluation_run, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_results_with_all_params(self, async_client: AsyncGradient) -> None: evaluation_run = await async_client.agents.evaluation_runs.list_results( @@ -306,7 +306,7 @@ async def test_method_list_results_with_all_params(self, async_client: AsyncGrad ) assert_matches_type(EvaluationRunListResultsResponse, evaluation_run, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_results(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_runs.with_raw_response.list_results( @@ -318,7 +318,7 @@ async def test_raw_response_list_results(self, async_client: AsyncGradient) -> N evaluation_run = await response.parse() assert_matches_type(EvaluationRunListResultsResponse, evaluation_run, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_results(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_runs.with_streaming_response.list_results( @@ -332,7 +332,7 @@ async def test_streaming_response_list_results(self, async_client: AsyncGradient assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_list_results(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `evaluation_run_uuid` but received ''"): @@ -340,7 +340,7 @@ async def test_path_params_list_results(self, async_client: AsyncGradient) -> No evaluation_run_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_results(self, async_client: AsyncGradient) -> None: evaluation_run = await async_client.agents.evaluation_runs.retrieve_results( @@ -349,7 +349,7 @@ async def test_method_retrieve_results(self, async_client: AsyncGradient) -> Non ) assert_matches_type(EvaluationRunRetrieveResultsResponse, evaluation_run, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve_results(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_runs.with_raw_response.retrieve_results( @@ -362,7 +362,7 @@ async def test_raw_response_retrieve_results(self, async_client: AsyncGradient) evaluation_run = await response.parse() assert_matches_type(EvaluationRunRetrieveResultsResponse, evaluation_run, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve_results(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_runs.with_streaming_response.retrieve_results( @@ -377,7 +377,7 @@ async def test_streaming_response_retrieve_results(self, async_client: AsyncGrad assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve_results(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `evaluation_run_uuid` but received ''"): diff --git a/tests/api_resources/agents/test_evaluation_test_cases.py b/tests/api_resources/agents/test_evaluation_test_cases.py index a8942239..03c9af54 100644 --- a/tests/api_resources/agents/test_evaluation_test_cases.py +++ b/tests/api_resources/agents/test_evaluation_test_cases.py @@ -23,13 +23,13 @@ class TestEvaluationTestCases: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: evaluation_test_case = client.agents.evaluation_test_cases.create() assert_matches_type(EvaluationTestCaseCreateResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: evaluation_test_case = client.agents.evaluation_test_cases.create( @@ -48,7 +48,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(EvaluationTestCaseCreateResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.agents.evaluation_test_cases.with_raw_response.create() @@ -58,7 +58,7 @@ def test_raw_response_create(self, client: Gradient) -> None: evaluation_test_case = response.parse() assert_matches_type(EvaluationTestCaseCreateResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.agents.evaluation_test_cases.with_streaming_response.create() as response: @@ -70,7 +70,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: evaluation_test_case = client.agents.evaluation_test_cases.retrieve( @@ -78,7 +78,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(EvaluationTestCaseRetrieveResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gradient) -> None: evaluation_test_case = client.agents.evaluation_test_cases.retrieve( @@ -87,7 +87,7 @@ def test_method_retrieve_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(EvaluationTestCaseRetrieveResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.agents.evaluation_test_cases.with_raw_response.retrieve( @@ -99,7 +99,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: evaluation_test_case = response.parse() assert_matches_type(EvaluationTestCaseRetrieveResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.agents.evaluation_test_cases.with_streaming_response.retrieve( @@ -113,7 +113,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `test_case_uuid` but received ''"): @@ -121,7 +121,7 @@ def test_path_params_retrieve(self, client: Gradient) -> None: test_case_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gradient) -> None: evaluation_test_case = client.agents.evaluation_test_cases.update( @@ -129,7 +129,7 @@ def test_method_update(self, client: Gradient) -> None: ) assert_matches_type(EvaluationTestCaseUpdateResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gradient) -> None: evaluation_test_case = client.agents.evaluation_test_cases.update( @@ -148,7 +148,7 @@ def test_method_update_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(EvaluationTestCaseUpdateResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gradient) -> None: response = client.agents.evaluation_test_cases.with_raw_response.update( @@ -160,7 +160,7 @@ def test_raw_response_update(self, client: Gradient) -> None: evaluation_test_case = response.parse() assert_matches_type(EvaluationTestCaseUpdateResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gradient) -> None: with client.agents.evaluation_test_cases.with_streaming_response.update( @@ -174,7 +174,7 @@ def test_streaming_response_update(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_test_case_uuid` but received ''"): @@ -182,13 +182,13 @@ def test_path_params_update(self, client: Gradient) -> None: path_test_case_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: evaluation_test_case = client.agents.evaluation_test_cases.list() assert_matches_type(EvaluationTestCaseListResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.agents.evaluation_test_cases.with_raw_response.list() @@ -198,7 +198,7 @@ def test_raw_response_list(self, client: Gradient) -> None: evaluation_test_case = response.parse() assert_matches_type(EvaluationTestCaseListResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.agents.evaluation_test_cases.with_streaming_response.list() as response: @@ -210,7 +210,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_evaluation_runs(self, client: Gradient) -> None: evaluation_test_case = client.agents.evaluation_test_cases.list_evaluation_runs( @@ -218,7 +218,7 @@ def test_method_list_evaluation_runs(self, client: Gradient) -> None: ) assert_matches_type(EvaluationTestCaseListEvaluationRunsResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_evaluation_runs_with_all_params(self, client: Gradient) -> None: evaluation_test_case = client.agents.evaluation_test_cases.list_evaluation_runs( @@ -227,7 +227,7 @@ def test_method_list_evaluation_runs_with_all_params(self, client: Gradient) -> ) assert_matches_type(EvaluationTestCaseListEvaluationRunsResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_evaluation_runs(self, client: Gradient) -> None: response = client.agents.evaluation_test_cases.with_raw_response.list_evaluation_runs( @@ -239,7 +239,7 @@ def test_raw_response_list_evaluation_runs(self, client: Gradient) -> None: evaluation_test_case = response.parse() assert_matches_type(EvaluationTestCaseListEvaluationRunsResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_evaluation_runs(self, client: Gradient) -> None: with client.agents.evaluation_test_cases.with_streaming_response.list_evaluation_runs( @@ -253,7 +253,7 @@ def test_streaming_response_list_evaluation_runs(self, client: Gradient) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_list_evaluation_runs(self, client: Gradient) -> None: with pytest.raises( @@ -269,13 +269,13 @@ class TestAsyncEvaluationTestCases: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: evaluation_test_case = await async_client.agents.evaluation_test_cases.create() assert_matches_type(EvaluationTestCaseCreateResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: evaluation_test_case = await async_client.agents.evaluation_test_cases.create( @@ -294,7 +294,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(EvaluationTestCaseCreateResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_test_cases.with_raw_response.create() @@ -304,7 +304,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: evaluation_test_case = await response.parse() assert_matches_type(EvaluationTestCaseCreateResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_test_cases.with_streaming_response.create() as response: @@ -316,7 +316,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: evaluation_test_case = await async_client.agents.evaluation_test_cases.retrieve( @@ -324,7 +324,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(EvaluationTestCaseRetrieveResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGradient) -> None: evaluation_test_case = await async_client.agents.evaluation_test_cases.retrieve( @@ -333,7 +333,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGradient ) assert_matches_type(EvaluationTestCaseRetrieveResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_test_cases.with_raw_response.retrieve( @@ -345,7 +345,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: evaluation_test_case = await response.parse() assert_matches_type(EvaluationTestCaseRetrieveResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_test_cases.with_streaming_response.retrieve( @@ -359,7 +359,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `test_case_uuid` but received ''"): @@ -367,7 +367,7 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: test_case_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGradient) -> None: evaluation_test_case = await async_client.agents.evaluation_test_cases.update( @@ -375,7 +375,7 @@ async def test_method_update(self, async_client: AsyncGradient) -> None: ) assert_matches_type(EvaluationTestCaseUpdateResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGradient) -> None: evaluation_test_case = await async_client.agents.evaluation_test_cases.update( @@ -394,7 +394,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(EvaluationTestCaseUpdateResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_test_cases.with_raw_response.update( @@ -406,7 +406,7 @@ async def test_raw_response_update(self, async_client: AsyncGradient) -> None: evaluation_test_case = await response.parse() assert_matches_type(EvaluationTestCaseUpdateResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_test_cases.with_streaming_response.update( @@ -420,7 +420,7 @@ async def test_streaming_response_update(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_test_case_uuid` but received ''"): @@ -428,13 +428,13 @@ async def test_path_params_update(self, async_client: AsyncGradient) -> None: path_test_case_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: evaluation_test_case = await async_client.agents.evaluation_test_cases.list() assert_matches_type(EvaluationTestCaseListResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_test_cases.with_raw_response.list() @@ -444,7 +444,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: evaluation_test_case = await response.parse() assert_matches_type(EvaluationTestCaseListResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_test_cases.with_streaming_response.list() as response: @@ -456,7 +456,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_evaluation_runs(self, async_client: AsyncGradient) -> None: evaluation_test_case = await async_client.agents.evaluation_test_cases.list_evaluation_runs( @@ -464,7 +464,7 @@ async def test_method_list_evaluation_runs(self, async_client: AsyncGradient) -> ) assert_matches_type(EvaluationTestCaseListEvaluationRunsResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_evaluation_runs_with_all_params(self, async_client: AsyncGradient) -> None: evaluation_test_case = await async_client.agents.evaluation_test_cases.list_evaluation_runs( @@ -473,7 +473,7 @@ async def test_method_list_evaluation_runs_with_all_params(self, async_client: A ) assert_matches_type(EvaluationTestCaseListEvaluationRunsResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_evaluation_runs(self, async_client: AsyncGradient) -> None: response = await async_client.agents.evaluation_test_cases.with_raw_response.list_evaluation_runs( @@ -485,7 +485,7 @@ async def test_raw_response_list_evaluation_runs(self, async_client: AsyncGradie evaluation_test_case = await response.parse() assert_matches_type(EvaluationTestCaseListEvaluationRunsResponse, evaluation_test_case, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_evaluation_runs(self, async_client: AsyncGradient) -> None: async with async_client.agents.evaluation_test_cases.with_streaming_response.list_evaluation_runs( @@ -499,7 +499,7 @@ async def test_streaming_response_list_evaluation_runs(self, async_client: Async assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_list_evaluation_runs(self, async_client: AsyncGradient) -> None: with pytest.raises( diff --git a/tests/api_resources/agents/test_functions.py b/tests/api_resources/agents/test_functions.py index 64d55331..6b1fb5a0 100644 --- a/tests/api_resources/agents/test_functions.py +++ b/tests/api_resources/agents/test_functions.py @@ -21,7 +21,7 @@ class TestFunctions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: function = client.agents.functions.create( @@ -29,7 +29,7 @@ def test_method_create(self, client: Gradient) -> None: ) assert_matches_type(FunctionCreateResponse, function, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: function = client.agents.functions.create( @@ -44,7 +44,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(FunctionCreateResponse, function, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.agents.functions.with_raw_response.create( @@ -56,7 +56,7 @@ def test_raw_response_create(self, client: Gradient) -> None: function = response.parse() assert_matches_type(FunctionCreateResponse, function, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.agents.functions.with_streaming_response.create( @@ -70,7 +70,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_create(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_agent_uuid` but received ''"): @@ -78,7 +78,7 @@ def test_path_params_create(self, client: Gradient) -> None: path_agent_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gradient) -> None: function = client.agents.functions.update( @@ -87,7 +87,7 @@ def test_method_update(self, client: Gradient) -> None: ) assert_matches_type(FunctionUpdateResponse, function, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gradient) -> None: function = client.agents.functions.update( @@ -104,7 +104,7 @@ def test_method_update_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(FunctionUpdateResponse, function, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gradient) -> None: response = client.agents.functions.with_raw_response.update( @@ -117,7 +117,7 @@ def test_raw_response_update(self, client: Gradient) -> None: function = response.parse() assert_matches_type(FunctionUpdateResponse, function, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gradient) -> None: with client.agents.functions.with_streaming_response.update( @@ -132,7 +132,7 @@ def test_streaming_response_update(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_agent_uuid` but received ''"): @@ -147,7 +147,7 @@ def test_path_params_update(self, client: Gradient) -> None: path_agent_uuid='"123e4567-e89b-12d3-a456-426614174000"', ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: function = client.agents.functions.delete( @@ -156,7 +156,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert_matches_type(FunctionDeleteResponse, function, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.agents.functions.with_raw_response.delete( @@ -169,7 +169,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: function = response.parse() assert_matches_type(FunctionDeleteResponse, function, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.agents.functions.with_streaming_response.delete( @@ -184,7 +184,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `agent_uuid` but received ''"): @@ -205,7 +205,7 @@ class TestAsyncFunctions: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: function = await async_client.agents.functions.create( @@ -213,7 +213,7 @@ async def test_method_create(self, async_client: AsyncGradient) -> None: ) assert_matches_type(FunctionCreateResponse, function, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: function = await async_client.agents.functions.create( @@ -228,7 +228,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(FunctionCreateResponse, function, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.agents.functions.with_raw_response.create( @@ -240,7 +240,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: function = await response.parse() assert_matches_type(FunctionCreateResponse, function, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with async_client.agents.functions.with_streaming_response.create( @@ -254,7 +254,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_create(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_agent_uuid` but received ''"): @@ -262,7 +262,7 @@ async def test_path_params_create(self, async_client: AsyncGradient) -> None: path_agent_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGradient) -> None: function = await async_client.agents.functions.update( @@ -271,7 +271,7 @@ async def test_method_update(self, async_client: AsyncGradient) -> None: ) assert_matches_type(FunctionUpdateResponse, function, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGradient) -> None: function = await async_client.agents.functions.update( @@ -288,7 +288,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(FunctionUpdateResponse, function, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGradient) -> None: response = await async_client.agents.functions.with_raw_response.update( @@ -301,7 +301,7 @@ async def test_raw_response_update(self, async_client: AsyncGradient) -> None: function = await response.parse() assert_matches_type(FunctionUpdateResponse, function, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGradient) -> None: async with async_client.agents.functions.with_streaming_response.update( @@ -316,7 +316,7 @@ async def test_streaming_response_update(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_agent_uuid` but received ''"): @@ -331,7 +331,7 @@ async def test_path_params_update(self, async_client: AsyncGradient) -> None: path_agent_uuid='"123e4567-e89b-12d3-a456-426614174000"', ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: function = await async_client.agents.functions.delete( @@ -340,7 +340,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert_matches_type(FunctionDeleteResponse, function, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.agents.functions.with_raw_response.delete( @@ -353,7 +353,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: function = await response.parse() assert_matches_type(FunctionDeleteResponse, function, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.agents.functions.with_streaming_response.delete( @@ -368,7 +368,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `agent_uuid` but received ''"): diff --git a/tests/api_resources/agents/test_knowledge_bases.py b/tests/api_resources/agents/test_knowledge_bases.py index 2cf09753..c773fd94 100644 --- a/tests/api_resources/agents/test_knowledge_bases.py +++ b/tests/api_resources/agents/test_knowledge_bases.py @@ -17,7 +17,7 @@ class TestKnowledgeBases: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_attach(self, client: Gradient) -> None: knowledge_base = client.agents.knowledge_bases.attach( @@ -25,7 +25,7 @@ def test_method_attach(self, client: Gradient) -> None: ) assert_matches_type(APILinkKnowledgeBaseOutput, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_attach(self, client: Gradient) -> None: response = client.agents.knowledge_bases.with_raw_response.attach( @@ -37,7 +37,7 @@ def test_raw_response_attach(self, client: Gradient) -> None: knowledge_base = response.parse() assert_matches_type(APILinkKnowledgeBaseOutput, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_attach(self, client: Gradient) -> None: with client.agents.knowledge_bases.with_streaming_response.attach( @@ -51,7 +51,7 @@ def test_streaming_response_attach(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_attach(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `agent_uuid` but received ''"): @@ -59,7 +59,7 @@ def test_path_params_attach(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_attach_single(self, client: Gradient) -> None: knowledge_base = client.agents.knowledge_bases.attach_single( @@ -68,7 +68,7 @@ def test_method_attach_single(self, client: Gradient) -> None: ) assert_matches_type(APILinkKnowledgeBaseOutput, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_attach_single(self, client: Gradient) -> None: response = client.agents.knowledge_bases.with_raw_response.attach_single( @@ -81,7 +81,7 @@ def test_raw_response_attach_single(self, client: Gradient) -> None: knowledge_base = response.parse() assert_matches_type(APILinkKnowledgeBaseOutput, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_attach_single(self, client: Gradient) -> None: with client.agents.knowledge_bases.with_streaming_response.attach_single( @@ -96,7 +96,7 @@ def test_streaming_response_attach_single(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_attach_single(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `agent_uuid` but received ''"): @@ -111,7 +111,7 @@ def test_path_params_attach_single(self, client: Gradient) -> None: agent_uuid='"123e4567-e89b-12d3-a456-426614174000"', ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_detach(self, client: Gradient) -> None: knowledge_base = client.agents.knowledge_bases.detach( @@ -120,7 +120,7 @@ def test_method_detach(self, client: Gradient) -> None: ) assert_matches_type(KnowledgeBaseDetachResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_detach(self, client: Gradient) -> None: response = client.agents.knowledge_bases.with_raw_response.detach( @@ -133,7 +133,7 @@ def test_raw_response_detach(self, client: Gradient) -> None: knowledge_base = response.parse() assert_matches_type(KnowledgeBaseDetachResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_detach(self, client: Gradient) -> None: with client.agents.knowledge_bases.with_streaming_response.detach( @@ -148,7 +148,7 @@ def test_streaming_response_detach(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_detach(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `agent_uuid` but received ''"): @@ -169,7 +169,7 @@ class TestAsyncKnowledgeBases: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_attach(self, async_client: AsyncGradient) -> None: knowledge_base = await async_client.agents.knowledge_bases.attach( @@ -177,7 +177,7 @@ async def test_method_attach(self, async_client: AsyncGradient) -> None: ) assert_matches_type(APILinkKnowledgeBaseOutput, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_attach(self, async_client: AsyncGradient) -> None: response = await async_client.agents.knowledge_bases.with_raw_response.attach( @@ -189,7 +189,7 @@ async def test_raw_response_attach(self, async_client: AsyncGradient) -> None: knowledge_base = await response.parse() assert_matches_type(APILinkKnowledgeBaseOutput, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_attach(self, async_client: AsyncGradient) -> None: async with async_client.agents.knowledge_bases.with_streaming_response.attach( @@ -203,7 +203,7 @@ async def test_streaming_response_attach(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_attach(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `agent_uuid` but received ''"): @@ -211,7 +211,7 @@ async def test_path_params_attach(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_attach_single(self, async_client: AsyncGradient) -> None: knowledge_base = await async_client.agents.knowledge_bases.attach_single( @@ -220,7 +220,7 @@ async def test_method_attach_single(self, async_client: AsyncGradient) -> None: ) assert_matches_type(APILinkKnowledgeBaseOutput, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_attach_single(self, async_client: AsyncGradient) -> None: response = await async_client.agents.knowledge_bases.with_raw_response.attach_single( @@ -233,7 +233,7 @@ async def test_raw_response_attach_single(self, async_client: AsyncGradient) -> knowledge_base = await response.parse() assert_matches_type(APILinkKnowledgeBaseOutput, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_attach_single(self, async_client: AsyncGradient) -> None: async with async_client.agents.knowledge_bases.with_streaming_response.attach_single( @@ -248,7 +248,7 @@ async def test_streaming_response_attach_single(self, async_client: AsyncGradien assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_attach_single(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `agent_uuid` but received ''"): @@ -263,7 +263,7 @@ async def test_path_params_attach_single(self, async_client: AsyncGradient) -> N agent_uuid='"123e4567-e89b-12d3-a456-426614174000"', ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_detach(self, async_client: AsyncGradient) -> None: knowledge_base = await async_client.agents.knowledge_bases.detach( @@ -272,7 +272,7 @@ async def test_method_detach(self, async_client: AsyncGradient) -> None: ) assert_matches_type(KnowledgeBaseDetachResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_detach(self, async_client: AsyncGradient) -> None: response = await async_client.agents.knowledge_bases.with_raw_response.detach( @@ -285,7 +285,7 @@ async def test_raw_response_detach(self, async_client: AsyncGradient) -> None: knowledge_base = await response.parse() assert_matches_type(KnowledgeBaseDetachResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_detach(self, async_client: AsyncGradient) -> None: async with async_client.agents.knowledge_bases.with_streaming_response.detach( @@ -300,7 +300,7 @@ async def test_streaming_response_detach(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_detach(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `agent_uuid` but received ''"): diff --git a/tests/api_resources/agents/test_routes.py b/tests/api_resources/agents/test_routes.py index 3444dcc7..4edc5f73 100644 --- a/tests/api_resources/agents/test_routes.py +++ b/tests/api_resources/agents/test_routes.py @@ -22,7 +22,7 @@ class TestRoutes: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gradient) -> None: route = client.agents.routes.update( @@ -31,7 +31,7 @@ def test_method_update(self, client: Gradient) -> None: ) assert_matches_type(RouteUpdateResponse, route, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gradient) -> None: route = client.agents.routes.update( @@ -45,7 +45,7 @@ def test_method_update_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(RouteUpdateResponse, route, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gradient) -> None: response = client.agents.routes.with_raw_response.update( @@ -58,7 +58,7 @@ def test_raw_response_update(self, client: Gradient) -> None: route = response.parse() assert_matches_type(RouteUpdateResponse, route, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gradient) -> None: with client.agents.routes.with_streaming_response.update( @@ -73,7 +73,7 @@ def test_streaming_response_update(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update(self, client: Gradient) -> None: with pytest.raises( @@ -90,7 +90,7 @@ def test_path_params_update(self, client: Gradient) -> None: path_parent_agent_uuid='"123e4567-e89b-12d3-a456-426614174000"', ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: route = client.agents.routes.delete( @@ -99,7 +99,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert_matches_type(RouteDeleteResponse, route, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.agents.routes.with_raw_response.delete( @@ -112,7 +112,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: route = response.parse() assert_matches_type(RouteDeleteResponse, route, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.agents.routes.with_streaming_response.delete( @@ -127,7 +127,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `parent_agent_uuid` but received ''"): @@ -142,7 +142,7 @@ def test_path_params_delete(self, client: Gradient) -> None: parent_agent_uuid='"123e4567-e89b-12d3-a456-426614174000"', ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_add(self, client: Gradient) -> None: route = client.agents.routes.add( @@ -151,7 +151,7 @@ def test_method_add(self, client: Gradient) -> None: ) assert_matches_type(RouteAddResponse, route, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_add_with_all_params(self, client: Gradient) -> None: route = client.agents.routes.add( @@ -164,7 +164,7 @@ def test_method_add_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(RouteAddResponse, route, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_add(self, client: Gradient) -> None: response = client.agents.routes.with_raw_response.add( @@ -177,7 +177,7 @@ def test_raw_response_add(self, client: Gradient) -> None: route = response.parse() assert_matches_type(RouteAddResponse, route, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_add(self, client: Gradient) -> None: with client.agents.routes.with_streaming_response.add( @@ -192,7 +192,7 @@ def test_streaming_response_add(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_add(self, client: Gradient) -> None: with pytest.raises( @@ -209,7 +209,7 @@ def test_path_params_add(self, client: Gradient) -> None: path_parent_agent_uuid='"123e4567-e89b-12d3-a456-426614174000"', ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_view(self, client: Gradient) -> None: route = client.agents.routes.view( @@ -217,7 +217,7 @@ def test_method_view(self, client: Gradient) -> None: ) assert_matches_type(RouteViewResponse, route, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_view(self, client: Gradient) -> None: response = client.agents.routes.with_raw_response.view( @@ -229,7 +229,7 @@ def test_raw_response_view(self, client: Gradient) -> None: route = response.parse() assert_matches_type(RouteViewResponse, route, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_view(self, client: Gradient) -> None: with client.agents.routes.with_streaming_response.view( @@ -243,7 +243,7 @@ def test_streaming_response_view(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_view(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): @@ -257,7 +257,7 @@ class TestAsyncRoutes: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGradient) -> None: route = await async_client.agents.routes.update( @@ -266,7 +266,7 @@ async def test_method_update(self, async_client: AsyncGradient) -> None: ) assert_matches_type(RouteUpdateResponse, route, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGradient) -> None: route = await async_client.agents.routes.update( @@ -280,7 +280,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(RouteUpdateResponse, route, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGradient) -> None: response = await async_client.agents.routes.with_raw_response.update( @@ -293,7 +293,7 @@ async def test_raw_response_update(self, async_client: AsyncGradient) -> None: route = await response.parse() assert_matches_type(RouteUpdateResponse, route, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGradient) -> None: async with async_client.agents.routes.with_streaming_response.update( @@ -308,7 +308,7 @@ async def test_streaming_response_update(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncGradient) -> None: with pytest.raises( @@ -325,7 +325,7 @@ async def test_path_params_update(self, async_client: AsyncGradient) -> None: path_parent_agent_uuid='"123e4567-e89b-12d3-a456-426614174000"', ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: route = await async_client.agents.routes.delete( @@ -334,7 +334,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert_matches_type(RouteDeleteResponse, route, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.agents.routes.with_raw_response.delete( @@ -347,7 +347,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: route = await response.parse() assert_matches_type(RouteDeleteResponse, route, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.agents.routes.with_streaming_response.delete( @@ -362,7 +362,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `parent_agent_uuid` but received ''"): @@ -377,7 +377,7 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: parent_agent_uuid='"123e4567-e89b-12d3-a456-426614174000"', ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_add(self, async_client: AsyncGradient) -> None: route = await async_client.agents.routes.add( @@ -386,7 +386,7 @@ async def test_method_add(self, async_client: AsyncGradient) -> None: ) assert_matches_type(RouteAddResponse, route, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_add_with_all_params(self, async_client: AsyncGradient) -> None: route = await async_client.agents.routes.add( @@ -399,7 +399,7 @@ async def test_method_add_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(RouteAddResponse, route, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_add(self, async_client: AsyncGradient) -> None: response = await async_client.agents.routes.with_raw_response.add( @@ -412,7 +412,7 @@ async def test_raw_response_add(self, async_client: AsyncGradient) -> None: route = await response.parse() assert_matches_type(RouteAddResponse, route, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_add(self, async_client: AsyncGradient) -> None: async with async_client.agents.routes.with_streaming_response.add( @@ -427,7 +427,7 @@ async def test_streaming_response_add(self, async_client: AsyncGradient) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_add(self, async_client: AsyncGradient) -> None: with pytest.raises( @@ -444,7 +444,7 @@ async def test_path_params_add(self, async_client: AsyncGradient) -> None: path_parent_agent_uuid='"123e4567-e89b-12d3-a456-426614174000"', ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_view(self, async_client: AsyncGradient) -> None: route = await async_client.agents.routes.view( @@ -452,7 +452,7 @@ async def test_method_view(self, async_client: AsyncGradient) -> None: ) assert_matches_type(RouteViewResponse, route, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_view(self, async_client: AsyncGradient) -> None: response = await async_client.agents.routes.with_raw_response.view( @@ -464,7 +464,7 @@ async def test_raw_response_view(self, async_client: AsyncGradient) -> None: route = await response.parse() assert_matches_type(RouteViewResponse, route, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_view(self, async_client: AsyncGradient) -> None: async with async_client.agents.routes.with_streaming_response.view( @@ -478,7 +478,7 @@ async def test_streaming_response_view(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_view(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): diff --git a/tests/api_resources/agents/test_versions.py b/tests/api_resources/agents/test_versions.py index d12e362e..ab10c5e4 100644 --- a/tests/api_resources/agents/test_versions.py +++ b/tests/api_resources/agents/test_versions.py @@ -17,7 +17,7 @@ class TestVersions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gradient) -> None: version = client.agents.versions.update( @@ -25,7 +25,7 @@ def test_method_update(self, client: Gradient) -> None: ) assert_matches_type(VersionUpdateResponse, version, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gradient) -> None: version = client.agents.versions.update( @@ -35,7 +35,7 @@ def test_method_update_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(VersionUpdateResponse, version, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gradient) -> None: response = client.agents.versions.with_raw_response.update( @@ -47,7 +47,7 @@ def test_raw_response_update(self, client: Gradient) -> None: version = response.parse() assert_matches_type(VersionUpdateResponse, version, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gradient) -> None: with client.agents.versions.with_streaming_response.update( @@ -61,7 +61,7 @@ def test_streaming_response_update(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_uuid` but received ''"): @@ -69,7 +69,7 @@ def test_path_params_update(self, client: Gradient) -> None: path_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: version = client.agents.versions.list( @@ -77,7 +77,7 @@ def test_method_list(self, client: Gradient) -> None: ) assert_matches_type(VersionListResponse, version, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: version = client.agents.versions.list( @@ -87,7 +87,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(VersionListResponse, version, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.agents.versions.with_raw_response.list( @@ -99,7 +99,7 @@ def test_raw_response_list(self, client: Gradient) -> None: version = response.parse() assert_matches_type(VersionListResponse, version, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.agents.versions.with_streaming_response.list( @@ -113,7 +113,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_list(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): @@ -127,7 +127,7 @@ class TestAsyncVersions: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGradient) -> None: version = await async_client.agents.versions.update( @@ -135,7 +135,7 @@ async def test_method_update(self, async_client: AsyncGradient) -> None: ) assert_matches_type(VersionUpdateResponse, version, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGradient) -> None: version = await async_client.agents.versions.update( @@ -145,7 +145,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(VersionUpdateResponse, version, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGradient) -> None: response = await async_client.agents.versions.with_raw_response.update( @@ -157,7 +157,7 @@ async def test_raw_response_update(self, async_client: AsyncGradient) -> None: version = await response.parse() assert_matches_type(VersionUpdateResponse, version, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGradient) -> None: async with async_client.agents.versions.with_streaming_response.update( @@ -171,7 +171,7 @@ async def test_streaming_response_update(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_uuid` but received ''"): @@ -179,7 +179,7 @@ async def test_path_params_update(self, async_client: AsyncGradient) -> None: path_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: version = await async_client.agents.versions.list( @@ -187,7 +187,7 @@ async def test_method_list(self, async_client: AsyncGradient) -> None: ) assert_matches_type(VersionListResponse, version, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: version = await async_client.agents.versions.list( @@ -197,7 +197,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(VersionListResponse, version, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.agents.versions.with_raw_response.list( @@ -209,7 +209,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: version = await response.parse() assert_matches_type(VersionListResponse, version, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.agents.versions.with_streaming_response.list( @@ -223,7 +223,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_list(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): diff --git a/tests/api_resources/apps/test_job_invocations.py b/tests/api_resources/apps/test_job_invocations.py index a7cb68df..388be266 100644 --- a/tests/api_resources/apps/test_job_invocations.py +++ b/tests/api_resources/apps/test_job_invocations.py @@ -17,7 +17,7 @@ class TestJobInvocations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_cancel(self, client: Gradient) -> None: job_invocation = client.apps.job_invocations.cancel( @@ -26,7 +26,7 @@ def test_method_cancel(self, client: Gradient) -> None: ) assert_matches_type(JobInvocationCancelResponse, job_invocation, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_cancel_with_all_params(self, client: Gradient) -> None: job_invocation = client.apps.job_invocations.cancel( @@ -36,7 +36,7 @@ def test_method_cancel_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(JobInvocationCancelResponse, job_invocation, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_cancel(self, client: Gradient) -> None: response = client.apps.job_invocations.with_raw_response.cancel( @@ -49,7 +49,7 @@ def test_raw_response_cancel(self, client: Gradient) -> None: job_invocation = response.parse() assert_matches_type(JobInvocationCancelResponse, job_invocation, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_cancel(self, client: Gradient) -> None: with client.apps.job_invocations.with_streaming_response.cancel( @@ -64,7 +64,7 @@ def test_streaming_response_cancel(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_cancel(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): @@ -85,7 +85,7 @@ class TestAsyncJobInvocations: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_cancel(self, async_client: AsyncGradient) -> None: job_invocation = await async_client.apps.job_invocations.cancel( @@ -94,7 +94,7 @@ async def test_method_cancel(self, async_client: AsyncGradient) -> None: ) assert_matches_type(JobInvocationCancelResponse, job_invocation, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_cancel_with_all_params(self, async_client: AsyncGradient) -> None: job_invocation = await async_client.apps.job_invocations.cancel( @@ -104,7 +104,7 @@ async def test_method_cancel_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(JobInvocationCancelResponse, job_invocation, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_cancel(self, async_client: AsyncGradient) -> None: response = await async_client.apps.job_invocations.with_raw_response.cancel( @@ -117,7 +117,7 @@ async def test_raw_response_cancel(self, async_client: AsyncGradient) -> None: job_invocation = await response.parse() assert_matches_type(JobInvocationCancelResponse, job_invocation, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_cancel(self, async_client: AsyncGradient) -> None: async with async_client.apps.job_invocations.with_streaming_response.cancel( @@ -132,7 +132,7 @@ async def test_streaming_response_cancel(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_cancel(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): diff --git a/tests/api_resources/chat/test_completions.py b/tests/api_resources/chat/test_completions.py index fce393fd..81125c20 100644 --- a/tests/api_resources/chat/test_completions.py +++ b/tests/api_resources/chat/test_completions.py @@ -17,7 +17,7 @@ class TestCompletions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_overload_1(self, client: Gradient) -> None: completion = client.chat.completions.create( @@ -31,7 +31,7 @@ def test_method_create_overload_1(self, client: Gradient) -> None: ) assert_matches_type(CompletionCreateResponse, completion, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params_overload_1(self, client: Gradient) -> None: completion = client.chat.completions.create( @@ -71,7 +71,7 @@ def test_method_create_with_all_params_overload_1(self, client: Gradient) -> Non ) assert_matches_type(CompletionCreateResponse, completion, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_overload_1(self, client: Gradient) -> None: response = client.chat.completions.with_raw_response.create( @@ -89,7 +89,7 @@ def test_raw_response_create_overload_1(self, client: Gradient) -> None: completion = response.parse() assert_matches_type(CompletionCreateResponse, completion, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_overload_1(self, client: Gradient) -> None: with client.chat.completions.with_streaming_response.create( @@ -109,7 +109,7 @@ def test_streaming_response_create_overload_1(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_overload_2(self, client: Gradient) -> None: completion_stream = client.chat.completions.create( @@ -124,7 +124,7 @@ def test_method_create_overload_2(self, client: Gradient) -> None: ) completion_stream.response.close() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params_overload_2(self, client: Gradient) -> None: completion_stream = client.chat.completions.create( @@ -164,7 +164,7 @@ def test_method_create_with_all_params_overload_2(self, client: Gradient) -> Non ) completion_stream.response.close() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_overload_2(self, client: Gradient) -> None: response = client.chat.completions.with_raw_response.create( @@ -182,7 +182,7 @@ def test_raw_response_create_overload_2(self, client: Gradient) -> None: stream = response.parse() stream.close() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_overload_2(self, client: Gradient) -> None: with client.chat.completions.with_streaming_response.create( @@ -209,7 +209,7 @@ class TestAsyncCompletions: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_overload_1(self, async_client: AsyncGradient) -> None: completion = await async_client.chat.completions.create( @@ -223,7 +223,7 @@ async def test_method_create_overload_1(self, async_client: AsyncGradient) -> No ) assert_matches_type(CompletionCreateResponse, completion, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGradient) -> None: completion = await async_client.chat.completions.create( @@ -263,7 +263,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn ) assert_matches_type(CompletionCreateResponse, completion, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncGradient) -> None: response = await async_client.chat.completions.with_raw_response.create( @@ -281,7 +281,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncGradient) completion = await response.parse() assert_matches_type(CompletionCreateResponse, completion, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncGradient) -> None: async with async_client.chat.completions.with_streaming_response.create( @@ -301,7 +301,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncGra assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_overload_2(self, async_client: AsyncGradient) -> None: completion_stream = await async_client.chat.completions.create( @@ -316,7 +316,7 @@ async def test_method_create_overload_2(self, async_client: AsyncGradient) -> No ) await completion_stream.response.aclose() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGradient) -> None: completion_stream = await async_client.chat.completions.create( @@ -356,7 +356,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn ) await completion_stream.response.aclose() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) -> None: response = await async_client.chat.completions.with_raw_response.create( @@ -374,7 +374,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) stream = await response.parse() await stream.close() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncGradient) -> None: async with async_client.chat.completions.with_streaming_response.create( diff --git a/tests/api_resources/databases/schema_registry/test_config.py b/tests/api_resources/databases/schema_registry/test_config.py index ebd60c4c..c58a6ad9 100644 --- a/tests/api_resources/databases/schema_registry/test_config.py +++ b/tests/api_resources/databases/schema_registry/test_config.py @@ -22,7 +22,7 @@ class TestConfig: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: config = client.databases.schema_registry.config.retrieve( @@ -30,7 +30,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(ConfigRetrieveResponse, config, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.databases.schema_registry.config.with_raw_response.retrieve( @@ -42,7 +42,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: config = response.parse() assert_matches_type(ConfigRetrieveResponse, config, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.databases.schema_registry.config.with_streaming_response.retrieve( @@ -56,7 +56,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `database_cluster_uuid` but received ''"): @@ -64,7 +64,7 @@ def test_path_params_retrieve(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gradient) -> None: config = client.databases.schema_registry.config.update( @@ -73,7 +73,7 @@ def test_method_update(self, client: Gradient) -> None: ) assert_matches_type(ConfigUpdateResponse, config, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gradient) -> None: response = client.databases.schema_registry.config.with_raw_response.update( @@ -86,7 +86,7 @@ def test_raw_response_update(self, client: Gradient) -> None: config = response.parse() assert_matches_type(ConfigUpdateResponse, config, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gradient) -> None: with client.databases.schema_registry.config.with_streaming_response.update( @@ -101,7 +101,7 @@ def test_streaming_response_update(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `database_cluster_uuid` but received ''"): @@ -110,7 +110,7 @@ def test_path_params_update(self, client: Gradient) -> None: compatibility_level="BACKWARD", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_subject(self, client: Gradient) -> None: config = client.databases.schema_registry.config.retrieve_subject( @@ -119,7 +119,7 @@ def test_method_retrieve_subject(self, client: Gradient) -> None: ) assert_matches_type(ConfigRetrieveSubjectResponse, config, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve_subject(self, client: Gradient) -> None: response = client.databases.schema_registry.config.with_raw_response.retrieve_subject( @@ -132,7 +132,7 @@ def test_raw_response_retrieve_subject(self, client: Gradient) -> None: config = response.parse() assert_matches_type(ConfigRetrieveSubjectResponse, config, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve_subject(self, client: Gradient) -> None: with client.databases.schema_registry.config.with_streaming_response.retrieve_subject( @@ -147,7 +147,7 @@ def test_streaming_response_retrieve_subject(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve_subject(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `database_cluster_uuid` but received ''"): @@ -162,7 +162,7 @@ def test_path_params_retrieve_subject(self, client: Gradient) -> None: database_cluster_uuid="9cc10173-e9ea-4176-9dbc-a4cee4c4ff30", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_subject(self, client: Gradient) -> None: config = client.databases.schema_registry.config.update_subject( @@ -172,7 +172,7 @@ def test_method_update_subject(self, client: Gradient) -> None: ) assert_matches_type(ConfigUpdateSubjectResponse, config, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update_subject(self, client: Gradient) -> None: response = client.databases.schema_registry.config.with_raw_response.update_subject( @@ -186,7 +186,7 @@ def test_raw_response_update_subject(self, client: Gradient) -> None: config = response.parse() assert_matches_type(ConfigUpdateSubjectResponse, config, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update_subject(self, client: Gradient) -> None: with client.databases.schema_registry.config.with_streaming_response.update_subject( @@ -202,7 +202,7 @@ def test_streaming_response_update_subject(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update_subject(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `database_cluster_uuid` but received ''"): @@ -225,7 +225,7 @@ class TestAsyncConfig: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: config = await async_client.databases.schema_registry.config.retrieve( @@ -233,7 +233,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(ConfigRetrieveResponse, config, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.databases.schema_registry.config.with_raw_response.retrieve( @@ -245,7 +245,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: config = await response.parse() assert_matches_type(ConfigRetrieveResponse, config, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.databases.schema_registry.config.with_streaming_response.retrieve( @@ -259,7 +259,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `database_cluster_uuid` but received ''"): @@ -267,7 +267,7 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGradient) -> None: config = await async_client.databases.schema_registry.config.update( @@ -276,7 +276,7 @@ async def test_method_update(self, async_client: AsyncGradient) -> None: ) assert_matches_type(ConfigUpdateResponse, config, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGradient) -> None: response = await async_client.databases.schema_registry.config.with_raw_response.update( @@ -289,7 +289,7 @@ async def test_raw_response_update(self, async_client: AsyncGradient) -> None: config = await response.parse() assert_matches_type(ConfigUpdateResponse, config, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGradient) -> None: async with async_client.databases.schema_registry.config.with_streaming_response.update( @@ -304,7 +304,7 @@ async def test_streaming_response_update(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `database_cluster_uuid` but received ''"): @@ -313,7 +313,7 @@ async def test_path_params_update(self, async_client: AsyncGradient) -> None: compatibility_level="BACKWARD", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_subject(self, async_client: AsyncGradient) -> None: config = await async_client.databases.schema_registry.config.retrieve_subject( @@ -322,7 +322,7 @@ async def test_method_retrieve_subject(self, async_client: AsyncGradient) -> Non ) assert_matches_type(ConfigRetrieveSubjectResponse, config, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve_subject(self, async_client: AsyncGradient) -> None: response = await async_client.databases.schema_registry.config.with_raw_response.retrieve_subject( @@ -335,7 +335,7 @@ async def test_raw_response_retrieve_subject(self, async_client: AsyncGradient) config = await response.parse() assert_matches_type(ConfigRetrieveSubjectResponse, config, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve_subject(self, async_client: AsyncGradient) -> None: async with async_client.databases.schema_registry.config.with_streaming_response.retrieve_subject( @@ -350,7 +350,7 @@ async def test_streaming_response_retrieve_subject(self, async_client: AsyncGrad assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve_subject(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `database_cluster_uuid` but received ''"): @@ -365,7 +365,7 @@ async def test_path_params_retrieve_subject(self, async_client: AsyncGradient) - database_cluster_uuid="9cc10173-e9ea-4176-9dbc-a4cee4c4ff30", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_subject(self, async_client: AsyncGradient) -> None: config = await async_client.databases.schema_registry.config.update_subject( @@ -375,7 +375,7 @@ async def test_method_update_subject(self, async_client: AsyncGradient) -> None: ) assert_matches_type(ConfigUpdateSubjectResponse, config, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update_subject(self, async_client: AsyncGradient) -> None: response = await async_client.databases.schema_registry.config.with_raw_response.update_subject( @@ -389,7 +389,7 @@ async def test_raw_response_update_subject(self, async_client: AsyncGradient) -> config = await response.parse() assert_matches_type(ConfigUpdateSubjectResponse, config, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update_subject(self, async_client: AsyncGradient) -> None: async with async_client.databases.schema_registry.config.with_streaming_response.update_subject( @@ -405,7 +405,7 @@ async def test_streaming_response_update_subject(self, async_client: AsyncGradie assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update_subject(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `database_cluster_uuid` but received ''"): diff --git a/tests/api_resources/gpu_droplets/account/test_keys.py b/tests/api_resources/gpu_droplets/account/test_keys.py index 93817d1e..42702d3a 100644 --- a/tests/api_resources/gpu_droplets/account/test_keys.py +++ b/tests/api_resources/gpu_droplets/account/test_keys.py @@ -22,7 +22,7 @@ class TestKeys: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: key = client.gpu_droplets.account.keys.create( @@ -31,7 +31,7 @@ def test_method_create(self, client: Gradient) -> None: ) assert_matches_type(KeyCreateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.gpu_droplets.account.keys.with_raw_response.create( @@ -44,7 +44,7 @@ def test_raw_response_create(self, client: Gradient) -> None: key = response.parse() assert_matches_type(KeyCreateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.gpu_droplets.account.keys.with_streaming_response.create( @@ -59,7 +59,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: key = client.gpu_droplets.account.keys.retrieve( @@ -67,7 +67,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(KeyRetrieveResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.gpu_droplets.account.keys.with_raw_response.retrieve( @@ -79,7 +79,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: key = response.parse() assert_matches_type(KeyRetrieveResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.gpu_droplets.account.keys.with_streaming_response.retrieve( @@ -93,7 +93,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gradient) -> None: key = client.gpu_droplets.account.keys.update( @@ -101,7 +101,7 @@ def test_method_update(self, client: Gradient) -> None: ) assert_matches_type(KeyUpdateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gradient) -> None: key = client.gpu_droplets.account.keys.update( @@ -110,7 +110,7 @@ def test_method_update_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(KeyUpdateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gradient) -> None: response = client.gpu_droplets.account.keys.with_raw_response.update( @@ -122,7 +122,7 @@ def test_raw_response_update(self, client: Gradient) -> None: key = response.parse() assert_matches_type(KeyUpdateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gradient) -> None: with client.gpu_droplets.account.keys.with_streaming_response.update( @@ -136,13 +136,13 @@ def test_streaming_response_update(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: key = client.gpu_droplets.account.keys.list() assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: key = client.gpu_droplets.account.keys.list( @@ -151,7 +151,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.gpu_droplets.account.keys.with_raw_response.list() @@ -161,7 +161,7 @@ def test_raw_response_list(self, client: Gradient) -> None: key = response.parse() assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.gpu_droplets.account.keys.with_streaming_response.list() as response: @@ -173,7 +173,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: key = client.gpu_droplets.account.keys.delete( @@ -181,7 +181,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert key is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.gpu_droplets.account.keys.with_raw_response.delete( @@ -193,7 +193,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: key = response.parse() assert key is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.gpu_droplets.account.keys.with_streaming_response.delete( @@ -213,7 +213,7 @@ class TestAsyncKeys: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: key = await async_client.gpu_droplets.account.keys.create( @@ -222,7 +222,7 @@ async def test_method_create(self, async_client: AsyncGradient) -> None: ) assert_matches_type(KeyCreateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.account.keys.with_raw_response.create( @@ -235,7 +235,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: key = await response.parse() assert_matches_type(KeyCreateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.account.keys.with_streaming_response.create( @@ -250,7 +250,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: key = await async_client.gpu_droplets.account.keys.retrieve( @@ -258,7 +258,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(KeyRetrieveResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.account.keys.with_raw_response.retrieve( @@ -270,7 +270,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: key = await response.parse() assert_matches_type(KeyRetrieveResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.account.keys.with_streaming_response.retrieve( @@ -284,7 +284,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGradient) -> None: key = await async_client.gpu_droplets.account.keys.update( @@ -292,7 +292,7 @@ async def test_method_update(self, async_client: AsyncGradient) -> None: ) assert_matches_type(KeyUpdateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGradient) -> None: key = await async_client.gpu_droplets.account.keys.update( @@ -301,7 +301,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(KeyUpdateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.account.keys.with_raw_response.update( @@ -313,7 +313,7 @@ async def test_raw_response_update(self, async_client: AsyncGradient) -> None: key = await response.parse() assert_matches_type(KeyUpdateResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.account.keys.with_streaming_response.update( @@ -327,13 +327,13 @@ async def test_streaming_response_update(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: key = await async_client.gpu_droplets.account.keys.list() assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: key = await async_client.gpu_droplets.account.keys.list( @@ -342,7 +342,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.account.keys.with_raw_response.list() @@ -352,7 +352,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: key = await response.parse() assert_matches_type(KeyListResponse, key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.account.keys.with_streaming_response.list() as response: @@ -364,7 +364,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: key = await async_client.gpu_droplets.account.keys.delete( @@ -372,7 +372,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert key is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.account.keys.with_raw_response.delete( @@ -384,7 +384,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: key = await response.parse() assert key is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.account.keys.with_streaming_response.delete( diff --git a/tests/api_resources/gpu_droplets/firewalls/test_droplets.py b/tests/api_resources/gpu_droplets/firewalls/test_droplets.py index 693e315d..f75aeaf6 100644 --- a/tests/api_resources/gpu_droplets/firewalls/test_droplets.py +++ b/tests/api_resources/gpu_droplets/firewalls/test_droplets.py @@ -15,7 +15,7 @@ class TestDroplets: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_add(self, client: Gradient) -> None: droplet = client.gpu_droplets.firewalls.droplets.add( @@ -24,7 +24,7 @@ def test_method_add(self, client: Gradient) -> None: ) assert droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_add(self, client: Gradient) -> None: response = client.gpu_droplets.firewalls.droplets.with_raw_response.add( @@ -37,7 +37,7 @@ def test_raw_response_add(self, client: Gradient) -> None: droplet = response.parse() assert droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_add(self, client: Gradient) -> None: with client.gpu_droplets.firewalls.droplets.with_streaming_response.add( @@ -52,7 +52,7 @@ def test_streaming_response_add(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_add(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `firewall_id` but received ''"): @@ -61,7 +61,7 @@ def test_path_params_add(self, client: Gradient) -> None: droplet_ids=[49696269], ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_remove(self, client: Gradient) -> None: droplet = client.gpu_droplets.firewalls.droplets.remove( @@ -70,7 +70,7 @@ def test_method_remove(self, client: Gradient) -> None: ) assert droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_remove(self, client: Gradient) -> None: response = client.gpu_droplets.firewalls.droplets.with_raw_response.remove( @@ -83,7 +83,7 @@ def test_raw_response_remove(self, client: Gradient) -> None: droplet = response.parse() assert droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_remove(self, client: Gradient) -> None: with client.gpu_droplets.firewalls.droplets.with_streaming_response.remove( @@ -98,7 +98,7 @@ def test_streaming_response_remove(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_remove(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `firewall_id` but received ''"): @@ -113,7 +113,7 @@ class TestAsyncDroplets: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_add(self, async_client: AsyncGradient) -> None: droplet = await async_client.gpu_droplets.firewalls.droplets.add( @@ -122,7 +122,7 @@ async def test_method_add(self, async_client: AsyncGradient) -> None: ) assert droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_add(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.firewalls.droplets.with_raw_response.add( @@ -135,7 +135,7 @@ async def test_raw_response_add(self, async_client: AsyncGradient) -> None: droplet = await response.parse() assert droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_add(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.firewalls.droplets.with_streaming_response.add( @@ -150,7 +150,7 @@ async def test_streaming_response_add(self, async_client: AsyncGradient) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_add(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `firewall_id` but received ''"): @@ -159,7 +159,7 @@ async def test_path_params_add(self, async_client: AsyncGradient) -> None: droplet_ids=[49696269], ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_remove(self, async_client: AsyncGradient) -> None: droplet = await async_client.gpu_droplets.firewalls.droplets.remove( @@ -168,7 +168,7 @@ async def test_method_remove(self, async_client: AsyncGradient) -> None: ) assert droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_remove(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.firewalls.droplets.with_raw_response.remove( @@ -181,7 +181,7 @@ async def test_raw_response_remove(self, async_client: AsyncGradient) -> None: droplet = await response.parse() assert droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_remove(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.firewalls.droplets.with_streaming_response.remove( @@ -196,7 +196,7 @@ async def test_streaming_response_remove(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_remove(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `firewall_id` but received ''"): diff --git a/tests/api_resources/gpu_droplets/firewalls/test_rules.py b/tests/api_resources/gpu_droplets/firewalls/test_rules.py index 27694390..2c04b390 100644 --- a/tests/api_resources/gpu_droplets/firewalls/test_rules.py +++ b/tests/api_resources/gpu_droplets/firewalls/test_rules.py @@ -15,7 +15,7 @@ class TestRules: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_add(self, client: Gradient) -> None: rule = client.gpu_droplets.firewalls.rules.add( @@ -23,7 +23,7 @@ def test_method_add(self, client: Gradient) -> None: ) assert rule is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_add_with_all_params(self, client: Gradient) -> None: rule = client.gpu_droplets.firewalls.rules.add( @@ -57,7 +57,7 @@ def test_method_add_with_all_params(self, client: Gradient) -> None: ) assert rule is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_add(self, client: Gradient) -> None: response = client.gpu_droplets.firewalls.rules.with_raw_response.add( @@ -69,7 +69,7 @@ def test_raw_response_add(self, client: Gradient) -> None: rule = response.parse() assert rule is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_add(self, client: Gradient) -> None: with client.gpu_droplets.firewalls.rules.with_streaming_response.add( @@ -83,7 +83,7 @@ def test_streaming_response_add(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_add(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `firewall_id` but received ''"): @@ -91,7 +91,7 @@ def test_path_params_add(self, client: Gradient) -> None: firewall_id="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_remove(self, client: Gradient) -> None: rule = client.gpu_droplets.firewalls.rules.remove( @@ -99,7 +99,7 @@ def test_method_remove(self, client: Gradient) -> None: ) assert rule is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_remove_with_all_params(self, client: Gradient) -> None: rule = client.gpu_droplets.firewalls.rules.remove( @@ -133,7 +133,7 @@ def test_method_remove_with_all_params(self, client: Gradient) -> None: ) assert rule is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_remove(self, client: Gradient) -> None: response = client.gpu_droplets.firewalls.rules.with_raw_response.remove( @@ -145,7 +145,7 @@ def test_raw_response_remove(self, client: Gradient) -> None: rule = response.parse() assert rule is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_remove(self, client: Gradient) -> None: with client.gpu_droplets.firewalls.rules.with_streaming_response.remove( @@ -159,7 +159,7 @@ def test_streaming_response_remove(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_remove(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `firewall_id` but received ''"): @@ -173,7 +173,7 @@ class TestAsyncRules: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_add(self, async_client: AsyncGradient) -> None: rule = await async_client.gpu_droplets.firewalls.rules.add( @@ -181,7 +181,7 @@ async def test_method_add(self, async_client: AsyncGradient) -> None: ) assert rule is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_add_with_all_params(self, async_client: AsyncGradient) -> None: rule = await async_client.gpu_droplets.firewalls.rules.add( @@ -215,7 +215,7 @@ async def test_method_add_with_all_params(self, async_client: AsyncGradient) -> ) assert rule is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_add(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.firewalls.rules.with_raw_response.add( @@ -227,7 +227,7 @@ async def test_raw_response_add(self, async_client: AsyncGradient) -> None: rule = await response.parse() assert rule is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_add(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.firewalls.rules.with_streaming_response.add( @@ -241,7 +241,7 @@ async def test_streaming_response_add(self, async_client: AsyncGradient) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_add(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `firewall_id` but received ''"): @@ -249,7 +249,7 @@ async def test_path_params_add(self, async_client: AsyncGradient) -> None: firewall_id="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_remove(self, async_client: AsyncGradient) -> None: rule = await async_client.gpu_droplets.firewalls.rules.remove( @@ -257,7 +257,7 @@ async def test_method_remove(self, async_client: AsyncGradient) -> None: ) assert rule is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_remove_with_all_params(self, async_client: AsyncGradient) -> None: rule = await async_client.gpu_droplets.firewalls.rules.remove( @@ -291,7 +291,7 @@ async def test_method_remove_with_all_params(self, async_client: AsyncGradient) ) assert rule is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_remove(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.firewalls.rules.with_raw_response.remove( @@ -303,7 +303,7 @@ async def test_raw_response_remove(self, async_client: AsyncGradient) -> None: rule = await response.parse() assert rule is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_remove(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.firewalls.rules.with_streaming_response.remove( @@ -317,7 +317,7 @@ async def test_streaming_response_remove(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_remove(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `firewall_id` but received ''"): diff --git a/tests/api_resources/gpu_droplets/firewalls/test_tags.py b/tests/api_resources/gpu_droplets/firewalls/test_tags.py index 50c7563b..170c5317 100644 --- a/tests/api_resources/gpu_droplets/firewalls/test_tags.py +++ b/tests/api_resources/gpu_droplets/firewalls/test_tags.py @@ -15,7 +15,7 @@ class TestTags: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_add(self, client: Gradient) -> None: tag = client.gpu_droplets.firewalls.tags.add( @@ -24,7 +24,7 @@ def test_method_add(self, client: Gradient) -> None: ) assert tag is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_add(self, client: Gradient) -> None: response = client.gpu_droplets.firewalls.tags.with_raw_response.add( @@ -37,7 +37,7 @@ def test_raw_response_add(self, client: Gradient) -> None: tag = response.parse() assert tag is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_add(self, client: Gradient) -> None: with client.gpu_droplets.firewalls.tags.with_streaming_response.add( @@ -52,7 +52,7 @@ def test_streaming_response_add(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_add(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `firewall_id` but received ''"): @@ -61,7 +61,7 @@ def test_path_params_add(self, client: Gradient) -> None: tags=["frontend"], ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_remove(self, client: Gradient) -> None: tag = client.gpu_droplets.firewalls.tags.remove( @@ -70,7 +70,7 @@ def test_method_remove(self, client: Gradient) -> None: ) assert tag is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_remove(self, client: Gradient) -> None: response = client.gpu_droplets.firewalls.tags.with_raw_response.remove( @@ -83,7 +83,7 @@ def test_raw_response_remove(self, client: Gradient) -> None: tag = response.parse() assert tag is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_remove(self, client: Gradient) -> None: with client.gpu_droplets.firewalls.tags.with_streaming_response.remove( @@ -98,7 +98,7 @@ def test_streaming_response_remove(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_remove(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `firewall_id` but received ''"): @@ -113,7 +113,7 @@ class TestAsyncTags: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_add(self, async_client: AsyncGradient) -> None: tag = await async_client.gpu_droplets.firewalls.tags.add( @@ -122,7 +122,7 @@ async def test_method_add(self, async_client: AsyncGradient) -> None: ) assert tag is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_add(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.firewalls.tags.with_raw_response.add( @@ -135,7 +135,7 @@ async def test_raw_response_add(self, async_client: AsyncGradient) -> None: tag = await response.parse() assert tag is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_add(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.firewalls.tags.with_streaming_response.add( @@ -150,7 +150,7 @@ async def test_streaming_response_add(self, async_client: AsyncGradient) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_add(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `firewall_id` but received ''"): @@ -159,7 +159,7 @@ async def test_path_params_add(self, async_client: AsyncGradient) -> None: tags=["frontend"], ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_remove(self, async_client: AsyncGradient) -> None: tag = await async_client.gpu_droplets.firewalls.tags.remove( @@ -168,7 +168,7 @@ async def test_method_remove(self, async_client: AsyncGradient) -> None: ) assert tag is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_remove(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.firewalls.tags.with_raw_response.remove( @@ -181,7 +181,7 @@ async def test_raw_response_remove(self, async_client: AsyncGradient) -> None: tag = await response.parse() assert tag is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_remove(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.firewalls.tags.with_streaming_response.remove( @@ -196,7 +196,7 @@ async def test_streaming_response_remove(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_remove(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `firewall_id` but received ''"): diff --git a/tests/api_resources/gpu_droplets/floating_ips/test_actions.py b/tests/api_resources/gpu_droplets/floating_ips/test_actions.py index 7f7ab06a..31376bca 100644 --- a/tests/api_resources/gpu_droplets/floating_ips/test_actions.py +++ b/tests/api_resources/gpu_droplets/floating_ips/test_actions.py @@ -21,7 +21,7 @@ class TestActions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_overload_1(self, client: Gradient) -> None: action = client.gpu_droplets.floating_ips.actions.create( @@ -30,7 +30,7 @@ def test_method_create_overload_1(self, client: Gradient) -> None: ) assert_matches_type(ActionCreateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_overload_1(self, client: Gradient) -> None: response = client.gpu_droplets.floating_ips.actions.with_raw_response.create( @@ -43,7 +43,7 @@ def test_raw_response_create_overload_1(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionCreateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_overload_1(self, client: Gradient) -> None: with client.gpu_droplets.floating_ips.actions.with_streaming_response.create( @@ -58,7 +58,7 @@ def test_streaming_response_create_overload_1(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_create_overload_1(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `floating_ip` but received ''"): @@ -67,7 +67,7 @@ def test_path_params_create_overload_1(self, client: Gradient) -> None: type="assign", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_overload_2(self, client: Gradient) -> None: action = client.gpu_droplets.floating_ips.actions.create( @@ -77,7 +77,7 @@ def test_method_create_overload_2(self, client: Gradient) -> None: ) assert_matches_type(ActionCreateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_overload_2(self, client: Gradient) -> None: response = client.gpu_droplets.floating_ips.actions.with_raw_response.create( @@ -91,7 +91,7 @@ def test_raw_response_create_overload_2(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionCreateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_overload_2(self, client: Gradient) -> None: with client.gpu_droplets.floating_ips.actions.with_streaming_response.create( @@ -107,7 +107,7 @@ def test_streaming_response_create_overload_2(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_create_overload_2(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `floating_ip` but received ''"): @@ -117,7 +117,7 @@ def test_path_params_create_overload_2(self, client: Gradient) -> None: type="assign", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: action = client.gpu_droplets.floating_ips.actions.retrieve( @@ -126,7 +126,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(ActionRetrieveResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.gpu_droplets.floating_ips.actions.with_raw_response.retrieve( @@ -139,7 +139,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionRetrieveResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.gpu_droplets.floating_ips.actions.with_streaming_response.retrieve( @@ -154,7 +154,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `floating_ip` but received ''"): @@ -163,7 +163,7 @@ def test_path_params_retrieve(self, client: Gradient) -> None: floating_ip="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: action = client.gpu_droplets.floating_ips.actions.list( @@ -171,7 +171,7 @@ def test_method_list(self, client: Gradient) -> None: ) assert_matches_type(ActionListResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.gpu_droplets.floating_ips.actions.with_raw_response.list( @@ -183,7 +183,7 @@ def test_raw_response_list(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionListResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.gpu_droplets.floating_ips.actions.with_streaming_response.list( @@ -197,7 +197,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_list(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `floating_ip` but received ''"): @@ -211,7 +211,7 @@ class TestAsyncActions: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_overload_1(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.floating_ips.actions.create( @@ -220,7 +220,7 @@ async def test_method_create_overload_1(self, async_client: AsyncGradient) -> No ) assert_matches_type(ActionCreateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.floating_ips.actions.with_raw_response.create( @@ -233,7 +233,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncGradient) action = await response.parse() assert_matches_type(ActionCreateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.floating_ips.actions.with_streaming_response.create( @@ -248,7 +248,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncGra assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_create_overload_1(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `floating_ip` but received ''"): @@ -257,7 +257,7 @@ async def test_path_params_create_overload_1(self, async_client: AsyncGradient) type="assign", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_overload_2(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.floating_ips.actions.create( @@ -267,7 +267,7 @@ async def test_method_create_overload_2(self, async_client: AsyncGradient) -> No ) assert_matches_type(ActionCreateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.floating_ips.actions.with_raw_response.create( @@ -281,7 +281,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) action = await response.parse() assert_matches_type(ActionCreateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.floating_ips.actions.with_streaming_response.create( @@ -297,7 +297,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGra assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_create_overload_2(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `floating_ip` but received ''"): @@ -307,7 +307,7 @@ async def test_path_params_create_overload_2(self, async_client: AsyncGradient) type="assign", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.floating_ips.actions.retrieve( @@ -316,7 +316,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(ActionRetrieveResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.floating_ips.actions.with_raw_response.retrieve( @@ -329,7 +329,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: action = await response.parse() assert_matches_type(ActionRetrieveResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.floating_ips.actions.with_streaming_response.retrieve( @@ -344,7 +344,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `floating_ip` but received ''"): @@ -353,7 +353,7 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: floating_ip="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.floating_ips.actions.list( @@ -361,7 +361,7 @@ async def test_method_list(self, async_client: AsyncGradient) -> None: ) assert_matches_type(ActionListResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.floating_ips.actions.with_raw_response.list( @@ -373,7 +373,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: action = await response.parse() assert_matches_type(ActionListResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.floating_ips.actions.with_streaming_response.list( @@ -387,7 +387,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_list(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `floating_ip` but received ''"): diff --git a/tests/api_resources/gpu_droplets/images/test_actions.py b/tests/api_resources/gpu_droplets/images/test_actions.py index ad5d4892..7cc7b4d4 100644 --- a/tests/api_resources/gpu_droplets/images/test_actions.py +++ b/tests/api_resources/gpu_droplets/images/test_actions.py @@ -18,7 +18,7 @@ class TestActions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_overload_1(self, client: Gradient) -> None: action = client.gpu_droplets.images.actions.create( @@ -27,7 +27,7 @@ def test_method_create_overload_1(self, client: Gradient) -> None: ) assert_matches_type(Action, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_overload_1(self, client: Gradient) -> None: response = client.gpu_droplets.images.actions.with_raw_response.create( @@ -40,7 +40,7 @@ def test_raw_response_create_overload_1(self, client: Gradient) -> None: action = response.parse() assert_matches_type(Action, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_overload_1(self, client: Gradient) -> None: with client.gpu_droplets.images.actions.with_streaming_response.create( @@ -55,7 +55,7 @@ def test_streaming_response_create_overload_1(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_overload_2(self, client: Gradient) -> None: action = client.gpu_droplets.images.actions.create( @@ -65,7 +65,7 @@ def test_method_create_overload_2(self, client: Gradient) -> None: ) assert_matches_type(Action, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_overload_2(self, client: Gradient) -> None: response = client.gpu_droplets.images.actions.with_raw_response.create( @@ -79,7 +79,7 @@ def test_raw_response_create_overload_2(self, client: Gradient) -> None: action = response.parse() assert_matches_type(Action, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_overload_2(self, client: Gradient) -> None: with client.gpu_droplets.images.actions.with_streaming_response.create( @@ -95,7 +95,7 @@ def test_streaming_response_create_overload_2(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: action = client.gpu_droplets.images.actions.retrieve( @@ -104,7 +104,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(Action, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.gpu_droplets.images.actions.with_raw_response.retrieve( @@ -117,7 +117,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: action = response.parse() assert_matches_type(Action, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.gpu_droplets.images.actions.with_streaming_response.retrieve( @@ -132,7 +132,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: action = client.gpu_droplets.images.actions.list( @@ -140,7 +140,7 @@ def test_method_list(self, client: Gradient) -> None: ) assert_matches_type(ActionListResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.gpu_droplets.images.actions.with_raw_response.list( @@ -152,7 +152,7 @@ def test_raw_response_list(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionListResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.gpu_droplets.images.actions.with_streaming_response.list( @@ -172,7 +172,7 @@ class TestAsyncActions: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_overload_1(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.images.actions.create( @@ -181,7 +181,7 @@ async def test_method_create_overload_1(self, async_client: AsyncGradient) -> No ) assert_matches_type(Action, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.images.actions.with_raw_response.create( @@ -194,7 +194,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncGradient) action = await response.parse() assert_matches_type(Action, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.images.actions.with_streaming_response.create( @@ -209,7 +209,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncGra assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_overload_2(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.images.actions.create( @@ -219,7 +219,7 @@ async def test_method_create_overload_2(self, async_client: AsyncGradient) -> No ) assert_matches_type(Action, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.images.actions.with_raw_response.create( @@ -233,7 +233,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) action = await response.parse() assert_matches_type(Action, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.images.actions.with_streaming_response.create( @@ -249,7 +249,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGra assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.images.actions.retrieve( @@ -258,7 +258,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(Action, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.images.actions.with_raw_response.retrieve( @@ -271,7 +271,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: action = await response.parse() assert_matches_type(Action, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.images.actions.with_streaming_response.retrieve( @@ -286,7 +286,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.images.actions.list( @@ -294,7 +294,7 @@ async def test_method_list(self, async_client: AsyncGradient) -> None: ) assert_matches_type(ActionListResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.images.actions.with_raw_response.list( @@ -306,7 +306,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: action = await response.parse() assert_matches_type(ActionListResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.images.actions.with_streaming_response.list( diff --git a/tests/api_resources/gpu_droplets/load_balancers/test_droplets.py b/tests/api_resources/gpu_droplets/load_balancers/test_droplets.py index e6eefd23..884032dd 100644 --- a/tests/api_resources/gpu_droplets/load_balancers/test_droplets.py +++ b/tests/api_resources/gpu_droplets/load_balancers/test_droplets.py @@ -15,7 +15,7 @@ class TestDroplets: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_add(self, client: Gradient) -> None: droplet = client.gpu_droplets.load_balancers.droplets.add( @@ -24,7 +24,7 @@ def test_method_add(self, client: Gradient) -> None: ) assert droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_add(self, client: Gradient) -> None: response = client.gpu_droplets.load_balancers.droplets.with_raw_response.add( @@ -37,7 +37,7 @@ def test_raw_response_add(self, client: Gradient) -> None: droplet = response.parse() assert droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_add(self, client: Gradient) -> None: with client.gpu_droplets.load_balancers.droplets.with_streaming_response.add( @@ -52,7 +52,7 @@ def test_streaming_response_add(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_add(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `lb_id` but received ''"): @@ -61,7 +61,7 @@ def test_path_params_add(self, client: Gradient) -> None: droplet_ids=[3164444, 3164445], ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_remove(self, client: Gradient) -> None: droplet = client.gpu_droplets.load_balancers.droplets.remove( @@ -70,7 +70,7 @@ def test_method_remove(self, client: Gradient) -> None: ) assert droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_remove(self, client: Gradient) -> None: response = client.gpu_droplets.load_balancers.droplets.with_raw_response.remove( @@ -83,7 +83,7 @@ def test_raw_response_remove(self, client: Gradient) -> None: droplet = response.parse() assert droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_remove(self, client: Gradient) -> None: with client.gpu_droplets.load_balancers.droplets.with_streaming_response.remove( @@ -98,7 +98,7 @@ def test_streaming_response_remove(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_remove(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `lb_id` but received ''"): @@ -113,7 +113,7 @@ class TestAsyncDroplets: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_add(self, async_client: AsyncGradient) -> None: droplet = await async_client.gpu_droplets.load_balancers.droplets.add( @@ -122,7 +122,7 @@ async def test_method_add(self, async_client: AsyncGradient) -> None: ) assert droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_add(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.load_balancers.droplets.with_raw_response.add( @@ -135,7 +135,7 @@ async def test_raw_response_add(self, async_client: AsyncGradient) -> None: droplet = await response.parse() assert droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_add(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.load_balancers.droplets.with_streaming_response.add( @@ -150,7 +150,7 @@ async def test_streaming_response_add(self, async_client: AsyncGradient) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_add(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `lb_id` but received ''"): @@ -159,7 +159,7 @@ async def test_path_params_add(self, async_client: AsyncGradient) -> None: droplet_ids=[3164444, 3164445], ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_remove(self, async_client: AsyncGradient) -> None: droplet = await async_client.gpu_droplets.load_balancers.droplets.remove( @@ -168,7 +168,7 @@ async def test_method_remove(self, async_client: AsyncGradient) -> None: ) assert droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_remove(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.load_balancers.droplets.with_raw_response.remove( @@ -181,7 +181,7 @@ async def test_raw_response_remove(self, async_client: AsyncGradient) -> None: droplet = await response.parse() assert droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_remove(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.load_balancers.droplets.with_streaming_response.remove( @@ -196,7 +196,7 @@ async def test_streaming_response_remove(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_remove(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `lb_id` but received ''"): diff --git a/tests/api_resources/gpu_droplets/load_balancers/test_forwarding_rules.py b/tests/api_resources/gpu_droplets/load_balancers/test_forwarding_rules.py index a3cc0bd1..43498e13 100644 --- a/tests/api_resources/gpu_droplets/load_balancers/test_forwarding_rules.py +++ b/tests/api_resources/gpu_droplets/load_balancers/test_forwarding_rules.py @@ -15,7 +15,7 @@ class TestForwardingRules: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_add(self, client: Gradient) -> None: forwarding_rule = client.gpu_droplets.load_balancers.forwarding_rules.add( @@ -31,7 +31,7 @@ def test_method_add(self, client: Gradient) -> None: ) assert forwarding_rule is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_add(self, client: Gradient) -> None: response = client.gpu_droplets.load_balancers.forwarding_rules.with_raw_response.add( @@ -51,7 +51,7 @@ def test_raw_response_add(self, client: Gradient) -> None: forwarding_rule = response.parse() assert forwarding_rule is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_add(self, client: Gradient) -> None: with client.gpu_droplets.load_balancers.forwarding_rules.with_streaming_response.add( @@ -73,7 +73,7 @@ def test_streaming_response_add(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_add(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `lb_id` but received ''"): @@ -89,7 +89,7 @@ def test_path_params_add(self, client: Gradient) -> None: ], ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_remove(self, client: Gradient) -> None: forwarding_rule = client.gpu_droplets.load_balancers.forwarding_rules.remove( @@ -105,7 +105,7 @@ def test_method_remove(self, client: Gradient) -> None: ) assert forwarding_rule is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_remove(self, client: Gradient) -> None: response = client.gpu_droplets.load_balancers.forwarding_rules.with_raw_response.remove( @@ -125,7 +125,7 @@ def test_raw_response_remove(self, client: Gradient) -> None: forwarding_rule = response.parse() assert forwarding_rule is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_remove(self, client: Gradient) -> None: with client.gpu_droplets.load_balancers.forwarding_rules.with_streaming_response.remove( @@ -147,7 +147,7 @@ def test_streaming_response_remove(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_remove(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `lb_id` but received ''"): @@ -169,7 +169,7 @@ class TestAsyncForwardingRules: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_add(self, async_client: AsyncGradient) -> None: forwarding_rule = await async_client.gpu_droplets.load_balancers.forwarding_rules.add( @@ -185,7 +185,7 @@ async def test_method_add(self, async_client: AsyncGradient) -> None: ) assert forwarding_rule is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_add(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.load_balancers.forwarding_rules.with_raw_response.add( @@ -205,7 +205,7 @@ async def test_raw_response_add(self, async_client: AsyncGradient) -> None: forwarding_rule = await response.parse() assert forwarding_rule is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_add(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.load_balancers.forwarding_rules.with_streaming_response.add( @@ -227,7 +227,7 @@ async def test_streaming_response_add(self, async_client: AsyncGradient) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_add(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `lb_id` but received ''"): @@ -243,7 +243,7 @@ async def test_path_params_add(self, async_client: AsyncGradient) -> None: ], ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_remove(self, async_client: AsyncGradient) -> None: forwarding_rule = await async_client.gpu_droplets.load_balancers.forwarding_rules.remove( @@ -259,7 +259,7 @@ async def test_method_remove(self, async_client: AsyncGradient) -> None: ) assert forwarding_rule is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_remove(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.load_balancers.forwarding_rules.with_raw_response.remove( @@ -279,7 +279,7 @@ async def test_raw_response_remove(self, async_client: AsyncGradient) -> None: forwarding_rule = await response.parse() assert forwarding_rule is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_remove(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.load_balancers.forwarding_rules.with_streaming_response.remove( @@ -301,7 +301,7 @@ async def test_streaming_response_remove(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_remove(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `lb_id` but received ''"): diff --git a/tests/api_resources/gpu_droplets/test_actions.py b/tests/api_resources/gpu_droplets/test_actions.py index e514196b..897414b7 100644 --- a/tests/api_resources/gpu_droplets/test_actions.py +++ b/tests/api_resources/gpu_droplets/test_actions.py @@ -22,7 +22,7 @@ class TestActions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: action = client.gpu_droplets.actions.retrieve( @@ -31,7 +31,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(ActionRetrieveResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.gpu_droplets.actions.with_raw_response.retrieve( @@ -44,7 +44,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionRetrieveResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.gpu_droplets.actions.with_streaming_response.retrieve( @@ -59,7 +59,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: action = client.gpu_droplets.actions.list( @@ -67,7 +67,7 @@ def test_method_list(self, client: Gradient) -> None: ) assert_matches_type(ActionListResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: action = client.gpu_droplets.actions.list( @@ -77,7 +77,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(ActionListResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.gpu_droplets.actions.with_raw_response.list( @@ -89,7 +89,7 @@ def test_raw_response_list(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionListResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.gpu_droplets.actions.with_streaming_response.list( @@ -103,7 +103,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_bulk_initiate_overload_1(self, client: Gradient) -> None: action = client.gpu_droplets.actions.bulk_initiate( @@ -111,7 +111,7 @@ def test_method_bulk_initiate_overload_1(self, client: Gradient) -> None: ) assert_matches_type(ActionBulkInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_bulk_initiate_with_all_params_overload_1(self, client: Gradient) -> None: action = client.gpu_droplets.actions.bulk_initiate( @@ -120,7 +120,7 @@ def test_method_bulk_initiate_with_all_params_overload_1(self, client: Gradient) ) assert_matches_type(ActionBulkInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_bulk_initiate_overload_1(self, client: Gradient) -> None: response = client.gpu_droplets.actions.with_raw_response.bulk_initiate( @@ -132,7 +132,7 @@ def test_raw_response_bulk_initiate_overload_1(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionBulkInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_bulk_initiate_overload_1(self, client: Gradient) -> None: with client.gpu_droplets.actions.with_streaming_response.bulk_initiate( @@ -146,7 +146,7 @@ def test_streaming_response_bulk_initiate_overload_1(self, client: Gradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_bulk_initiate_overload_2(self, client: Gradient) -> None: action = client.gpu_droplets.actions.bulk_initiate( @@ -154,7 +154,7 @@ def test_method_bulk_initiate_overload_2(self, client: Gradient) -> None: ) assert_matches_type(ActionBulkInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_bulk_initiate_with_all_params_overload_2(self, client: Gradient) -> None: action = client.gpu_droplets.actions.bulk_initiate( @@ -164,7 +164,7 @@ def test_method_bulk_initiate_with_all_params_overload_2(self, client: Gradient) ) assert_matches_type(ActionBulkInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_bulk_initiate_overload_2(self, client: Gradient) -> None: response = client.gpu_droplets.actions.with_raw_response.bulk_initiate( @@ -176,7 +176,7 @@ def test_raw_response_bulk_initiate_overload_2(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionBulkInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_bulk_initiate_overload_2(self, client: Gradient) -> None: with client.gpu_droplets.actions.with_streaming_response.bulk_initiate( @@ -190,7 +190,7 @@ def test_streaming_response_bulk_initiate_overload_2(self, client: Gradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_overload_1(self, client: Gradient) -> None: action = client.gpu_droplets.actions.initiate( @@ -199,7 +199,7 @@ def test_method_initiate_overload_1(self, client: Gradient) -> None: ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_initiate_overload_1(self, client: Gradient) -> None: response = client.gpu_droplets.actions.with_raw_response.initiate( @@ -212,7 +212,7 @@ def test_raw_response_initiate_overload_1(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_initiate_overload_1(self, client: Gradient) -> None: with client.gpu_droplets.actions.with_streaming_response.initiate( @@ -227,7 +227,7 @@ def test_streaming_response_initiate_overload_1(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_overload_2(self, client: Gradient) -> None: action = client.gpu_droplets.actions.initiate( @@ -236,7 +236,7 @@ def test_method_initiate_overload_2(self, client: Gradient) -> None: ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_with_all_params_overload_2(self, client: Gradient) -> None: action = client.gpu_droplets.actions.initiate( @@ -250,7 +250,7 @@ def test_method_initiate_with_all_params_overload_2(self, client: Gradient) -> N ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_initiate_overload_2(self, client: Gradient) -> None: response = client.gpu_droplets.actions.with_raw_response.initiate( @@ -263,7 +263,7 @@ def test_raw_response_initiate_overload_2(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_initiate_overload_2(self, client: Gradient) -> None: with client.gpu_droplets.actions.with_streaming_response.initiate( @@ -278,7 +278,7 @@ def test_streaming_response_initiate_overload_2(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_overload_3(self, client: Gradient) -> None: action = client.gpu_droplets.actions.initiate( @@ -287,7 +287,7 @@ def test_method_initiate_overload_3(self, client: Gradient) -> None: ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_with_all_params_overload_3(self, client: Gradient) -> None: action = client.gpu_droplets.actions.initiate( @@ -301,7 +301,7 @@ def test_method_initiate_with_all_params_overload_3(self, client: Gradient) -> N ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_initiate_overload_3(self, client: Gradient) -> None: response = client.gpu_droplets.actions.with_raw_response.initiate( @@ -314,7 +314,7 @@ def test_raw_response_initiate_overload_3(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_initiate_overload_3(self, client: Gradient) -> None: with client.gpu_droplets.actions.with_streaming_response.initiate( @@ -329,7 +329,7 @@ def test_streaming_response_initiate_overload_3(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_overload_4(self, client: Gradient) -> None: action = client.gpu_droplets.actions.initiate( @@ -338,7 +338,7 @@ def test_method_initiate_overload_4(self, client: Gradient) -> None: ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_with_all_params_overload_4(self, client: Gradient) -> None: action = client.gpu_droplets.actions.initiate( @@ -348,7 +348,7 @@ def test_method_initiate_with_all_params_overload_4(self, client: Gradient) -> N ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_initiate_overload_4(self, client: Gradient) -> None: response = client.gpu_droplets.actions.with_raw_response.initiate( @@ -361,7 +361,7 @@ def test_raw_response_initiate_overload_4(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_initiate_overload_4(self, client: Gradient) -> None: with client.gpu_droplets.actions.with_streaming_response.initiate( @@ -376,7 +376,7 @@ def test_streaming_response_initiate_overload_4(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_overload_5(self, client: Gradient) -> None: action = client.gpu_droplets.actions.initiate( @@ -385,7 +385,7 @@ def test_method_initiate_overload_5(self, client: Gradient) -> None: ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_with_all_params_overload_5(self, client: Gradient) -> None: action = client.gpu_droplets.actions.initiate( @@ -396,7 +396,7 @@ def test_method_initiate_with_all_params_overload_5(self, client: Gradient) -> N ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_initiate_overload_5(self, client: Gradient) -> None: response = client.gpu_droplets.actions.with_raw_response.initiate( @@ -409,7 +409,7 @@ def test_raw_response_initiate_overload_5(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_initiate_overload_5(self, client: Gradient) -> None: with client.gpu_droplets.actions.with_streaming_response.initiate( @@ -424,7 +424,7 @@ def test_streaming_response_initiate_overload_5(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_overload_6(self, client: Gradient) -> None: action = client.gpu_droplets.actions.initiate( @@ -433,7 +433,7 @@ def test_method_initiate_overload_6(self, client: Gradient) -> None: ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_with_all_params_overload_6(self, client: Gradient) -> None: action = client.gpu_droplets.actions.initiate( @@ -443,7 +443,7 @@ def test_method_initiate_with_all_params_overload_6(self, client: Gradient) -> N ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_initiate_overload_6(self, client: Gradient) -> None: response = client.gpu_droplets.actions.with_raw_response.initiate( @@ -456,7 +456,7 @@ def test_raw_response_initiate_overload_6(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_initiate_overload_6(self, client: Gradient) -> None: with client.gpu_droplets.actions.with_streaming_response.initiate( @@ -471,7 +471,7 @@ def test_streaming_response_initiate_overload_6(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_overload_7(self, client: Gradient) -> None: action = client.gpu_droplets.actions.initiate( @@ -480,7 +480,7 @@ def test_method_initiate_overload_7(self, client: Gradient) -> None: ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_with_all_params_overload_7(self, client: Gradient) -> None: action = client.gpu_droplets.actions.initiate( @@ -490,7 +490,7 @@ def test_method_initiate_with_all_params_overload_7(self, client: Gradient) -> N ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_initiate_overload_7(self, client: Gradient) -> None: response = client.gpu_droplets.actions.with_raw_response.initiate( @@ -503,7 +503,7 @@ def test_raw_response_initiate_overload_7(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_initiate_overload_7(self, client: Gradient) -> None: with client.gpu_droplets.actions.with_streaming_response.initiate( @@ -518,7 +518,7 @@ def test_streaming_response_initiate_overload_7(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_overload_8(self, client: Gradient) -> None: action = client.gpu_droplets.actions.initiate( @@ -527,7 +527,7 @@ def test_method_initiate_overload_8(self, client: Gradient) -> None: ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_with_all_params_overload_8(self, client: Gradient) -> None: action = client.gpu_droplets.actions.initiate( @@ -537,7 +537,7 @@ def test_method_initiate_with_all_params_overload_8(self, client: Gradient) -> N ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_initiate_overload_8(self, client: Gradient) -> None: response = client.gpu_droplets.actions.with_raw_response.initiate( @@ -550,7 +550,7 @@ def test_raw_response_initiate_overload_8(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_initiate_overload_8(self, client: Gradient) -> None: with client.gpu_droplets.actions.with_streaming_response.initiate( @@ -565,7 +565,7 @@ def test_streaming_response_initiate_overload_8(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_overload_9(self, client: Gradient) -> None: action = client.gpu_droplets.actions.initiate( @@ -574,7 +574,7 @@ def test_method_initiate_overload_9(self, client: Gradient) -> None: ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_with_all_params_overload_9(self, client: Gradient) -> None: action = client.gpu_droplets.actions.initiate( @@ -584,7 +584,7 @@ def test_method_initiate_with_all_params_overload_9(self, client: Gradient) -> N ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_initiate_overload_9(self, client: Gradient) -> None: response = client.gpu_droplets.actions.with_raw_response.initiate( @@ -597,7 +597,7 @@ def test_raw_response_initiate_overload_9(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_initiate_overload_9(self, client: Gradient) -> None: with client.gpu_droplets.actions.with_streaming_response.initiate( @@ -618,7 +618,7 @@ class TestAsyncActions: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.retrieve( @@ -627,7 +627,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(ActionRetrieveResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.actions.with_raw_response.retrieve( @@ -640,7 +640,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: action = await response.parse() assert_matches_type(ActionRetrieveResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.actions.with_streaming_response.retrieve( @@ -655,7 +655,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.list( @@ -663,7 +663,7 @@ async def test_method_list(self, async_client: AsyncGradient) -> None: ) assert_matches_type(ActionListResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.list( @@ -673,7 +673,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(ActionListResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.actions.with_raw_response.list( @@ -685,7 +685,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: action = await response.parse() assert_matches_type(ActionListResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.actions.with_streaming_response.list( @@ -699,7 +699,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_bulk_initiate_overload_1(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.bulk_initiate( @@ -707,7 +707,7 @@ async def test_method_bulk_initiate_overload_1(self, async_client: AsyncGradient ) assert_matches_type(ActionBulkInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_bulk_initiate_with_all_params_overload_1(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.bulk_initiate( @@ -716,7 +716,7 @@ async def test_method_bulk_initiate_with_all_params_overload_1(self, async_clien ) assert_matches_type(ActionBulkInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_bulk_initiate_overload_1(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.actions.with_raw_response.bulk_initiate( @@ -728,7 +728,7 @@ async def test_raw_response_bulk_initiate_overload_1(self, async_client: AsyncGr action = await response.parse() assert_matches_type(ActionBulkInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_bulk_initiate_overload_1(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.actions.with_streaming_response.bulk_initiate( @@ -742,7 +742,7 @@ async def test_streaming_response_bulk_initiate_overload_1(self, async_client: A assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_bulk_initiate_overload_2(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.bulk_initiate( @@ -750,7 +750,7 @@ async def test_method_bulk_initiate_overload_2(self, async_client: AsyncGradient ) assert_matches_type(ActionBulkInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_bulk_initiate_with_all_params_overload_2(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.bulk_initiate( @@ -760,7 +760,7 @@ async def test_method_bulk_initiate_with_all_params_overload_2(self, async_clien ) assert_matches_type(ActionBulkInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_bulk_initiate_overload_2(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.actions.with_raw_response.bulk_initiate( @@ -772,7 +772,7 @@ async def test_raw_response_bulk_initiate_overload_2(self, async_client: AsyncGr action = await response.parse() assert_matches_type(ActionBulkInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_bulk_initiate_overload_2(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.actions.with_streaming_response.bulk_initiate( @@ -786,7 +786,7 @@ async def test_streaming_response_bulk_initiate_overload_2(self, async_client: A assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_overload_1(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.initiate( @@ -795,7 +795,7 @@ async def test_method_initiate_overload_1(self, async_client: AsyncGradient) -> ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_initiate_overload_1(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.actions.with_raw_response.initiate( @@ -808,7 +808,7 @@ async def test_raw_response_initiate_overload_1(self, async_client: AsyncGradien action = await response.parse() assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_initiate_overload_1(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.actions.with_streaming_response.initiate( @@ -823,7 +823,7 @@ async def test_streaming_response_initiate_overload_1(self, async_client: AsyncG assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_overload_2(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.initiate( @@ -832,7 +832,7 @@ async def test_method_initiate_overload_2(self, async_client: AsyncGradient) -> ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_with_all_params_overload_2(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.initiate( @@ -846,7 +846,7 @@ async def test_method_initiate_with_all_params_overload_2(self, async_client: As ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_initiate_overload_2(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.actions.with_raw_response.initiate( @@ -859,7 +859,7 @@ async def test_raw_response_initiate_overload_2(self, async_client: AsyncGradien action = await response.parse() assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_initiate_overload_2(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.actions.with_streaming_response.initiate( @@ -874,7 +874,7 @@ async def test_streaming_response_initiate_overload_2(self, async_client: AsyncG assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_overload_3(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.initiate( @@ -883,7 +883,7 @@ async def test_method_initiate_overload_3(self, async_client: AsyncGradient) -> ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_with_all_params_overload_3(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.initiate( @@ -897,7 +897,7 @@ async def test_method_initiate_with_all_params_overload_3(self, async_client: As ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_initiate_overload_3(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.actions.with_raw_response.initiate( @@ -910,7 +910,7 @@ async def test_raw_response_initiate_overload_3(self, async_client: AsyncGradien action = await response.parse() assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_initiate_overload_3(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.actions.with_streaming_response.initiate( @@ -925,7 +925,7 @@ async def test_streaming_response_initiate_overload_3(self, async_client: AsyncG assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_overload_4(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.initiate( @@ -934,7 +934,7 @@ async def test_method_initiate_overload_4(self, async_client: AsyncGradient) -> ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_with_all_params_overload_4(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.initiate( @@ -944,7 +944,7 @@ async def test_method_initiate_with_all_params_overload_4(self, async_client: As ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_initiate_overload_4(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.actions.with_raw_response.initiate( @@ -957,7 +957,7 @@ async def test_raw_response_initiate_overload_4(self, async_client: AsyncGradien action = await response.parse() assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_initiate_overload_4(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.actions.with_streaming_response.initiate( @@ -972,7 +972,7 @@ async def test_streaming_response_initiate_overload_4(self, async_client: AsyncG assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_overload_5(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.initiate( @@ -981,7 +981,7 @@ async def test_method_initiate_overload_5(self, async_client: AsyncGradient) -> ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_with_all_params_overload_5(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.initiate( @@ -992,7 +992,7 @@ async def test_method_initiate_with_all_params_overload_5(self, async_client: As ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_initiate_overload_5(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.actions.with_raw_response.initiate( @@ -1005,7 +1005,7 @@ async def test_raw_response_initiate_overload_5(self, async_client: AsyncGradien action = await response.parse() assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_initiate_overload_5(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.actions.with_streaming_response.initiate( @@ -1020,7 +1020,7 @@ async def test_streaming_response_initiate_overload_5(self, async_client: AsyncG assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_overload_6(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.initiate( @@ -1029,7 +1029,7 @@ async def test_method_initiate_overload_6(self, async_client: AsyncGradient) -> ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_with_all_params_overload_6(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.initiate( @@ -1039,7 +1039,7 @@ async def test_method_initiate_with_all_params_overload_6(self, async_client: As ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_initiate_overload_6(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.actions.with_raw_response.initiate( @@ -1052,7 +1052,7 @@ async def test_raw_response_initiate_overload_6(self, async_client: AsyncGradien action = await response.parse() assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_initiate_overload_6(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.actions.with_streaming_response.initiate( @@ -1067,7 +1067,7 @@ async def test_streaming_response_initiate_overload_6(self, async_client: AsyncG assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_overload_7(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.initiate( @@ -1076,7 +1076,7 @@ async def test_method_initiate_overload_7(self, async_client: AsyncGradient) -> ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_with_all_params_overload_7(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.initiate( @@ -1086,7 +1086,7 @@ async def test_method_initiate_with_all_params_overload_7(self, async_client: As ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_initiate_overload_7(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.actions.with_raw_response.initiate( @@ -1099,7 +1099,7 @@ async def test_raw_response_initiate_overload_7(self, async_client: AsyncGradien action = await response.parse() assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_initiate_overload_7(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.actions.with_streaming_response.initiate( @@ -1114,7 +1114,7 @@ async def test_streaming_response_initiate_overload_7(self, async_client: AsyncG assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_overload_8(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.initiate( @@ -1123,7 +1123,7 @@ async def test_method_initiate_overload_8(self, async_client: AsyncGradient) -> ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_with_all_params_overload_8(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.initiate( @@ -1133,7 +1133,7 @@ async def test_method_initiate_with_all_params_overload_8(self, async_client: As ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_initiate_overload_8(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.actions.with_raw_response.initiate( @@ -1146,7 +1146,7 @@ async def test_raw_response_initiate_overload_8(self, async_client: AsyncGradien action = await response.parse() assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_initiate_overload_8(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.actions.with_streaming_response.initiate( @@ -1161,7 +1161,7 @@ async def test_streaming_response_initiate_overload_8(self, async_client: AsyncG assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_overload_9(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.initiate( @@ -1170,7 +1170,7 @@ async def test_method_initiate_overload_9(self, async_client: AsyncGradient) -> ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_with_all_params_overload_9(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.actions.initiate( @@ -1180,7 +1180,7 @@ async def test_method_initiate_with_all_params_overload_9(self, async_client: As ) assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_initiate_overload_9(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.actions.with_raw_response.initiate( @@ -1193,7 +1193,7 @@ async def test_raw_response_initiate_overload_9(self, async_client: AsyncGradien action = await response.parse() assert_matches_type(ActionInitiateResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_initiate_overload_9(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.actions.with_streaming_response.initiate( diff --git a/tests/api_resources/gpu_droplets/test_autoscale.py b/tests/api_resources/gpu_droplets/test_autoscale.py index bbb0c2e4..d6322172 100644 --- a/tests/api_resources/gpu_droplets/test_autoscale.py +++ b/tests/api_resources/gpu_droplets/test_autoscale.py @@ -24,7 +24,7 @@ class TestAutoscale: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: autoscale = client.gpu_droplets.autoscale.create( @@ -42,7 +42,7 @@ def test_method_create(self, client: Gradient) -> None: ) assert_matches_type(AutoscaleCreateResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: autoscale = client.gpu_droplets.autoscale.create( @@ -70,7 +70,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(AutoscaleCreateResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.gpu_droplets.autoscale.with_raw_response.create( @@ -92,7 +92,7 @@ def test_raw_response_create(self, client: Gradient) -> None: autoscale = response.parse() assert_matches_type(AutoscaleCreateResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.gpu_droplets.autoscale.with_streaming_response.create( @@ -116,7 +116,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: autoscale = client.gpu_droplets.autoscale.retrieve( @@ -124,7 +124,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(AutoscaleRetrieveResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.gpu_droplets.autoscale.with_raw_response.retrieve( @@ -136,7 +136,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: autoscale = response.parse() assert_matches_type(AutoscaleRetrieveResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.gpu_droplets.autoscale.with_streaming_response.retrieve( @@ -150,7 +150,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `autoscale_pool_id` but received ''"): @@ -158,7 +158,7 @@ def test_path_params_retrieve(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gradient) -> None: autoscale = client.gpu_droplets.autoscale.update( @@ -174,7 +174,7 @@ def test_method_update(self, client: Gradient) -> None: ) assert_matches_type(AutoscaleUpdateResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gradient) -> None: autoscale = client.gpu_droplets.autoscale.update( @@ -197,7 +197,7 @@ def test_method_update_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(AutoscaleUpdateResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gradient) -> None: response = client.gpu_droplets.autoscale.with_raw_response.update( @@ -217,7 +217,7 @@ def test_raw_response_update(self, client: Gradient) -> None: autoscale = response.parse() assert_matches_type(AutoscaleUpdateResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gradient) -> None: with client.gpu_droplets.autoscale.with_streaming_response.update( @@ -239,7 +239,7 @@ def test_streaming_response_update(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `autoscale_pool_id` but received ''"): @@ -255,13 +255,13 @@ def test_path_params_update(self, client: Gradient) -> None: name="my-autoscale-pool", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: autoscale = client.gpu_droplets.autoscale.list() assert_matches_type(AutoscaleListResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: autoscale = client.gpu_droplets.autoscale.list( @@ -271,7 +271,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(AutoscaleListResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.gpu_droplets.autoscale.with_raw_response.list() @@ -281,7 +281,7 @@ def test_raw_response_list(self, client: Gradient) -> None: autoscale = response.parse() assert_matches_type(AutoscaleListResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.gpu_droplets.autoscale.with_streaming_response.list() as response: @@ -293,7 +293,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: autoscale = client.gpu_droplets.autoscale.delete( @@ -301,7 +301,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert autoscale is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.gpu_droplets.autoscale.with_raw_response.delete( @@ -313,7 +313,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: autoscale = response.parse() assert autoscale is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.gpu_droplets.autoscale.with_streaming_response.delete( @@ -327,7 +327,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `autoscale_pool_id` but received ''"): @@ -335,7 +335,7 @@ def test_path_params_delete(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_dangerous(self, client: Gradient) -> None: autoscale = client.gpu_droplets.autoscale.delete_dangerous( @@ -344,7 +344,7 @@ def test_method_delete_dangerous(self, client: Gradient) -> None: ) assert autoscale is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete_dangerous(self, client: Gradient) -> None: response = client.gpu_droplets.autoscale.with_raw_response.delete_dangerous( @@ -357,7 +357,7 @@ def test_raw_response_delete_dangerous(self, client: Gradient) -> None: autoscale = response.parse() assert autoscale is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete_dangerous(self, client: Gradient) -> None: with client.gpu_droplets.autoscale.with_streaming_response.delete_dangerous( @@ -372,7 +372,7 @@ def test_streaming_response_delete_dangerous(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete_dangerous(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `autoscale_pool_id` but received ''"): @@ -381,7 +381,7 @@ def test_path_params_delete_dangerous(self, client: Gradient) -> None: x_dangerous=True, ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_history(self, client: Gradient) -> None: autoscale = client.gpu_droplets.autoscale.list_history( @@ -389,7 +389,7 @@ def test_method_list_history(self, client: Gradient) -> None: ) assert_matches_type(AutoscaleListHistoryResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_history_with_all_params(self, client: Gradient) -> None: autoscale = client.gpu_droplets.autoscale.list_history( @@ -399,7 +399,7 @@ def test_method_list_history_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(AutoscaleListHistoryResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_history(self, client: Gradient) -> None: response = client.gpu_droplets.autoscale.with_raw_response.list_history( @@ -411,7 +411,7 @@ def test_raw_response_list_history(self, client: Gradient) -> None: autoscale = response.parse() assert_matches_type(AutoscaleListHistoryResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_history(self, client: Gradient) -> None: with client.gpu_droplets.autoscale.with_streaming_response.list_history( @@ -425,7 +425,7 @@ def test_streaming_response_list_history(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_list_history(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `autoscale_pool_id` but received ''"): @@ -433,7 +433,7 @@ def test_path_params_list_history(self, client: Gradient) -> None: autoscale_pool_id="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_members(self, client: Gradient) -> None: autoscale = client.gpu_droplets.autoscale.list_members( @@ -441,7 +441,7 @@ def test_method_list_members(self, client: Gradient) -> None: ) assert_matches_type(AutoscaleListMembersResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_members_with_all_params(self, client: Gradient) -> None: autoscale = client.gpu_droplets.autoscale.list_members( @@ -451,7 +451,7 @@ def test_method_list_members_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(AutoscaleListMembersResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_members(self, client: Gradient) -> None: response = client.gpu_droplets.autoscale.with_raw_response.list_members( @@ -463,7 +463,7 @@ def test_raw_response_list_members(self, client: Gradient) -> None: autoscale = response.parse() assert_matches_type(AutoscaleListMembersResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_members(self, client: Gradient) -> None: with client.gpu_droplets.autoscale.with_streaming_response.list_members( @@ -477,7 +477,7 @@ def test_streaming_response_list_members(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_list_members(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `autoscale_pool_id` but received ''"): @@ -491,7 +491,7 @@ class TestAsyncAutoscale: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: autoscale = await async_client.gpu_droplets.autoscale.create( @@ -509,7 +509,7 @@ async def test_method_create(self, async_client: AsyncGradient) -> None: ) assert_matches_type(AutoscaleCreateResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: autoscale = await async_client.gpu_droplets.autoscale.create( @@ -537,7 +537,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(AutoscaleCreateResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.autoscale.with_raw_response.create( @@ -559,7 +559,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: autoscale = await response.parse() assert_matches_type(AutoscaleCreateResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.autoscale.with_streaming_response.create( @@ -583,7 +583,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: autoscale = await async_client.gpu_droplets.autoscale.retrieve( @@ -591,7 +591,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(AutoscaleRetrieveResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.autoscale.with_raw_response.retrieve( @@ -603,7 +603,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: autoscale = await response.parse() assert_matches_type(AutoscaleRetrieveResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.autoscale.with_streaming_response.retrieve( @@ -617,7 +617,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `autoscale_pool_id` but received ''"): @@ -625,7 +625,7 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGradient) -> None: autoscale = await async_client.gpu_droplets.autoscale.update( @@ -641,7 +641,7 @@ async def test_method_update(self, async_client: AsyncGradient) -> None: ) assert_matches_type(AutoscaleUpdateResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGradient) -> None: autoscale = await async_client.gpu_droplets.autoscale.update( @@ -664,7 +664,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(AutoscaleUpdateResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.autoscale.with_raw_response.update( @@ -684,7 +684,7 @@ async def test_raw_response_update(self, async_client: AsyncGradient) -> None: autoscale = await response.parse() assert_matches_type(AutoscaleUpdateResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.autoscale.with_streaming_response.update( @@ -706,7 +706,7 @@ async def test_streaming_response_update(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `autoscale_pool_id` but received ''"): @@ -722,13 +722,13 @@ async def test_path_params_update(self, async_client: AsyncGradient) -> None: name="my-autoscale-pool", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: autoscale = await async_client.gpu_droplets.autoscale.list() assert_matches_type(AutoscaleListResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: autoscale = await async_client.gpu_droplets.autoscale.list( @@ -738,7 +738,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(AutoscaleListResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.autoscale.with_raw_response.list() @@ -748,7 +748,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: autoscale = await response.parse() assert_matches_type(AutoscaleListResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.autoscale.with_streaming_response.list() as response: @@ -760,7 +760,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: autoscale = await async_client.gpu_droplets.autoscale.delete( @@ -768,7 +768,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert autoscale is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.autoscale.with_raw_response.delete( @@ -780,7 +780,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: autoscale = await response.parse() assert autoscale is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.autoscale.with_streaming_response.delete( @@ -794,7 +794,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `autoscale_pool_id` but received ''"): @@ -802,7 +802,7 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_dangerous(self, async_client: AsyncGradient) -> None: autoscale = await async_client.gpu_droplets.autoscale.delete_dangerous( @@ -811,7 +811,7 @@ async def test_method_delete_dangerous(self, async_client: AsyncGradient) -> Non ) assert autoscale is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete_dangerous(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.autoscale.with_raw_response.delete_dangerous( @@ -824,7 +824,7 @@ async def test_raw_response_delete_dangerous(self, async_client: AsyncGradient) autoscale = await response.parse() assert autoscale is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete_dangerous(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.autoscale.with_streaming_response.delete_dangerous( @@ -839,7 +839,7 @@ async def test_streaming_response_delete_dangerous(self, async_client: AsyncGrad assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete_dangerous(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `autoscale_pool_id` but received ''"): @@ -848,7 +848,7 @@ async def test_path_params_delete_dangerous(self, async_client: AsyncGradient) - x_dangerous=True, ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_history(self, async_client: AsyncGradient) -> None: autoscale = await async_client.gpu_droplets.autoscale.list_history( @@ -856,7 +856,7 @@ async def test_method_list_history(self, async_client: AsyncGradient) -> None: ) assert_matches_type(AutoscaleListHistoryResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_history_with_all_params(self, async_client: AsyncGradient) -> None: autoscale = await async_client.gpu_droplets.autoscale.list_history( @@ -866,7 +866,7 @@ async def test_method_list_history_with_all_params(self, async_client: AsyncGrad ) assert_matches_type(AutoscaleListHistoryResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_history(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.autoscale.with_raw_response.list_history( @@ -878,7 +878,7 @@ async def test_raw_response_list_history(self, async_client: AsyncGradient) -> N autoscale = await response.parse() assert_matches_type(AutoscaleListHistoryResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_history(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.autoscale.with_streaming_response.list_history( @@ -892,7 +892,7 @@ async def test_streaming_response_list_history(self, async_client: AsyncGradient assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_list_history(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `autoscale_pool_id` but received ''"): @@ -900,7 +900,7 @@ async def test_path_params_list_history(self, async_client: AsyncGradient) -> No autoscale_pool_id="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_members(self, async_client: AsyncGradient) -> None: autoscale = await async_client.gpu_droplets.autoscale.list_members( @@ -908,7 +908,7 @@ async def test_method_list_members(self, async_client: AsyncGradient) -> None: ) assert_matches_type(AutoscaleListMembersResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_members_with_all_params(self, async_client: AsyncGradient) -> None: autoscale = await async_client.gpu_droplets.autoscale.list_members( @@ -918,7 +918,7 @@ async def test_method_list_members_with_all_params(self, async_client: AsyncGrad ) assert_matches_type(AutoscaleListMembersResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_members(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.autoscale.with_raw_response.list_members( @@ -930,7 +930,7 @@ async def test_raw_response_list_members(self, async_client: AsyncGradient) -> N autoscale = await response.parse() assert_matches_type(AutoscaleListMembersResponse, autoscale, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_members(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.autoscale.with_streaming_response.list_members( @@ -944,7 +944,7 @@ async def test_streaming_response_list_members(self, async_client: AsyncGradient assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_list_members(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `autoscale_pool_id` but received ''"): diff --git a/tests/api_resources/gpu_droplets/test_backups.py b/tests/api_resources/gpu_droplets/test_backups.py index c6e854e4..c5e8615f 100644 --- a/tests/api_resources/gpu_droplets/test_backups.py +++ b/tests/api_resources/gpu_droplets/test_backups.py @@ -22,7 +22,7 @@ class TestBackups: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: backup = client.gpu_droplets.backups.list( @@ -30,7 +30,7 @@ def test_method_list(self, client: Gradient) -> None: ) assert_matches_type(BackupListResponse, backup, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: backup = client.gpu_droplets.backups.list( @@ -40,7 +40,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(BackupListResponse, backup, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.gpu_droplets.backups.with_raw_response.list( @@ -52,7 +52,7 @@ def test_raw_response_list(self, client: Gradient) -> None: backup = response.parse() assert_matches_type(BackupListResponse, backup, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.gpu_droplets.backups.with_streaming_response.list( @@ -66,13 +66,13 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_policies(self, client: Gradient) -> None: backup = client.gpu_droplets.backups.list_policies() assert_matches_type(BackupListPoliciesResponse, backup, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_policies_with_all_params(self, client: Gradient) -> None: backup = client.gpu_droplets.backups.list_policies( @@ -81,7 +81,7 @@ def test_method_list_policies_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(BackupListPoliciesResponse, backup, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_policies(self, client: Gradient) -> None: response = client.gpu_droplets.backups.with_raw_response.list_policies() @@ -91,7 +91,7 @@ def test_raw_response_list_policies(self, client: Gradient) -> None: backup = response.parse() assert_matches_type(BackupListPoliciesResponse, backup, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_policies(self, client: Gradient) -> None: with client.gpu_droplets.backups.with_streaming_response.list_policies() as response: @@ -103,13 +103,13 @@ def test_streaming_response_list_policies(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_supported_policies(self, client: Gradient) -> None: backup = client.gpu_droplets.backups.list_supported_policies() assert_matches_type(BackupListSupportedPoliciesResponse, backup, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_supported_policies(self, client: Gradient) -> None: response = client.gpu_droplets.backups.with_raw_response.list_supported_policies() @@ -119,7 +119,7 @@ def test_raw_response_list_supported_policies(self, client: Gradient) -> None: backup = response.parse() assert_matches_type(BackupListSupportedPoliciesResponse, backup, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_supported_policies(self, client: Gradient) -> None: with client.gpu_droplets.backups.with_streaming_response.list_supported_policies() as response: @@ -131,7 +131,7 @@ def test_streaming_response_list_supported_policies(self, client: Gradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_policy(self, client: Gradient) -> None: backup = client.gpu_droplets.backups.retrieve_policy( @@ -139,7 +139,7 @@ def test_method_retrieve_policy(self, client: Gradient) -> None: ) assert_matches_type(BackupRetrievePolicyResponse, backup, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve_policy(self, client: Gradient) -> None: response = client.gpu_droplets.backups.with_raw_response.retrieve_policy( @@ -151,7 +151,7 @@ def test_raw_response_retrieve_policy(self, client: Gradient) -> None: backup = response.parse() assert_matches_type(BackupRetrievePolicyResponse, backup, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve_policy(self, client: Gradient) -> None: with client.gpu_droplets.backups.with_streaming_response.retrieve_policy( @@ -171,7 +171,7 @@ class TestAsyncBackups: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: backup = await async_client.gpu_droplets.backups.list( @@ -179,7 +179,7 @@ async def test_method_list(self, async_client: AsyncGradient) -> None: ) assert_matches_type(BackupListResponse, backup, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: backup = await async_client.gpu_droplets.backups.list( @@ -189,7 +189,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(BackupListResponse, backup, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.backups.with_raw_response.list( @@ -201,7 +201,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: backup = await response.parse() assert_matches_type(BackupListResponse, backup, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.backups.with_streaming_response.list( @@ -215,13 +215,13 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_policies(self, async_client: AsyncGradient) -> None: backup = await async_client.gpu_droplets.backups.list_policies() assert_matches_type(BackupListPoliciesResponse, backup, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_policies_with_all_params(self, async_client: AsyncGradient) -> None: backup = await async_client.gpu_droplets.backups.list_policies( @@ -230,7 +230,7 @@ async def test_method_list_policies_with_all_params(self, async_client: AsyncGra ) assert_matches_type(BackupListPoliciesResponse, backup, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_policies(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.backups.with_raw_response.list_policies() @@ -240,7 +240,7 @@ async def test_raw_response_list_policies(self, async_client: AsyncGradient) -> backup = await response.parse() assert_matches_type(BackupListPoliciesResponse, backup, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_policies(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.backups.with_streaming_response.list_policies() as response: @@ -252,13 +252,13 @@ async def test_streaming_response_list_policies(self, async_client: AsyncGradien assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_supported_policies(self, async_client: AsyncGradient) -> None: backup = await async_client.gpu_droplets.backups.list_supported_policies() assert_matches_type(BackupListSupportedPoliciesResponse, backup, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_supported_policies(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.backups.with_raw_response.list_supported_policies() @@ -268,7 +268,7 @@ async def test_raw_response_list_supported_policies(self, async_client: AsyncGra backup = await response.parse() assert_matches_type(BackupListSupportedPoliciesResponse, backup, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_supported_policies(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.backups.with_streaming_response.list_supported_policies() as response: @@ -280,7 +280,7 @@ async def test_streaming_response_list_supported_policies(self, async_client: As assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_policy(self, async_client: AsyncGradient) -> None: backup = await async_client.gpu_droplets.backups.retrieve_policy( @@ -288,7 +288,7 @@ async def test_method_retrieve_policy(self, async_client: AsyncGradient) -> None ) assert_matches_type(BackupRetrievePolicyResponse, backup, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve_policy(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.backups.with_raw_response.retrieve_policy( @@ -300,7 +300,7 @@ async def test_raw_response_retrieve_policy(self, async_client: AsyncGradient) - backup = await response.parse() assert_matches_type(BackupRetrievePolicyResponse, backup, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve_policy(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.backups.with_streaming_response.retrieve_policy( diff --git a/tests/api_resources/gpu_droplets/test_destroy_with_associated_resources.py b/tests/api_resources/gpu_droplets/test_destroy_with_associated_resources.py index 80f1bd7c..bdaaeab9 100644 --- a/tests/api_resources/gpu_droplets/test_destroy_with_associated_resources.py +++ b/tests/api_resources/gpu_droplets/test_destroy_with_associated_resources.py @@ -20,7 +20,7 @@ class TestDestroyWithAssociatedResources: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: destroy_with_associated_resource = client.gpu_droplets.destroy_with_associated_resources.list( @@ -30,7 +30,7 @@ def test_method_list(self, client: Gradient) -> None: DestroyWithAssociatedResourceListResponse, destroy_with_associated_resource, path=["response"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.gpu_droplets.destroy_with_associated_resources.with_raw_response.list( @@ -44,7 +44,7 @@ def test_raw_response_list(self, client: Gradient) -> None: DestroyWithAssociatedResourceListResponse, destroy_with_associated_resource, path=["response"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.gpu_droplets.destroy_with_associated_resources.with_streaming_response.list( @@ -60,7 +60,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_check_status(self, client: Gradient) -> None: destroy_with_associated_resource = client.gpu_droplets.destroy_with_associated_resources.check_status( @@ -70,7 +70,7 @@ def test_method_check_status(self, client: Gradient) -> None: DestroyWithAssociatedResourceCheckStatusResponse, destroy_with_associated_resource, path=["response"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_check_status(self, client: Gradient) -> None: response = client.gpu_droplets.destroy_with_associated_resources.with_raw_response.check_status( @@ -84,7 +84,7 @@ def test_raw_response_check_status(self, client: Gradient) -> None: DestroyWithAssociatedResourceCheckStatusResponse, destroy_with_associated_resource, path=["response"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_check_status(self, client: Gradient) -> None: with client.gpu_droplets.destroy_with_associated_resources.with_streaming_response.check_status( @@ -100,7 +100,7 @@ def test_streaming_response_check_status(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_dangerous(self, client: Gradient) -> None: destroy_with_associated_resource = client.gpu_droplets.destroy_with_associated_resources.delete_dangerous( @@ -109,7 +109,7 @@ def test_method_delete_dangerous(self, client: Gradient) -> None: ) assert destroy_with_associated_resource is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete_dangerous(self, client: Gradient) -> None: response = client.gpu_droplets.destroy_with_associated_resources.with_raw_response.delete_dangerous( @@ -122,7 +122,7 @@ def test_raw_response_delete_dangerous(self, client: Gradient) -> None: destroy_with_associated_resource = response.parse() assert destroy_with_associated_resource is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete_dangerous(self, client: Gradient) -> None: with client.gpu_droplets.destroy_with_associated_resources.with_streaming_response.delete_dangerous( @@ -137,7 +137,7 @@ def test_streaming_response_delete_dangerous(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_selective(self, client: Gradient) -> None: destroy_with_associated_resource = client.gpu_droplets.destroy_with_associated_resources.delete_selective( @@ -145,7 +145,7 @@ def test_method_delete_selective(self, client: Gradient) -> None: ) assert destroy_with_associated_resource is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_selective_with_all_params(self, client: Gradient) -> None: destroy_with_associated_resource = client.gpu_droplets.destroy_with_associated_resources.delete_selective( @@ -158,7 +158,7 @@ def test_method_delete_selective_with_all_params(self, client: Gradient) -> None ) assert destroy_with_associated_resource is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete_selective(self, client: Gradient) -> None: response = client.gpu_droplets.destroy_with_associated_resources.with_raw_response.delete_selective( @@ -170,7 +170,7 @@ def test_raw_response_delete_selective(self, client: Gradient) -> None: destroy_with_associated_resource = response.parse() assert destroy_with_associated_resource is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete_selective(self, client: Gradient) -> None: with client.gpu_droplets.destroy_with_associated_resources.with_streaming_response.delete_selective( @@ -184,7 +184,7 @@ def test_streaming_response_delete_selective(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retry(self, client: Gradient) -> None: destroy_with_associated_resource = client.gpu_droplets.destroy_with_associated_resources.retry( @@ -192,7 +192,7 @@ def test_method_retry(self, client: Gradient) -> None: ) assert destroy_with_associated_resource is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retry(self, client: Gradient) -> None: response = client.gpu_droplets.destroy_with_associated_resources.with_raw_response.retry( @@ -204,7 +204,7 @@ def test_raw_response_retry(self, client: Gradient) -> None: destroy_with_associated_resource = response.parse() assert destroy_with_associated_resource is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retry(self, client: Gradient) -> None: with client.gpu_droplets.destroy_with_associated_resources.with_streaming_response.retry( @@ -224,7 +224,7 @@ class TestAsyncDestroyWithAssociatedResources: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: destroy_with_associated_resource = await async_client.gpu_droplets.destroy_with_associated_resources.list( @@ -234,7 +234,7 @@ async def test_method_list(self, async_client: AsyncGradient) -> None: DestroyWithAssociatedResourceListResponse, destroy_with_associated_resource, path=["response"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.destroy_with_associated_resources.with_raw_response.list( @@ -248,7 +248,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: DestroyWithAssociatedResourceListResponse, destroy_with_associated_resource, path=["response"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.destroy_with_associated_resources.with_streaming_response.list( @@ -264,7 +264,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_check_status(self, async_client: AsyncGradient) -> None: destroy_with_associated_resource = ( @@ -276,7 +276,7 @@ async def test_method_check_status(self, async_client: AsyncGradient) -> None: DestroyWithAssociatedResourceCheckStatusResponse, destroy_with_associated_resource, path=["response"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_check_status(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.destroy_with_associated_resources.with_raw_response.check_status( @@ -290,7 +290,7 @@ async def test_raw_response_check_status(self, async_client: AsyncGradient) -> N DestroyWithAssociatedResourceCheckStatusResponse, destroy_with_associated_resource, path=["response"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_check_status(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.destroy_with_associated_resources.with_streaming_response.check_status( @@ -306,7 +306,7 @@ async def test_streaming_response_check_status(self, async_client: AsyncGradient assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_dangerous(self, async_client: AsyncGradient) -> None: destroy_with_associated_resource = ( @@ -317,7 +317,7 @@ async def test_method_delete_dangerous(self, async_client: AsyncGradient) -> Non ) assert destroy_with_associated_resource is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete_dangerous(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.destroy_with_associated_resources.with_raw_response.delete_dangerous( @@ -330,7 +330,7 @@ async def test_raw_response_delete_dangerous(self, async_client: AsyncGradient) destroy_with_associated_resource = await response.parse() assert destroy_with_associated_resource is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete_dangerous(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.destroy_with_associated_resources.with_streaming_response.delete_dangerous( @@ -345,7 +345,7 @@ async def test_streaming_response_delete_dangerous(self, async_client: AsyncGrad assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_selective(self, async_client: AsyncGradient) -> None: destroy_with_associated_resource = ( @@ -355,7 +355,7 @@ async def test_method_delete_selective(self, async_client: AsyncGradient) -> Non ) assert destroy_with_associated_resource is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_selective_with_all_params(self, async_client: AsyncGradient) -> None: destroy_with_associated_resource = ( @@ -370,7 +370,7 @@ async def test_method_delete_selective_with_all_params(self, async_client: Async ) assert destroy_with_associated_resource is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete_selective(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.destroy_with_associated_resources.with_raw_response.delete_selective( @@ -382,7 +382,7 @@ async def test_raw_response_delete_selective(self, async_client: AsyncGradient) destroy_with_associated_resource = await response.parse() assert destroy_with_associated_resource is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete_selective(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.destroy_with_associated_resources.with_streaming_response.delete_selective( @@ -396,7 +396,7 @@ async def test_streaming_response_delete_selective(self, async_client: AsyncGrad assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retry(self, async_client: AsyncGradient) -> None: destroy_with_associated_resource = await async_client.gpu_droplets.destroy_with_associated_resources.retry( @@ -404,7 +404,7 @@ async def test_method_retry(self, async_client: AsyncGradient) -> None: ) assert destroy_with_associated_resource is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retry(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.destroy_with_associated_resources.with_raw_response.retry( @@ -416,7 +416,7 @@ async def test_raw_response_retry(self, async_client: AsyncGradient) -> None: destroy_with_associated_resource = await response.parse() assert destroy_with_associated_resource is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retry(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.destroy_with_associated_resources.with_streaming_response.retry( diff --git a/tests/api_resources/gpu_droplets/test_firewalls.py b/tests/api_resources/gpu_droplets/test_firewalls.py index 3d8469b3..60c7bbc9 100644 --- a/tests/api_resources/gpu_droplets/test_firewalls.py +++ b/tests/api_resources/gpu_droplets/test_firewalls.py @@ -22,13 +22,13 @@ class TestFirewalls: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: firewall = client.gpu_droplets.firewalls.create() assert_matches_type(FirewallCreateResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: firewall = client.gpu_droplets.firewalls.create( @@ -77,7 +77,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(FirewallCreateResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.gpu_droplets.firewalls.with_raw_response.create() @@ -87,7 +87,7 @@ def test_raw_response_create(self, client: Gradient) -> None: firewall = response.parse() assert_matches_type(FirewallCreateResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.gpu_droplets.firewalls.with_streaming_response.create() as response: @@ -99,7 +99,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: firewall = client.gpu_droplets.firewalls.retrieve( @@ -107,7 +107,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(FirewallRetrieveResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.gpu_droplets.firewalls.with_raw_response.retrieve( @@ -119,7 +119,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: firewall = response.parse() assert_matches_type(FirewallRetrieveResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.gpu_droplets.firewalls.with_streaming_response.retrieve( @@ -133,7 +133,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `firewall_id` but received ''"): @@ -141,7 +141,7 @@ def test_path_params_retrieve(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gradient) -> None: firewall = client.gpu_droplets.firewalls.update( @@ -150,7 +150,7 @@ def test_method_update(self, client: Gradient) -> None: ) assert_matches_type(FirewallUpdateResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gradient) -> None: firewall = client.gpu_droplets.firewalls.update( @@ -200,7 +200,7 @@ def test_method_update_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(FirewallUpdateResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gradient) -> None: response = client.gpu_droplets.firewalls.with_raw_response.update( @@ -213,7 +213,7 @@ def test_raw_response_update(self, client: Gradient) -> None: firewall = response.parse() assert_matches_type(FirewallUpdateResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gradient) -> None: with client.gpu_droplets.firewalls.with_streaming_response.update( @@ -228,7 +228,7 @@ def test_streaming_response_update(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `firewall_id` but received ''"): @@ -237,13 +237,13 @@ def test_path_params_update(self, client: Gradient) -> None: firewall={"name": "frontend-firewall"}, ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: firewall = client.gpu_droplets.firewalls.list() assert_matches_type(FirewallListResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: firewall = client.gpu_droplets.firewalls.list( @@ -252,7 +252,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(FirewallListResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.gpu_droplets.firewalls.with_raw_response.list() @@ -262,7 +262,7 @@ def test_raw_response_list(self, client: Gradient) -> None: firewall = response.parse() assert_matches_type(FirewallListResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.gpu_droplets.firewalls.with_streaming_response.list() as response: @@ -274,7 +274,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: firewall = client.gpu_droplets.firewalls.delete( @@ -282,7 +282,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert firewall is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.gpu_droplets.firewalls.with_raw_response.delete( @@ -294,7 +294,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: firewall = response.parse() assert firewall is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.gpu_droplets.firewalls.with_streaming_response.delete( @@ -308,7 +308,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `firewall_id` but received ''"): @@ -322,13 +322,13 @@ class TestAsyncFirewalls: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: firewall = await async_client.gpu_droplets.firewalls.create() assert_matches_type(FirewallCreateResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: firewall = await async_client.gpu_droplets.firewalls.create( @@ -377,7 +377,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(FirewallCreateResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.firewalls.with_raw_response.create() @@ -387,7 +387,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: firewall = await response.parse() assert_matches_type(FirewallCreateResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.firewalls.with_streaming_response.create() as response: @@ -399,7 +399,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: firewall = await async_client.gpu_droplets.firewalls.retrieve( @@ -407,7 +407,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(FirewallRetrieveResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.firewalls.with_raw_response.retrieve( @@ -419,7 +419,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: firewall = await response.parse() assert_matches_type(FirewallRetrieveResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.firewalls.with_streaming_response.retrieve( @@ -433,7 +433,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `firewall_id` but received ''"): @@ -441,7 +441,7 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGradient) -> None: firewall = await async_client.gpu_droplets.firewalls.update( @@ -450,7 +450,7 @@ async def test_method_update(self, async_client: AsyncGradient) -> None: ) assert_matches_type(FirewallUpdateResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGradient) -> None: firewall = await async_client.gpu_droplets.firewalls.update( @@ -500,7 +500,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(FirewallUpdateResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.firewalls.with_raw_response.update( @@ -513,7 +513,7 @@ async def test_raw_response_update(self, async_client: AsyncGradient) -> None: firewall = await response.parse() assert_matches_type(FirewallUpdateResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.firewalls.with_streaming_response.update( @@ -528,7 +528,7 @@ async def test_streaming_response_update(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `firewall_id` but received ''"): @@ -537,13 +537,13 @@ async def test_path_params_update(self, async_client: AsyncGradient) -> None: firewall={"name": "frontend-firewall"}, ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: firewall = await async_client.gpu_droplets.firewalls.list() assert_matches_type(FirewallListResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: firewall = await async_client.gpu_droplets.firewalls.list( @@ -552,7 +552,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(FirewallListResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.firewalls.with_raw_response.list() @@ -562,7 +562,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: firewall = await response.parse() assert_matches_type(FirewallListResponse, firewall, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.firewalls.with_streaming_response.list() as response: @@ -574,7 +574,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: firewall = await async_client.gpu_droplets.firewalls.delete( @@ -582,7 +582,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert firewall is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.firewalls.with_raw_response.delete( @@ -594,7 +594,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: firewall = await response.parse() assert firewall is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.firewalls.with_streaming_response.delete( @@ -608,7 +608,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `firewall_id` but received ''"): diff --git a/tests/api_resources/gpu_droplets/test_floating_ips.py b/tests/api_resources/gpu_droplets/test_floating_ips.py index 3119bf28..84156532 100644 --- a/tests/api_resources/gpu_droplets/test_floating_ips.py +++ b/tests/api_resources/gpu_droplets/test_floating_ips.py @@ -21,7 +21,7 @@ class TestFloatingIPs: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_overload_1(self, client: Gradient) -> None: floating_ip = client.gpu_droplets.floating_ips.create( @@ -29,7 +29,7 @@ def test_method_create_overload_1(self, client: Gradient) -> None: ) assert_matches_type(FloatingIPCreateResponse, floating_ip, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_overload_1(self, client: Gradient) -> None: response = client.gpu_droplets.floating_ips.with_raw_response.create( @@ -41,7 +41,7 @@ def test_raw_response_create_overload_1(self, client: Gradient) -> None: floating_ip = response.parse() assert_matches_type(FloatingIPCreateResponse, floating_ip, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_overload_1(self, client: Gradient) -> None: with client.gpu_droplets.floating_ips.with_streaming_response.create( @@ -55,7 +55,7 @@ def test_streaming_response_create_overload_1(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_overload_2(self, client: Gradient) -> None: floating_ip = client.gpu_droplets.floating_ips.create( @@ -63,7 +63,7 @@ def test_method_create_overload_2(self, client: Gradient) -> None: ) assert_matches_type(FloatingIPCreateResponse, floating_ip, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params_overload_2(self, client: Gradient) -> None: floating_ip = client.gpu_droplets.floating_ips.create( @@ -72,7 +72,7 @@ def test_method_create_with_all_params_overload_2(self, client: Gradient) -> Non ) assert_matches_type(FloatingIPCreateResponse, floating_ip, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_overload_2(self, client: Gradient) -> None: response = client.gpu_droplets.floating_ips.with_raw_response.create( @@ -84,7 +84,7 @@ def test_raw_response_create_overload_2(self, client: Gradient) -> None: floating_ip = response.parse() assert_matches_type(FloatingIPCreateResponse, floating_ip, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_overload_2(self, client: Gradient) -> None: with client.gpu_droplets.floating_ips.with_streaming_response.create( @@ -98,7 +98,7 @@ def test_streaming_response_create_overload_2(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: floating_ip = client.gpu_droplets.floating_ips.retrieve( @@ -106,7 +106,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(FloatingIPRetrieveResponse, floating_ip, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.gpu_droplets.floating_ips.with_raw_response.retrieve( @@ -118,7 +118,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: floating_ip = response.parse() assert_matches_type(FloatingIPRetrieveResponse, floating_ip, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.gpu_droplets.floating_ips.with_streaming_response.retrieve( @@ -132,7 +132,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `floating_ip` but received ''"): @@ -140,13 +140,13 @@ def test_path_params_retrieve(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: floating_ip = client.gpu_droplets.floating_ips.list() assert_matches_type(FloatingIPListResponse, floating_ip, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: floating_ip = client.gpu_droplets.floating_ips.list( @@ -155,7 +155,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(FloatingIPListResponse, floating_ip, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.gpu_droplets.floating_ips.with_raw_response.list() @@ -165,7 +165,7 @@ def test_raw_response_list(self, client: Gradient) -> None: floating_ip = response.parse() assert_matches_type(FloatingIPListResponse, floating_ip, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.gpu_droplets.floating_ips.with_streaming_response.list() as response: @@ -177,7 +177,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: floating_ip = client.gpu_droplets.floating_ips.delete( @@ -185,7 +185,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert floating_ip is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.gpu_droplets.floating_ips.with_raw_response.delete( @@ -197,7 +197,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: floating_ip = response.parse() assert floating_ip is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.gpu_droplets.floating_ips.with_streaming_response.delete( @@ -211,7 +211,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `floating_ip` but received ''"): @@ -225,7 +225,7 @@ class TestAsyncFloatingIPs: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_overload_1(self, async_client: AsyncGradient) -> None: floating_ip = await async_client.gpu_droplets.floating_ips.create( @@ -233,7 +233,7 @@ async def test_method_create_overload_1(self, async_client: AsyncGradient) -> No ) assert_matches_type(FloatingIPCreateResponse, floating_ip, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.floating_ips.with_raw_response.create( @@ -245,7 +245,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncGradient) floating_ip = await response.parse() assert_matches_type(FloatingIPCreateResponse, floating_ip, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.floating_ips.with_streaming_response.create( @@ -259,7 +259,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncGra assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_overload_2(self, async_client: AsyncGradient) -> None: floating_ip = await async_client.gpu_droplets.floating_ips.create( @@ -267,7 +267,7 @@ async def test_method_create_overload_2(self, async_client: AsyncGradient) -> No ) assert_matches_type(FloatingIPCreateResponse, floating_ip, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGradient) -> None: floating_ip = await async_client.gpu_droplets.floating_ips.create( @@ -276,7 +276,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn ) assert_matches_type(FloatingIPCreateResponse, floating_ip, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.floating_ips.with_raw_response.create( @@ -288,7 +288,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) floating_ip = await response.parse() assert_matches_type(FloatingIPCreateResponse, floating_ip, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.floating_ips.with_streaming_response.create( @@ -302,7 +302,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGra assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: floating_ip = await async_client.gpu_droplets.floating_ips.retrieve( @@ -310,7 +310,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(FloatingIPRetrieveResponse, floating_ip, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.floating_ips.with_raw_response.retrieve( @@ -322,7 +322,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: floating_ip = await response.parse() assert_matches_type(FloatingIPRetrieveResponse, floating_ip, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.floating_ips.with_streaming_response.retrieve( @@ -336,7 +336,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `floating_ip` but received ''"): @@ -344,13 +344,13 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: floating_ip = await async_client.gpu_droplets.floating_ips.list() assert_matches_type(FloatingIPListResponse, floating_ip, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: floating_ip = await async_client.gpu_droplets.floating_ips.list( @@ -359,7 +359,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(FloatingIPListResponse, floating_ip, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.floating_ips.with_raw_response.list() @@ -369,7 +369,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: floating_ip = await response.parse() assert_matches_type(FloatingIPListResponse, floating_ip, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.floating_ips.with_streaming_response.list() as response: @@ -381,7 +381,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: floating_ip = await async_client.gpu_droplets.floating_ips.delete( @@ -389,7 +389,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert floating_ip is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.floating_ips.with_raw_response.delete( @@ -401,7 +401,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: floating_ip = await response.parse() assert floating_ip is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.floating_ips.with_streaming_response.delete( @@ -415,7 +415,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `floating_ip` but received ''"): diff --git a/tests/api_resources/gpu_droplets/test_images.py b/tests/api_resources/gpu_droplets/test_images.py index 480f94a5..1bebbe99 100644 --- a/tests/api_resources/gpu_droplets/test_images.py +++ b/tests/api_resources/gpu_droplets/test_images.py @@ -22,13 +22,13 @@ class TestImages: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: image = client.gpu_droplets.images.create() assert_matches_type(ImageCreateResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: image = client.gpu_droplets.images.create( @@ -41,7 +41,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(ImageCreateResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.gpu_droplets.images.with_raw_response.create() @@ -51,7 +51,7 @@ def test_raw_response_create(self, client: Gradient) -> None: image = response.parse() assert_matches_type(ImageCreateResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.gpu_droplets.images.with_streaming_response.create() as response: @@ -63,7 +63,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: image = client.gpu_droplets.images.retrieve( @@ -71,7 +71,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(ImageRetrieveResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.gpu_droplets.images.with_raw_response.retrieve( @@ -83,7 +83,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: image = response.parse() assert_matches_type(ImageRetrieveResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.gpu_droplets.images.with_streaming_response.retrieve( @@ -97,7 +97,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gradient) -> None: image = client.gpu_droplets.images.update( @@ -105,7 +105,7 @@ def test_method_update(self, client: Gradient) -> None: ) assert_matches_type(ImageUpdateResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gradient) -> None: image = client.gpu_droplets.images.update( @@ -116,7 +116,7 @@ def test_method_update_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(ImageUpdateResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gradient) -> None: response = client.gpu_droplets.images.with_raw_response.update( @@ -128,7 +128,7 @@ def test_raw_response_update(self, client: Gradient) -> None: image = response.parse() assert_matches_type(ImageUpdateResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gradient) -> None: with client.gpu_droplets.images.with_streaming_response.update( @@ -142,13 +142,13 @@ def test_streaming_response_update(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: image = client.gpu_droplets.images.list() assert_matches_type(ImageListResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: image = client.gpu_droplets.images.list( @@ -160,7 +160,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(ImageListResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.gpu_droplets.images.with_raw_response.list() @@ -170,7 +170,7 @@ def test_raw_response_list(self, client: Gradient) -> None: image = response.parse() assert_matches_type(ImageListResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.gpu_droplets.images.with_streaming_response.list() as response: @@ -182,7 +182,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: image = client.gpu_droplets.images.delete( @@ -190,7 +190,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert image is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.gpu_droplets.images.with_raw_response.delete( @@ -202,7 +202,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: image = response.parse() assert image is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.gpu_droplets.images.with_streaming_response.delete( @@ -222,13 +222,13 @@ class TestAsyncImages: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: image = await async_client.gpu_droplets.images.create() assert_matches_type(ImageCreateResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: image = await async_client.gpu_droplets.images.create( @@ -241,7 +241,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(ImageCreateResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.images.with_raw_response.create() @@ -251,7 +251,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: image = await response.parse() assert_matches_type(ImageCreateResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.images.with_streaming_response.create() as response: @@ -263,7 +263,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: image = await async_client.gpu_droplets.images.retrieve( @@ -271,7 +271,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(ImageRetrieveResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.images.with_raw_response.retrieve( @@ -283,7 +283,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: image = await response.parse() assert_matches_type(ImageRetrieveResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.images.with_streaming_response.retrieve( @@ -297,7 +297,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGradient) -> None: image = await async_client.gpu_droplets.images.update( @@ -305,7 +305,7 @@ async def test_method_update(self, async_client: AsyncGradient) -> None: ) assert_matches_type(ImageUpdateResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGradient) -> None: image = await async_client.gpu_droplets.images.update( @@ -316,7 +316,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(ImageUpdateResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.images.with_raw_response.update( @@ -328,7 +328,7 @@ async def test_raw_response_update(self, async_client: AsyncGradient) -> None: image = await response.parse() assert_matches_type(ImageUpdateResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.images.with_streaming_response.update( @@ -342,13 +342,13 @@ async def test_streaming_response_update(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: image = await async_client.gpu_droplets.images.list() assert_matches_type(ImageListResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: image = await async_client.gpu_droplets.images.list( @@ -360,7 +360,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(ImageListResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.images.with_raw_response.list() @@ -370,7 +370,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: image = await response.parse() assert_matches_type(ImageListResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.images.with_streaming_response.list() as response: @@ -382,7 +382,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: image = await async_client.gpu_droplets.images.delete( @@ -390,7 +390,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert image is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.images.with_raw_response.delete( @@ -402,7 +402,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: image = await response.parse() assert image is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.images.with_streaming_response.delete( diff --git a/tests/api_resources/gpu_droplets/test_load_balancers.py b/tests/api_resources/gpu_droplets/test_load_balancers.py index 363520e4..91138402 100644 --- a/tests/api_resources/gpu_droplets/test_load_balancers.py +++ b/tests/api_resources/gpu_droplets/test_load_balancers.py @@ -22,7 +22,7 @@ class TestLoadBalancers: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_overload_1(self, client: Gradient) -> None: load_balancer = client.gpu_droplets.load_balancers.create( @@ -37,7 +37,7 @@ def test_method_create_overload_1(self, client: Gradient) -> None: ) assert_matches_type(LoadBalancerCreateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params_overload_1(self, client: Gradient) -> None: load_balancer = client.gpu_droplets.load_balancers.create( @@ -108,7 +108,7 @@ def test_method_create_with_all_params_overload_1(self, client: Gradient) -> Non ) assert_matches_type(LoadBalancerCreateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_overload_1(self, client: Gradient) -> None: response = client.gpu_droplets.load_balancers.with_raw_response.create( @@ -127,7 +127,7 @@ def test_raw_response_create_overload_1(self, client: Gradient) -> None: load_balancer = response.parse() assert_matches_type(LoadBalancerCreateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_overload_1(self, client: Gradient) -> None: with client.gpu_droplets.load_balancers.with_streaming_response.create( @@ -148,7 +148,7 @@ def test_streaming_response_create_overload_1(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_overload_2(self, client: Gradient) -> None: load_balancer = client.gpu_droplets.load_balancers.create( @@ -163,7 +163,7 @@ def test_method_create_overload_2(self, client: Gradient) -> None: ) assert_matches_type(LoadBalancerCreateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params_overload_2(self, client: Gradient) -> None: load_balancer = client.gpu_droplets.load_balancers.create( @@ -234,7 +234,7 @@ def test_method_create_with_all_params_overload_2(self, client: Gradient) -> Non ) assert_matches_type(LoadBalancerCreateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_overload_2(self, client: Gradient) -> None: response = client.gpu_droplets.load_balancers.with_raw_response.create( @@ -253,7 +253,7 @@ def test_raw_response_create_overload_2(self, client: Gradient) -> None: load_balancer = response.parse() assert_matches_type(LoadBalancerCreateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_overload_2(self, client: Gradient) -> None: with client.gpu_droplets.load_balancers.with_streaming_response.create( @@ -274,7 +274,7 @@ def test_streaming_response_create_overload_2(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: load_balancer = client.gpu_droplets.load_balancers.retrieve( @@ -282,7 +282,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(LoadBalancerRetrieveResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.gpu_droplets.load_balancers.with_raw_response.retrieve( @@ -294,7 +294,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: load_balancer = response.parse() assert_matches_type(LoadBalancerRetrieveResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.gpu_droplets.load_balancers.with_streaming_response.retrieve( @@ -308,7 +308,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `lb_id` but received ''"): @@ -316,7 +316,7 @@ def test_path_params_retrieve(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_overload_1(self, client: Gradient) -> None: load_balancer = client.gpu_droplets.load_balancers.update( @@ -332,7 +332,7 @@ def test_method_update_overload_1(self, client: Gradient) -> None: ) assert_matches_type(LoadBalancerUpdateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params_overload_1(self, client: Gradient) -> None: load_balancer = client.gpu_droplets.load_balancers.update( @@ -404,7 +404,7 @@ def test_method_update_with_all_params_overload_1(self, client: Gradient) -> Non ) assert_matches_type(LoadBalancerUpdateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update_overload_1(self, client: Gradient) -> None: response = client.gpu_droplets.load_balancers.with_raw_response.update( @@ -424,7 +424,7 @@ def test_raw_response_update_overload_1(self, client: Gradient) -> None: load_balancer = response.parse() assert_matches_type(LoadBalancerUpdateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update_overload_1(self, client: Gradient) -> None: with client.gpu_droplets.load_balancers.with_streaming_response.update( @@ -446,7 +446,7 @@ def test_streaming_response_update_overload_1(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update_overload_1(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `lb_id` but received ''"): @@ -462,7 +462,7 @@ def test_path_params_update_overload_1(self, client: Gradient) -> None: ], ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_overload_2(self, client: Gradient) -> None: load_balancer = client.gpu_droplets.load_balancers.update( @@ -478,7 +478,7 @@ def test_method_update_overload_2(self, client: Gradient) -> None: ) assert_matches_type(LoadBalancerUpdateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params_overload_2(self, client: Gradient) -> None: load_balancer = client.gpu_droplets.load_balancers.update( @@ -550,7 +550,7 @@ def test_method_update_with_all_params_overload_2(self, client: Gradient) -> Non ) assert_matches_type(LoadBalancerUpdateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update_overload_2(self, client: Gradient) -> None: response = client.gpu_droplets.load_balancers.with_raw_response.update( @@ -570,7 +570,7 @@ def test_raw_response_update_overload_2(self, client: Gradient) -> None: load_balancer = response.parse() assert_matches_type(LoadBalancerUpdateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update_overload_2(self, client: Gradient) -> None: with client.gpu_droplets.load_balancers.with_streaming_response.update( @@ -592,7 +592,7 @@ def test_streaming_response_update_overload_2(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update_overload_2(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `lb_id` but received ''"): @@ -608,13 +608,13 @@ def test_path_params_update_overload_2(self, client: Gradient) -> None: ], ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: load_balancer = client.gpu_droplets.load_balancers.list() assert_matches_type(LoadBalancerListResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: load_balancer = client.gpu_droplets.load_balancers.list( @@ -623,7 +623,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(LoadBalancerListResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.gpu_droplets.load_balancers.with_raw_response.list() @@ -633,7 +633,7 @@ def test_raw_response_list(self, client: Gradient) -> None: load_balancer = response.parse() assert_matches_type(LoadBalancerListResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.gpu_droplets.load_balancers.with_streaming_response.list() as response: @@ -645,7 +645,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: load_balancer = client.gpu_droplets.load_balancers.delete( @@ -653,7 +653,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert load_balancer is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.gpu_droplets.load_balancers.with_raw_response.delete( @@ -665,7 +665,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: load_balancer = response.parse() assert load_balancer is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.gpu_droplets.load_balancers.with_streaming_response.delete( @@ -679,7 +679,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `lb_id` but received ''"): @@ -687,7 +687,7 @@ def test_path_params_delete(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_cache(self, client: Gradient) -> None: load_balancer = client.gpu_droplets.load_balancers.delete_cache( @@ -695,7 +695,7 @@ def test_method_delete_cache(self, client: Gradient) -> None: ) assert load_balancer is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete_cache(self, client: Gradient) -> None: response = client.gpu_droplets.load_balancers.with_raw_response.delete_cache( @@ -707,7 +707,7 @@ def test_raw_response_delete_cache(self, client: Gradient) -> None: load_balancer = response.parse() assert load_balancer is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete_cache(self, client: Gradient) -> None: with client.gpu_droplets.load_balancers.with_streaming_response.delete_cache( @@ -721,7 +721,7 @@ def test_streaming_response_delete_cache(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete_cache(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `lb_id` but received ''"): @@ -735,7 +735,7 @@ class TestAsyncLoadBalancers: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_overload_1(self, async_client: AsyncGradient) -> None: load_balancer = await async_client.gpu_droplets.load_balancers.create( @@ -750,7 +750,7 @@ async def test_method_create_overload_1(self, async_client: AsyncGradient) -> No ) assert_matches_type(LoadBalancerCreateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGradient) -> None: load_balancer = await async_client.gpu_droplets.load_balancers.create( @@ -821,7 +821,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn ) assert_matches_type(LoadBalancerCreateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.load_balancers.with_raw_response.create( @@ -840,7 +840,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncGradient) load_balancer = await response.parse() assert_matches_type(LoadBalancerCreateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.load_balancers.with_streaming_response.create( @@ -861,7 +861,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncGra assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_overload_2(self, async_client: AsyncGradient) -> None: load_balancer = await async_client.gpu_droplets.load_balancers.create( @@ -876,7 +876,7 @@ async def test_method_create_overload_2(self, async_client: AsyncGradient) -> No ) assert_matches_type(LoadBalancerCreateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGradient) -> None: load_balancer = await async_client.gpu_droplets.load_balancers.create( @@ -947,7 +947,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn ) assert_matches_type(LoadBalancerCreateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.load_balancers.with_raw_response.create( @@ -966,7 +966,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) load_balancer = await response.parse() assert_matches_type(LoadBalancerCreateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.load_balancers.with_streaming_response.create( @@ -987,7 +987,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGra assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: load_balancer = await async_client.gpu_droplets.load_balancers.retrieve( @@ -995,7 +995,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(LoadBalancerRetrieveResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.load_balancers.with_raw_response.retrieve( @@ -1007,7 +1007,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: load_balancer = await response.parse() assert_matches_type(LoadBalancerRetrieveResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.load_balancers.with_streaming_response.retrieve( @@ -1021,7 +1021,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `lb_id` but received ''"): @@ -1029,7 +1029,7 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_overload_1(self, async_client: AsyncGradient) -> None: load_balancer = await async_client.gpu_droplets.load_balancers.update( @@ -1045,7 +1045,7 @@ async def test_method_update_overload_1(self, async_client: AsyncGradient) -> No ) assert_matches_type(LoadBalancerUpdateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params_overload_1(self, async_client: AsyncGradient) -> None: load_balancer = await async_client.gpu_droplets.load_balancers.update( @@ -1117,7 +1117,7 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn ) assert_matches_type(LoadBalancerUpdateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.load_balancers.with_raw_response.update( @@ -1137,7 +1137,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncGradient) load_balancer = await response.parse() assert_matches_type(LoadBalancerUpdateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.load_balancers.with_streaming_response.update( @@ -1159,7 +1159,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncGra assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update_overload_1(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `lb_id` but received ''"): @@ -1175,7 +1175,7 @@ async def test_path_params_update_overload_1(self, async_client: AsyncGradient) ], ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_overload_2(self, async_client: AsyncGradient) -> None: load_balancer = await async_client.gpu_droplets.load_balancers.update( @@ -1191,7 +1191,7 @@ async def test_method_update_overload_2(self, async_client: AsyncGradient) -> No ) assert_matches_type(LoadBalancerUpdateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params_overload_2(self, async_client: AsyncGradient) -> None: load_balancer = await async_client.gpu_droplets.load_balancers.update( @@ -1263,7 +1263,7 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn ) assert_matches_type(LoadBalancerUpdateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.load_balancers.with_raw_response.update( @@ -1283,7 +1283,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncGradient) load_balancer = await response.parse() assert_matches_type(LoadBalancerUpdateResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.load_balancers.with_streaming_response.update( @@ -1305,7 +1305,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncGra assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update_overload_2(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `lb_id` but received ''"): @@ -1321,13 +1321,13 @@ async def test_path_params_update_overload_2(self, async_client: AsyncGradient) ], ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: load_balancer = await async_client.gpu_droplets.load_balancers.list() assert_matches_type(LoadBalancerListResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: load_balancer = await async_client.gpu_droplets.load_balancers.list( @@ -1336,7 +1336,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(LoadBalancerListResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.load_balancers.with_raw_response.list() @@ -1346,7 +1346,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: load_balancer = await response.parse() assert_matches_type(LoadBalancerListResponse, load_balancer, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.load_balancers.with_streaming_response.list() as response: @@ -1358,7 +1358,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: load_balancer = await async_client.gpu_droplets.load_balancers.delete( @@ -1366,7 +1366,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert load_balancer is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.load_balancers.with_raw_response.delete( @@ -1378,7 +1378,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: load_balancer = await response.parse() assert load_balancer is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.load_balancers.with_streaming_response.delete( @@ -1392,7 +1392,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `lb_id` but received ''"): @@ -1400,7 +1400,7 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_cache(self, async_client: AsyncGradient) -> None: load_balancer = await async_client.gpu_droplets.load_balancers.delete_cache( @@ -1408,7 +1408,7 @@ async def test_method_delete_cache(self, async_client: AsyncGradient) -> None: ) assert load_balancer is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete_cache(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.load_balancers.with_raw_response.delete_cache( @@ -1420,7 +1420,7 @@ async def test_raw_response_delete_cache(self, async_client: AsyncGradient) -> N load_balancer = await response.parse() assert load_balancer is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete_cache(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.load_balancers.with_streaming_response.delete_cache( @@ -1434,7 +1434,7 @@ async def test_streaming_response_delete_cache(self, async_client: AsyncGradient assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete_cache(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `lb_id` but received ''"): diff --git a/tests/api_resources/gpu_droplets/test_sizes.py b/tests/api_resources/gpu_droplets/test_sizes.py index 7fc4fe80..308694ac 100644 --- a/tests/api_resources/gpu_droplets/test_sizes.py +++ b/tests/api_resources/gpu_droplets/test_sizes.py @@ -17,13 +17,13 @@ class TestSizes: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: size = client.gpu_droplets.sizes.list() assert_matches_type(SizeListResponse, size, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: size = client.gpu_droplets.sizes.list( @@ -32,7 +32,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(SizeListResponse, size, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.gpu_droplets.sizes.with_raw_response.list() @@ -42,7 +42,7 @@ def test_raw_response_list(self, client: Gradient) -> None: size = response.parse() assert_matches_type(SizeListResponse, size, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.gpu_droplets.sizes.with_streaming_response.list() as response: @@ -60,13 +60,13 @@ class TestAsyncSizes: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: size = await async_client.gpu_droplets.sizes.list() assert_matches_type(SizeListResponse, size, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: size = await async_client.gpu_droplets.sizes.list( @@ -75,7 +75,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(SizeListResponse, size, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.sizes.with_raw_response.list() @@ -85,7 +85,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: size = await response.parse() assert_matches_type(SizeListResponse, size, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.sizes.with_streaming_response.list() as response: diff --git a/tests/api_resources/gpu_droplets/test_snapshots.py b/tests/api_resources/gpu_droplets/test_snapshots.py index 5f8da45a..ca4d146f 100644 --- a/tests/api_resources/gpu_droplets/test_snapshots.py +++ b/tests/api_resources/gpu_droplets/test_snapshots.py @@ -17,7 +17,7 @@ class TestSnapshots: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: snapshot = client.gpu_droplets.snapshots.retrieve( @@ -25,7 +25,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.gpu_droplets.snapshots.with_raw_response.retrieve( @@ -37,7 +37,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: snapshot = response.parse() assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.gpu_droplets.snapshots.with_streaming_response.retrieve( @@ -51,13 +51,13 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: snapshot = client.gpu_droplets.snapshots.list() assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: snapshot = client.gpu_droplets.snapshots.list( @@ -67,7 +67,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.gpu_droplets.snapshots.with_raw_response.list() @@ -77,7 +77,7 @@ def test_raw_response_list(self, client: Gradient) -> None: snapshot = response.parse() assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.gpu_droplets.snapshots.with_streaming_response.list() as response: @@ -89,7 +89,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: snapshot = client.gpu_droplets.snapshots.delete( @@ -97,7 +97,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert snapshot is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.gpu_droplets.snapshots.with_raw_response.delete( @@ -109,7 +109,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: snapshot = response.parse() assert snapshot is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.gpu_droplets.snapshots.with_streaming_response.delete( @@ -129,7 +129,7 @@ class TestAsyncSnapshots: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: snapshot = await async_client.gpu_droplets.snapshots.retrieve( @@ -137,7 +137,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.snapshots.with_raw_response.retrieve( @@ -149,7 +149,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: snapshot = await response.parse() assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.snapshots.with_streaming_response.retrieve( @@ -163,13 +163,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: snapshot = await async_client.gpu_droplets.snapshots.list() assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: snapshot = await async_client.gpu_droplets.snapshots.list( @@ -179,7 +179,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.snapshots.with_raw_response.list() @@ -189,7 +189,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: snapshot = await response.parse() assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.snapshots.with_streaming_response.list() as response: @@ -201,7 +201,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: snapshot = await async_client.gpu_droplets.snapshots.delete( @@ -209,7 +209,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert snapshot is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.snapshots.with_raw_response.delete( @@ -221,7 +221,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: snapshot = await response.parse() assert snapshot is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.snapshots.with_streaming_response.delete( diff --git a/tests/api_resources/gpu_droplets/test_volumes.py b/tests/api_resources/gpu_droplets/test_volumes.py index 8243625d..c0d83f63 100644 --- a/tests/api_resources/gpu_droplets/test_volumes.py +++ b/tests/api_resources/gpu_droplets/test_volumes.py @@ -21,7 +21,7 @@ class TestVolumes: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_overload_1(self, client: Gradient) -> None: volume = client.gpu_droplets.volumes.create( @@ -31,7 +31,7 @@ def test_method_create_overload_1(self, client: Gradient) -> None: ) assert_matches_type(VolumeCreateResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params_overload_1(self, client: Gradient) -> None: volume = client.gpu_droplets.volumes.create( @@ -46,7 +46,7 @@ def test_method_create_with_all_params_overload_1(self, client: Gradient) -> Non ) assert_matches_type(VolumeCreateResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_overload_1(self, client: Gradient) -> None: response = client.gpu_droplets.volumes.with_raw_response.create( @@ -60,7 +60,7 @@ def test_raw_response_create_overload_1(self, client: Gradient) -> None: volume = response.parse() assert_matches_type(VolumeCreateResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_overload_1(self, client: Gradient) -> None: with client.gpu_droplets.volumes.with_streaming_response.create( @@ -76,7 +76,7 @@ def test_streaming_response_create_overload_1(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_overload_2(self, client: Gradient) -> None: volume = client.gpu_droplets.volumes.create( @@ -86,7 +86,7 @@ def test_method_create_overload_2(self, client: Gradient) -> None: ) assert_matches_type(VolumeCreateResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params_overload_2(self, client: Gradient) -> None: volume = client.gpu_droplets.volumes.create( @@ -101,7 +101,7 @@ def test_method_create_with_all_params_overload_2(self, client: Gradient) -> Non ) assert_matches_type(VolumeCreateResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_overload_2(self, client: Gradient) -> None: response = client.gpu_droplets.volumes.with_raw_response.create( @@ -115,7 +115,7 @@ def test_raw_response_create_overload_2(self, client: Gradient) -> None: volume = response.parse() assert_matches_type(VolumeCreateResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_overload_2(self, client: Gradient) -> None: with client.gpu_droplets.volumes.with_streaming_response.create( @@ -131,7 +131,7 @@ def test_streaming_response_create_overload_2(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: volume = client.gpu_droplets.volumes.retrieve( @@ -139,7 +139,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(VolumeRetrieveResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.gpu_droplets.volumes.with_raw_response.retrieve( @@ -151,7 +151,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: volume = response.parse() assert_matches_type(VolumeRetrieveResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.gpu_droplets.volumes.with_streaming_response.retrieve( @@ -165,7 +165,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `volume_id` but received ''"): @@ -173,13 +173,13 @@ def test_path_params_retrieve(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: volume = client.gpu_droplets.volumes.list() assert_matches_type(VolumeListResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: volume = client.gpu_droplets.volumes.list( @@ -190,7 +190,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(VolumeListResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.gpu_droplets.volumes.with_raw_response.list() @@ -200,7 +200,7 @@ def test_raw_response_list(self, client: Gradient) -> None: volume = response.parse() assert_matches_type(VolumeListResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.gpu_droplets.volumes.with_streaming_response.list() as response: @@ -212,7 +212,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: volume = client.gpu_droplets.volumes.delete( @@ -220,7 +220,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert volume is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.gpu_droplets.volumes.with_raw_response.delete( @@ -232,7 +232,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: volume = response.parse() assert volume is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.gpu_droplets.volumes.with_streaming_response.delete( @@ -246,7 +246,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `volume_id` but received ''"): @@ -254,13 +254,13 @@ def test_path_params_delete(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_by_name(self, client: Gradient) -> None: volume = client.gpu_droplets.volumes.delete_by_name() assert volume is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_by_name_with_all_params(self, client: Gradient) -> None: volume = client.gpu_droplets.volumes.delete_by_name( @@ -269,7 +269,7 @@ def test_method_delete_by_name_with_all_params(self, client: Gradient) -> None: ) assert volume is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete_by_name(self, client: Gradient) -> None: response = client.gpu_droplets.volumes.with_raw_response.delete_by_name() @@ -279,7 +279,7 @@ def test_raw_response_delete_by_name(self, client: Gradient) -> None: volume = response.parse() assert volume is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete_by_name(self, client: Gradient) -> None: with client.gpu_droplets.volumes.with_streaming_response.delete_by_name() as response: @@ -297,7 +297,7 @@ class TestAsyncVolumes: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_overload_1(self, async_client: AsyncGradient) -> None: volume = await async_client.gpu_droplets.volumes.create( @@ -307,7 +307,7 @@ async def test_method_create_overload_1(self, async_client: AsyncGradient) -> No ) assert_matches_type(VolumeCreateResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGradient) -> None: volume = await async_client.gpu_droplets.volumes.create( @@ -322,7 +322,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn ) assert_matches_type(VolumeCreateResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.volumes.with_raw_response.create( @@ -336,7 +336,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncGradient) volume = await response.parse() assert_matches_type(VolumeCreateResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.volumes.with_streaming_response.create( @@ -352,7 +352,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncGra assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_overload_2(self, async_client: AsyncGradient) -> None: volume = await async_client.gpu_droplets.volumes.create( @@ -362,7 +362,7 @@ async def test_method_create_overload_2(self, async_client: AsyncGradient) -> No ) assert_matches_type(VolumeCreateResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGradient) -> None: volume = await async_client.gpu_droplets.volumes.create( @@ -377,7 +377,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn ) assert_matches_type(VolumeCreateResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.volumes.with_raw_response.create( @@ -391,7 +391,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) volume = await response.parse() assert_matches_type(VolumeCreateResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.volumes.with_streaming_response.create( @@ -407,7 +407,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGra assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: volume = await async_client.gpu_droplets.volumes.retrieve( @@ -415,7 +415,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(VolumeRetrieveResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.volumes.with_raw_response.retrieve( @@ -427,7 +427,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: volume = await response.parse() assert_matches_type(VolumeRetrieveResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.volumes.with_streaming_response.retrieve( @@ -441,7 +441,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `volume_id` but received ''"): @@ -449,13 +449,13 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: volume = await async_client.gpu_droplets.volumes.list() assert_matches_type(VolumeListResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: volume = await async_client.gpu_droplets.volumes.list( @@ -466,7 +466,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(VolumeListResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.volumes.with_raw_response.list() @@ -476,7 +476,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: volume = await response.parse() assert_matches_type(VolumeListResponse, volume, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.volumes.with_streaming_response.list() as response: @@ -488,7 +488,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: volume = await async_client.gpu_droplets.volumes.delete( @@ -496,7 +496,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert volume is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.volumes.with_raw_response.delete( @@ -508,7 +508,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: volume = await response.parse() assert volume is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.volumes.with_streaming_response.delete( @@ -522,7 +522,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `volume_id` but received ''"): @@ -530,13 +530,13 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_by_name(self, async_client: AsyncGradient) -> None: volume = await async_client.gpu_droplets.volumes.delete_by_name() assert volume is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_by_name_with_all_params(self, async_client: AsyncGradient) -> None: volume = await async_client.gpu_droplets.volumes.delete_by_name( @@ -545,7 +545,7 @@ async def test_method_delete_by_name_with_all_params(self, async_client: AsyncGr ) assert volume is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete_by_name(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.volumes.with_raw_response.delete_by_name() @@ -555,7 +555,7 @@ async def test_raw_response_delete_by_name(self, async_client: AsyncGradient) -> volume = await response.parse() assert volume is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete_by_name(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.volumes.with_streaming_response.delete_by_name() as response: diff --git a/tests/api_resources/gpu_droplets/volumes/test_actions.py b/tests/api_resources/gpu_droplets/volumes/test_actions.py index 7159db48..f1bb3a21 100644 --- a/tests/api_resources/gpu_droplets/volumes/test_actions.py +++ b/tests/api_resources/gpu_droplets/volumes/test_actions.py @@ -22,7 +22,7 @@ class TestActions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: action = client.gpu_droplets.volumes.actions.retrieve( @@ -31,7 +31,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(ActionRetrieveResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_with_all_params(self, client: Gradient) -> None: action = client.gpu_droplets.volumes.actions.retrieve( @@ -42,7 +42,7 @@ def test_method_retrieve_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(ActionRetrieveResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.gpu_droplets.volumes.actions.with_raw_response.retrieve( @@ -55,7 +55,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionRetrieveResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.gpu_droplets.volumes.actions.with_streaming_response.retrieve( @@ -70,7 +70,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `volume_id` but received ''"): @@ -79,7 +79,7 @@ def test_path_params_retrieve(self, client: Gradient) -> None: volume_id="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: action = client.gpu_droplets.volumes.actions.list( @@ -87,7 +87,7 @@ def test_method_list(self, client: Gradient) -> None: ) assert_matches_type(ActionListResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: action = client.gpu_droplets.volumes.actions.list( @@ -97,7 +97,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(ActionListResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.gpu_droplets.volumes.actions.with_raw_response.list( @@ -109,7 +109,7 @@ def test_raw_response_list(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionListResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.gpu_droplets.volumes.actions.with_streaming_response.list( @@ -123,7 +123,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_list(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `volume_id` but received ''"): @@ -131,7 +131,7 @@ def test_path_params_list(self, client: Gradient) -> None: volume_id="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_by_id_overload_1(self, client: Gradient) -> None: action = client.gpu_droplets.volumes.actions.initiate_by_id( @@ -141,7 +141,7 @@ def test_method_initiate_by_id_overload_1(self, client: Gradient) -> None: ) assert_matches_type(ActionInitiateByIDResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_by_id_with_all_params_overload_1(self, client: Gradient) -> None: action = client.gpu_droplets.volumes.actions.initiate_by_id( @@ -155,7 +155,7 @@ def test_method_initiate_by_id_with_all_params_overload_1(self, client: Gradient ) assert_matches_type(ActionInitiateByIDResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_initiate_by_id_overload_1(self, client: Gradient) -> None: response = client.gpu_droplets.volumes.actions.with_raw_response.initiate_by_id( @@ -169,7 +169,7 @@ def test_raw_response_initiate_by_id_overload_1(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionInitiateByIDResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_initiate_by_id_overload_1(self, client: Gradient) -> None: with client.gpu_droplets.volumes.actions.with_streaming_response.initiate_by_id( @@ -185,7 +185,7 @@ def test_streaming_response_initiate_by_id_overload_1(self, client: Gradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_initiate_by_id_overload_1(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `volume_id` but received ''"): @@ -195,7 +195,7 @@ def test_path_params_initiate_by_id_overload_1(self, client: Gradient) -> None: type="attach", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_by_id_overload_2(self, client: Gradient) -> None: action = client.gpu_droplets.volumes.actions.initiate_by_id( @@ -205,7 +205,7 @@ def test_method_initiate_by_id_overload_2(self, client: Gradient) -> None: ) assert_matches_type(ActionInitiateByIDResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_by_id_with_all_params_overload_2(self, client: Gradient) -> None: action = client.gpu_droplets.volumes.actions.initiate_by_id( @@ -218,7 +218,7 @@ def test_method_initiate_by_id_with_all_params_overload_2(self, client: Gradient ) assert_matches_type(ActionInitiateByIDResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_initiate_by_id_overload_2(self, client: Gradient) -> None: response = client.gpu_droplets.volumes.actions.with_raw_response.initiate_by_id( @@ -232,7 +232,7 @@ def test_raw_response_initiate_by_id_overload_2(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionInitiateByIDResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_initiate_by_id_overload_2(self, client: Gradient) -> None: with client.gpu_droplets.volumes.actions.with_streaming_response.initiate_by_id( @@ -248,7 +248,7 @@ def test_streaming_response_initiate_by_id_overload_2(self, client: Gradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_initiate_by_id_overload_2(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `volume_id` but received ''"): @@ -258,7 +258,7 @@ def test_path_params_initiate_by_id_overload_2(self, client: Gradient) -> None: type="attach", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_by_id_overload_3(self, client: Gradient) -> None: action = client.gpu_droplets.volumes.actions.initiate_by_id( @@ -268,7 +268,7 @@ def test_method_initiate_by_id_overload_3(self, client: Gradient) -> None: ) assert_matches_type(ActionInitiateByIDResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_by_id_with_all_params_overload_3(self, client: Gradient) -> None: action = client.gpu_droplets.volumes.actions.initiate_by_id( @@ -281,7 +281,7 @@ def test_method_initiate_by_id_with_all_params_overload_3(self, client: Gradient ) assert_matches_type(ActionInitiateByIDResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_initiate_by_id_overload_3(self, client: Gradient) -> None: response = client.gpu_droplets.volumes.actions.with_raw_response.initiate_by_id( @@ -295,7 +295,7 @@ def test_raw_response_initiate_by_id_overload_3(self, client: Gradient) -> None: action = response.parse() assert_matches_type(ActionInitiateByIDResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_initiate_by_id_overload_3(self, client: Gradient) -> None: with client.gpu_droplets.volumes.actions.with_streaming_response.initiate_by_id( @@ -311,7 +311,7 @@ def test_streaming_response_initiate_by_id_overload_3(self, client: Gradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_initiate_by_id_overload_3(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `volume_id` but received ''"): @@ -321,7 +321,7 @@ def test_path_params_initiate_by_id_overload_3(self, client: Gradient) -> None: type="attach", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_by_name_overload_1(self, client: Gradient) -> None: action = client.gpu_droplets.volumes.actions.initiate_by_name( @@ -330,7 +330,7 @@ def test_method_initiate_by_name_overload_1(self, client: Gradient) -> None: ) assert_matches_type(ActionInitiateByNameResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_by_name_with_all_params_overload_1(self, client: Gradient) -> None: action = client.gpu_droplets.volumes.actions.initiate_by_name( @@ -343,7 +343,7 @@ def test_method_initiate_by_name_with_all_params_overload_1(self, client: Gradie ) assert_matches_type(ActionInitiateByNameResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_initiate_by_name_overload_1(self, client: Gradient) -> None: response = client.gpu_droplets.volumes.actions.with_raw_response.initiate_by_name( @@ -356,7 +356,7 @@ def test_raw_response_initiate_by_name_overload_1(self, client: Gradient) -> Non action = response.parse() assert_matches_type(ActionInitiateByNameResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_initiate_by_name_overload_1(self, client: Gradient) -> None: with client.gpu_droplets.volumes.actions.with_streaming_response.initiate_by_name( @@ -371,7 +371,7 @@ def test_streaming_response_initiate_by_name_overload_1(self, client: Gradient) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_by_name_overload_2(self, client: Gradient) -> None: action = client.gpu_droplets.volumes.actions.initiate_by_name( @@ -380,7 +380,7 @@ def test_method_initiate_by_name_overload_2(self, client: Gradient) -> None: ) assert_matches_type(ActionInitiateByNameResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_by_name_with_all_params_overload_2(self, client: Gradient) -> None: action = client.gpu_droplets.volumes.actions.initiate_by_name( @@ -392,7 +392,7 @@ def test_method_initiate_by_name_with_all_params_overload_2(self, client: Gradie ) assert_matches_type(ActionInitiateByNameResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_initiate_by_name_overload_2(self, client: Gradient) -> None: response = client.gpu_droplets.volumes.actions.with_raw_response.initiate_by_name( @@ -405,7 +405,7 @@ def test_raw_response_initiate_by_name_overload_2(self, client: Gradient) -> Non action = response.parse() assert_matches_type(ActionInitiateByNameResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_initiate_by_name_overload_2(self, client: Gradient) -> None: with client.gpu_droplets.volumes.actions.with_streaming_response.initiate_by_name( @@ -426,7 +426,7 @@ class TestAsyncActions: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.volumes.actions.retrieve( @@ -435,7 +435,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(ActionRetrieveResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_with_all_params(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.volumes.actions.retrieve( @@ -446,7 +446,7 @@ async def test_method_retrieve_with_all_params(self, async_client: AsyncGradient ) assert_matches_type(ActionRetrieveResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.volumes.actions.with_raw_response.retrieve( @@ -459,7 +459,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: action = await response.parse() assert_matches_type(ActionRetrieveResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.volumes.actions.with_streaming_response.retrieve( @@ -474,7 +474,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `volume_id` but received ''"): @@ -483,7 +483,7 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: volume_id="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.volumes.actions.list( @@ -491,7 +491,7 @@ async def test_method_list(self, async_client: AsyncGradient) -> None: ) assert_matches_type(ActionListResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.volumes.actions.list( @@ -501,7 +501,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(ActionListResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.volumes.actions.with_raw_response.list( @@ -513,7 +513,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: action = await response.parse() assert_matches_type(ActionListResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.volumes.actions.with_streaming_response.list( @@ -527,7 +527,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_list(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `volume_id` but received ''"): @@ -535,7 +535,7 @@ async def test_path_params_list(self, async_client: AsyncGradient) -> None: volume_id="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_by_id_overload_1(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.volumes.actions.initiate_by_id( @@ -545,7 +545,7 @@ async def test_method_initiate_by_id_overload_1(self, async_client: AsyncGradien ) assert_matches_type(ActionInitiateByIDResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_by_id_with_all_params_overload_1(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.volumes.actions.initiate_by_id( @@ -559,7 +559,7 @@ async def test_method_initiate_by_id_with_all_params_overload_1(self, async_clie ) assert_matches_type(ActionInitiateByIDResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_initiate_by_id_overload_1(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.volumes.actions.with_raw_response.initiate_by_id( @@ -573,7 +573,7 @@ async def test_raw_response_initiate_by_id_overload_1(self, async_client: AsyncG action = await response.parse() assert_matches_type(ActionInitiateByIDResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_initiate_by_id_overload_1(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.volumes.actions.with_streaming_response.initiate_by_id( @@ -589,7 +589,7 @@ async def test_streaming_response_initiate_by_id_overload_1(self, async_client: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_initiate_by_id_overload_1(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `volume_id` but received ''"): @@ -599,7 +599,7 @@ async def test_path_params_initiate_by_id_overload_1(self, async_client: AsyncGr type="attach", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_by_id_overload_2(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.volumes.actions.initiate_by_id( @@ -609,7 +609,7 @@ async def test_method_initiate_by_id_overload_2(self, async_client: AsyncGradien ) assert_matches_type(ActionInitiateByIDResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_by_id_with_all_params_overload_2(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.volumes.actions.initiate_by_id( @@ -622,7 +622,7 @@ async def test_method_initiate_by_id_with_all_params_overload_2(self, async_clie ) assert_matches_type(ActionInitiateByIDResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_initiate_by_id_overload_2(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.volumes.actions.with_raw_response.initiate_by_id( @@ -636,7 +636,7 @@ async def test_raw_response_initiate_by_id_overload_2(self, async_client: AsyncG action = await response.parse() assert_matches_type(ActionInitiateByIDResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_initiate_by_id_overload_2(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.volumes.actions.with_streaming_response.initiate_by_id( @@ -652,7 +652,7 @@ async def test_streaming_response_initiate_by_id_overload_2(self, async_client: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_initiate_by_id_overload_2(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `volume_id` but received ''"): @@ -662,7 +662,7 @@ async def test_path_params_initiate_by_id_overload_2(self, async_client: AsyncGr type="attach", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_by_id_overload_3(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.volumes.actions.initiate_by_id( @@ -672,7 +672,7 @@ async def test_method_initiate_by_id_overload_3(self, async_client: AsyncGradien ) assert_matches_type(ActionInitiateByIDResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_by_id_with_all_params_overload_3(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.volumes.actions.initiate_by_id( @@ -685,7 +685,7 @@ async def test_method_initiate_by_id_with_all_params_overload_3(self, async_clie ) assert_matches_type(ActionInitiateByIDResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_initiate_by_id_overload_3(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.volumes.actions.with_raw_response.initiate_by_id( @@ -699,7 +699,7 @@ async def test_raw_response_initiate_by_id_overload_3(self, async_client: AsyncG action = await response.parse() assert_matches_type(ActionInitiateByIDResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_initiate_by_id_overload_3(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.volumes.actions.with_streaming_response.initiate_by_id( @@ -715,7 +715,7 @@ async def test_streaming_response_initiate_by_id_overload_3(self, async_client: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_initiate_by_id_overload_3(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `volume_id` but received ''"): @@ -725,7 +725,7 @@ async def test_path_params_initiate_by_id_overload_3(self, async_client: AsyncGr type="attach", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_by_name_overload_1(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.volumes.actions.initiate_by_name( @@ -734,7 +734,7 @@ async def test_method_initiate_by_name_overload_1(self, async_client: AsyncGradi ) assert_matches_type(ActionInitiateByNameResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_by_name_with_all_params_overload_1(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.volumes.actions.initiate_by_name( @@ -747,7 +747,7 @@ async def test_method_initiate_by_name_with_all_params_overload_1(self, async_cl ) assert_matches_type(ActionInitiateByNameResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_initiate_by_name_overload_1(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.volumes.actions.with_raw_response.initiate_by_name( @@ -760,7 +760,7 @@ async def test_raw_response_initiate_by_name_overload_1(self, async_client: Asyn action = await response.parse() assert_matches_type(ActionInitiateByNameResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_initiate_by_name_overload_1(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.volumes.actions.with_streaming_response.initiate_by_name( @@ -775,7 +775,7 @@ async def test_streaming_response_initiate_by_name_overload_1(self, async_client assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_by_name_overload_2(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.volumes.actions.initiate_by_name( @@ -784,7 +784,7 @@ async def test_method_initiate_by_name_overload_2(self, async_client: AsyncGradi ) assert_matches_type(ActionInitiateByNameResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_by_name_with_all_params_overload_2(self, async_client: AsyncGradient) -> None: action = await async_client.gpu_droplets.volumes.actions.initiate_by_name( @@ -796,7 +796,7 @@ async def test_method_initiate_by_name_with_all_params_overload_2(self, async_cl ) assert_matches_type(ActionInitiateByNameResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_initiate_by_name_overload_2(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.volumes.actions.with_raw_response.initiate_by_name( @@ -809,7 +809,7 @@ async def test_raw_response_initiate_by_name_overload_2(self, async_client: Asyn action = await response.parse() assert_matches_type(ActionInitiateByNameResponse, action, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_initiate_by_name_overload_2(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.volumes.actions.with_streaming_response.initiate_by_name( diff --git a/tests/api_resources/gpu_droplets/volumes/test_snapshots.py b/tests/api_resources/gpu_droplets/volumes/test_snapshots.py index ec157513..ae47fc90 100644 --- a/tests/api_resources/gpu_droplets/volumes/test_snapshots.py +++ b/tests/api_resources/gpu_droplets/volumes/test_snapshots.py @@ -21,7 +21,7 @@ class TestSnapshots: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: snapshot = client.gpu_droplets.volumes.snapshots.create( @@ -30,7 +30,7 @@ def test_method_create(self, client: Gradient) -> None: ) assert_matches_type(SnapshotCreateResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: snapshot = client.gpu_droplets.volumes.snapshots.create( @@ -40,7 +40,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(SnapshotCreateResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.gpu_droplets.volumes.snapshots.with_raw_response.create( @@ -53,7 +53,7 @@ def test_raw_response_create(self, client: Gradient) -> None: snapshot = response.parse() assert_matches_type(SnapshotCreateResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.gpu_droplets.volumes.snapshots.with_streaming_response.create( @@ -68,7 +68,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_create(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `volume_id` but received ''"): @@ -77,7 +77,7 @@ def test_path_params_create(self, client: Gradient) -> None: name="big-data-snapshot1475261774", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: snapshot = client.gpu_droplets.volumes.snapshots.retrieve( @@ -85,7 +85,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.gpu_droplets.volumes.snapshots.with_raw_response.retrieve( @@ -97,7 +97,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: snapshot = response.parse() assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.gpu_droplets.volumes.snapshots.with_streaming_response.retrieve( @@ -111,7 +111,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `snapshot_id` but received ''"): @@ -119,7 +119,7 @@ def test_path_params_retrieve(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: snapshot = client.gpu_droplets.volumes.snapshots.list( @@ -127,7 +127,7 @@ def test_method_list(self, client: Gradient) -> None: ) assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: snapshot = client.gpu_droplets.volumes.snapshots.list( @@ -137,7 +137,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.gpu_droplets.volumes.snapshots.with_raw_response.list( @@ -149,7 +149,7 @@ def test_raw_response_list(self, client: Gradient) -> None: snapshot = response.parse() assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.gpu_droplets.volumes.snapshots.with_streaming_response.list( @@ -163,7 +163,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_list(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `volume_id` but received ''"): @@ -171,7 +171,7 @@ def test_path_params_list(self, client: Gradient) -> None: volume_id="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: snapshot = client.gpu_droplets.volumes.snapshots.delete( @@ -179,7 +179,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert snapshot is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.gpu_droplets.volumes.snapshots.with_raw_response.delete( @@ -191,7 +191,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: snapshot = response.parse() assert snapshot is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.gpu_droplets.volumes.snapshots.with_streaming_response.delete( @@ -205,7 +205,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `snapshot_id` but received ''"): @@ -219,7 +219,7 @@ class TestAsyncSnapshots: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: snapshot = await async_client.gpu_droplets.volumes.snapshots.create( @@ -228,7 +228,7 @@ async def test_method_create(self, async_client: AsyncGradient) -> None: ) assert_matches_type(SnapshotCreateResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: snapshot = await async_client.gpu_droplets.volumes.snapshots.create( @@ -238,7 +238,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(SnapshotCreateResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.volumes.snapshots.with_raw_response.create( @@ -251,7 +251,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: snapshot = await response.parse() assert_matches_type(SnapshotCreateResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.volumes.snapshots.with_streaming_response.create( @@ -266,7 +266,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_create(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `volume_id` but received ''"): @@ -275,7 +275,7 @@ async def test_path_params_create(self, async_client: AsyncGradient) -> None: name="big-data-snapshot1475261774", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: snapshot = await async_client.gpu_droplets.volumes.snapshots.retrieve( @@ -283,7 +283,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.volumes.snapshots.with_raw_response.retrieve( @@ -295,7 +295,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: snapshot = await response.parse() assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.volumes.snapshots.with_streaming_response.retrieve( @@ -309,7 +309,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `snapshot_id` but received ''"): @@ -317,7 +317,7 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: snapshot = await async_client.gpu_droplets.volumes.snapshots.list( @@ -325,7 +325,7 @@ async def test_method_list(self, async_client: AsyncGradient) -> None: ) assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: snapshot = await async_client.gpu_droplets.volumes.snapshots.list( @@ -335,7 +335,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.volumes.snapshots.with_raw_response.list( @@ -347,7 +347,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: snapshot = await response.parse() assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.volumes.snapshots.with_streaming_response.list( @@ -361,7 +361,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_list(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `volume_id` but received ''"): @@ -369,7 +369,7 @@ async def test_path_params_list(self, async_client: AsyncGradient) -> None: volume_id="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: snapshot = await async_client.gpu_droplets.volumes.snapshots.delete( @@ -377,7 +377,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert snapshot is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.volumes.snapshots.with_raw_response.delete( @@ -389,7 +389,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: snapshot = await response.parse() assert snapshot is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.volumes.snapshots.with_streaming_response.delete( @@ -403,7 +403,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `snapshot_id` but received ''"): diff --git a/tests/api_resources/inference/test_api_keys.py b/tests/api_resources/inference/test_api_keys.py index 0bbfa00f..99a9e553 100644 --- a/tests/api_resources/inference/test_api_keys.py +++ b/tests/api_resources/inference/test_api_keys.py @@ -23,13 +23,13 @@ class TestAPIKeys: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: api_key = client.inference.api_keys.create() assert_matches_type(APIKeyCreateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: api_key = client.inference.api_keys.create( @@ -37,7 +37,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(APIKeyCreateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.inference.api_keys.with_raw_response.create() @@ -47,7 +47,7 @@ def test_raw_response_create(self, client: Gradient) -> None: api_key = response.parse() assert_matches_type(APIKeyCreateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.inference.api_keys.with_streaming_response.create() as response: @@ -59,7 +59,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gradient) -> None: api_key = client.inference.api_keys.update( @@ -67,7 +67,7 @@ def test_method_update(self, client: Gradient) -> None: ) assert_matches_type(APIKeyUpdateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gradient) -> None: api_key = client.inference.api_keys.update( @@ -77,7 +77,7 @@ def test_method_update_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(APIKeyUpdateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gradient) -> None: response = client.inference.api_keys.with_raw_response.update( @@ -89,7 +89,7 @@ def test_raw_response_update(self, client: Gradient) -> None: api_key = response.parse() assert_matches_type(APIKeyUpdateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gradient) -> None: with client.inference.api_keys.with_streaming_response.update( @@ -103,7 +103,7 @@ def test_streaming_response_update(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_api_key_uuid` but received ''"): @@ -111,13 +111,13 @@ def test_path_params_update(self, client: Gradient) -> None: path_api_key_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: api_key = client.inference.api_keys.list() assert_matches_type(APIKeyListResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: api_key = client.inference.api_keys.list( @@ -126,7 +126,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(APIKeyListResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.inference.api_keys.with_raw_response.list() @@ -136,7 +136,7 @@ def test_raw_response_list(self, client: Gradient) -> None: api_key = response.parse() assert_matches_type(APIKeyListResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.inference.api_keys.with_streaming_response.list() as response: @@ -148,7 +148,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: api_key = client.inference.api_keys.delete( @@ -156,7 +156,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert_matches_type(APIKeyDeleteResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.inference.api_keys.with_raw_response.delete( @@ -168,7 +168,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: api_key = response.parse() assert_matches_type(APIKeyDeleteResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.inference.api_keys.with_streaming_response.delete( @@ -182,7 +182,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_uuid` but received ''"): @@ -190,7 +190,7 @@ def test_path_params_delete(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_regenerate(self, client: Gradient) -> None: api_key = client.inference.api_keys.update_regenerate( @@ -198,7 +198,7 @@ def test_method_update_regenerate(self, client: Gradient) -> None: ) assert_matches_type(APIKeyUpdateRegenerateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update_regenerate(self, client: Gradient) -> None: response = client.inference.api_keys.with_raw_response.update_regenerate( @@ -210,7 +210,7 @@ def test_raw_response_update_regenerate(self, client: Gradient) -> None: api_key = response.parse() assert_matches_type(APIKeyUpdateRegenerateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update_regenerate(self, client: Gradient) -> None: with client.inference.api_keys.with_streaming_response.update_regenerate( @@ -224,7 +224,7 @@ def test_streaming_response_update_regenerate(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update_regenerate(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_uuid` but received ''"): @@ -238,13 +238,13 @@ class TestAsyncAPIKeys: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: api_key = await async_client.inference.api_keys.create() assert_matches_type(APIKeyCreateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: api_key = await async_client.inference.api_keys.create( @@ -252,7 +252,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(APIKeyCreateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.inference.api_keys.with_raw_response.create() @@ -262,7 +262,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: api_key = await response.parse() assert_matches_type(APIKeyCreateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with async_client.inference.api_keys.with_streaming_response.create() as response: @@ -274,7 +274,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGradient) -> None: api_key = await async_client.inference.api_keys.update( @@ -282,7 +282,7 @@ async def test_method_update(self, async_client: AsyncGradient) -> None: ) assert_matches_type(APIKeyUpdateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGradient) -> None: api_key = await async_client.inference.api_keys.update( @@ -292,7 +292,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(APIKeyUpdateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGradient) -> None: response = await async_client.inference.api_keys.with_raw_response.update( @@ -304,7 +304,7 @@ async def test_raw_response_update(self, async_client: AsyncGradient) -> None: api_key = await response.parse() assert_matches_type(APIKeyUpdateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGradient) -> None: async with async_client.inference.api_keys.with_streaming_response.update( @@ -318,7 +318,7 @@ async def test_streaming_response_update(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_api_key_uuid` but received ''"): @@ -326,13 +326,13 @@ async def test_path_params_update(self, async_client: AsyncGradient) -> None: path_api_key_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: api_key = await async_client.inference.api_keys.list() assert_matches_type(APIKeyListResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: api_key = await async_client.inference.api_keys.list( @@ -341,7 +341,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(APIKeyListResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.inference.api_keys.with_raw_response.list() @@ -351,7 +351,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: api_key = await response.parse() assert_matches_type(APIKeyListResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.inference.api_keys.with_streaming_response.list() as response: @@ -363,7 +363,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: api_key = await async_client.inference.api_keys.delete( @@ -371,7 +371,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert_matches_type(APIKeyDeleteResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.inference.api_keys.with_raw_response.delete( @@ -383,7 +383,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: api_key = await response.parse() assert_matches_type(APIKeyDeleteResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.inference.api_keys.with_streaming_response.delete( @@ -397,7 +397,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_uuid` but received ''"): @@ -405,7 +405,7 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_regenerate(self, async_client: AsyncGradient) -> None: api_key = await async_client.inference.api_keys.update_regenerate( @@ -413,7 +413,7 @@ async def test_method_update_regenerate(self, async_client: AsyncGradient) -> No ) assert_matches_type(APIKeyUpdateRegenerateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update_regenerate(self, async_client: AsyncGradient) -> None: response = await async_client.inference.api_keys.with_raw_response.update_regenerate( @@ -425,7 +425,7 @@ async def test_raw_response_update_regenerate(self, async_client: AsyncGradient) api_key = await response.parse() assert_matches_type(APIKeyUpdateRegenerateResponse, api_key, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update_regenerate(self, async_client: AsyncGradient) -> None: async with async_client.inference.api_keys.with_streaming_response.update_regenerate( @@ -439,7 +439,7 @@ async def test_streaming_response_update_regenerate(self, async_client: AsyncGra assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update_regenerate(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_uuid` but received ''"): diff --git a/tests/api_resources/knowledge_bases/test_data_sources.py b/tests/api_resources/knowledge_bases/test_data_sources.py index d28fd409..e8f430b4 100644 --- a/tests/api_resources/knowledge_bases/test_data_sources.py +++ b/tests/api_resources/knowledge_bases/test_data_sources.py @@ -23,7 +23,7 @@ class TestDataSources: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: data_source = client.knowledge_bases.data_sources.create( @@ -31,7 +31,7 @@ def test_method_create(self, client: Gradient) -> None: ) assert_matches_type(DataSourceCreateResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: data_source = client.knowledge_bases.data_sources.create( @@ -65,7 +65,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(DataSourceCreateResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.knowledge_bases.data_sources.with_raw_response.create( @@ -77,7 +77,7 @@ def test_raw_response_create(self, client: Gradient) -> None: data_source = response.parse() assert_matches_type(DataSourceCreateResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.knowledge_bases.data_sources.with_streaming_response.create( @@ -91,7 +91,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_create(self, client: Gradient) -> None: with pytest.raises( @@ -101,7 +101,7 @@ def test_path_params_create(self, client: Gradient) -> None: path_knowledge_base_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gradient) -> None: data_source = client.knowledge_bases.data_sources.update( @@ -110,7 +110,7 @@ def test_method_update(self, client: Gradient) -> None: ) assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gradient) -> None: data_source = client.knowledge_bases.data_sources.update( @@ -128,7 +128,7 @@ def test_method_update_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gradient) -> None: response = client.knowledge_bases.data_sources.with_raw_response.update( @@ -141,7 +141,7 @@ def test_raw_response_update(self, client: Gradient) -> None: data_source = response.parse() assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gradient) -> None: with client.knowledge_bases.data_sources.with_streaming_response.update( @@ -156,7 +156,7 @@ def test_streaming_response_update(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update(self, client: Gradient) -> None: with pytest.raises( @@ -173,7 +173,7 @@ def test_path_params_update(self, client: Gradient) -> None: path_knowledge_base_uuid="123e4567-e89b-12d3-a456-426614174000", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: data_source = client.knowledge_bases.data_sources.list( @@ -181,7 +181,7 @@ def test_method_list(self, client: Gradient) -> None: ) assert_matches_type(DataSourceListResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: data_source = client.knowledge_bases.data_sources.list( @@ -191,7 +191,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(DataSourceListResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.knowledge_bases.data_sources.with_raw_response.list( @@ -203,7 +203,7 @@ def test_raw_response_list(self, client: Gradient) -> None: data_source = response.parse() assert_matches_type(DataSourceListResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.knowledge_bases.data_sources.with_streaming_response.list( @@ -217,7 +217,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_list(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `knowledge_base_uuid` but received ''"): @@ -225,7 +225,7 @@ def test_path_params_list(self, client: Gradient) -> None: knowledge_base_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: data_source = client.knowledge_bases.data_sources.delete( @@ -234,7 +234,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert_matches_type(DataSourceDeleteResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.knowledge_bases.data_sources.with_raw_response.delete( @@ -247,7 +247,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: data_source = response.parse() assert_matches_type(DataSourceDeleteResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.knowledge_bases.data_sources.with_streaming_response.delete( @@ -262,7 +262,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `knowledge_base_uuid` but received ''"): @@ -277,13 +277,13 @@ def test_path_params_delete(self, client: Gradient) -> None: knowledge_base_uuid='"123e4567-e89b-12d3-a456-426614174000"', ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_presigned_urls(self, client: Gradient) -> None: data_source = client.knowledge_bases.data_sources.create_presigned_urls() assert_matches_type(DataSourceCreatePresignedURLsResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_presigned_urls_with_all_params(self, client: Gradient) -> None: data_source = client.knowledge_bases.data_sources.create_presigned_urls( @@ -296,7 +296,7 @@ def test_method_create_presigned_urls_with_all_params(self, client: Gradient) -> ) assert_matches_type(DataSourceCreatePresignedURLsResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_presigned_urls(self, client: Gradient) -> None: response = client.knowledge_bases.data_sources.with_raw_response.create_presigned_urls() @@ -306,7 +306,7 @@ def test_raw_response_create_presigned_urls(self, client: Gradient) -> None: data_source = response.parse() assert_matches_type(DataSourceCreatePresignedURLsResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_presigned_urls(self, client: Gradient) -> None: with client.knowledge_bases.data_sources.with_streaming_response.create_presigned_urls() as response: @@ -324,7 +324,7 @@ class TestAsyncDataSources: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: data_source = await async_client.knowledge_bases.data_sources.create( @@ -332,7 +332,7 @@ async def test_method_create(self, async_client: AsyncGradient) -> None: ) assert_matches_type(DataSourceCreateResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: data_source = await async_client.knowledge_bases.data_sources.create( @@ -366,7 +366,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(DataSourceCreateResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.knowledge_bases.data_sources.with_raw_response.create( @@ -378,7 +378,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: data_source = await response.parse() assert_matches_type(DataSourceCreateResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with async_client.knowledge_bases.data_sources.with_streaming_response.create( @@ -392,7 +392,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_create(self, async_client: AsyncGradient) -> None: with pytest.raises( @@ -402,7 +402,7 @@ async def test_path_params_create(self, async_client: AsyncGradient) -> None: path_knowledge_base_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGradient) -> None: data_source = await async_client.knowledge_bases.data_sources.update( @@ -411,7 +411,7 @@ async def test_method_update(self, async_client: AsyncGradient) -> None: ) assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGradient) -> None: data_source = await async_client.knowledge_bases.data_sources.update( @@ -429,7 +429,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGradient) -> None: response = await async_client.knowledge_bases.data_sources.with_raw_response.update( @@ -442,7 +442,7 @@ async def test_raw_response_update(self, async_client: AsyncGradient) -> None: data_source = await response.parse() assert_matches_type(DataSourceUpdateResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGradient) -> None: async with async_client.knowledge_bases.data_sources.with_streaming_response.update( @@ -457,7 +457,7 @@ async def test_streaming_response_update(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncGradient) -> None: with pytest.raises( @@ -474,7 +474,7 @@ async def test_path_params_update(self, async_client: AsyncGradient) -> None: path_knowledge_base_uuid="123e4567-e89b-12d3-a456-426614174000", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: data_source = await async_client.knowledge_bases.data_sources.list( @@ -482,7 +482,7 @@ async def test_method_list(self, async_client: AsyncGradient) -> None: ) assert_matches_type(DataSourceListResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: data_source = await async_client.knowledge_bases.data_sources.list( @@ -492,7 +492,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(DataSourceListResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.knowledge_bases.data_sources.with_raw_response.list( @@ -504,7 +504,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: data_source = await response.parse() assert_matches_type(DataSourceListResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.knowledge_bases.data_sources.with_streaming_response.list( @@ -518,7 +518,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_list(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `knowledge_base_uuid` but received ''"): @@ -526,7 +526,7 @@ async def test_path_params_list(self, async_client: AsyncGradient) -> None: knowledge_base_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: data_source = await async_client.knowledge_bases.data_sources.delete( @@ -535,7 +535,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert_matches_type(DataSourceDeleteResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.knowledge_bases.data_sources.with_raw_response.delete( @@ -548,7 +548,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: data_source = await response.parse() assert_matches_type(DataSourceDeleteResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.knowledge_bases.data_sources.with_streaming_response.delete( @@ -563,7 +563,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `knowledge_base_uuid` but received ''"): @@ -578,13 +578,13 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: knowledge_base_uuid='"123e4567-e89b-12d3-a456-426614174000"', ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_presigned_urls(self, async_client: AsyncGradient) -> None: data_source = await async_client.knowledge_bases.data_sources.create_presigned_urls() assert_matches_type(DataSourceCreatePresignedURLsResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_presigned_urls_with_all_params(self, async_client: AsyncGradient) -> None: data_source = await async_client.knowledge_bases.data_sources.create_presigned_urls( @@ -597,7 +597,7 @@ async def test_method_create_presigned_urls_with_all_params(self, async_client: ) assert_matches_type(DataSourceCreatePresignedURLsResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_presigned_urls(self, async_client: AsyncGradient) -> None: response = await async_client.knowledge_bases.data_sources.with_raw_response.create_presigned_urls() @@ -607,7 +607,7 @@ async def test_raw_response_create_presigned_urls(self, async_client: AsyncGradi data_source = await response.parse() assert_matches_type(DataSourceCreatePresignedURLsResponse, data_source, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_presigned_urls(self, async_client: AsyncGradient) -> None: async with ( diff --git a/tests/api_resources/knowledge_bases/test_indexing_jobs.py b/tests/api_resources/knowledge_bases/test_indexing_jobs.py index 231aceff..516250be 100644 --- a/tests/api_resources/knowledge_bases/test_indexing_jobs.py +++ b/tests/api_resources/knowledge_bases/test_indexing_jobs.py @@ -25,13 +25,13 @@ class TestIndexingJobs: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: indexing_job = client.knowledge_bases.indexing_jobs.create() assert_matches_type(IndexingJobCreateResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: indexing_job = client.knowledge_bases.indexing_jobs.create( @@ -40,7 +40,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(IndexingJobCreateResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.knowledge_bases.indexing_jobs.with_raw_response.create() @@ -50,7 +50,7 @@ def test_raw_response_create(self, client: Gradient) -> None: indexing_job = response.parse() assert_matches_type(IndexingJobCreateResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.knowledge_bases.indexing_jobs.with_streaming_response.create() as response: @@ -62,7 +62,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: indexing_job = client.knowledge_bases.indexing_jobs.retrieve( @@ -70,7 +70,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(IndexingJobRetrieveResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.knowledge_bases.indexing_jobs.with_raw_response.retrieve( @@ -82,7 +82,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: indexing_job = response.parse() assert_matches_type(IndexingJobRetrieveResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.knowledge_bases.indexing_jobs.with_streaming_response.retrieve( @@ -96,7 +96,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): @@ -104,13 +104,13 @@ def test_path_params_retrieve(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: indexing_job = client.knowledge_bases.indexing_jobs.list() assert_matches_type(IndexingJobListResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: indexing_job = client.knowledge_bases.indexing_jobs.list( @@ -119,7 +119,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(IndexingJobListResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.knowledge_bases.indexing_jobs.with_raw_response.list() @@ -129,7 +129,7 @@ def test_raw_response_list(self, client: Gradient) -> None: indexing_job = response.parse() assert_matches_type(IndexingJobListResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.knowledge_bases.indexing_jobs.with_streaming_response.list() as response: @@ -141,7 +141,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_data_sources(self, client: Gradient) -> None: indexing_job = client.knowledge_bases.indexing_jobs.retrieve_data_sources( @@ -149,7 +149,7 @@ def test_method_retrieve_data_sources(self, client: Gradient) -> None: ) assert_matches_type(IndexingJobRetrieveDataSourcesResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve_data_sources(self, client: Gradient) -> None: response = client.knowledge_bases.indexing_jobs.with_raw_response.retrieve_data_sources( @@ -161,7 +161,7 @@ def test_raw_response_retrieve_data_sources(self, client: Gradient) -> None: indexing_job = response.parse() assert_matches_type(IndexingJobRetrieveDataSourcesResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve_data_sources(self, client: Gradient) -> None: with client.knowledge_bases.indexing_jobs.with_streaming_response.retrieve_data_sources( @@ -175,7 +175,7 @@ def test_streaming_response_retrieve_data_sources(self, client: Gradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve_data_sources(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `indexing_job_uuid` but received ''"): @@ -183,7 +183,7 @@ def test_path_params_retrieve_data_sources(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_signed_url(self, client: Gradient) -> None: indexing_job = client.knowledge_bases.indexing_jobs.retrieve_signed_url( @@ -191,7 +191,7 @@ def test_method_retrieve_signed_url(self, client: Gradient) -> None: ) assert_matches_type(IndexingJobRetrieveSignedURLResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve_signed_url(self, client: Gradient) -> None: response = client.knowledge_bases.indexing_jobs.with_raw_response.retrieve_signed_url( @@ -203,7 +203,7 @@ def test_raw_response_retrieve_signed_url(self, client: Gradient) -> None: indexing_job = response.parse() assert_matches_type(IndexingJobRetrieveSignedURLResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve_signed_url(self, client: Gradient) -> None: with client.knowledge_bases.indexing_jobs.with_streaming_response.retrieve_signed_url( @@ -217,7 +217,7 @@ def test_streaming_response_retrieve_signed_url(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve_signed_url(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `indexing_job_uuid` but received ''"): @@ -225,7 +225,7 @@ def test_path_params_retrieve_signed_url(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_cancel(self, client: Gradient) -> None: indexing_job = client.knowledge_bases.indexing_jobs.update_cancel( @@ -233,7 +233,7 @@ def test_method_update_cancel(self, client: Gradient) -> None: ) assert_matches_type(IndexingJobUpdateCancelResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_cancel_with_all_params(self, client: Gradient) -> None: indexing_job = client.knowledge_bases.indexing_jobs.update_cancel( @@ -242,7 +242,7 @@ def test_method_update_cancel_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(IndexingJobUpdateCancelResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update_cancel(self, client: Gradient) -> None: response = client.knowledge_bases.indexing_jobs.with_raw_response.update_cancel( @@ -254,7 +254,7 @@ def test_raw_response_update_cancel(self, client: Gradient) -> None: indexing_job = response.parse() assert_matches_type(IndexingJobUpdateCancelResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update_cancel(self, client: Gradient) -> None: with client.knowledge_bases.indexing_jobs.with_streaming_response.update_cancel( @@ -268,7 +268,7 @@ def test_streaming_response_update_cancel(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update_cancel(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_uuid` but received ''"): @@ -401,13 +401,13 @@ class TestAsyncIndexingJobs: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: indexing_job = await async_client.knowledge_bases.indexing_jobs.create() assert_matches_type(IndexingJobCreateResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: indexing_job = await async_client.knowledge_bases.indexing_jobs.create( @@ -416,7 +416,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(IndexingJobCreateResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.knowledge_bases.indexing_jobs.with_raw_response.create() @@ -426,7 +426,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: indexing_job = await response.parse() assert_matches_type(IndexingJobCreateResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with async_client.knowledge_bases.indexing_jobs.with_streaming_response.create() as response: @@ -438,7 +438,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: indexing_job = await async_client.knowledge_bases.indexing_jobs.retrieve( @@ -446,7 +446,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(IndexingJobRetrieveResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.knowledge_bases.indexing_jobs.with_raw_response.retrieve( @@ -458,7 +458,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: indexing_job = await response.parse() assert_matches_type(IndexingJobRetrieveResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.knowledge_bases.indexing_jobs.with_streaming_response.retrieve( @@ -472,7 +472,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): @@ -480,13 +480,13 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: indexing_job = await async_client.knowledge_bases.indexing_jobs.list() assert_matches_type(IndexingJobListResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: indexing_job = await async_client.knowledge_bases.indexing_jobs.list( @@ -495,7 +495,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(IndexingJobListResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.knowledge_bases.indexing_jobs.with_raw_response.list() @@ -505,7 +505,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: indexing_job = await response.parse() assert_matches_type(IndexingJobListResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.knowledge_bases.indexing_jobs.with_streaming_response.list() as response: @@ -517,7 +517,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_data_sources(self, async_client: AsyncGradient) -> None: indexing_job = await async_client.knowledge_bases.indexing_jobs.retrieve_data_sources( @@ -525,7 +525,7 @@ async def test_method_retrieve_data_sources(self, async_client: AsyncGradient) - ) assert_matches_type(IndexingJobRetrieveDataSourcesResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve_data_sources(self, async_client: AsyncGradient) -> None: response = await async_client.knowledge_bases.indexing_jobs.with_raw_response.retrieve_data_sources( @@ -537,7 +537,7 @@ async def test_raw_response_retrieve_data_sources(self, async_client: AsyncGradi indexing_job = await response.parse() assert_matches_type(IndexingJobRetrieveDataSourcesResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve_data_sources(self, async_client: AsyncGradient) -> None: async with async_client.knowledge_bases.indexing_jobs.with_streaming_response.retrieve_data_sources( @@ -551,7 +551,7 @@ async def test_streaming_response_retrieve_data_sources(self, async_client: Asyn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve_data_sources(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `indexing_job_uuid` but received ''"): @@ -559,7 +559,7 @@ async def test_path_params_retrieve_data_sources(self, async_client: AsyncGradie "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_signed_url(self, async_client: AsyncGradient) -> None: indexing_job = await async_client.knowledge_bases.indexing_jobs.retrieve_signed_url( @@ -567,7 +567,7 @@ async def test_method_retrieve_signed_url(self, async_client: AsyncGradient) -> ) assert_matches_type(IndexingJobRetrieveSignedURLResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve_signed_url(self, async_client: AsyncGradient) -> None: response = await async_client.knowledge_bases.indexing_jobs.with_raw_response.retrieve_signed_url( @@ -579,7 +579,7 @@ async def test_raw_response_retrieve_signed_url(self, async_client: AsyncGradien indexing_job = await response.parse() assert_matches_type(IndexingJobRetrieveSignedURLResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve_signed_url(self, async_client: AsyncGradient) -> None: async with async_client.knowledge_bases.indexing_jobs.with_streaming_response.retrieve_signed_url( @@ -593,7 +593,7 @@ async def test_streaming_response_retrieve_signed_url(self, async_client: AsyncG assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve_signed_url(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `indexing_job_uuid` but received ''"): @@ -601,7 +601,7 @@ async def test_path_params_retrieve_signed_url(self, async_client: AsyncGradient "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_cancel(self, async_client: AsyncGradient) -> None: indexing_job = await async_client.knowledge_bases.indexing_jobs.update_cancel( @@ -609,7 +609,7 @@ async def test_method_update_cancel(self, async_client: AsyncGradient) -> None: ) assert_matches_type(IndexingJobUpdateCancelResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_cancel_with_all_params(self, async_client: AsyncGradient) -> None: indexing_job = await async_client.knowledge_bases.indexing_jobs.update_cancel( @@ -618,7 +618,7 @@ async def test_method_update_cancel_with_all_params(self, async_client: AsyncGra ) assert_matches_type(IndexingJobUpdateCancelResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update_cancel(self, async_client: AsyncGradient) -> None: response = await async_client.knowledge_bases.indexing_jobs.with_raw_response.update_cancel( @@ -630,7 +630,7 @@ async def test_raw_response_update_cancel(self, async_client: AsyncGradient) -> indexing_job = await response.parse() assert_matches_type(IndexingJobUpdateCancelResponse, indexing_job, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update_cancel(self, async_client: AsyncGradient) -> None: async with async_client.knowledge_bases.indexing_jobs.with_streaming_response.update_cancel( @@ -644,7 +644,7 @@ async def test_streaming_response_update_cancel(self, async_client: AsyncGradien assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update_cancel(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_uuid` but received ''"): diff --git a/tests/api_resources/models/providers/test_anthropic.py b/tests/api_resources/models/providers/test_anthropic.py index b0aeb37c..d0e8209c 100644 --- a/tests/api_resources/models/providers/test_anthropic.py +++ b/tests/api_resources/models/providers/test_anthropic.py @@ -24,13 +24,13 @@ class TestAnthropic: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: anthropic = client.models.providers.anthropic.create() assert_matches_type(AnthropicCreateResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: anthropic = client.models.providers.anthropic.create( @@ -39,7 +39,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(AnthropicCreateResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.models.providers.anthropic.with_raw_response.create() @@ -49,7 +49,7 @@ def test_raw_response_create(self, client: Gradient) -> None: anthropic = response.parse() assert_matches_type(AnthropicCreateResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.models.providers.anthropic.with_streaming_response.create() as response: @@ -61,7 +61,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: anthropic = client.models.providers.anthropic.retrieve( @@ -69,7 +69,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(AnthropicRetrieveResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.models.providers.anthropic.with_raw_response.retrieve( @@ -81,7 +81,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: anthropic = response.parse() assert_matches_type(AnthropicRetrieveResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.models.providers.anthropic.with_streaming_response.retrieve( @@ -95,7 +95,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_uuid` but received ''"): @@ -103,7 +103,7 @@ def test_path_params_retrieve(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gradient) -> None: anthropic = client.models.providers.anthropic.update( @@ -111,7 +111,7 @@ def test_method_update(self, client: Gradient) -> None: ) assert_matches_type(AnthropicUpdateResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gradient) -> None: anthropic = client.models.providers.anthropic.update( @@ -122,7 +122,7 @@ def test_method_update_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(AnthropicUpdateResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gradient) -> None: response = client.models.providers.anthropic.with_raw_response.update( @@ -134,7 +134,7 @@ def test_raw_response_update(self, client: Gradient) -> None: anthropic = response.parse() assert_matches_type(AnthropicUpdateResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gradient) -> None: with client.models.providers.anthropic.with_streaming_response.update( @@ -148,7 +148,7 @@ def test_streaming_response_update(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_api_key_uuid` but received ''"): @@ -156,13 +156,13 @@ def test_path_params_update(self, client: Gradient) -> None: path_api_key_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: anthropic = client.models.providers.anthropic.list() assert_matches_type(AnthropicListResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: anthropic = client.models.providers.anthropic.list( @@ -171,7 +171,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(AnthropicListResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.models.providers.anthropic.with_raw_response.list() @@ -181,7 +181,7 @@ def test_raw_response_list(self, client: Gradient) -> None: anthropic = response.parse() assert_matches_type(AnthropicListResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.models.providers.anthropic.with_streaming_response.list() as response: @@ -193,7 +193,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: anthropic = client.models.providers.anthropic.delete( @@ -201,7 +201,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert_matches_type(AnthropicDeleteResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.models.providers.anthropic.with_raw_response.delete( @@ -213,7 +213,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: anthropic = response.parse() assert_matches_type(AnthropicDeleteResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.models.providers.anthropic.with_streaming_response.delete( @@ -227,7 +227,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_uuid` but received ''"): @@ -235,7 +235,7 @@ def test_path_params_delete(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_agents(self, client: Gradient) -> None: anthropic = client.models.providers.anthropic.list_agents( @@ -243,7 +243,7 @@ def test_method_list_agents(self, client: Gradient) -> None: ) assert_matches_type(AnthropicListAgentsResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_agents_with_all_params(self, client: Gradient) -> None: anthropic = client.models.providers.anthropic.list_agents( @@ -253,7 +253,7 @@ def test_method_list_agents_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(AnthropicListAgentsResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_agents(self, client: Gradient) -> None: response = client.models.providers.anthropic.with_raw_response.list_agents( @@ -265,7 +265,7 @@ def test_raw_response_list_agents(self, client: Gradient) -> None: anthropic = response.parse() assert_matches_type(AnthropicListAgentsResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_agents(self, client: Gradient) -> None: with client.models.providers.anthropic.with_streaming_response.list_agents( @@ -279,7 +279,7 @@ def test_streaming_response_list_agents(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_list_agents(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): @@ -293,13 +293,13 @@ class TestAsyncAnthropic: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: anthropic = await async_client.models.providers.anthropic.create() assert_matches_type(AnthropicCreateResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: anthropic = await async_client.models.providers.anthropic.create( @@ -308,7 +308,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(AnthropicCreateResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.models.providers.anthropic.with_raw_response.create() @@ -318,7 +318,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: anthropic = await response.parse() assert_matches_type(AnthropicCreateResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with async_client.models.providers.anthropic.with_streaming_response.create() as response: @@ -330,7 +330,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: anthropic = await async_client.models.providers.anthropic.retrieve( @@ -338,7 +338,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(AnthropicRetrieveResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.models.providers.anthropic.with_raw_response.retrieve( @@ -350,7 +350,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: anthropic = await response.parse() assert_matches_type(AnthropicRetrieveResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.models.providers.anthropic.with_streaming_response.retrieve( @@ -364,7 +364,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_uuid` but received ''"): @@ -372,7 +372,7 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGradient) -> None: anthropic = await async_client.models.providers.anthropic.update( @@ -380,7 +380,7 @@ async def test_method_update(self, async_client: AsyncGradient) -> None: ) assert_matches_type(AnthropicUpdateResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGradient) -> None: anthropic = await async_client.models.providers.anthropic.update( @@ -391,7 +391,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(AnthropicUpdateResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGradient) -> None: response = await async_client.models.providers.anthropic.with_raw_response.update( @@ -403,7 +403,7 @@ async def test_raw_response_update(self, async_client: AsyncGradient) -> None: anthropic = await response.parse() assert_matches_type(AnthropicUpdateResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGradient) -> None: async with async_client.models.providers.anthropic.with_streaming_response.update( @@ -417,7 +417,7 @@ async def test_streaming_response_update(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_api_key_uuid` but received ''"): @@ -425,13 +425,13 @@ async def test_path_params_update(self, async_client: AsyncGradient) -> None: path_api_key_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: anthropic = await async_client.models.providers.anthropic.list() assert_matches_type(AnthropicListResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: anthropic = await async_client.models.providers.anthropic.list( @@ -440,7 +440,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(AnthropicListResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.models.providers.anthropic.with_raw_response.list() @@ -450,7 +450,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: anthropic = await response.parse() assert_matches_type(AnthropicListResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.models.providers.anthropic.with_streaming_response.list() as response: @@ -462,7 +462,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: anthropic = await async_client.models.providers.anthropic.delete( @@ -470,7 +470,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert_matches_type(AnthropicDeleteResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.models.providers.anthropic.with_raw_response.delete( @@ -482,7 +482,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: anthropic = await response.parse() assert_matches_type(AnthropicDeleteResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.models.providers.anthropic.with_streaming_response.delete( @@ -496,7 +496,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_uuid` but received ''"): @@ -504,7 +504,7 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_agents(self, async_client: AsyncGradient) -> None: anthropic = await async_client.models.providers.anthropic.list_agents( @@ -512,7 +512,7 @@ async def test_method_list_agents(self, async_client: AsyncGradient) -> None: ) assert_matches_type(AnthropicListAgentsResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_agents_with_all_params(self, async_client: AsyncGradient) -> None: anthropic = await async_client.models.providers.anthropic.list_agents( @@ -522,7 +522,7 @@ async def test_method_list_agents_with_all_params(self, async_client: AsyncGradi ) assert_matches_type(AnthropicListAgentsResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_agents(self, async_client: AsyncGradient) -> None: response = await async_client.models.providers.anthropic.with_raw_response.list_agents( @@ -534,7 +534,7 @@ async def test_raw_response_list_agents(self, async_client: AsyncGradient) -> No anthropic = await response.parse() assert_matches_type(AnthropicListAgentsResponse, anthropic, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_agents(self, async_client: AsyncGradient) -> None: async with async_client.models.providers.anthropic.with_streaming_response.list_agents( @@ -548,7 +548,7 @@ async def test_streaming_response_list_agents(self, async_client: AsyncGradient) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_list_agents(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): diff --git a/tests/api_resources/models/providers/test_openai.py b/tests/api_resources/models/providers/test_openai.py index c5780e05..14ef2c24 100644 --- a/tests/api_resources/models/providers/test_openai.py +++ b/tests/api_resources/models/providers/test_openai.py @@ -24,13 +24,13 @@ class TestOpenAI: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: openai = client.models.providers.openai.create() assert_matches_type(OpenAICreateResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: openai = client.models.providers.openai.create( @@ -39,7 +39,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(OpenAICreateResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.models.providers.openai.with_raw_response.create() @@ -49,7 +49,7 @@ def test_raw_response_create(self, client: Gradient) -> None: openai = response.parse() assert_matches_type(OpenAICreateResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.models.providers.openai.with_streaming_response.create() as response: @@ -61,7 +61,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: openai = client.models.providers.openai.retrieve( @@ -69,7 +69,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(OpenAIRetrieveResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.models.providers.openai.with_raw_response.retrieve( @@ -81,7 +81,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: openai = response.parse() assert_matches_type(OpenAIRetrieveResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.models.providers.openai.with_streaming_response.retrieve( @@ -95,7 +95,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_uuid` but received ''"): @@ -103,7 +103,7 @@ def test_path_params_retrieve(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gradient) -> None: openai = client.models.providers.openai.update( @@ -111,7 +111,7 @@ def test_method_update(self, client: Gradient) -> None: ) assert_matches_type(OpenAIUpdateResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gradient) -> None: openai = client.models.providers.openai.update( @@ -122,7 +122,7 @@ def test_method_update_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(OpenAIUpdateResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gradient) -> None: response = client.models.providers.openai.with_raw_response.update( @@ -134,7 +134,7 @@ def test_raw_response_update(self, client: Gradient) -> None: openai = response.parse() assert_matches_type(OpenAIUpdateResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gradient) -> None: with client.models.providers.openai.with_streaming_response.update( @@ -148,7 +148,7 @@ def test_streaming_response_update(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_api_key_uuid` but received ''"): @@ -156,13 +156,13 @@ def test_path_params_update(self, client: Gradient) -> None: path_api_key_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: openai = client.models.providers.openai.list() assert_matches_type(OpenAIListResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: openai = client.models.providers.openai.list( @@ -171,7 +171,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(OpenAIListResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.models.providers.openai.with_raw_response.list() @@ -181,7 +181,7 @@ def test_raw_response_list(self, client: Gradient) -> None: openai = response.parse() assert_matches_type(OpenAIListResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.models.providers.openai.with_streaming_response.list() as response: @@ -193,7 +193,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: openai = client.models.providers.openai.delete( @@ -201,7 +201,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert_matches_type(OpenAIDeleteResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.models.providers.openai.with_raw_response.delete( @@ -213,7 +213,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: openai = response.parse() assert_matches_type(OpenAIDeleteResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.models.providers.openai.with_streaming_response.delete( @@ -227,7 +227,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_uuid` but received ''"): @@ -235,7 +235,7 @@ def test_path_params_delete(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_agents(self, client: Gradient) -> None: openai = client.models.providers.openai.retrieve_agents( @@ -243,7 +243,7 @@ def test_method_retrieve_agents(self, client: Gradient) -> None: ) assert_matches_type(OpenAIRetrieveAgentsResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_agents_with_all_params(self, client: Gradient) -> None: openai = client.models.providers.openai.retrieve_agents( @@ -253,7 +253,7 @@ def test_method_retrieve_agents_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(OpenAIRetrieveAgentsResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve_agents(self, client: Gradient) -> None: response = client.models.providers.openai.with_raw_response.retrieve_agents( @@ -265,7 +265,7 @@ def test_raw_response_retrieve_agents(self, client: Gradient) -> None: openai = response.parse() assert_matches_type(OpenAIRetrieveAgentsResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve_agents(self, client: Gradient) -> None: with client.models.providers.openai.with_streaming_response.retrieve_agents( @@ -279,7 +279,7 @@ def test_streaming_response_retrieve_agents(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve_agents(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): @@ -293,13 +293,13 @@ class TestAsyncOpenAI: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: openai = await async_client.models.providers.openai.create() assert_matches_type(OpenAICreateResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: openai = await async_client.models.providers.openai.create( @@ -308,7 +308,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(OpenAICreateResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.models.providers.openai.with_raw_response.create() @@ -318,7 +318,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: openai = await response.parse() assert_matches_type(OpenAICreateResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with async_client.models.providers.openai.with_streaming_response.create() as response: @@ -330,7 +330,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: openai = await async_client.models.providers.openai.retrieve( @@ -338,7 +338,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(OpenAIRetrieveResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.models.providers.openai.with_raw_response.retrieve( @@ -350,7 +350,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: openai = await response.parse() assert_matches_type(OpenAIRetrieveResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.models.providers.openai.with_streaming_response.retrieve( @@ -364,7 +364,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_uuid` but received ''"): @@ -372,7 +372,7 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGradient) -> None: openai = await async_client.models.providers.openai.update( @@ -380,7 +380,7 @@ async def test_method_update(self, async_client: AsyncGradient) -> None: ) assert_matches_type(OpenAIUpdateResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGradient) -> None: openai = await async_client.models.providers.openai.update( @@ -391,7 +391,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(OpenAIUpdateResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGradient) -> None: response = await async_client.models.providers.openai.with_raw_response.update( @@ -403,7 +403,7 @@ async def test_raw_response_update(self, async_client: AsyncGradient) -> None: openai = await response.parse() assert_matches_type(OpenAIUpdateResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGradient) -> None: async with async_client.models.providers.openai.with_streaming_response.update( @@ -417,7 +417,7 @@ async def test_streaming_response_update(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_api_key_uuid` but received ''"): @@ -425,13 +425,13 @@ async def test_path_params_update(self, async_client: AsyncGradient) -> None: path_api_key_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: openai = await async_client.models.providers.openai.list() assert_matches_type(OpenAIListResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: openai = await async_client.models.providers.openai.list( @@ -440,7 +440,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(OpenAIListResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.models.providers.openai.with_raw_response.list() @@ -450,7 +450,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: openai = await response.parse() assert_matches_type(OpenAIListResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.models.providers.openai.with_streaming_response.list() as response: @@ -462,7 +462,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: openai = await async_client.models.providers.openai.delete( @@ -470,7 +470,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert_matches_type(OpenAIDeleteResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.models.providers.openai.with_raw_response.delete( @@ -482,7 +482,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: openai = await response.parse() assert_matches_type(OpenAIDeleteResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.models.providers.openai.with_streaming_response.delete( @@ -496,7 +496,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `api_key_uuid` but received ''"): @@ -504,7 +504,7 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_agents(self, async_client: AsyncGradient) -> None: openai = await async_client.models.providers.openai.retrieve_agents( @@ -512,7 +512,7 @@ async def test_method_retrieve_agents(self, async_client: AsyncGradient) -> None ) assert_matches_type(OpenAIRetrieveAgentsResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_agents_with_all_params(self, async_client: AsyncGradient) -> None: openai = await async_client.models.providers.openai.retrieve_agents( @@ -522,7 +522,7 @@ async def test_method_retrieve_agents_with_all_params(self, async_client: AsyncG ) assert_matches_type(OpenAIRetrieveAgentsResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve_agents(self, async_client: AsyncGradient) -> None: response = await async_client.models.providers.openai.with_raw_response.retrieve_agents( @@ -534,7 +534,7 @@ async def test_raw_response_retrieve_agents(self, async_client: AsyncGradient) - openai = await response.parse() assert_matches_type(OpenAIRetrieveAgentsResponse, openai, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve_agents(self, async_client: AsyncGradient) -> None: async with async_client.models.providers.openai.with_streaming_response.retrieve_agents( @@ -548,7 +548,7 @@ async def test_streaming_response_retrieve_agents(self, async_client: AsyncGradi assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve_agents(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): diff --git a/tests/api_resources/nfs/test_snapshots.py b/tests/api_resources/nfs/test_snapshots.py index e17265f3..5b229811 100644 --- a/tests/api_resources/nfs/test_snapshots.py +++ b/tests/api_resources/nfs/test_snapshots.py @@ -20,7 +20,7 @@ class TestSnapshots: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: snapshot = client.nfs.snapshots.retrieve( @@ -29,7 +29,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.nfs.snapshots.with_raw_response.retrieve( @@ -42,7 +42,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: snapshot = response.parse() assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.nfs.snapshots.with_streaming_response.retrieve( @@ -57,7 +57,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_snapshot_id` but received ''"): @@ -66,7 +66,7 @@ def test_path_params_retrieve(self, client: Gradient) -> None: region="region", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: snapshot = client.nfs.snapshots.list( @@ -74,7 +74,7 @@ def test_method_list(self, client: Gradient) -> None: ) assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: snapshot = client.nfs.snapshots.list( @@ -83,7 +83,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.nfs.snapshots.with_raw_response.list( @@ -95,7 +95,7 @@ def test_raw_response_list(self, client: Gradient) -> None: snapshot = response.parse() assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.nfs.snapshots.with_streaming_response.list( @@ -109,7 +109,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: snapshot = client.nfs.snapshots.delete( @@ -118,7 +118,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert snapshot is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.nfs.snapshots.with_raw_response.delete( @@ -131,7 +131,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: snapshot = response.parse() assert snapshot is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.nfs.snapshots.with_streaming_response.delete( @@ -146,7 +146,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_snapshot_id` but received ''"): @@ -161,7 +161,7 @@ class TestAsyncSnapshots: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: snapshot = await async_client.nfs.snapshots.retrieve( @@ -170,7 +170,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.nfs.snapshots.with_raw_response.retrieve( @@ -183,7 +183,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: snapshot = await response.parse() assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.nfs.snapshots.with_streaming_response.retrieve( @@ -198,7 +198,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_snapshot_id` but received ''"): @@ -207,7 +207,7 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: region="region", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: snapshot = await async_client.nfs.snapshots.list( @@ -215,7 +215,7 @@ async def test_method_list(self, async_client: AsyncGradient) -> None: ) assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: snapshot = await async_client.nfs.snapshots.list( @@ -224,7 +224,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.nfs.snapshots.with_raw_response.list( @@ -236,7 +236,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: snapshot = await response.parse() assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.nfs.snapshots.with_streaming_response.list( @@ -250,7 +250,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: snapshot = await async_client.nfs.snapshots.delete( @@ -259,7 +259,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert snapshot is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.nfs.snapshots.with_raw_response.delete( @@ -272,7 +272,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: snapshot = await response.parse() assert snapshot is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.nfs.snapshots.with_streaming_response.delete( @@ -287,7 +287,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_snapshot_id` but received ''"): diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index c9e59e32..0c1833f6 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -26,13 +26,13 @@ class TestAgents: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: agent = client.agents.create() assert_matches_type(AgentCreateResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: agent = client.agents.create( @@ -51,7 +51,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(AgentCreateResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.agents.with_raw_response.create() @@ -61,7 +61,7 @@ def test_raw_response_create(self, client: Gradient) -> None: agent = response.parse() assert_matches_type(AgentCreateResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.agents.with_streaming_response.create() as response: @@ -73,7 +73,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: agent = client.agents.retrieve( @@ -81,7 +81,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(AgentRetrieveResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.agents.with_raw_response.retrieve( @@ -93,7 +93,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: agent = response.parse() assert_matches_type(AgentRetrieveResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.agents.with_streaming_response.retrieve( @@ -107,7 +107,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): @@ -115,7 +115,7 @@ def test_path_params_retrieve(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gradient) -> None: agent = client.agents.update( @@ -123,7 +123,7 @@ def test_method_update(self, client: Gradient) -> None: ) assert_matches_type(AgentUpdateResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gradient) -> None: agent = client.agents.update( @@ -150,7 +150,7 @@ def test_method_update_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(AgentUpdateResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gradient) -> None: response = client.agents.with_raw_response.update( @@ -162,7 +162,7 @@ def test_raw_response_update(self, client: Gradient) -> None: agent = response.parse() assert_matches_type(AgentUpdateResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gradient) -> None: with client.agents.with_streaming_response.update( @@ -176,7 +176,7 @@ def test_streaming_response_update(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_uuid` but received ''"): @@ -184,13 +184,13 @@ def test_path_params_update(self, client: Gradient) -> None: path_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: agent = client.agents.list() assert_matches_type(AgentListResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: agent = client.agents.list( @@ -200,7 +200,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(AgentListResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.agents.with_raw_response.list() @@ -210,7 +210,7 @@ def test_raw_response_list(self, client: Gradient) -> None: agent = response.parse() assert_matches_type(AgentListResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.agents.with_streaming_response.list() as response: @@ -222,7 +222,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: agent = client.agents.delete( @@ -230,7 +230,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert_matches_type(AgentDeleteResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.agents.with_raw_response.delete( @@ -242,7 +242,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: agent = response.parse() assert_matches_type(AgentDeleteResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.agents.with_streaming_response.delete( @@ -256,7 +256,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): @@ -264,7 +264,7 @@ def test_path_params_delete(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_usage(self, client: Gradient) -> None: agent = client.agents.retrieve_usage( @@ -272,7 +272,7 @@ def test_method_retrieve_usage(self, client: Gradient) -> None: ) assert_matches_type(AgentRetrieveUsageResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve_usage_with_all_params(self, client: Gradient) -> None: agent = client.agents.retrieve_usage( @@ -282,7 +282,7 @@ def test_method_retrieve_usage_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(AgentRetrieveUsageResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve_usage(self, client: Gradient) -> None: response = client.agents.with_raw_response.retrieve_usage( @@ -294,7 +294,7 @@ def test_raw_response_retrieve_usage(self, client: Gradient) -> None: agent = response.parse() assert_matches_type(AgentRetrieveUsageResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve_usage(self, client: Gradient) -> None: with client.agents.with_streaming_response.retrieve_usage( @@ -308,7 +308,7 @@ def test_streaming_response_retrieve_usage(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve_usage(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): @@ -316,7 +316,7 @@ def test_path_params_retrieve_usage(self, client: Gradient) -> None: uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_status(self, client: Gradient) -> None: agent = client.agents.update_status( @@ -324,7 +324,7 @@ def test_method_update_status(self, client: Gradient) -> None: ) assert_matches_type(AgentUpdateStatusResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_status_with_all_params(self, client: Gradient) -> None: agent = client.agents.update_status( @@ -334,7 +334,7 @@ def test_method_update_status_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(AgentUpdateStatusResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update_status(self, client: Gradient) -> None: response = client.agents.with_raw_response.update_status( @@ -346,7 +346,7 @@ def test_raw_response_update_status(self, client: Gradient) -> None: agent = response.parse() assert_matches_type(AgentUpdateStatusResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update_status(self, client: Gradient) -> None: with client.agents.with_streaming_response.update_status( @@ -360,7 +360,7 @@ def test_streaming_response_update_status(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update_status(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_uuid` but received ''"): @@ -473,13 +473,13 @@ class TestAsyncAgents: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: agent = await async_client.agents.create() assert_matches_type(AgentCreateResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: agent = await async_client.agents.create( @@ -498,7 +498,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(AgentCreateResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.agents.with_raw_response.create() @@ -508,7 +508,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: agent = await response.parse() assert_matches_type(AgentCreateResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with async_client.agents.with_streaming_response.create() as response: @@ -520,7 +520,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: agent = await async_client.agents.retrieve( @@ -528,7 +528,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(AgentRetrieveResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.agents.with_raw_response.retrieve( @@ -540,7 +540,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: agent = await response.parse() assert_matches_type(AgentRetrieveResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.agents.with_streaming_response.retrieve( @@ -554,7 +554,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): @@ -562,7 +562,7 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGradient) -> None: agent = await async_client.agents.update( @@ -570,7 +570,7 @@ async def test_method_update(self, async_client: AsyncGradient) -> None: ) assert_matches_type(AgentUpdateResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGradient) -> None: agent = await async_client.agents.update( @@ -597,7 +597,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(AgentUpdateResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGradient) -> None: response = await async_client.agents.with_raw_response.update( @@ -609,7 +609,7 @@ async def test_raw_response_update(self, async_client: AsyncGradient) -> None: agent = await response.parse() assert_matches_type(AgentUpdateResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGradient) -> None: async with async_client.agents.with_streaming_response.update( @@ -623,7 +623,7 @@ async def test_streaming_response_update(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_uuid` but received ''"): @@ -631,13 +631,13 @@ async def test_path_params_update(self, async_client: AsyncGradient) -> None: path_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: agent = await async_client.agents.list() assert_matches_type(AgentListResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: agent = await async_client.agents.list( @@ -647,7 +647,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(AgentListResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.agents.with_raw_response.list() @@ -657,7 +657,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: agent = await response.parse() assert_matches_type(AgentListResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.agents.with_streaming_response.list() as response: @@ -669,7 +669,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: agent = await async_client.agents.delete( @@ -677,7 +677,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert_matches_type(AgentDeleteResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.agents.with_raw_response.delete( @@ -689,7 +689,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: agent = await response.parse() assert_matches_type(AgentDeleteResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.agents.with_streaming_response.delete( @@ -703,7 +703,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): @@ -711,7 +711,7 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_usage(self, async_client: AsyncGradient) -> None: agent = await async_client.agents.retrieve_usage( @@ -719,7 +719,7 @@ async def test_method_retrieve_usage(self, async_client: AsyncGradient) -> None: ) assert_matches_type(AgentRetrieveUsageResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve_usage_with_all_params(self, async_client: AsyncGradient) -> None: agent = await async_client.agents.retrieve_usage( @@ -729,7 +729,7 @@ async def test_method_retrieve_usage_with_all_params(self, async_client: AsyncGr ) assert_matches_type(AgentRetrieveUsageResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve_usage(self, async_client: AsyncGradient) -> None: response = await async_client.agents.with_raw_response.retrieve_usage( @@ -741,7 +741,7 @@ async def test_raw_response_retrieve_usage(self, async_client: AsyncGradient) -> agent = await response.parse() assert_matches_type(AgentRetrieveUsageResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve_usage(self, async_client: AsyncGradient) -> None: async with async_client.agents.with_streaming_response.retrieve_usage( @@ -755,7 +755,7 @@ async def test_streaming_response_retrieve_usage(self, async_client: AsyncGradie assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve_usage(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): @@ -763,7 +763,7 @@ async def test_path_params_retrieve_usage(self, async_client: AsyncGradient) -> uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_status(self, async_client: AsyncGradient) -> None: agent = await async_client.agents.update_status( @@ -771,7 +771,7 @@ async def test_method_update_status(self, async_client: AsyncGradient) -> None: ) assert_matches_type(AgentUpdateStatusResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_status_with_all_params(self, async_client: AsyncGradient) -> None: agent = await async_client.agents.update_status( @@ -781,7 +781,7 @@ async def test_method_update_status_with_all_params(self, async_client: AsyncGra ) assert_matches_type(AgentUpdateStatusResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update_status(self, async_client: AsyncGradient) -> None: response = await async_client.agents.with_raw_response.update_status( @@ -793,7 +793,7 @@ async def test_raw_response_update_status(self, async_client: AsyncGradient) -> agent = await response.parse() assert_matches_type(AgentUpdateStatusResponse, agent, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update_status(self, async_client: AsyncGradient) -> None: async with async_client.agents.with_streaming_response.update_status( @@ -807,7 +807,7 @@ async def test_streaming_response_update_status(self, async_client: AsyncGradien assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update_status(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_uuid` but received ''"): diff --git a/tests/api_resources/test_billing.py b/tests/api_resources/test_billing.py index 59181b15..9bcd29e0 100644 --- a/tests/api_resources/test_billing.py +++ b/tests/api_resources/test_billing.py @@ -18,7 +18,7 @@ class TestBilling: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_insights(self, client: Gradient) -> None: billing = client.billing.list_insights( @@ -28,7 +28,7 @@ def test_method_list_insights(self, client: Gradient) -> None: ) assert_matches_type(BillingListInsightsResponse, billing, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_insights_with_all_params(self, client: Gradient) -> None: billing = client.billing.list_insights( @@ -40,7 +40,7 @@ def test_method_list_insights_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(BillingListInsightsResponse, billing, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_insights(self, client: Gradient) -> None: response = client.billing.with_raw_response.list_insights( @@ -54,7 +54,7 @@ def test_raw_response_list_insights(self, client: Gradient) -> None: billing = response.parse() assert_matches_type(BillingListInsightsResponse, billing, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_insights(self, client: Gradient) -> None: with client.billing.with_streaming_response.list_insights( @@ -70,7 +70,7 @@ def test_streaming_response_list_insights(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_list_insights(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_urn` but received ''"): @@ -100,7 +100,7 @@ class TestAsyncBilling: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_insights(self, async_client: AsyncGradient) -> None: billing = await async_client.billing.list_insights( @@ -110,7 +110,7 @@ async def test_method_list_insights(self, async_client: AsyncGradient) -> None: ) assert_matches_type(BillingListInsightsResponse, billing, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_insights_with_all_params(self, async_client: AsyncGradient) -> None: billing = await async_client.billing.list_insights( @@ -122,7 +122,7 @@ async def test_method_list_insights_with_all_params(self, async_client: AsyncGra ) assert_matches_type(BillingListInsightsResponse, billing, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_insights(self, async_client: AsyncGradient) -> None: response = await async_client.billing.with_raw_response.list_insights( @@ -136,7 +136,7 @@ async def test_raw_response_list_insights(self, async_client: AsyncGradient) -> billing = await response.parse() assert_matches_type(BillingListInsightsResponse, billing, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_insights(self, async_client: AsyncGradient) -> None: async with async_client.billing.with_streaming_response.list_insights( @@ -152,7 +152,7 @@ async def test_streaming_response_list_insights(self, async_client: AsyncGradien assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_list_insights(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_urn` but received ''"): diff --git a/tests/api_resources/test_gpu_droplets.py b/tests/api_resources/test_gpu_droplets.py index 7d50c037..32a26a9a 100644 --- a/tests/api_resources/test_gpu_droplets.py +++ b/tests/api_resources/test_gpu_droplets.py @@ -25,7 +25,7 @@ class TestGPUDroplets: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_overload_1(self, client: Gradient) -> None: gpu_droplet = client.gpu_droplets.create( @@ -35,7 +35,7 @@ def test_method_create_overload_1(self, client: Gradient) -> None: ) assert_matches_type(GPUDropletCreateResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params_overload_1(self, client: Gradient) -> None: gpu_droplet = client.gpu_droplets.create( @@ -61,7 +61,7 @@ def test_method_create_with_all_params_overload_1(self, client: Gradient) -> Non ) assert_matches_type(GPUDropletCreateResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_overload_1(self, client: Gradient) -> None: response = client.gpu_droplets.with_raw_response.create( @@ -75,7 +75,7 @@ def test_raw_response_create_overload_1(self, client: Gradient) -> None: gpu_droplet = response.parse() assert_matches_type(GPUDropletCreateResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_overload_1(self, client: Gradient) -> None: with client.gpu_droplets.with_streaming_response.create( @@ -91,7 +91,7 @@ def test_streaming_response_create_overload_1(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_overload_2(self, client: Gradient) -> None: gpu_droplet = client.gpu_droplets.create( @@ -101,7 +101,7 @@ def test_method_create_overload_2(self, client: Gradient) -> None: ) assert_matches_type(GPUDropletCreateResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params_overload_2(self, client: Gradient) -> None: gpu_droplet = client.gpu_droplets.create( @@ -127,7 +127,7 @@ def test_method_create_with_all_params_overload_2(self, client: Gradient) -> Non ) assert_matches_type(GPUDropletCreateResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_overload_2(self, client: Gradient) -> None: response = client.gpu_droplets.with_raw_response.create( @@ -141,7 +141,7 @@ def test_raw_response_create_overload_2(self, client: Gradient) -> None: gpu_droplet = response.parse() assert_matches_type(GPUDropletCreateResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_overload_2(self, client: Gradient) -> None: with client.gpu_droplets.with_streaming_response.create( @@ -157,7 +157,7 @@ def test_streaming_response_create_overload_2(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: gpu_droplet = client.gpu_droplets.retrieve( @@ -165,7 +165,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(GPUDropletRetrieveResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.gpu_droplets.with_raw_response.retrieve( @@ -177,7 +177,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: gpu_droplet = response.parse() assert_matches_type(GPUDropletRetrieveResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.gpu_droplets.with_streaming_response.retrieve( @@ -191,13 +191,13 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: gpu_droplet = client.gpu_droplets.list() assert_matches_type(GPUDropletListResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: gpu_droplet = client.gpu_droplets.list( @@ -209,7 +209,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(GPUDropletListResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.gpu_droplets.with_raw_response.list() @@ -219,7 +219,7 @@ def test_raw_response_list(self, client: Gradient) -> None: gpu_droplet = response.parse() assert_matches_type(GPUDropletListResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.gpu_droplets.with_streaming_response.list() as response: @@ -231,7 +231,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: gpu_droplet = client.gpu_droplets.delete( @@ -239,7 +239,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert gpu_droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.gpu_droplets.with_raw_response.delete( @@ -251,7 +251,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: gpu_droplet = response.parse() assert gpu_droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.gpu_droplets.with_streaming_response.delete( @@ -265,7 +265,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete_by_tag(self, client: Gradient) -> None: gpu_droplet = client.gpu_droplets.delete_by_tag( @@ -273,7 +273,7 @@ def test_method_delete_by_tag(self, client: Gradient) -> None: ) assert gpu_droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete_by_tag(self, client: Gradient) -> None: response = client.gpu_droplets.with_raw_response.delete_by_tag( @@ -285,7 +285,7 @@ def test_raw_response_delete_by_tag(self, client: Gradient) -> None: gpu_droplet = response.parse() assert gpu_droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete_by_tag(self, client: Gradient) -> None: with client.gpu_droplets.with_streaming_response.delete_by_tag( @@ -299,7 +299,7 @@ def test_streaming_response_delete_by_tag(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_firewalls(self, client: Gradient) -> None: gpu_droplet = client.gpu_droplets.list_firewalls( @@ -307,7 +307,7 @@ def test_method_list_firewalls(self, client: Gradient) -> None: ) assert_matches_type(GPUDropletListFirewallsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_firewalls_with_all_params(self, client: Gradient) -> None: gpu_droplet = client.gpu_droplets.list_firewalls( @@ -317,7 +317,7 @@ def test_method_list_firewalls_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(GPUDropletListFirewallsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_firewalls(self, client: Gradient) -> None: response = client.gpu_droplets.with_raw_response.list_firewalls( @@ -329,7 +329,7 @@ def test_raw_response_list_firewalls(self, client: Gradient) -> None: gpu_droplet = response.parse() assert_matches_type(GPUDropletListFirewallsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_firewalls(self, client: Gradient) -> None: with client.gpu_droplets.with_streaming_response.list_firewalls( @@ -343,7 +343,7 @@ def test_streaming_response_list_firewalls(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_kernels(self, client: Gradient) -> None: gpu_droplet = client.gpu_droplets.list_kernels( @@ -351,7 +351,7 @@ def test_method_list_kernels(self, client: Gradient) -> None: ) assert_matches_type(GPUDropletListKernelsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_kernels_with_all_params(self, client: Gradient) -> None: gpu_droplet = client.gpu_droplets.list_kernels( @@ -361,7 +361,7 @@ def test_method_list_kernels_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(GPUDropletListKernelsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_kernels(self, client: Gradient) -> None: response = client.gpu_droplets.with_raw_response.list_kernels( @@ -373,7 +373,7 @@ def test_raw_response_list_kernels(self, client: Gradient) -> None: gpu_droplet = response.parse() assert_matches_type(GPUDropletListKernelsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_kernels(self, client: Gradient) -> None: with client.gpu_droplets.with_streaming_response.list_kernels( @@ -387,7 +387,7 @@ def test_streaming_response_list_kernels(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_neighbors(self, client: Gradient) -> None: gpu_droplet = client.gpu_droplets.list_neighbors( @@ -395,7 +395,7 @@ def test_method_list_neighbors(self, client: Gradient) -> None: ) assert_matches_type(GPUDropletListNeighborsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_neighbors(self, client: Gradient) -> None: response = client.gpu_droplets.with_raw_response.list_neighbors( @@ -407,7 +407,7 @@ def test_raw_response_list_neighbors(self, client: Gradient) -> None: gpu_droplet = response.parse() assert_matches_type(GPUDropletListNeighborsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_neighbors(self, client: Gradient) -> None: with client.gpu_droplets.with_streaming_response.list_neighbors( @@ -421,7 +421,7 @@ def test_streaming_response_list_neighbors(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_snapshots(self, client: Gradient) -> None: gpu_droplet = client.gpu_droplets.list_snapshots( @@ -429,7 +429,7 @@ def test_method_list_snapshots(self, client: Gradient) -> None: ) assert_matches_type(GPUDropletListSnapshotsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_snapshots_with_all_params(self, client: Gradient) -> None: gpu_droplet = client.gpu_droplets.list_snapshots( @@ -439,7 +439,7 @@ def test_method_list_snapshots_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(GPUDropletListSnapshotsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_snapshots(self, client: Gradient) -> None: response = client.gpu_droplets.with_raw_response.list_snapshots( @@ -451,7 +451,7 @@ def test_raw_response_list_snapshots(self, client: Gradient) -> None: gpu_droplet = response.parse() assert_matches_type(GPUDropletListSnapshotsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_snapshots(self, client: Gradient) -> None: with client.gpu_droplets.with_streaming_response.list_snapshots( @@ -471,7 +471,7 @@ class TestAsyncGPUDroplets: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_overload_1(self, async_client: AsyncGradient) -> None: gpu_droplet = await async_client.gpu_droplets.create( @@ -481,7 +481,7 @@ async def test_method_create_overload_1(self, async_client: AsyncGradient) -> No ) assert_matches_type(GPUDropletCreateResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGradient) -> None: gpu_droplet = await async_client.gpu_droplets.create( @@ -507,7 +507,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn ) assert_matches_type(GPUDropletCreateResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.with_raw_response.create( @@ -521,7 +521,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncGradient) gpu_droplet = await response.parse() assert_matches_type(GPUDropletCreateResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.with_streaming_response.create( @@ -537,7 +537,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncGra assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_overload_2(self, async_client: AsyncGradient) -> None: gpu_droplet = await async_client.gpu_droplets.create( @@ -547,7 +547,7 @@ async def test_method_create_overload_2(self, async_client: AsyncGradient) -> No ) assert_matches_type(GPUDropletCreateResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGradient) -> None: gpu_droplet = await async_client.gpu_droplets.create( @@ -573,7 +573,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn ) assert_matches_type(GPUDropletCreateResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.with_raw_response.create( @@ -587,7 +587,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) gpu_droplet = await response.parse() assert_matches_type(GPUDropletCreateResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.with_streaming_response.create( @@ -603,7 +603,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncGra assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: gpu_droplet = await async_client.gpu_droplets.retrieve( @@ -611,7 +611,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(GPUDropletRetrieveResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.with_raw_response.retrieve( @@ -623,7 +623,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: gpu_droplet = await response.parse() assert_matches_type(GPUDropletRetrieveResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.with_streaming_response.retrieve( @@ -637,13 +637,13 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: gpu_droplet = await async_client.gpu_droplets.list() assert_matches_type(GPUDropletListResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: gpu_droplet = await async_client.gpu_droplets.list( @@ -655,7 +655,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(GPUDropletListResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.with_raw_response.list() @@ -665,7 +665,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: gpu_droplet = await response.parse() assert_matches_type(GPUDropletListResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.with_streaming_response.list() as response: @@ -677,7 +677,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: gpu_droplet = await async_client.gpu_droplets.delete( @@ -685,7 +685,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert gpu_droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.with_raw_response.delete( @@ -697,7 +697,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: gpu_droplet = await response.parse() assert gpu_droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.with_streaming_response.delete( @@ -711,7 +711,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete_by_tag(self, async_client: AsyncGradient) -> None: gpu_droplet = await async_client.gpu_droplets.delete_by_tag( @@ -719,7 +719,7 @@ async def test_method_delete_by_tag(self, async_client: AsyncGradient) -> None: ) assert gpu_droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete_by_tag(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.with_raw_response.delete_by_tag( @@ -731,7 +731,7 @@ async def test_raw_response_delete_by_tag(self, async_client: AsyncGradient) -> gpu_droplet = await response.parse() assert gpu_droplet is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete_by_tag(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.with_streaming_response.delete_by_tag( @@ -745,7 +745,7 @@ async def test_streaming_response_delete_by_tag(self, async_client: AsyncGradien assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_firewalls(self, async_client: AsyncGradient) -> None: gpu_droplet = await async_client.gpu_droplets.list_firewalls( @@ -753,7 +753,7 @@ async def test_method_list_firewalls(self, async_client: AsyncGradient) -> None: ) assert_matches_type(GPUDropletListFirewallsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_firewalls_with_all_params(self, async_client: AsyncGradient) -> None: gpu_droplet = await async_client.gpu_droplets.list_firewalls( @@ -763,7 +763,7 @@ async def test_method_list_firewalls_with_all_params(self, async_client: AsyncGr ) assert_matches_type(GPUDropletListFirewallsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_firewalls(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.with_raw_response.list_firewalls( @@ -775,7 +775,7 @@ async def test_raw_response_list_firewalls(self, async_client: AsyncGradient) -> gpu_droplet = await response.parse() assert_matches_type(GPUDropletListFirewallsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_firewalls(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.with_streaming_response.list_firewalls( @@ -789,7 +789,7 @@ async def test_streaming_response_list_firewalls(self, async_client: AsyncGradie assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_kernels(self, async_client: AsyncGradient) -> None: gpu_droplet = await async_client.gpu_droplets.list_kernels( @@ -797,7 +797,7 @@ async def test_method_list_kernels(self, async_client: AsyncGradient) -> None: ) assert_matches_type(GPUDropletListKernelsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_kernels_with_all_params(self, async_client: AsyncGradient) -> None: gpu_droplet = await async_client.gpu_droplets.list_kernels( @@ -807,7 +807,7 @@ async def test_method_list_kernels_with_all_params(self, async_client: AsyncGrad ) assert_matches_type(GPUDropletListKernelsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_kernels(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.with_raw_response.list_kernels( @@ -819,7 +819,7 @@ async def test_raw_response_list_kernels(self, async_client: AsyncGradient) -> N gpu_droplet = await response.parse() assert_matches_type(GPUDropletListKernelsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_kernels(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.with_streaming_response.list_kernels( @@ -833,7 +833,7 @@ async def test_streaming_response_list_kernels(self, async_client: AsyncGradient assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_neighbors(self, async_client: AsyncGradient) -> None: gpu_droplet = await async_client.gpu_droplets.list_neighbors( @@ -841,7 +841,7 @@ async def test_method_list_neighbors(self, async_client: AsyncGradient) -> None: ) assert_matches_type(GPUDropletListNeighborsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_neighbors(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.with_raw_response.list_neighbors( @@ -853,7 +853,7 @@ async def test_raw_response_list_neighbors(self, async_client: AsyncGradient) -> gpu_droplet = await response.parse() assert_matches_type(GPUDropletListNeighborsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_neighbors(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.with_streaming_response.list_neighbors( @@ -867,7 +867,7 @@ async def test_streaming_response_list_neighbors(self, async_client: AsyncGradie assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_snapshots(self, async_client: AsyncGradient) -> None: gpu_droplet = await async_client.gpu_droplets.list_snapshots( @@ -875,7 +875,7 @@ async def test_method_list_snapshots(self, async_client: AsyncGradient) -> None: ) assert_matches_type(GPUDropletListSnapshotsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_snapshots_with_all_params(self, async_client: AsyncGradient) -> None: gpu_droplet = await async_client.gpu_droplets.list_snapshots( @@ -885,7 +885,7 @@ async def test_method_list_snapshots_with_all_params(self, async_client: AsyncGr ) assert_matches_type(GPUDropletListSnapshotsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_snapshots(self, async_client: AsyncGradient) -> None: response = await async_client.gpu_droplets.with_raw_response.list_snapshots( @@ -897,7 +897,7 @@ async def test_raw_response_list_snapshots(self, async_client: AsyncGradient) -> gpu_droplet = await response.parse() assert_matches_type(GPUDropletListSnapshotsResponse, gpu_droplet, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_snapshots(self, async_client: AsyncGradient) -> None: async with async_client.gpu_droplets.with_streaming_response.list_snapshots( diff --git a/tests/api_resources/test_images.py b/tests/api_resources/test_images.py index 47428d02..981570c2 100644 --- a/tests/api_resources/test_images.py +++ b/tests/api_resources/test_images.py @@ -17,7 +17,7 @@ class TestImages: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_generate_overload_1(self, client: Gradient) -> None: image = client.images.generate( @@ -25,7 +25,7 @@ def test_method_generate_overload_1(self, client: Gradient) -> None: ) assert_matches_type(ImageGenerateResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_generate_with_all_params_overload_1(self, client: Gradient) -> None: image = client.images.generate( @@ -44,7 +44,7 @@ def test_method_generate_with_all_params_overload_1(self, client: Gradient) -> N ) assert_matches_type(ImageGenerateResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_generate_overload_1(self, client: Gradient) -> None: response = client.images.with_raw_response.generate( @@ -56,7 +56,7 @@ def test_raw_response_generate_overload_1(self, client: Gradient) -> None: image = response.parse() assert_matches_type(ImageGenerateResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_generate_overload_1(self, client: Gradient) -> None: with client.images.with_streaming_response.generate( @@ -70,7 +70,7 @@ def test_streaming_response_generate_overload_1(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_generate_overload_2(self, client: Gradient) -> None: image_stream = client.images.generate( @@ -79,7 +79,7 @@ def test_method_generate_overload_2(self, client: Gradient) -> None: ) image_stream.response.close() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_generate_with_all_params_overload_2(self, client: Gradient) -> None: image_stream = client.images.generate( @@ -98,7 +98,7 @@ def test_method_generate_with_all_params_overload_2(self, client: Gradient) -> N ) image_stream.response.close() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_generate_overload_2(self, client: Gradient) -> None: response = client.images.with_raw_response.generate( @@ -110,7 +110,7 @@ def test_raw_response_generate_overload_2(self, client: Gradient) -> None: stream = response.parse() stream.close() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_generate_overload_2(self, client: Gradient) -> None: with client.images.with_streaming_response.generate( @@ -131,7 +131,7 @@ class TestAsyncImages: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_generate_overload_1(self, async_client: AsyncGradient) -> None: image = await async_client.images.generate( @@ -139,7 +139,7 @@ async def test_method_generate_overload_1(self, async_client: AsyncGradient) -> ) assert_matches_type(ImageGenerateResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_generate_with_all_params_overload_1(self, async_client: AsyncGradient) -> None: image = await async_client.images.generate( @@ -158,7 +158,7 @@ async def test_method_generate_with_all_params_overload_1(self, async_client: As ) assert_matches_type(ImageGenerateResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_generate_overload_1(self, async_client: AsyncGradient) -> None: response = await async_client.images.with_raw_response.generate( @@ -170,7 +170,7 @@ async def test_raw_response_generate_overload_1(self, async_client: AsyncGradien image = await response.parse() assert_matches_type(ImageGenerateResponse, image, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_generate_overload_1(self, async_client: AsyncGradient) -> None: async with async_client.images.with_streaming_response.generate( @@ -184,7 +184,7 @@ async def test_streaming_response_generate_overload_1(self, async_client: AsyncG assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_generate_overload_2(self, async_client: AsyncGradient) -> None: image_stream = await async_client.images.generate( @@ -193,7 +193,7 @@ async def test_method_generate_overload_2(self, async_client: AsyncGradient) -> ) await image_stream.response.aclose() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_generate_with_all_params_overload_2(self, async_client: AsyncGradient) -> None: image_stream = await async_client.images.generate( @@ -212,7 +212,7 @@ async def test_method_generate_with_all_params_overload_2(self, async_client: As ) await image_stream.response.aclose() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_generate_overload_2(self, async_client: AsyncGradient) -> None: response = await async_client.images.with_raw_response.generate( @@ -224,7 +224,7 @@ async def test_raw_response_generate_overload_2(self, async_client: AsyncGradien stream = await response.parse() await stream.close() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_generate_overload_2(self, async_client: AsyncGradient) -> None: async with async_client.images.with_streaming_response.generate( diff --git a/tests/api_resources/test_knowledge_bases.py b/tests/api_resources/test_knowledge_bases.py index 9ce9785d..a7c0d5e4 100644 --- a/tests/api_resources/test_knowledge_bases.py +++ b/tests/api_resources/test_knowledge_bases.py @@ -24,13 +24,13 @@ class TestKnowledgeBases: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: knowledge_base = client.knowledge_bases.create() assert_matches_type(KnowledgeBaseCreateResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params(self, client: Gradient) -> None: knowledge_base = client.knowledge_bases.create( @@ -89,7 +89,7 @@ def test_method_create_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(KnowledgeBaseCreateResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.knowledge_bases.with_raw_response.create() @@ -99,7 +99,7 @@ def test_raw_response_create(self, client: Gradient) -> None: knowledge_base = response.parse() assert_matches_type(KnowledgeBaseCreateResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.knowledge_bases.with_streaming_response.create() as response: @@ -111,7 +111,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: knowledge_base = client.knowledge_bases.retrieve( @@ -119,7 +119,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(KnowledgeBaseRetrieveResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.knowledge_bases.with_raw_response.retrieve( @@ -131,7 +131,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: knowledge_base = response.parse() assert_matches_type(KnowledgeBaseRetrieveResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.knowledge_bases.with_streaming_response.retrieve( @@ -145,7 +145,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): @@ -153,7 +153,7 @@ def test_path_params_retrieve(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update(self, client: Gradient) -> None: knowledge_base = client.knowledge_bases.update( @@ -161,7 +161,7 @@ def test_method_update(self, client: Gradient) -> None: ) assert_matches_type(KnowledgeBaseUpdateResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_with_all_params(self, client: Gradient) -> None: knowledge_base = client.knowledge_bases.update( @@ -175,7 +175,7 @@ def test_method_update_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(KnowledgeBaseUpdateResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_update(self, client: Gradient) -> None: response = client.knowledge_bases.with_raw_response.update( @@ -187,7 +187,7 @@ def test_raw_response_update(self, client: Gradient) -> None: knowledge_base = response.parse() assert_matches_type(KnowledgeBaseUpdateResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_update(self, client: Gradient) -> None: with client.knowledge_bases.with_streaming_response.update( @@ -201,7 +201,7 @@ def test_streaming_response_update(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_update(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_uuid` but received ''"): @@ -209,13 +209,13 @@ def test_path_params_update(self, client: Gradient) -> None: path_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: knowledge_base = client.knowledge_bases.list() assert_matches_type(KnowledgeBaseListResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: knowledge_base = client.knowledge_bases.list( @@ -224,7 +224,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(KnowledgeBaseListResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.knowledge_bases.with_raw_response.list() @@ -234,7 +234,7 @@ def test_raw_response_list(self, client: Gradient) -> None: knowledge_base = response.parse() assert_matches_type(KnowledgeBaseListResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.knowledge_bases.with_streaming_response.list() as response: @@ -246,7 +246,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: knowledge_base = client.knowledge_bases.delete( @@ -254,7 +254,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert_matches_type(KnowledgeBaseDeleteResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.knowledge_bases.with_raw_response.delete( @@ -266,7 +266,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: knowledge_base = response.parse() assert_matches_type(KnowledgeBaseDeleteResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.knowledge_bases.with_streaming_response.delete( @@ -280,7 +280,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): @@ -384,7 +384,7 @@ def test_path_params_wait_for_database(self, client: Gradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_indexing_jobs(self, client: Gradient) -> None: knowledge_base = client.knowledge_bases.list_indexing_jobs( @@ -392,7 +392,7 @@ def test_method_list_indexing_jobs(self, client: Gradient) -> None: ) assert_matches_type(KnowledgeBaseListIndexingJobsResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list_indexing_jobs(self, client: Gradient) -> None: response = client.knowledge_bases.with_raw_response.list_indexing_jobs( @@ -404,7 +404,7 @@ def test_raw_response_list_indexing_jobs(self, client: Gradient) -> None: knowledge_base = response.parse() assert_matches_type(KnowledgeBaseListIndexingJobsResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list_indexing_jobs(self, client: Gradient) -> None: with client.knowledge_bases.with_streaming_response.list_indexing_jobs( @@ -418,7 +418,7 @@ def test_streaming_response_list_indexing_jobs(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_list_indexing_jobs(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `knowledge_base_uuid` but received ''"): @@ -432,13 +432,13 @@ class TestAsyncKnowledgeBases: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: knowledge_base = await async_client.knowledge_bases.create() assert_matches_type(KnowledgeBaseCreateResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: knowledge_base = await async_client.knowledge_bases.create( @@ -497,7 +497,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(KnowledgeBaseCreateResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.knowledge_bases.with_raw_response.create() @@ -507,7 +507,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: knowledge_base = await response.parse() assert_matches_type(KnowledgeBaseCreateResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with async_client.knowledge_bases.with_streaming_response.create() as response: @@ -519,7 +519,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: knowledge_base = await async_client.knowledge_bases.retrieve( @@ -527,7 +527,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(KnowledgeBaseRetrieveResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.knowledge_bases.with_raw_response.retrieve( @@ -539,7 +539,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: knowledge_base = await response.parse() assert_matches_type(KnowledgeBaseRetrieveResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.knowledge_bases.with_streaming_response.retrieve( @@ -553,7 +553,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): @@ -561,7 +561,7 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update(self, async_client: AsyncGradient) -> None: knowledge_base = await async_client.knowledge_bases.update( @@ -569,7 +569,7 @@ async def test_method_update(self, async_client: AsyncGradient) -> None: ) assert_matches_type(KnowledgeBaseUpdateResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncGradient) -> None: knowledge_base = await async_client.knowledge_bases.update( @@ -583,7 +583,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncGradient) ) assert_matches_type(KnowledgeBaseUpdateResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_update(self, async_client: AsyncGradient) -> None: response = await async_client.knowledge_bases.with_raw_response.update( @@ -595,7 +595,7 @@ async def test_raw_response_update(self, async_client: AsyncGradient) -> None: knowledge_base = await response.parse() assert_matches_type(KnowledgeBaseUpdateResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_update(self, async_client: AsyncGradient) -> None: async with async_client.knowledge_bases.with_streaming_response.update( @@ -609,7 +609,7 @@ async def test_streaming_response_update(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_update(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_uuid` but received ''"): @@ -617,13 +617,13 @@ async def test_path_params_update(self, async_client: AsyncGradient) -> None: path_uuid="", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: knowledge_base = await async_client.knowledge_bases.list() assert_matches_type(KnowledgeBaseListResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: knowledge_base = await async_client.knowledge_bases.list( @@ -632,7 +632,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(KnowledgeBaseListResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.knowledge_bases.with_raw_response.list() @@ -642,7 +642,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: knowledge_base = await response.parse() assert_matches_type(KnowledgeBaseListResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.knowledge_bases.with_streaming_response.list() as response: @@ -654,7 +654,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: knowledge_base = await async_client.knowledge_bases.delete( @@ -662,7 +662,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert_matches_type(KnowledgeBaseDeleteResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.knowledge_bases.with_raw_response.delete( @@ -674,7 +674,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: knowledge_base = await response.parse() assert_matches_type(KnowledgeBaseDeleteResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.knowledge_bases.with_streaming_response.delete( @@ -688,7 +688,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `uuid` but received ''"): @@ -792,7 +792,7 @@ async def test_path_params_wait_for_database(self, async_client: AsyncGradient) "", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_indexing_jobs(self, async_client: AsyncGradient) -> None: knowledge_base = await async_client.knowledge_bases.list_indexing_jobs( @@ -800,7 +800,7 @@ async def test_method_list_indexing_jobs(self, async_client: AsyncGradient) -> N ) assert_matches_type(KnowledgeBaseListIndexingJobsResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list_indexing_jobs(self, async_client: AsyncGradient) -> None: response = await async_client.knowledge_bases.with_raw_response.list_indexing_jobs( @@ -812,7 +812,7 @@ async def test_raw_response_list_indexing_jobs(self, async_client: AsyncGradient knowledge_base = await response.parse() assert_matches_type(KnowledgeBaseListIndexingJobsResponse, knowledge_base, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list_indexing_jobs(self, async_client: AsyncGradient) -> None: async with async_client.knowledge_bases.with_streaming_response.list_indexing_jobs( @@ -826,7 +826,7 @@ async def test_streaming_response_list_indexing_jobs(self, async_client: AsyncGr assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_list_indexing_jobs(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `knowledge_base_uuid` but received ''"): diff --git a/tests/api_resources/test_models.py b/tests/api_resources/test_models.py index 8e6edaef..d2dc075a 100644 --- a/tests/api_resources/test_models.py +++ b/tests/api_resources/test_models.py @@ -17,13 +17,13 @@ class TestModels: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: model = client.models.list() assert_matches_type(ModelListResponse, model, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: model = client.models.list( @@ -34,7 +34,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(ModelListResponse, model, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.models.with_raw_response.list() @@ -44,7 +44,7 @@ def test_raw_response_list(self, client: Gradient) -> None: model = response.parse() assert_matches_type(ModelListResponse, model, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.models.with_streaming_response.list() as response: @@ -62,13 +62,13 @@ class TestAsyncModels: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: model = await async_client.models.list() assert_matches_type(ModelListResponse, model, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: model = await async_client.models.list( @@ -79,7 +79,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(ModelListResponse, model, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.models.with_raw_response.list() @@ -89,7 +89,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: model = await response.parse() assert_matches_type(ModelListResponse, model, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.models.with_streaming_response.list() as response: diff --git a/tests/api_resources/test_nfs.py b/tests/api_resources/test_nfs.py index 6969ee96..e60033eb 100644 --- a/tests/api_resources/test_nfs.py +++ b/tests/api_resources/test_nfs.py @@ -22,7 +22,7 @@ class TestNfs: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create(self, client: Gradient) -> None: nf = client.nfs.create( @@ -33,7 +33,7 @@ def test_method_create(self, client: Gradient) -> None: ) assert_matches_type(NfCreateResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: response = client.nfs.with_raw_response.create( @@ -48,7 +48,7 @@ def test_raw_response_create(self, client: Gradient) -> None: nf = response.parse() assert_matches_type(NfCreateResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create(self, client: Gradient) -> None: with client.nfs.with_streaming_response.create( @@ -65,7 +65,7 @@ def test_streaming_response_create(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: nf = client.nfs.retrieve( @@ -74,7 +74,7 @@ def test_method_retrieve(self, client: Gradient) -> None: ) assert_matches_type(NfRetrieveResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.nfs.with_raw_response.retrieve( @@ -87,7 +87,7 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: nf = response.parse() assert_matches_type(NfRetrieveResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.nfs.with_streaming_response.retrieve( @@ -102,7 +102,7 @@ def test_streaming_response_retrieve(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): @@ -111,7 +111,7 @@ def test_path_params_retrieve(self, client: Gradient) -> None: region="region", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: nf = client.nfs.list( @@ -119,7 +119,7 @@ def test_method_list(self, client: Gradient) -> None: ) assert_matches_type(NfListResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.nfs.with_raw_response.list( @@ -131,7 +131,7 @@ def test_raw_response_list(self, client: Gradient) -> None: nf = response.parse() assert_matches_type(NfListResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.nfs.with_streaming_response.list( @@ -145,7 +145,7 @@ def test_streaming_response_list(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: nf = client.nfs.delete( @@ -154,7 +154,7 @@ def test_method_delete(self, client: Gradient) -> None: ) assert nf is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_delete(self, client: Gradient) -> None: response = client.nfs.with_raw_response.delete( @@ -167,7 +167,7 @@ def test_raw_response_delete(self, client: Gradient) -> None: nf = response.parse() assert nf is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_delete(self, client: Gradient) -> None: with client.nfs.with_streaming_response.delete( @@ -182,7 +182,7 @@ def test_streaming_response_delete(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): @@ -191,7 +191,7 @@ def test_path_params_delete(self, client: Gradient) -> None: region="region", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_action_overload_1(self, client: Gradient) -> None: nf = client.nfs.initiate_action( @@ -201,7 +201,7 @@ def test_method_initiate_action_overload_1(self, client: Gradient) -> None: ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_action_with_all_params_overload_1(self, client: Gradient) -> None: nf = client.nfs.initiate_action( @@ -212,7 +212,7 @@ def test_method_initiate_action_with_all_params_overload_1(self, client: Gradien ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_initiate_action_overload_1(self, client: Gradient) -> None: response = client.nfs.with_raw_response.initiate_action( @@ -226,7 +226,7 @@ def test_raw_response_initiate_action_overload_1(self, client: Gradient) -> None nf = response.parse() assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_initiate_action_overload_1(self, client: Gradient) -> None: with client.nfs.with_streaming_response.initiate_action( @@ -242,7 +242,7 @@ def test_streaming_response_initiate_action_overload_1(self, client: Gradient) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_initiate_action_overload_1(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): @@ -252,7 +252,7 @@ def test_path_params_initiate_action_overload_1(self, client: Gradient) -> None: type="resize", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_action_overload_2(self, client: Gradient) -> None: nf = client.nfs.initiate_action( @@ -262,7 +262,7 @@ def test_method_initiate_action_overload_2(self, client: Gradient) -> None: ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_action_with_all_params_overload_2(self, client: Gradient) -> None: nf = client.nfs.initiate_action( @@ -273,7 +273,7 @@ def test_method_initiate_action_with_all_params_overload_2(self, client: Gradien ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_initiate_action_overload_2(self, client: Gradient) -> None: response = client.nfs.with_raw_response.initiate_action( @@ -287,7 +287,7 @@ def test_raw_response_initiate_action_overload_2(self, client: Gradient) -> None nf = response.parse() assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_initiate_action_overload_2(self, client: Gradient) -> None: with client.nfs.with_streaming_response.initiate_action( @@ -303,7 +303,7 @@ def test_streaming_response_initiate_action_overload_2(self, client: Gradient) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_initiate_action_overload_2(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): @@ -313,7 +313,7 @@ def test_path_params_initiate_action_overload_2(self, client: Gradient) -> None: type="resize", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_action_overload_3(self, client: Gradient) -> None: nf = client.nfs.initiate_action( @@ -323,7 +323,7 @@ def test_method_initiate_action_overload_3(self, client: Gradient) -> None: ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_action_with_all_params_overload_3(self, client: Gradient) -> None: nf = client.nfs.initiate_action( @@ -334,7 +334,7 @@ def test_method_initiate_action_with_all_params_overload_3(self, client: Gradien ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_initiate_action_overload_3(self, client: Gradient) -> None: response = client.nfs.with_raw_response.initiate_action( @@ -348,7 +348,7 @@ def test_raw_response_initiate_action_overload_3(self, client: Gradient) -> None nf = response.parse() assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_initiate_action_overload_3(self, client: Gradient) -> None: with client.nfs.with_streaming_response.initiate_action( @@ -364,7 +364,7 @@ def test_streaming_response_initiate_action_overload_3(self, client: Gradient) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_initiate_action_overload_3(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): @@ -374,7 +374,7 @@ def test_path_params_initiate_action_overload_3(self, client: Gradient) -> None: type="resize", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_action_overload_4(self, client: Gradient) -> None: nf = client.nfs.initiate_action( @@ -384,7 +384,7 @@ def test_method_initiate_action_overload_4(self, client: Gradient) -> None: ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_initiate_action_with_all_params_overload_4(self, client: Gradient) -> None: nf = client.nfs.initiate_action( @@ -395,7 +395,7 @@ def test_method_initiate_action_with_all_params_overload_4(self, client: Gradien ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_initiate_action_overload_4(self, client: Gradient) -> None: response = client.nfs.with_raw_response.initiate_action( @@ -409,7 +409,7 @@ def test_raw_response_initiate_action_overload_4(self, client: Gradient) -> None nf = response.parse() assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_initiate_action_overload_4(self, client: Gradient) -> None: with client.nfs.with_streaming_response.initiate_action( @@ -425,7 +425,7 @@ def test_streaming_response_initiate_action_overload_4(self, client: Gradient) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_initiate_action_overload_4(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): @@ -441,7 +441,7 @@ class TestAsyncNfs: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.create( @@ -452,7 +452,7 @@ async def test_method_create(self, async_client: AsyncGradient) -> None: ) assert_matches_type(NfCreateResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: response = await async_client.nfs.with_raw_response.create( @@ -467,7 +467,7 @@ async def test_raw_response_create(self, async_client: AsyncGradient) -> None: nf = await response.parse() assert_matches_type(NfCreateResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create(self, async_client: AsyncGradient) -> None: async with async_client.nfs.with_streaming_response.create( @@ -484,7 +484,7 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.retrieve( @@ -493,7 +493,7 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: ) assert_matches_type(NfRetrieveResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.nfs.with_raw_response.retrieve( @@ -506,7 +506,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: nf = await response.parse() assert_matches_type(NfRetrieveResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.nfs.with_streaming_response.retrieve( @@ -521,7 +521,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): @@ -530,7 +530,7 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: region="region", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.list( @@ -538,7 +538,7 @@ async def test_method_list(self, async_client: AsyncGradient) -> None: ) assert_matches_type(NfListResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.nfs.with_raw_response.list( @@ -550,7 +550,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: nf = await response.parse() assert_matches_type(NfListResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.nfs.with_streaming_response.list( @@ -564,7 +564,7 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.delete( @@ -573,7 +573,7 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: ) assert nf is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.nfs.with_raw_response.delete( @@ -586,7 +586,7 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: nf = await response.parse() assert nf is None - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.nfs.with_streaming_response.delete( @@ -601,7 +601,7 @@ async def test_streaming_response_delete(self, async_client: AsyncGradient) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): @@ -610,7 +610,7 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: region="region", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_action_overload_1(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.initiate_action( @@ -620,7 +620,7 @@ async def test_method_initiate_action_overload_1(self, async_client: AsyncGradie ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_action_with_all_params_overload_1(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.initiate_action( @@ -631,7 +631,7 @@ async def test_method_initiate_action_with_all_params_overload_1(self, async_cli ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_initiate_action_overload_1(self, async_client: AsyncGradient) -> None: response = await async_client.nfs.with_raw_response.initiate_action( @@ -645,7 +645,7 @@ async def test_raw_response_initiate_action_overload_1(self, async_client: Async nf = await response.parse() assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_initiate_action_overload_1(self, async_client: AsyncGradient) -> None: async with async_client.nfs.with_streaming_response.initiate_action( @@ -661,7 +661,7 @@ async def test_streaming_response_initiate_action_overload_1(self, async_client: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_initiate_action_overload_1(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): @@ -671,7 +671,7 @@ async def test_path_params_initiate_action_overload_1(self, async_client: AsyncG type="resize", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_action_overload_2(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.initiate_action( @@ -681,7 +681,7 @@ async def test_method_initiate_action_overload_2(self, async_client: AsyncGradie ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_action_with_all_params_overload_2(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.initiate_action( @@ -692,7 +692,7 @@ async def test_method_initiate_action_with_all_params_overload_2(self, async_cli ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_initiate_action_overload_2(self, async_client: AsyncGradient) -> None: response = await async_client.nfs.with_raw_response.initiate_action( @@ -706,7 +706,7 @@ async def test_raw_response_initiate_action_overload_2(self, async_client: Async nf = await response.parse() assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_initiate_action_overload_2(self, async_client: AsyncGradient) -> None: async with async_client.nfs.with_streaming_response.initiate_action( @@ -722,7 +722,7 @@ async def test_streaming_response_initiate_action_overload_2(self, async_client: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_initiate_action_overload_2(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): @@ -732,7 +732,7 @@ async def test_path_params_initiate_action_overload_2(self, async_client: AsyncG type="resize", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_action_overload_3(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.initiate_action( @@ -742,7 +742,7 @@ async def test_method_initiate_action_overload_3(self, async_client: AsyncGradie ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_action_with_all_params_overload_3(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.initiate_action( @@ -753,7 +753,7 @@ async def test_method_initiate_action_with_all_params_overload_3(self, async_cli ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_initiate_action_overload_3(self, async_client: AsyncGradient) -> None: response = await async_client.nfs.with_raw_response.initiate_action( @@ -767,7 +767,7 @@ async def test_raw_response_initiate_action_overload_3(self, async_client: Async nf = await response.parse() assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_initiate_action_overload_3(self, async_client: AsyncGradient) -> None: async with async_client.nfs.with_streaming_response.initiate_action( @@ -783,7 +783,7 @@ async def test_streaming_response_initiate_action_overload_3(self, async_client: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_initiate_action_overload_3(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): @@ -793,7 +793,7 @@ async def test_path_params_initiate_action_overload_3(self, async_client: AsyncG type="resize", ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_action_overload_4(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.initiate_action( @@ -803,7 +803,7 @@ async def test_method_initiate_action_overload_4(self, async_client: AsyncGradie ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_initiate_action_with_all_params_overload_4(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.initiate_action( @@ -814,7 +814,7 @@ async def test_method_initiate_action_with_all_params_overload_4(self, async_cli ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_initiate_action_overload_4(self, async_client: AsyncGradient) -> None: response = await async_client.nfs.with_raw_response.initiate_action( @@ -828,7 +828,7 @@ async def test_raw_response_initiate_action_overload_4(self, async_client: Async nf = await response.parse() assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_initiate_action_overload_4(self, async_client: AsyncGradient) -> None: async with async_client.nfs.with_streaming_response.initiate_action( @@ -844,7 +844,7 @@ async def test_streaming_response_initiate_action_overload_4(self, async_client: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_initiate_action_overload_4(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): diff --git a/tests/api_resources/test_regions.py b/tests/api_resources/test_regions.py index 8cbf6afb..1ba008bb 100644 --- a/tests/api_resources/test_regions.py +++ b/tests/api_resources/test_regions.py @@ -17,13 +17,13 @@ class TestRegions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: region = client.regions.list() assert_matches_type(RegionListResponse, region, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Gradient) -> None: region = client.regions.list( @@ -32,7 +32,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(RegionListResponse, region, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: response = client.regions.with_raw_response.list() @@ -42,7 +42,7 @@ def test_raw_response_list(self, client: Gradient) -> None: region = response.parse() assert_matches_type(RegionListResponse, region, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: with client.regions.with_streaming_response.list() as response: @@ -60,13 +60,13 @@ class TestAsyncRegions: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: region = await async_client.regions.list() assert_matches_type(RegionListResponse, region, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: region = await async_client.regions.list( @@ -75,7 +75,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> ) assert_matches_type(RegionListResponse, region, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: response = await async_client.regions.with_raw_response.list() @@ -85,7 +85,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: region = await response.parse() assert_matches_type(RegionListResponse, region, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: async with async_client.regions.with_streaming_response.list() as response: diff --git a/tests/api_resources/test_responses.py b/tests/api_resources/test_responses.py index 0d8d7acf..fc6cd4fe 100644 --- a/tests/api_resources/test_responses.py +++ b/tests/api_resources/test_responses.py @@ -17,7 +17,7 @@ class TestResponses: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_overload_1(self, client: Gradient) -> None: response = client.responses.create( @@ -26,7 +26,7 @@ def test_method_create_overload_1(self, client: Gradient) -> None: ) assert_matches_type(CreateResponseResponse, response, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params_overload_1(self, client: Gradient) -> None: response = client.responses.create( @@ -56,7 +56,7 @@ def test_method_create_with_all_params_overload_1(self, client: Gradient) -> Non ) assert_matches_type(CreateResponseResponse, response, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_overload_1(self, client: Gradient) -> None: http_response = client.responses.with_raw_response.create( @@ -69,7 +69,7 @@ def test_raw_response_create_overload_1(self, client: Gradient) -> None: response = http_response.parse() assert_matches_type(CreateResponseResponse, response, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_overload_1(self, client: Gradient) -> None: with client.responses.with_streaming_response.create( @@ -84,7 +84,7 @@ def test_streaming_response_create_overload_1(self, client: Gradient) -> None: assert cast(Any, http_response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_overload_2(self, client: Gradient) -> None: response_stream = client.responses.create( @@ -94,7 +94,7 @@ def test_method_create_overload_2(self, client: Gradient) -> None: ) response_stream.response.close() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_create_with_all_params_overload_2(self, client: Gradient) -> None: response_stream = client.responses.create( @@ -124,7 +124,7 @@ def test_method_create_with_all_params_overload_2(self, client: Gradient) -> Non ) response_stream.response.close() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create_overload_2(self, client: Gradient) -> None: response = client.responses.with_raw_response.create( @@ -137,7 +137,7 @@ def test_raw_response_create_overload_2(self, client: Gradient) -> None: stream = response.parse() stream.close() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_create_overload_2(self, client: Gradient) -> None: with client.responses.with_streaming_response.create( @@ -159,7 +159,7 @@ class TestAsyncResponses: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_overload_1(self, async_client: AsyncGradient) -> None: response = await async_client.responses.create( @@ -168,7 +168,7 @@ async def test_method_create_overload_1(self, async_client: AsyncGradient) -> No ) assert_matches_type(CreateResponseResponse, response, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params_overload_1(self, async_client: AsyncGradient) -> None: response = await async_client.responses.create( @@ -198,7 +198,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn ) assert_matches_type(CreateResponseResponse, response, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncGradient) -> None: http_response = await async_client.responses.with_raw_response.create( @@ -211,7 +211,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncGradient) response = await http_response.parse() assert_matches_type(CreateResponseResponse, response, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncGradient) -> None: async with async_client.responses.with_streaming_response.create( @@ -226,7 +226,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncGra assert cast(Any, http_response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_overload_2(self, async_client: AsyncGradient) -> None: response_stream = await async_client.responses.create( @@ -236,7 +236,7 @@ async def test_method_create_overload_2(self, async_client: AsyncGradient) -> No ) await response_stream.response.aclose() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_create_with_all_params_overload_2(self, async_client: AsyncGradient) -> None: response_stream = await async_client.responses.create( @@ -266,7 +266,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn ) await response_stream.response.aclose() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) -> None: response = await async_client.responses.with_raw_response.create( @@ -279,7 +279,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncGradient) stream = await response.parse() await stream.close() - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncGradient) -> None: async with async_client.responses.with_streaming_response.create( diff --git a/tests/api_resources/test_retrieve.py b/tests/api_resources/test_retrieve.py index 167d2a96..8b5ed252 100644 --- a/tests/api_resources/test_retrieve.py +++ b/tests/api_resources/test_retrieve.py @@ -17,7 +17,7 @@ class TestRetrieve: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_documents(self, client: Gradient) -> None: retrieve = client.retrieve.documents( @@ -27,7 +27,7 @@ def test_method_documents(self, client: Gradient) -> None: ) assert_matches_type(RetrieveDocumentsResponse, retrieve, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_documents_with_all_params(self, client: Gradient) -> None: retrieve = client.retrieve.documents( @@ -61,7 +61,7 @@ def test_method_documents_with_all_params(self, client: Gradient) -> None: ) assert_matches_type(RetrieveDocumentsResponse, retrieve, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_documents(self, client: Gradient) -> None: response = client.retrieve.with_raw_response.documents( @@ -75,7 +75,7 @@ def test_raw_response_documents(self, client: Gradient) -> None: retrieve = response.parse() assert_matches_type(RetrieveDocumentsResponse, retrieve, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_documents(self, client: Gradient) -> None: with client.retrieve.with_streaming_response.documents( @@ -91,7 +91,7 @@ def test_streaming_response_documents(self, client: Gradient) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_path_params_documents(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `knowledge_base_id` but received ''"): @@ -107,7 +107,7 @@ class TestAsyncRetrieve: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_documents(self, async_client: AsyncGradient) -> None: retrieve = await async_client.retrieve.documents( @@ -117,7 +117,7 @@ async def test_method_documents(self, async_client: AsyncGradient) -> None: ) assert_matches_type(RetrieveDocumentsResponse, retrieve, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_documents_with_all_params(self, async_client: AsyncGradient) -> None: retrieve = await async_client.retrieve.documents( @@ -151,7 +151,7 @@ async def test_method_documents_with_all_params(self, async_client: AsyncGradien ) assert_matches_type(RetrieveDocumentsResponse, retrieve, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_documents(self, async_client: AsyncGradient) -> None: response = await async_client.retrieve.with_raw_response.documents( @@ -165,7 +165,7 @@ async def test_raw_response_documents(self, async_client: AsyncGradient) -> None retrieve = await response.parse() assert_matches_type(RetrieveDocumentsResponse, retrieve, path=["response"]) - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_documents(self, async_client: AsyncGradient) -> None: async with async_client.retrieve.with_streaming_response.documents( @@ -181,7 +181,7 @@ async def test_streaming_response_documents(self, async_client: AsyncGradient) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Prism tests are disabled") + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_path_params_documents(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `knowledge_base_id` but received ''"): From a946008866978eeb0671af44f017aa808fde653c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 13:28:21 +0000 Subject: [PATCH 79/96] chore(internal): add request options to SSE classes --- src/gradient/_response.py | 3 +++ src/gradient/_streaming.py | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gradient/_response.py b/src/gradient/_response.py index 4702edaf..0e9dc172 100644 --- a/src/gradient/_response.py +++ b/src/gradient/_response.py @@ -152,6 +152,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: ), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -162,6 +163,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=extract_stream_chunk_type(self._stream_cls), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -175,6 +177,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=cast_to, response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) diff --git a/src/gradient/_streaming.py b/src/gradient/_streaming.py index f0516264..92ce2af2 100644 --- a/src/gradient/_streaming.py +++ b/src/gradient/_streaming.py @@ -4,7 +4,7 @@ import json import inspect from types import TracebackType -from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, AsyncIterator, cast +from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, Optional, AsyncIterator, cast from typing_extensions import Self, Protocol, TypeGuard, override, get_origin, runtime_checkable import httpx @@ -14,6 +14,7 @@ if TYPE_CHECKING: from ._client import Gradient, AsyncGradient + from ._models import FinalRequestOptions _T = TypeVar("_T") @@ -23,7 +24,7 @@ class Stream(Generic[_T]): """Provides the core interface to iterate over a synchronous stream response.""" response: httpx.Response - + _options: Optional[FinalRequestOptions] = None _decoder: SSEBytesDecoder def __init__( @@ -32,10 +33,12 @@ def __init__( cast_to: type[_T], response: httpx.Response, client: Gradient, + options: Optional[FinalRequestOptions] = None, ) -> None: self.response = response self._cast_to = cast_to self._client = client + self._options = options self._decoder = client._make_sse_decoder() self._iterator = self.__stream__() @@ -104,7 +107,7 @@ class AsyncStream(Generic[_T]): """Provides the core interface to iterate over an asynchronous stream response.""" response: httpx.Response - + _options: Optional[FinalRequestOptions] = None _decoder: SSEDecoder | SSEBytesDecoder def __init__( @@ -113,10 +116,12 @@ def __init__( cast_to: type[_T], response: httpx.Response, client: AsyncGradient, + options: Optional[FinalRequestOptions] = None, ) -> None: self.response = response self._cast_to = cast_to self._client = client + self._options = options self._decoder = client._make_sse_decoder() self._iterator = self.__stream__() From 5d43513fee6703903e38d3e2832af69fb4c298d6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 20:26:12 +0000 Subject: [PATCH 80/96] chore(internal): make `test_proxy_environment_variables` more resilient --- tests/test_client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_client.py b/tests/test_client.py index d5f1bbe6..a0d6e3d8 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1171,6 +1171,8 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: 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") + # Delete in case our environment has this set + monkeypatch.delenv("HTTP_PROXY", raising=False) client = DefaultHttpxClient() @@ -2302,6 +2304,8 @@ async def test_get_platform(self) -> None: 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") + # Delete in case our environment has this set + monkeypatch.delenv("HTTP_PROXY", raising=False) client = DefaultAsyncHttpxClient() From 706c8e97f7ea69cec356584e24968b7f9b07146a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 17:42:33 +0000 Subject: [PATCH 81/96] chore(internal): make `test_proxy_environment_variables` more resilient to env --- tests/test_client.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index a0d6e3d8..f0605826 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1171,8 +1171,14 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: 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") - # Delete in case our environment has this set + # Delete in case our environment has any proxy env vars set monkeypatch.delenv("HTTP_PROXY", raising=False) + monkeypatch.delenv("ALL_PROXY", raising=False) + monkeypatch.delenv("NO_PROXY", raising=False) + monkeypatch.delenv("http_proxy", raising=False) + monkeypatch.delenv("https_proxy", raising=False) + monkeypatch.delenv("all_proxy", raising=False) + monkeypatch.delenv("no_proxy", raising=False) client = DefaultHttpxClient() @@ -2304,8 +2310,14 @@ async def test_get_platform(self) -> None: 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") - # Delete in case our environment has this set + # Delete in case our environment has any proxy env vars set monkeypatch.delenv("HTTP_PROXY", raising=False) + monkeypatch.delenv("ALL_PROXY", raising=False) + monkeypatch.delenv("NO_PROXY", raising=False) + monkeypatch.delenv("http_proxy", raising=False) + monkeypatch.delenv("https_proxy", raising=False) + monkeypatch.delenv("all_proxy", raising=False) + monkeypatch.delenv("no_proxy", raising=False) client = DefaultAsyncHttpxClient() From 16ddef49df0929477c5d75a002f161373868bae7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 01:25:54 +0000 Subject: [PATCH 82/96] chore(internal): codegen related update --- src/gradient/_client.py | 300 +++++++ src/gradient/resources/agents/agents.py | 170 ++++ src/gradient/resources/agents/api_keys.py | 8 + src/gradient/resources/agents/chat/chat.py | 18 + .../resources/agents/chat/completions.py | 8 + .../resources/agents/evaluation_datasets.py | 8 + .../evaluation_metrics/anthropic/anthropic.py | 18 + .../evaluation_metrics/anthropic/keys.py | 8 + .../evaluation_metrics/evaluation_metrics.py | 62 ++ .../evaluation_metrics/oauth2/dropbox.py | 8 + .../evaluation_metrics/oauth2/oauth2.py | 26 + .../agents/evaluation_metrics/openai/keys.py | 8 + .../evaluation_metrics/openai/openai.py | 18 + .../evaluation_metrics/scheduled_indexing.py | 8 + .../evaluation_metrics/workspaces/agents.py | 8 + .../workspaces/workspaces.py | 26 + .../resources/agents/evaluation_runs.py | 8 + .../resources/agents/evaluation_test_cases.py | 8 + src/gradient/resources/agents/functions.py | 8 + .../resources/agents/knowledge_bases.py | 8 + src/gradient/resources/agents/routes.py | 8 + src/gradient/resources/agents/versions.py | 8 + src/gradient/resources/apps/apps.py | 72 ++ .../resources/apps/job_invocations.py | 26 + src/gradient/resources/billing.py | 58 ++ src/gradient/resources/chat/chat.py | 18 + src/gradient/resources/chat/completions.py | 8 + .../databases/schema_registry/config.py | 52 ++ .../schema_registry/schema_registry.py | 150 ++++ .../resources/gpu_droplets/account/account.py | 6 + .../resources/gpu_droplets/account/keys.py | 4 + .../resources/gpu_droplets/actions.py | 42 + .../resources/gpu_droplets/autoscale.py | 8 + .../resources/gpu_droplets/backups.py | 22 + .../destroy_with_associated_resources.py | 22 + .../gpu_droplets/firewalls/droplets.py | 16 + .../gpu_droplets/firewalls/firewalls.py | 142 +++ .../resources/gpu_droplets/firewalls/rules.py | 16 + .../resources/gpu_droplets/firewalls/tags.py | 16 + .../gpu_droplets/floating_ips/actions.py | 44 + .../gpu_droplets/floating_ips/floating_ips.py | 170 ++++ .../resources/gpu_droplets/gpu_droplets.py | 850 ++++++++++++++++++ .../resources/gpu_droplets/images/actions.py | 20 + .../resources/gpu_droplets/images/images.py | 108 +++ .../gpu_droplets/load_balancers/droplets.py | 16 + .../load_balancers/forwarding_rules.py | 16 + .../load_balancers/load_balancers.py | 100 +++ src/gradient/resources/gpu_droplets/sizes.py | 22 + .../resources/gpu_droplets/snapshots.py | 24 + .../resources/gpu_droplets/volumes/actions.py | 20 + .../gpu_droplets/volumes/snapshots.py | 28 + .../resources/gpu_droplets/volumes/volumes.py | 160 ++++ src/gradient/resources/images.py | 4 + src/gradient/resources/inference/api_keys.py | 8 + src/gradient/resources/inference/inference.py | 18 + .../resources/knowledge_bases/data_sources.py | 8 + .../knowledge_bases/indexing_jobs.py | 8 + .../knowledge_bases/knowledge_bases.py | 44 + src/gradient/resources/models/models.py | 8 + .../resources/models/providers/anthropic.py | 8 + .../resources/models/providers/openai.py | 8 + .../resources/models/providers/providers.py | 36 + src/gradient/resources/nfs/nfs.py | 24 + src/gradient/resources/nfs/snapshots.py | 10 + src/gradient/resources/regions.py | 4 + src/gradient/resources/responses.py | 4 + 66 files changed, 3198 insertions(+) diff --git a/src/gradient/_client.py b/src/gradient/_client.py index 42867c7d..30e58802 100644 --- a/src/gradient/_client.py +++ b/src/gradient/_client.py @@ -188,6 +188,9 @@ def agent_endpoint(self) -> str: @cached_property def agents(self) -> AgentsResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ from .resources.agents import AgentsResource return AgentsResource(self) @@ -200,18 +203,30 @@ def chat(self) -> ChatResource: @cached_property def images(self) -> ImagesResource: + """Generate images from text prompts using various AI models.""" from .resources.images import ImagesResource return ImagesResource(self) @cached_property def responses(self) -> ResponsesResource: + """Generate text-to-text responses from text prompts.""" from .resources.responses import ResponsesResource return ResponsesResource(self) @cached_property def gpu_droplets(self) -> GPUDropletsResource: + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ from .resources.gpu_droplets import GPUDropletsResource return GPUDropletsResource(self) @@ -224,18 +239,25 @@ def inference(self) -> InferenceResource: @cached_property def knowledge_bases(self) -> KnowledgeBasesResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ from .resources.knowledge_bases import KnowledgeBasesResource return KnowledgeBasesResource(self) @cached_property def models(self) -> ModelsResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ from .resources.models import ModelsResource return ModelsResource(self) @cached_property def regions(self) -> RegionsResource: + """Provides information about DigitalOcean data center regions.""" from .resources.regions import RegionsResource return RegionsResource(self) @@ -266,6 +288,34 @@ def apps(self) -> AppsResource: @cached_property def billing(self) -> BillingResource: + """ + The billing endpoints allow you to retrieve your account balance, invoices, + billing history, and insights. + + **Balance:** By sending requests to the `/v2/customers/my/balance` endpoint, you can + retrieve the balance information for the requested customer account. + + **Invoices:** [Invoices](https://docs.digitalocean.com/platform/billing/invoices/) + are generated on the first of each month for every DigitalOcean + customer. An invoice preview is generated daily, which can be accessed + with the `preview` keyword in place of `$INVOICE_UUID`. To interact with + invoices, you will generally send requests to the invoices endpoint at + `/v2/customers/my/invoices`. + + **Billing History:** Billing history is a record of billing events for your account. + For example, entries may include events like payments made, invoices + issued, or credits granted. To interact with invoices, you + will generally send requests to the invoices endpoint at + `/v2/customers/my/billing_history`. + + **Billing Insights:** Day-over-day changes in billing resource usage based on nightly invoice items, + including total amount, region, SKU, and description for a specified date range. + It is important to note that the daily resource usage may not reflect month-end billing totals when totaled for + a given month as nightly invoice items do not necessarily encompass all invoicing factors for the entire month. + `v2/billing/{account_urn}/insights/{start_date}/{end_date}` where account_urn is the URN of the customer + account, can be a team (do:team:uuid) or an organization (do:teamgroup:uuid). The date range specified by + start_date and end_date must be in YYYY-MM-DD format. + """ from .resources.billing import BillingResource return BillingResource(self) @@ -560,6 +610,9 @@ def agent_endpoint(self) -> str: @cached_property def agents(self) -> AsyncAgentsResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ from .resources.agents import AsyncAgentsResource return AsyncAgentsResource(self) @@ -572,18 +625,30 @@ def chat(self) -> AsyncChatResource: @cached_property def images(self) -> AsyncImagesResource: + """Generate images from text prompts using various AI models.""" from .resources.images import AsyncImagesResource return AsyncImagesResource(self) @cached_property def responses(self) -> AsyncResponsesResource: + """Generate text-to-text responses from text prompts.""" from .resources.responses import AsyncResponsesResource return AsyncResponsesResource(self) @cached_property def gpu_droplets(self) -> AsyncGPUDropletsResource: + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ from .resources.gpu_droplets import AsyncGPUDropletsResource return AsyncGPUDropletsResource(self) @@ -596,18 +661,25 @@ def inference(self) -> AsyncInferenceResource: @cached_property def knowledge_bases(self) -> AsyncKnowledgeBasesResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ from .resources.knowledge_bases import AsyncKnowledgeBasesResource return AsyncKnowledgeBasesResource(self) @cached_property def models(self) -> AsyncModelsResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ from .resources.models import AsyncModelsResource return AsyncModelsResource(self) @cached_property def regions(self) -> AsyncRegionsResource: + """Provides information about DigitalOcean data center regions.""" from .resources.regions import AsyncRegionsResource return AsyncRegionsResource(self) @@ -638,6 +710,34 @@ def apps(self) -> AsyncAppsResource: @cached_property def billing(self) -> AsyncBillingResource: + """ + The billing endpoints allow you to retrieve your account balance, invoices, + billing history, and insights. + + **Balance:** By sending requests to the `/v2/customers/my/balance` endpoint, you can + retrieve the balance information for the requested customer account. + + **Invoices:** [Invoices](https://docs.digitalocean.com/platform/billing/invoices/) + are generated on the first of each month for every DigitalOcean + customer. An invoice preview is generated daily, which can be accessed + with the `preview` keyword in place of `$INVOICE_UUID`. To interact with + invoices, you will generally send requests to the invoices endpoint at + `/v2/customers/my/invoices`. + + **Billing History:** Billing history is a record of billing events for your account. + For example, entries may include events like payments made, invoices + issued, or credits granted. To interact with invoices, you + will generally send requests to the invoices endpoint at + `/v2/customers/my/billing_history`. + + **Billing Insights:** Day-over-day changes in billing resource usage based on nightly invoice items, + including total amount, region, SKU, and description for a specified date range. + It is important to note that the daily resource usage may not reflect month-end billing totals when totaled for + a given month as nightly invoice items do not necessarily encompass all invoicing factors for the entire month. + `v2/billing/{account_urn}/insights/{start_date}/{end_date}` where account_urn is the URN of the customer + account, can be a team (do:team:uuid) or an organization (do:teamgroup:uuid). The date range specified by + start_date and end_date must be in YYYY-MM-DD format. + """ from .resources.billing import AsyncBillingResource return AsyncBillingResource(self) @@ -830,6 +930,9 @@ def __init__(self, client: Gradient) -> None: @cached_property def agents(self) -> agents.AgentsResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ from .resources.agents import AgentsResourceWithRawResponse return AgentsResourceWithRawResponse(self._client.agents) @@ -842,18 +945,30 @@ def chat(self) -> chat.ChatResourceWithRawResponse: @cached_property def images(self) -> images.ImagesResourceWithRawResponse: + """Generate images from text prompts using various AI models.""" from .resources.images import ImagesResourceWithRawResponse return ImagesResourceWithRawResponse(self._client.images) @cached_property def responses(self) -> responses.ResponsesResourceWithRawResponse: + """Generate text-to-text responses from text prompts.""" from .resources.responses import ResponsesResourceWithRawResponse return ResponsesResourceWithRawResponse(self._client.responses) @cached_property def gpu_droplets(self) -> gpu_droplets.GPUDropletsResourceWithRawResponse: + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ from .resources.gpu_droplets import GPUDropletsResourceWithRawResponse return GPUDropletsResourceWithRawResponse(self._client.gpu_droplets) @@ -866,18 +981,25 @@ def inference(self) -> inference.InferenceResourceWithRawResponse: @cached_property def knowledge_bases(self) -> knowledge_bases.KnowledgeBasesResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ from .resources.knowledge_bases import KnowledgeBasesResourceWithRawResponse return KnowledgeBasesResourceWithRawResponse(self._client.knowledge_bases) @cached_property def models(self) -> models.ModelsResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ from .resources.models import ModelsResourceWithRawResponse return ModelsResourceWithRawResponse(self._client.models) @cached_property def regions(self) -> regions.RegionsResourceWithRawResponse: + """Provides information about DigitalOcean data center regions.""" from .resources.regions import RegionsResourceWithRawResponse return RegionsResourceWithRawResponse(self._client.regions) @@ -908,6 +1030,34 @@ def apps(self) -> apps.AppsResourceWithRawResponse: @cached_property def billing(self) -> billing.BillingResourceWithRawResponse: + """ + The billing endpoints allow you to retrieve your account balance, invoices, + billing history, and insights. + + **Balance:** By sending requests to the `/v2/customers/my/balance` endpoint, you can + retrieve the balance information for the requested customer account. + + **Invoices:** [Invoices](https://docs.digitalocean.com/platform/billing/invoices/) + are generated on the first of each month for every DigitalOcean + customer. An invoice preview is generated daily, which can be accessed + with the `preview` keyword in place of `$INVOICE_UUID`. To interact with + invoices, you will generally send requests to the invoices endpoint at + `/v2/customers/my/invoices`. + + **Billing History:** Billing history is a record of billing events for your account. + For example, entries may include events like payments made, invoices + issued, or credits granted. To interact with invoices, you + will generally send requests to the invoices endpoint at + `/v2/customers/my/billing_history`. + + **Billing Insights:** Day-over-day changes in billing resource usage based on nightly invoice items, + including total amount, region, SKU, and description for a specified date range. + It is important to note that the daily resource usage may not reflect month-end billing totals when totaled for + a given month as nightly invoice items do not necessarily encompass all invoicing factors for the entire month. + `v2/billing/{account_urn}/insights/{start_date}/{end_date}` where account_urn is the URN of the customer + account, can be a team (do:team:uuid) or an organization (do:teamgroup:uuid). The date range specified by + start_date and end_date must be in YYYY-MM-DD format. + """ from .resources.billing import BillingResourceWithRawResponse return BillingResourceWithRawResponse(self._client.billing) @@ -921,6 +1071,9 @@ def __init__(self, client: AsyncGradient) -> None: @cached_property def agents(self) -> agents.AsyncAgentsResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ from .resources.agents import AsyncAgentsResourceWithRawResponse return AsyncAgentsResourceWithRawResponse(self._client.agents) @@ -933,18 +1086,30 @@ def chat(self) -> chat.AsyncChatResourceWithRawResponse: @cached_property def images(self) -> images.AsyncImagesResourceWithRawResponse: + """Generate images from text prompts using various AI models.""" from .resources.images import AsyncImagesResourceWithRawResponse return AsyncImagesResourceWithRawResponse(self._client.images) @cached_property def responses(self) -> responses.AsyncResponsesResourceWithRawResponse: + """Generate text-to-text responses from text prompts.""" from .resources.responses import AsyncResponsesResourceWithRawResponse return AsyncResponsesResourceWithRawResponse(self._client.responses) @cached_property def gpu_droplets(self) -> gpu_droplets.AsyncGPUDropletsResourceWithRawResponse: + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ from .resources.gpu_droplets import AsyncGPUDropletsResourceWithRawResponse return AsyncGPUDropletsResourceWithRawResponse(self._client.gpu_droplets) @@ -959,6 +1124,9 @@ def inference(self) -> inference.AsyncInferenceResourceWithRawResponse: def knowledge_bases( self, ) -> knowledge_bases.AsyncKnowledgeBasesResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ from .resources.knowledge_bases import ( AsyncKnowledgeBasesResourceWithRawResponse, ) @@ -967,12 +1135,16 @@ def knowledge_bases( @cached_property def models(self) -> models.AsyncModelsResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ from .resources.models import AsyncModelsResourceWithRawResponse return AsyncModelsResourceWithRawResponse(self._client.models) @cached_property def regions(self) -> regions.AsyncRegionsResourceWithRawResponse: + """Provides information about DigitalOcean data center regions.""" from .resources.regions import AsyncRegionsResourceWithRawResponse return AsyncRegionsResourceWithRawResponse(self._client.regions) @@ -1003,6 +1175,34 @@ def apps(self) -> apps.AsyncAppsResourceWithRawResponse: @cached_property def billing(self) -> billing.AsyncBillingResourceWithRawResponse: + """ + The billing endpoints allow you to retrieve your account balance, invoices, + billing history, and insights. + + **Balance:** By sending requests to the `/v2/customers/my/balance` endpoint, you can + retrieve the balance information for the requested customer account. + + **Invoices:** [Invoices](https://docs.digitalocean.com/platform/billing/invoices/) + are generated on the first of each month for every DigitalOcean + customer. An invoice preview is generated daily, which can be accessed + with the `preview` keyword in place of `$INVOICE_UUID`. To interact with + invoices, you will generally send requests to the invoices endpoint at + `/v2/customers/my/invoices`. + + **Billing History:** Billing history is a record of billing events for your account. + For example, entries may include events like payments made, invoices + issued, or credits granted. To interact with invoices, you + will generally send requests to the invoices endpoint at + `/v2/customers/my/billing_history`. + + **Billing Insights:** Day-over-day changes in billing resource usage based on nightly invoice items, + including total amount, region, SKU, and description for a specified date range. + It is important to note that the daily resource usage may not reflect month-end billing totals when totaled for + a given month as nightly invoice items do not necessarily encompass all invoicing factors for the entire month. + `v2/billing/{account_urn}/insights/{start_date}/{end_date}` where account_urn is the URN of the customer + account, can be a team (do:team:uuid) or an organization (do:teamgroup:uuid). The date range specified by + start_date and end_date must be in YYYY-MM-DD format. + """ from .resources.billing import AsyncBillingResourceWithRawResponse return AsyncBillingResourceWithRawResponse(self._client.billing) @@ -1016,6 +1216,9 @@ def __init__(self, client: Gradient) -> None: @cached_property def agents(self) -> agents.AgentsResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ from .resources.agents import AgentsResourceWithStreamingResponse return AgentsResourceWithStreamingResponse(self._client.agents) @@ -1028,18 +1231,30 @@ def chat(self) -> chat.ChatResourceWithStreamingResponse: @cached_property def images(self) -> images.ImagesResourceWithStreamingResponse: + """Generate images from text prompts using various AI models.""" from .resources.images import ImagesResourceWithStreamingResponse return ImagesResourceWithStreamingResponse(self._client.images) @cached_property def responses(self) -> responses.ResponsesResourceWithStreamingResponse: + """Generate text-to-text responses from text prompts.""" from .resources.responses import ResponsesResourceWithStreamingResponse return ResponsesResourceWithStreamingResponse(self._client.responses) @cached_property def gpu_droplets(self) -> gpu_droplets.GPUDropletsResourceWithStreamingResponse: + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ from .resources.gpu_droplets import GPUDropletsResourceWithStreamingResponse return GPUDropletsResourceWithStreamingResponse(self._client.gpu_droplets) @@ -1054,6 +1269,9 @@ def inference(self) -> inference.InferenceResourceWithStreamingResponse: def knowledge_bases( self, ) -> knowledge_bases.KnowledgeBasesResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ from .resources.knowledge_bases import ( KnowledgeBasesResourceWithStreamingResponse, ) @@ -1062,12 +1280,16 @@ def knowledge_bases( @cached_property def models(self) -> models.ModelsResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ from .resources.models import ModelsResourceWithStreamingResponse return ModelsResourceWithStreamingResponse(self._client.models) @cached_property def regions(self) -> regions.RegionsResourceWithStreamingResponse: + """Provides information about DigitalOcean data center regions.""" from .resources.regions import RegionsResourceWithStreamingResponse return RegionsResourceWithStreamingResponse(self._client.regions) @@ -1098,6 +1320,34 @@ def apps(self) -> apps.AppsResourceWithStreamingResponse: @cached_property def billing(self) -> billing.BillingResourceWithStreamingResponse: + """ + The billing endpoints allow you to retrieve your account balance, invoices, + billing history, and insights. + + **Balance:** By sending requests to the `/v2/customers/my/balance` endpoint, you can + retrieve the balance information for the requested customer account. + + **Invoices:** [Invoices](https://docs.digitalocean.com/platform/billing/invoices/) + are generated on the first of each month for every DigitalOcean + customer. An invoice preview is generated daily, which can be accessed + with the `preview` keyword in place of `$INVOICE_UUID`. To interact with + invoices, you will generally send requests to the invoices endpoint at + `/v2/customers/my/invoices`. + + **Billing History:** Billing history is a record of billing events for your account. + For example, entries may include events like payments made, invoices + issued, or credits granted. To interact with invoices, you + will generally send requests to the invoices endpoint at + `/v2/customers/my/billing_history`. + + **Billing Insights:** Day-over-day changes in billing resource usage based on nightly invoice items, + including total amount, region, SKU, and description for a specified date range. + It is important to note that the daily resource usage may not reflect month-end billing totals when totaled for + a given month as nightly invoice items do not necessarily encompass all invoicing factors for the entire month. + `v2/billing/{account_urn}/insights/{start_date}/{end_date}` where account_urn is the URN of the customer + account, can be a team (do:team:uuid) or an organization (do:teamgroup:uuid). The date range specified by + start_date and end_date must be in YYYY-MM-DD format. + """ from .resources.billing import BillingResourceWithStreamingResponse return BillingResourceWithStreamingResponse(self._client.billing) @@ -1111,6 +1361,9 @@ def __init__(self, client: AsyncGradient) -> None: @cached_property def agents(self) -> agents.AsyncAgentsResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ from .resources.agents import AsyncAgentsResourceWithStreamingResponse return AsyncAgentsResourceWithStreamingResponse(self._client.agents) @@ -1123,12 +1376,14 @@ def chat(self) -> chat.AsyncChatResourceWithStreamingResponse: @cached_property def images(self) -> images.AsyncImagesResourceWithStreamingResponse: + """Generate images from text prompts using various AI models.""" from .resources.images import AsyncImagesResourceWithStreamingResponse return AsyncImagesResourceWithStreamingResponse(self._client.images) @cached_property def responses(self) -> responses.AsyncResponsesResourceWithStreamingResponse: + """Generate text-to-text responses from text prompts.""" from .resources.responses import AsyncResponsesResourceWithStreamingResponse return AsyncResponsesResourceWithStreamingResponse(self._client.responses) @@ -1137,6 +1392,16 @@ def responses(self) -> responses.AsyncResponsesResourceWithStreamingResponse: def gpu_droplets( self, ) -> gpu_droplets.AsyncGPUDropletsResourceWithStreamingResponse: + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ from .resources.gpu_droplets import ( AsyncGPUDropletsResourceWithStreamingResponse, ) @@ -1153,6 +1418,9 @@ def inference(self) -> inference.AsyncInferenceResourceWithStreamingResponse: def knowledge_bases( self, ) -> knowledge_bases.AsyncKnowledgeBasesResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ from .resources.knowledge_bases import ( AsyncKnowledgeBasesResourceWithStreamingResponse, ) @@ -1161,12 +1429,16 @@ def knowledge_bases( @cached_property def models(self) -> models.AsyncModelsResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ from .resources.models import AsyncModelsResourceWithStreamingResponse return AsyncModelsResourceWithStreamingResponse(self._client.models) @cached_property def regions(self) -> regions.AsyncRegionsResourceWithStreamingResponse: + """Provides information about DigitalOcean data center regions.""" from .resources.regions import AsyncRegionsResourceWithStreamingResponse return AsyncRegionsResourceWithStreamingResponse(self._client.regions) @@ -1197,6 +1469,34 @@ def apps(self) -> apps.AsyncAppsResourceWithStreamingResponse: @cached_property def billing(self) -> billing.AsyncBillingResourceWithStreamingResponse: + """ + The billing endpoints allow you to retrieve your account balance, invoices, + billing history, and insights. + + **Balance:** By sending requests to the `/v2/customers/my/balance` endpoint, you can + retrieve the balance information for the requested customer account. + + **Invoices:** [Invoices](https://docs.digitalocean.com/platform/billing/invoices/) + are generated on the first of each month for every DigitalOcean + customer. An invoice preview is generated daily, which can be accessed + with the `preview` keyword in place of `$INVOICE_UUID`. To interact with + invoices, you will generally send requests to the invoices endpoint at + `/v2/customers/my/invoices`. + + **Billing History:** Billing history is a record of billing events for your account. + For example, entries may include events like payments made, invoices + issued, or credits granted. To interact with invoices, you + will generally send requests to the invoices endpoint at + `/v2/customers/my/billing_history`. + + **Billing Insights:** Day-over-day changes in billing resource usage based on nightly invoice items, + including total amount, region, SKU, and description for a specified date range. + It is important to note that the daily resource usage may not reflect month-end billing totals when totaled for + a given month as nightly invoice items do not necessarily encompass all invoicing factors for the entire month. + `v2/billing/{account_urn}/insights/{start_date}/{end_date}` where account_urn is the URN of the customer + account, can be a team (do:team:uuid) or an organization (do:teamgroup:uuid). The date range specified by + start_date and end_date must be in YYYY-MM-DD format. + """ from .resources.billing import AsyncBillingResourceWithStreamingResponse return AsyncBillingResourceWithStreamingResponse(self._client.billing) diff --git a/src/gradient/resources/agents/agents.py b/src/gradient/resources/agents/agents.py index 33a59788..e6790b29 100644 --- a/src/gradient/resources/agents/agents.py +++ b/src/gradient/resources/agents/agents.py @@ -119,8 +119,15 @@ class AgentsResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def api_keys(self) -> APIKeysResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return APIKeysResource(self._client) @cached_property @@ -129,34 +136,58 @@ def chat(self) -> ChatResource: @cached_property def evaluation_metrics(self) -> EvaluationMetricsResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return EvaluationMetricsResource(self._client) @cached_property def evaluation_runs(self) -> EvaluationRunsResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return EvaluationRunsResource(self._client) @cached_property def evaluation_test_cases(self) -> EvaluationTestCasesResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return EvaluationTestCasesResource(self._client) @cached_property def evaluation_datasets(self) -> EvaluationDatasetsResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return EvaluationDatasetsResource(self._client) @cached_property def functions(self) -> FunctionsResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return FunctionsResource(self._client) @cached_property def versions(self) -> VersionsResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return VersionsResource(self._client) @cached_property def knowledge_bases(self) -> KnowledgeBasesResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return KnowledgeBasesResource(self._client) @cached_property def routes(self) -> RoutesResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return RoutesResource(self._client) @cached_property @@ -716,8 +747,15 @@ def wait_until_ready( class AsyncAgentsResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def api_keys(self) -> AsyncAPIKeysResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncAPIKeysResource(self._client) @cached_property @@ -726,34 +764,58 @@ def chat(self) -> AsyncChatResource: @cached_property def evaluation_metrics(self) -> AsyncEvaluationMetricsResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncEvaluationMetricsResource(self._client) @cached_property def evaluation_runs(self) -> AsyncEvaluationRunsResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncEvaluationRunsResource(self._client) @cached_property def evaluation_test_cases(self) -> AsyncEvaluationTestCasesResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncEvaluationTestCasesResource(self._client) @cached_property def evaluation_datasets(self) -> AsyncEvaluationDatasetsResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncEvaluationDatasetsResource(self._client) @cached_property def functions(self) -> AsyncFunctionsResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncFunctionsResource(self._client) @cached_property def versions(self) -> AsyncVersionsResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncVersionsResource(self._client) @cached_property def knowledge_bases(self) -> AsyncKnowledgeBasesResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncKnowledgeBasesResource(self._client) @cached_property def routes(self) -> AsyncRoutesResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncRoutesResource(self._client) @cached_property @@ -1345,6 +1407,9 @@ def __init__(self, agents: AgentsResource) -> None: @cached_property def api_keys(self) -> APIKeysResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return APIKeysResourceWithRawResponse(self._agents.api_keys) @cached_property @@ -1353,34 +1418,58 @@ def chat(self) -> ChatResourceWithRawResponse: @cached_property def evaluation_metrics(self) -> EvaluationMetricsResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return EvaluationMetricsResourceWithRawResponse(self._agents.evaluation_metrics) @cached_property def evaluation_runs(self) -> EvaluationRunsResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return EvaluationRunsResourceWithRawResponse(self._agents.evaluation_runs) @cached_property def evaluation_test_cases(self) -> EvaluationTestCasesResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return EvaluationTestCasesResourceWithRawResponse(self._agents.evaluation_test_cases) @cached_property def evaluation_datasets(self) -> EvaluationDatasetsResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return EvaluationDatasetsResourceWithRawResponse(self._agents.evaluation_datasets) @cached_property def functions(self) -> FunctionsResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return FunctionsResourceWithRawResponse(self._agents.functions) @cached_property def versions(self) -> VersionsResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return VersionsResourceWithRawResponse(self._agents.versions) @cached_property def knowledge_bases(self) -> KnowledgeBasesResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return KnowledgeBasesResourceWithRawResponse(self._agents.knowledge_bases) @cached_property def routes(self) -> RoutesResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return RoutesResourceWithRawResponse(self._agents.routes) @@ -1415,6 +1504,9 @@ def __init__(self, agents: AsyncAgentsResource) -> None: @cached_property def api_keys(self) -> AsyncAPIKeysResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncAPIKeysResourceWithRawResponse(self._agents.api_keys) @cached_property @@ -1423,34 +1515,58 @@ def chat(self) -> AsyncChatResourceWithRawResponse: @cached_property def evaluation_metrics(self) -> AsyncEvaluationMetricsResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncEvaluationMetricsResourceWithRawResponse(self._agents.evaluation_metrics) @cached_property def evaluation_runs(self) -> AsyncEvaluationRunsResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncEvaluationRunsResourceWithRawResponse(self._agents.evaluation_runs) @cached_property def evaluation_test_cases(self) -> AsyncEvaluationTestCasesResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncEvaluationTestCasesResourceWithRawResponse(self._agents.evaluation_test_cases) @cached_property def evaluation_datasets(self) -> AsyncEvaluationDatasetsResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncEvaluationDatasetsResourceWithRawResponse(self._agents.evaluation_datasets) @cached_property def functions(self) -> AsyncFunctionsResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncFunctionsResourceWithRawResponse(self._agents.functions) @cached_property def versions(self) -> AsyncVersionsResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncVersionsResourceWithRawResponse(self._agents.versions) @cached_property def knowledge_bases(self) -> AsyncKnowledgeBasesResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncKnowledgeBasesResourceWithRawResponse(self._agents.knowledge_bases) @cached_property def routes(self) -> AsyncRoutesResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncRoutesResourceWithRawResponse(self._agents.routes) @@ -1485,6 +1601,9 @@ def __init__(self, agents: AgentsResource) -> None: @cached_property def api_keys(self) -> APIKeysResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return APIKeysResourceWithStreamingResponse(self._agents.api_keys) @cached_property @@ -1493,34 +1612,58 @@ def chat(self) -> ChatResourceWithStreamingResponse: @cached_property def evaluation_metrics(self) -> EvaluationMetricsResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return EvaluationMetricsResourceWithStreamingResponse(self._agents.evaluation_metrics) @cached_property def evaluation_runs(self) -> EvaluationRunsResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return EvaluationRunsResourceWithStreamingResponse(self._agents.evaluation_runs) @cached_property def evaluation_test_cases(self) -> EvaluationTestCasesResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return EvaluationTestCasesResourceWithStreamingResponse(self._agents.evaluation_test_cases) @cached_property def evaluation_datasets(self) -> EvaluationDatasetsResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return EvaluationDatasetsResourceWithStreamingResponse(self._agents.evaluation_datasets) @cached_property def functions(self) -> FunctionsResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return FunctionsResourceWithStreamingResponse(self._agents.functions) @cached_property def versions(self) -> VersionsResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return VersionsResourceWithStreamingResponse(self._agents.versions) @cached_property def knowledge_bases(self) -> KnowledgeBasesResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return KnowledgeBasesResourceWithStreamingResponse(self._agents.knowledge_bases) @cached_property def routes(self) -> RoutesResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return RoutesResourceWithStreamingResponse(self._agents.routes) @@ -1555,6 +1698,9 @@ def __init__(self, agents: AsyncAgentsResource) -> None: @cached_property def api_keys(self) -> AsyncAPIKeysResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncAPIKeysResourceWithStreamingResponse(self._agents.api_keys) @cached_property @@ -1563,32 +1709,56 @@ def chat(self) -> AsyncChatResourceWithStreamingResponse: @cached_property def evaluation_metrics(self) -> AsyncEvaluationMetricsResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncEvaluationMetricsResourceWithStreamingResponse(self._agents.evaluation_metrics) @cached_property def evaluation_runs(self) -> AsyncEvaluationRunsResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncEvaluationRunsResourceWithStreamingResponse(self._agents.evaluation_runs) @cached_property def evaluation_test_cases(self) -> AsyncEvaluationTestCasesResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncEvaluationTestCasesResourceWithStreamingResponse(self._agents.evaluation_test_cases) @cached_property def evaluation_datasets(self) -> AsyncEvaluationDatasetsResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncEvaluationDatasetsResourceWithStreamingResponse(self._agents.evaluation_datasets) @cached_property def functions(self) -> AsyncFunctionsResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncFunctionsResourceWithStreamingResponse(self._agents.functions) @cached_property def versions(self) -> AsyncVersionsResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncVersionsResourceWithStreamingResponse(self._agents.versions) @cached_property def knowledge_bases(self) -> AsyncKnowledgeBasesResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncKnowledgeBasesResourceWithStreamingResponse(self._agents.knowledge_bases) @cached_property def routes(self) -> AsyncRoutesResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncRoutesResourceWithStreamingResponse(self._agents.routes) diff --git a/src/gradient/resources/agents/api_keys.py b/src/gradient/resources/agents/api_keys.py index 174ebf60..8a045851 100644 --- a/src/gradient/resources/agents/api_keys.py +++ b/src/gradient/resources/agents/api_keys.py @@ -26,6 +26,10 @@ class APIKeysResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> APIKeysResourceWithRawResponse: """ @@ -282,6 +286,10 @@ def regenerate( class AsyncAPIKeysResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> AsyncAPIKeysResourceWithRawResponse: """ diff --git a/src/gradient/resources/agents/chat/chat.py b/src/gradient/resources/agents/chat/chat.py index 80947cfb..a087c84d 100644 --- a/src/gradient/resources/agents/chat/chat.py +++ b/src/gradient/resources/agents/chat/chat.py @@ -19,6 +19,9 @@ class ChatResource(SyncAPIResource): @cached_property def completions(self) -> CompletionsResource: + """ + Given a list of messages comprising a conversation, the model will return a response. + """ return CompletionsResource(self._client) @cached_property @@ -44,6 +47,9 @@ def with_streaming_response(self) -> ChatResourceWithStreamingResponse: class AsyncChatResource(AsyncAPIResource): @cached_property def completions(self) -> AsyncCompletionsResource: + """ + Given a list of messages comprising a conversation, the model will return a response. + """ return AsyncCompletionsResource(self._client) @cached_property @@ -72,6 +78,9 @@ def __init__(self, chat: ChatResource) -> None: @cached_property def completions(self) -> CompletionsResourceWithRawResponse: + """ + Given a list of messages comprising a conversation, the model will return a response. + """ return CompletionsResourceWithRawResponse(self._chat.completions) @@ -81,6 +90,9 @@ def __init__(self, chat: AsyncChatResource) -> None: @cached_property def completions(self) -> AsyncCompletionsResourceWithRawResponse: + """ + Given a list of messages comprising a conversation, the model will return a response. + """ return AsyncCompletionsResourceWithRawResponse(self._chat.completions) @@ -90,6 +102,9 @@ def __init__(self, chat: ChatResource) -> None: @cached_property def completions(self) -> CompletionsResourceWithStreamingResponse: + """ + Given a list of messages comprising a conversation, the model will return a response. + """ return CompletionsResourceWithStreamingResponse(self._chat.completions) @@ -99,4 +114,7 @@ def __init__(self, chat: AsyncChatResource) -> None: @cached_property def completions(self) -> AsyncCompletionsResourceWithStreamingResponse: + """ + Given a list of messages comprising a conversation, the model will return a response. + """ return AsyncCompletionsResourceWithStreamingResponse(self._chat.completions) diff --git a/src/gradient/resources/agents/chat/completions.py b/src/gradient/resources/agents/chat/completions.py index 374fdc16..fdad67bb 100644 --- a/src/gradient/resources/agents/chat/completions.py +++ b/src/gradient/resources/agents/chat/completions.py @@ -27,6 +27,10 @@ class CompletionsResource(SyncAPIResource): + """ + Given a list of messages comprising a conversation, the model will return a response. + """ + @cached_property def with_raw_response(self) -> CompletionsResourceWithRawResponse: """ @@ -516,6 +520,10 @@ def create( class AsyncCompletionsResource(AsyncAPIResource): + """ + Given a list of messages comprising a conversation, the model will return a response. + """ + @cached_property def with_raw_response(self) -> AsyncCompletionsResourceWithRawResponse: """ diff --git a/src/gradient/resources/agents/evaluation_datasets.py b/src/gradient/resources/agents/evaluation_datasets.py index db9b473d..47ba1ba1 100644 --- a/src/gradient/resources/agents/evaluation_datasets.py +++ b/src/gradient/resources/agents/evaluation_datasets.py @@ -32,6 +32,10 @@ class EvaluationDatasetsResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> EvaluationDatasetsResourceWithRawResponse: """ @@ -144,6 +148,10 @@ def create_file_upload_presigned_urls( class AsyncEvaluationDatasetsResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> AsyncEvaluationDatasetsResourceWithRawResponse: """ diff --git a/src/gradient/resources/agents/evaluation_metrics/anthropic/anthropic.py b/src/gradient/resources/agents/evaluation_metrics/anthropic/anthropic.py index 0079d59b..20e6e5b1 100644 --- a/src/gradient/resources/agents/evaluation_metrics/anthropic/anthropic.py +++ b/src/gradient/resources/agents/evaluation_metrics/anthropic/anthropic.py @@ -19,6 +19,9 @@ class AnthropicResource(SyncAPIResource): @cached_property def keys(self) -> KeysResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return KeysResource(self._client) @cached_property @@ -44,6 +47,9 @@ def with_streaming_response(self) -> AnthropicResourceWithStreamingResponse: class AsyncAnthropicResource(AsyncAPIResource): @cached_property def keys(self) -> AsyncKeysResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncKeysResource(self._client) @cached_property @@ -72,6 +78,9 @@ def __init__(self, anthropic: AnthropicResource) -> None: @cached_property def keys(self) -> KeysResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return KeysResourceWithRawResponse(self._anthropic.keys) @@ -81,6 +90,9 @@ def __init__(self, anthropic: AsyncAnthropicResource) -> None: @cached_property def keys(self) -> AsyncKeysResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncKeysResourceWithRawResponse(self._anthropic.keys) @@ -90,6 +102,9 @@ def __init__(self, anthropic: AnthropicResource) -> None: @cached_property def keys(self) -> KeysResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return KeysResourceWithStreamingResponse(self._anthropic.keys) @@ -99,4 +114,7 @@ def __init__(self, anthropic: AsyncAnthropicResource) -> None: @cached_property def keys(self) -> AsyncKeysResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncKeysResourceWithStreamingResponse(self._anthropic.keys) diff --git a/src/gradient/resources/agents/evaluation_metrics/anthropic/keys.py b/src/gradient/resources/agents/evaluation_metrics/anthropic/keys.py index e015bf5c..195d8f88 100644 --- a/src/gradient/resources/agents/evaluation_metrics/anthropic/keys.py +++ b/src/gradient/resources/agents/evaluation_metrics/anthropic/keys.py @@ -32,6 +32,10 @@ class KeysResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> KeysResourceWithRawResponse: """ @@ -324,6 +328,10 @@ def list_agents( class AsyncKeysResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> AsyncKeysResourceWithRawResponse: """ diff --git a/src/gradient/resources/agents/evaluation_metrics/evaluation_metrics.py b/src/gradient/resources/agents/evaluation_metrics/evaluation_metrics.py index b9080132..1b081c70 100644 --- a/src/gradient/resources/agents/evaluation_metrics/evaluation_metrics.py +++ b/src/gradient/resources/agents/evaluation_metrics/evaluation_metrics.py @@ -63,8 +63,15 @@ class EvaluationMetricsResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def workspaces(self) -> WorkspacesResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return WorkspacesResource(self._client) @cached_property @@ -77,10 +84,16 @@ def openai(self) -> OpenAIResource: @cached_property def oauth2(self) -> Oauth2Resource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return Oauth2Resource(self._client) @cached_property def scheduled_indexing(self) -> ScheduledIndexingResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return ScheduledIndexingResource(self._client) @cached_property @@ -176,8 +189,15 @@ def list_regions( class AsyncEvaluationMetricsResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def workspaces(self) -> AsyncWorkspacesResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncWorkspacesResource(self._client) @cached_property @@ -190,10 +210,16 @@ def openai(self) -> AsyncOpenAIResource: @cached_property def oauth2(self) -> AsyncOauth2Resource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncOauth2Resource(self._client) @cached_property def scheduled_indexing(self) -> AsyncScheduledIndexingResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncScheduledIndexingResource(self._client) @cached_property @@ -301,6 +327,9 @@ def __init__(self, evaluation_metrics: EvaluationMetricsResource) -> None: @cached_property def workspaces(self) -> WorkspacesResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return WorkspacesResourceWithRawResponse(self._evaluation_metrics.workspaces) @cached_property @@ -313,10 +342,16 @@ def openai(self) -> OpenAIResourceWithRawResponse: @cached_property def oauth2(self) -> Oauth2ResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return Oauth2ResourceWithRawResponse(self._evaluation_metrics.oauth2) @cached_property def scheduled_indexing(self) -> ScheduledIndexingResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return ScheduledIndexingResourceWithRawResponse(self._evaluation_metrics.scheduled_indexing) @@ -333,6 +368,9 @@ def __init__(self, evaluation_metrics: AsyncEvaluationMetricsResource) -> None: @cached_property def workspaces(self) -> AsyncWorkspacesResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncWorkspacesResourceWithRawResponse(self._evaluation_metrics.workspaces) @cached_property @@ -345,10 +383,16 @@ def openai(self) -> AsyncOpenAIResourceWithRawResponse: @cached_property def oauth2(self) -> AsyncOauth2ResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncOauth2ResourceWithRawResponse(self._evaluation_metrics.oauth2) @cached_property def scheduled_indexing(self) -> AsyncScheduledIndexingResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncScheduledIndexingResourceWithRawResponse(self._evaluation_metrics.scheduled_indexing) @@ -365,6 +409,9 @@ def __init__(self, evaluation_metrics: EvaluationMetricsResource) -> None: @cached_property def workspaces(self) -> WorkspacesResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return WorkspacesResourceWithStreamingResponse(self._evaluation_metrics.workspaces) @cached_property @@ -377,10 +424,16 @@ def openai(self) -> OpenAIResourceWithStreamingResponse: @cached_property def oauth2(self) -> Oauth2ResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return Oauth2ResourceWithStreamingResponse(self._evaluation_metrics.oauth2) @cached_property def scheduled_indexing(self) -> ScheduledIndexingResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return ScheduledIndexingResourceWithStreamingResponse(self._evaluation_metrics.scheduled_indexing) @@ -397,6 +450,9 @@ def __init__(self, evaluation_metrics: AsyncEvaluationMetricsResource) -> None: @cached_property def workspaces(self) -> AsyncWorkspacesResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncWorkspacesResourceWithStreamingResponse(self._evaluation_metrics.workspaces) @cached_property @@ -409,8 +465,14 @@ def openai(self) -> AsyncOpenAIResourceWithStreamingResponse: @cached_property def oauth2(self) -> AsyncOauth2ResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncOauth2ResourceWithStreamingResponse(self._evaluation_metrics.oauth2) @cached_property def scheduled_indexing(self) -> AsyncScheduledIndexingResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncScheduledIndexingResourceWithStreamingResponse(self._evaluation_metrics.scheduled_indexing) diff --git a/src/gradient/resources/agents/evaluation_metrics/oauth2/dropbox.py b/src/gradient/resources/agents/evaluation_metrics/oauth2/dropbox.py index 256040ba..137aa164 100644 --- a/src/gradient/resources/agents/evaluation_metrics/oauth2/dropbox.py +++ b/src/gradient/resources/agents/evaluation_metrics/oauth2/dropbox.py @@ -22,6 +22,10 @@ class DropboxResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> DropboxResourceWithRawResponse: """ @@ -90,6 +94,10 @@ def create_tokens( class AsyncDropboxResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> AsyncDropboxResourceWithRawResponse: """ diff --git a/src/gradient/resources/agents/evaluation_metrics/oauth2/oauth2.py b/src/gradient/resources/agents/evaluation_metrics/oauth2/oauth2.py index 335e58d7..0cf47ca6 100644 --- a/src/gradient/resources/agents/evaluation_metrics/oauth2/oauth2.py +++ b/src/gradient/resources/agents/evaluation_metrics/oauth2/oauth2.py @@ -30,8 +30,15 @@ class Oauth2Resource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def dropbox(self) -> DropboxResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return DropboxResource(self._client) @cached_property @@ -104,8 +111,15 @@ def generate_url( class AsyncOauth2Resource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def dropbox(self) -> AsyncDropboxResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncDropboxResource(self._client) @cached_property @@ -187,6 +201,9 @@ def __init__(self, oauth2: Oauth2Resource) -> None: @cached_property def dropbox(self) -> DropboxResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return DropboxResourceWithRawResponse(self._oauth2.dropbox) @@ -200,6 +217,9 @@ def __init__(self, oauth2: AsyncOauth2Resource) -> None: @cached_property def dropbox(self) -> AsyncDropboxResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncDropboxResourceWithRawResponse(self._oauth2.dropbox) @@ -213,6 +233,9 @@ def __init__(self, oauth2: Oauth2Resource) -> None: @cached_property def dropbox(self) -> DropboxResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return DropboxResourceWithStreamingResponse(self._oauth2.dropbox) @@ -226,4 +249,7 @@ def __init__(self, oauth2: AsyncOauth2Resource) -> None: @cached_property def dropbox(self) -> AsyncDropboxResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncDropboxResourceWithStreamingResponse(self._oauth2.dropbox) diff --git a/src/gradient/resources/agents/evaluation_metrics/openai/keys.py b/src/gradient/resources/agents/evaluation_metrics/openai/keys.py index 9ab5cbad..ffe4992d 100644 --- a/src/gradient/resources/agents/evaluation_metrics/openai/keys.py +++ b/src/gradient/resources/agents/evaluation_metrics/openai/keys.py @@ -32,6 +32,10 @@ class KeysResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> KeysResourceWithRawResponse: """ @@ -322,6 +326,10 @@ def list_agents( class AsyncKeysResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> AsyncKeysResourceWithRawResponse: """ diff --git a/src/gradient/resources/agents/evaluation_metrics/openai/openai.py b/src/gradient/resources/agents/evaluation_metrics/openai/openai.py index 00fd8a7d..4963c752 100644 --- a/src/gradient/resources/agents/evaluation_metrics/openai/openai.py +++ b/src/gradient/resources/agents/evaluation_metrics/openai/openai.py @@ -19,6 +19,9 @@ class OpenAIResource(SyncAPIResource): @cached_property def keys(self) -> KeysResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return KeysResource(self._client) @cached_property @@ -44,6 +47,9 @@ def with_streaming_response(self) -> OpenAIResourceWithStreamingResponse: class AsyncOpenAIResource(AsyncAPIResource): @cached_property def keys(self) -> AsyncKeysResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncKeysResource(self._client) @cached_property @@ -72,6 +78,9 @@ def __init__(self, openai: OpenAIResource) -> None: @cached_property def keys(self) -> KeysResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return KeysResourceWithRawResponse(self._openai.keys) @@ -81,6 +90,9 @@ def __init__(self, openai: AsyncOpenAIResource) -> None: @cached_property def keys(self) -> AsyncKeysResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncKeysResourceWithRawResponse(self._openai.keys) @@ -90,6 +102,9 @@ def __init__(self, openai: OpenAIResource) -> None: @cached_property def keys(self) -> KeysResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return KeysResourceWithStreamingResponse(self._openai.keys) @@ -99,4 +114,7 @@ def __init__(self, openai: AsyncOpenAIResource) -> None: @cached_property def keys(self) -> AsyncKeysResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncKeysResourceWithStreamingResponse(self._openai.keys) diff --git a/src/gradient/resources/agents/evaluation_metrics/scheduled_indexing.py b/src/gradient/resources/agents/evaluation_metrics/scheduled_indexing.py index e346f7ae..b3da363c 100644 --- a/src/gradient/resources/agents/evaluation_metrics/scheduled_indexing.py +++ b/src/gradient/resources/agents/evaluation_metrics/scheduled_indexing.py @@ -26,6 +26,10 @@ class ScheduledIndexingResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> ScheduledIndexingResourceWithRawResponse: """ @@ -172,6 +176,10 @@ def delete( class AsyncScheduledIndexingResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> AsyncScheduledIndexingResourceWithRawResponse: """ diff --git a/src/gradient/resources/agents/evaluation_metrics/workspaces/agents.py b/src/gradient/resources/agents/evaluation_metrics/workspaces/agents.py index 7f9a766a..41f3f993 100644 --- a/src/gradient/resources/agents/evaluation_metrics/workspaces/agents.py +++ b/src/gradient/resources/agents/evaluation_metrics/workspaces/agents.py @@ -23,6 +23,10 @@ class AgentsResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> AgentsResourceWithRawResponse: """ @@ -151,6 +155,10 @@ def move( class AsyncAgentsResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> AsyncAgentsResourceWithRawResponse: """ diff --git a/src/gradient/resources/agents/evaluation_metrics/workspaces/workspaces.py b/src/gradient/resources/agents/evaluation_metrics/workspaces/workspaces.py index 73539bbd..7c2be668 100644 --- a/src/gradient/resources/agents/evaluation_metrics/workspaces/workspaces.py +++ b/src/gradient/resources/agents/evaluation_metrics/workspaces/workspaces.py @@ -37,8 +37,15 @@ class WorkspacesResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def agents(self) -> AgentsResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AgentsResource(self._client) @cached_property @@ -299,8 +306,15 @@ def list_evaluation_test_cases( class AsyncWorkspacesResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def agents(self) -> AsyncAgentsResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncAgentsResource(self._client) @cached_property @@ -585,6 +599,9 @@ def __init__(self, workspaces: WorkspacesResource) -> None: @cached_property def agents(self) -> AgentsResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AgentsResourceWithRawResponse(self._workspaces.agents) @@ -613,6 +630,9 @@ def __init__(self, workspaces: AsyncWorkspacesResource) -> None: @cached_property def agents(self) -> AsyncAgentsResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncAgentsResourceWithRawResponse(self._workspaces.agents) @@ -641,6 +661,9 @@ def __init__(self, workspaces: WorkspacesResource) -> None: @cached_property def agents(self) -> AgentsResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AgentsResourceWithStreamingResponse(self._workspaces.agents) @@ -669,4 +692,7 @@ def __init__(self, workspaces: AsyncWorkspacesResource) -> None: @cached_property def agents(self) -> AsyncAgentsResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncAgentsResourceWithStreamingResponse(self._workspaces.agents) diff --git a/src/gradient/resources/agents/evaluation_runs.py b/src/gradient/resources/agents/evaluation_runs.py index 2b5745af..50d51156 100644 --- a/src/gradient/resources/agents/evaluation_runs.py +++ b/src/gradient/resources/agents/evaluation_runs.py @@ -25,6 +25,10 @@ class EvaluationRunsResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> EvaluationRunsResourceWithRawResponse: """ @@ -231,6 +235,10 @@ def retrieve_results( class AsyncEvaluationRunsResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> AsyncEvaluationRunsResourceWithRawResponse: """ diff --git a/src/gradient/resources/agents/evaluation_test_cases.py b/src/gradient/resources/agents/evaluation_test_cases.py index 0e8cce03..cb47155d 100644 --- a/src/gradient/resources/agents/evaluation_test_cases.py +++ b/src/gradient/resources/agents/evaluation_test_cases.py @@ -34,6 +34,10 @@ class EvaluationTestCasesResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> EvaluationTestCasesResourceWithRawResponse: """ @@ -298,6 +302,10 @@ def list_evaluation_runs( class AsyncEvaluationTestCasesResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> AsyncEvaluationTestCasesResourceWithRawResponse: """ diff --git a/src/gradient/resources/agents/functions.py b/src/gradient/resources/agents/functions.py index 3d995d24..fc58d899 100644 --- a/src/gradient/resources/agents/functions.py +++ b/src/gradient/resources/agents/functions.py @@ -24,6 +24,10 @@ class FunctionsResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> FunctionsResourceWithRawResponse: """ @@ -229,6 +233,10 @@ def delete( class AsyncFunctionsResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> AsyncFunctionsResourceWithRawResponse: """ diff --git a/src/gradient/resources/agents/knowledge_bases.py b/src/gradient/resources/agents/knowledge_bases.py index deefd123..57268294 100644 --- a/src/gradient/resources/agents/knowledge_bases.py +++ b/src/gradient/resources/agents/knowledge_bases.py @@ -21,6 +21,10 @@ class KnowledgeBasesResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> KnowledgeBasesResourceWithRawResponse: """ @@ -160,6 +164,10 @@ def detach( class AsyncKnowledgeBasesResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> AsyncKnowledgeBasesResourceWithRawResponse: """ diff --git a/src/gradient/resources/agents/routes.py b/src/gradient/resources/agents/routes.py index dc37b7d2..3f80e8e8 100644 --- a/src/gradient/resources/agents/routes.py +++ b/src/gradient/resources/agents/routes.py @@ -25,6 +25,10 @@ class RoutesResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> RoutesResourceWithRawResponse: """ @@ -251,6 +255,10 @@ def view( class AsyncRoutesResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> AsyncRoutesResourceWithRawResponse: """ diff --git a/src/gradient/resources/agents/versions.py b/src/gradient/resources/agents/versions.py index 0331344a..90b55087 100644 --- a/src/gradient/resources/agents/versions.py +++ b/src/gradient/resources/agents/versions.py @@ -23,6 +23,10 @@ class VersionsResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> VersionsResourceWithRawResponse: """ @@ -145,6 +149,10 @@ def list( class AsyncVersionsResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> AsyncVersionsResourceWithRawResponse: """ diff --git a/src/gradient/resources/apps/apps.py b/src/gradient/resources/apps/apps.py index 889f2406..1caa9ee7 100644 --- a/src/gradient/resources/apps/apps.py +++ b/src/gradient/resources/apps/apps.py @@ -19,6 +19,18 @@ class AppsResource(SyncAPIResource): @cached_property def job_invocations(self) -> JobInvocationsResource: + """ + App Platform is a Platform-as-a-Service (PaaS) offering from DigitalOcean that allows + developers to publish code directly to DigitalOcean servers without worrying about the + underlying infrastructure. + + Most API operations are centered around a few core object types. Following are the + definitions of these types. These definitions will be omitted from the operation-specific + documentation. + + For documentation on app specifications (`AppSpec` objects), please refer to the + [product documentation](https://docs.digitalocean.com/products/app-platform/reference/app-spec/)). + """ return JobInvocationsResource(self._client) @cached_property @@ -44,6 +56,18 @@ def with_streaming_response(self) -> AppsResourceWithStreamingResponse: class AsyncAppsResource(AsyncAPIResource): @cached_property def job_invocations(self) -> AsyncJobInvocationsResource: + """ + App Platform is a Platform-as-a-Service (PaaS) offering from DigitalOcean that allows + developers to publish code directly to DigitalOcean servers without worrying about the + underlying infrastructure. + + Most API operations are centered around a few core object types. Following are the + definitions of these types. These definitions will be omitted from the operation-specific + documentation. + + For documentation on app specifications (`AppSpec` objects), please refer to the + [product documentation](https://docs.digitalocean.com/products/app-platform/reference/app-spec/)). + """ return AsyncJobInvocationsResource(self._client) @cached_property @@ -72,6 +96,18 @@ def __init__(self, apps: AppsResource) -> None: @cached_property def job_invocations(self) -> JobInvocationsResourceWithRawResponse: + """ + App Platform is a Platform-as-a-Service (PaaS) offering from DigitalOcean that allows + developers to publish code directly to DigitalOcean servers without worrying about the + underlying infrastructure. + + Most API operations are centered around a few core object types. Following are the + definitions of these types. These definitions will be omitted from the operation-specific + documentation. + + For documentation on app specifications (`AppSpec` objects), please refer to the + [product documentation](https://docs.digitalocean.com/products/app-platform/reference/app-spec/)). + """ return JobInvocationsResourceWithRawResponse(self._apps.job_invocations) @@ -81,6 +117,18 @@ def __init__(self, apps: AsyncAppsResource) -> None: @cached_property def job_invocations(self) -> AsyncJobInvocationsResourceWithRawResponse: + """ + App Platform is a Platform-as-a-Service (PaaS) offering from DigitalOcean that allows + developers to publish code directly to DigitalOcean servers without worrying about the + underlying infrastructure. + + Most API operations are centered around a few core object types. Following are the + definitions of these types. These definitions will be omitted from the operation-specific + documentation. + + For documentation on app specifications (`AppSpec` objects), please refer to the + [product documentation](https://docs.digitalocean.com/products/app-platform/reference/app-spec/)). + """ return AsyncJobInvocationsResourceWithRawResponse(self._apps.job_invocations) @@ -90,6 +138,18 @@ def __init__(self, apps: AppsResource) -> None: @cached_property def job_invocations(self) -> JobInvocationsResourceWithStreamingResponse: + """ + App Platform is a Platform-as-a-Service (PaaS) offering from DigitalOcean that allows + developers to publish code directly to DigitalOcean servers without worrying about the + underlying infrastructure. + + Most API operations are centered around a few core object types. Following are the + definitions of these types. These definitions will be omitted from the operation-specific + documentation. + + For documentation on app specifications (`AppSpec` objects), please refer to the + [product documentation](https://docs.digitalocean.com/products/app-platform/reference/app-spec/)). + """ return JobInvocationsResourceWithStreamingResponse(self._apps.job_invocations) @@ -99,4 +159,16 @@ def __init__(self, apps: AsyncAppsResource) -> None: @cached_property def job_invocations(self) -> AsyncJobInvocationsResourceWithStreamingResponse: + """ + App Platform is a Platform-as-a-Service (PaaS) offering from DigitalOcean that allows + developers to publish code directly to DigitalOcean servers without worrying about the + underlying infrastructure. + + Most API operations are centered around a few core object types. Following are the + definitions of these types. These definitions will be omitted from the operation-specific + documentation. + + For documentation on app specifications (`AppSpec` objects), please refer to the + [product documentation](https://docs.digitalocean.com/products/app-platform/reference/app-spec/)). + """ return AsyncJobInvocationsResourceWithStreamingResponse(self._apps.job_invocations) diff --git a/src/gradient/resources/apps/job_invocations.py b/src/gradient/resources/apps/job_invocations.py index 449dd829..02bc5a95 100644 --- a/src/gradient/resources/apps/job_invocations.py +++ b/src/gradient/resources/apps/job_invocations.py @@ -22,6 +22,19 @@ class JobInvocationsResource(SyncAPIResource): + """ + App Platform is a Platform-as-a-Service (PaaS) offering from DigitalOcean that allows + developers to publish code directly to DigitalOcean servers without worrying about the + underlying infrastructure. + + Most API operations are centered around a few core object types. Following are the + definitions of these types. These definitions will be omitted from the operation-specific + documentation. + + For documentation on app specifications (`AppSpec` objects), please refer to the + [product documentation](https://docs.digitalocean.com/products/app-platform/reference/app-spec/)). + """ + @cached_property def with_raw_response(self) -> JobInvocationsResourceWithRawResponse: """ @@ -88,6 +101,19 @@ def cancel( class AsyncJobInvocationsResource(AsyncAPIResource): + """ + App Platform is a Platform-as-a-Service (PaaS) offering from DigitalOcean that allows + developers to publish code directly to DigitalOcean servers without worrying about the + underlying infrastructure. + + Most API operations are centered around a few core object types. Following are the + definitions of these types. These definitions will be omitted from the operation-specific + documentation. + + For documentation on app specifications (`AppSpec` objects), please refer to the + [product documentation](https://docs.digitalocean.com/products/app-platform/reference/app-spec/)). + """ + @cached_property def with_raw_response(self) -> AsyncJobInvocationsResourceWithRawResponse: """ diff --git a/src/gradient/resources/billing.py b/src/gradient/resources/billing.py index f9f42aad..8261cfa9 100644 --- a/src/gradient/resources/billing.py +++ b/src/gradient/resources/billing.py @@ -25,6 +25,35 @@ class BillingResource(SyncAPIResource): + """ + The billing endpoints allow you to retrieve your account balance, invoices, + billing history, and insights. + + **Balance:** By sending requests to the `/v2/customers/my/balance` endpoint, you can + retrieve the balance information for the requested customer account. + + **Invoices:** [Invoices](https://docs.digitalocean.com/platform/billing/invoices/) + are generated on the first of each month for every DigitalOcean + customer. An invoice preview is generated daily, which can be accessed + with the `preview` keyword in place of `$INVOICE_UUID`. To interact with + invoices, you will generally send requests to the invoices endpoint at + `/v2/customers/my/invoices`. + + **Billing History:** Billing history is a record of billing events for your account. + For example, entries may include events like payments made, invoices + issued, or credits granted. To interact with invoices, you + will generally send requests to the invoices endpoint at + `/v2/customers/my/billing_history`. + + **Billing Insights:** Day-over-day changes in billing resource usage based on nightly invoice items, + including total amount, region, SKU, and description for a specified date range. + It is important to note that the daily resource usage may not reflect month-end billing totals when totaled for + a given month as nightly invoice items do not necessarily encompass all invoicing factors for the entire month. + `v2/billing/{account_urn}/insights/{start_date}/{end_date}` where account_urn is the URN of the customer + account, can be a team (do:team:uuid) or an organization (do:teamgroup:uuid). The date range specified by + start_date and end_date must be in YYYY-MM-DD format. + """ + @cached_property def with_raw_response(self) -> BillingResourceWithRawResponse: """ @@ -108,6 +137,35 @@ def list_insights( class AsyncBillingResource(AsyncAPIResource): + """ + The billing endpoints allow you to retrieve your account balance, invoices, + billing history, and insights. + + **Balance:** By sending requests to the `/v2/customers/my/balance` endpoint, you can + retrieve the balance information for the requested customer account. + + **Invoices:** [Invoices](https://docs.digitalocean.com/platform/billing/invoices/) + are generated on the first of each month for every DigitalOcean + customer. An invoice preview is generated daily, which can be accessed + with the `preview` keyword in place of `$INVOICE_UUID`. To interact with + invoices, you will generally send requests to the invoices endpoint at + `/v2/customers/my/invoices`. + + **Billing History:** Billing history is a record of billing events for your account. + For example, entries may include events like payments made, invoices + issued, or credits granted. To interact with invoices, you + will generally send requests to the invoices endpoint at + `/v2/customers/my/billing_history`. + + **Billing Insights:** Day-over-day changes in billing resource usage based on nightly invoice items, + including total amount, region, SKU, and description for a specified date range. + It is important to note that the daily resource usage may not reflect month-end billing totals when totaled for + a given month as nightly invoice items do not necessarily encompass all invoicing factors for the entire month. + `v2/billing/{account_urn}/insights/{start_date}/{end_date}` where account_urn is the URN of the customer + account, can be a team (do:team:uuid) or an organization (do:teamgroup:uuid). The date range specified by + start_date and end_date must be in YYYY-MM-DD format. + """ + @cached_property def with_raw_response(self) -> AsyncBillingResourceWithRawResponse: """ diff --git a/src/gradient/resources/chat/chat.py b/src/gradient/resources/chat/chat.py index ac933129..1175e6db 100644 --- a/src/gradient/resources/chat/chat.py +++ b/src/gradient/resources/chat/chat.py @@ -19,6 +19,9 @@ class ChatResource(SyncAPIResource): @cached_property def completions(self) -> CompletionsResource: + """ + Given a list of messages comprising a conversation, the model will return a response. + """ return CompletionsResource(self._client) @cached_property @@ -44,6 +47,9 @@ def with_streaming_response(self) -> ChatResourceWithStreamingResponse: class AsyncChatResource(AsyncAPIResource): @cached_property def completions(self) -> AsyncCompletionsResource: + """ + Given a list of messages comprising a conversation, the model will return a response. + """ return AsyncCompletionsResource(self._client) @cached_property @@ -72,6 +78,9 @@ def __init__(self, chat: ChatResource) -> None: @cached_property def completions(self) -> CompletionsResourceWithRawResponse: + """ + Given a list of messages comprising a conversation, the model will return a response. + """ return CompletionsResourceWithRawResponse(self._chat.completions) @@ -81,6 +90,9 @@ def __init__(self, chat: AsyncChatResource) -> None: @cached_property def completions(self) -> AsyncCompletionsResourceWithRawResponse: + """ + Given a list of messages comprising a conversation, the model will return a response. + """ return AsyncCompletionsResourceWithRawResponse(self._chat.completions) @@ -90,6 +102,9 @@ def __init__(self, chat: ChatResource) -> None: @cached_property def completions(self) -> CompletionsResourceWithStreamingResponse: + """ + Given a list of messages comprising a conversation, the model will return a response. + """ return CompletionsResourceWithStreamingResponse(self._chat.completions) @@ -99,4 +114,7 @@ def __init__(self, chat: AsyncChatResource) -> None: @cached_property def completions(self) -> AsyncCompletionsResourceWithStreamingResponse: + """ + Given a list of messages comprising a conversation, the model will return a response. + """ return AsyncCompletionsResourceWithStreamingResponse(self._chat.completions) diff --git a/src/gradient/resources/chat/completions.py b/src/gradient/resources/chat/completions.py index 779fffb0..d2ae1071 100644 --- a/src/gradient/resources/chat/completions.py +++ b/src/gradient/resources/chat/completions.py @@ -27,6 +27,10 @@ class CompletionsResource(SyncAPIResource): + """ + Given a list of messages comprising a conversation, the model will return a response. + """ + @cached_property def with_raw_response(self) -> CompletionsResourceWithRawResponse: """ @@ -517,6 +521,10 @@ def create( class AsyncCompletionsResource(AsyncAPIResource): + """ + Given a list of messages comprising a conversation, the model will return a response. + """ + @cached_property def with_raw_response(self) -> AsyncCompletionsResourceWithRawResponse: """ diff --git a/src/gradient/resources/databases/schema_registry/config.py b/src/gradient/resources/databases/schema_registry/config.py index e012dd77..825bd2ae 100644 --- a/src/gradient/resources/databases/schema_registry/config.py +++ b/src/gradient/resources/databases/schema_registry/config.py @@ -27,6 +27,32 @@ class ConfigResource(SyncAPIResource): + """ + DigitalOcean's [managed database service](https://docs.digitalocean.com/products/databases) + simplifies the creation and management of highly available database clusters. Currently, it + offers support for [PostgreSQL](http://docs.digitalocean.com/products/databases/postgresql/), + [Caching](https://docs.digitalocean.com/products/databases/redis/), + [Valkey](https://docs.digitalocean.com/products/databases/valkey/), + [MySQL](https://docs.digitalocean.com/products/databases/mysql/), + [MongoDB](https://docs.digitalocean.com/products/databases/mongodb/), and + [OpenSearch](https://docs.digitalocean.com/products/databases/opensearch/). + + By sending requests to the `/v2/databases` endpoint, you can list, create, or delete + database clusters as well as scale the size of a cluster, add or remove read-only replicas, + and manage other configuration details. + + Database clusters may be deployed in a multi-node, high-availability configuration. + If your machine type is above the basic nodes, your node plan is above the smallest option, + or you are running MongoDB, you may additionally include up to two standby nodes in your cluster. + + The size of individual nodes in a database cluster is represented by a human-readable slug, + which is used in some of the following requests. Each slug denotes the node's identifier, + CPU count, and amount of RAM, in that order. + + For a list of currently available database slugs and options, use the `/v2/databases/options` endpoint or use the + `doctl databases options` [command](https://docs.digitalocean.com/reference/doctl/reference/databases/options). + """ + @cached_property def with_raw_response(self) -> ConfigResourceWithRawResponse: """ @@ -230,6 +256,32 @@ def update_subject( class AsyncConfigResource(AsyncAPIResource): + """ + DigitalOcean's [managed database service](https://docs.digitalocean.com/products/databases) + simplifies the creation and management of highly available database clusters. Currently, it + offers support for [PostgreSQL](http://docs.digitalocean.com/products/databases/postgresql/), + [Caching](https://docs.digitalocean.com/products/databases/redis/), + [Valkey](https://docs.digitalocean.com/products/databases/valkey/), + [MySQL](https://docs.digitalocean.com/products/databases/mysql/), + [MongoDB](https://docs.digitalocean.com/products/databases/mongodb/), and + [OpenSearch](https://docs.digitalocean.com/products/databases/opensearch/). + + By sending requests to the `/v2/databases` endpoint, you can list, create, or delete + database clusters as well as scale the size of a cluster, add or remove read-only replicas, + and manage other configuration details. + + Database clusters may be deployed in a multi-node, high-availability configuration. + If your machine type is above the basic nodes, your node plan is above the smallest option, + or you are running MongoDB, you may additionally include up to two standby nodes in your cluster. + + The size of individual nodes in a database cluster is represented by a human-readable slug, + which is used in some of the following requests. Each slug denotes the node's identifier, + CPU count, and amount of RAM, in that order. + + For a list of currently available database slugs and options, use the `/v2/databases/options` endpoint or use the + `doctl databases options` [command](https://docs.digitalocean.com/reference/doctl/reference/databases/options). + """ + @cached_property def with_raw_response(self) -> AsyncConfigResourceWithRawResponse: """ diff --git a/src/gradient/resources/databases/schema_registry/schema_registry.py b/src/gradient/resources/databases/schema_registry/schema_registry.py index dd7d3dbe..de047c50 100644 --- a/src/gradient/resources/databases/schema_registry/schema_registry.py +++ b/src/gradient/resources/databases/schema_registry/schema_registry.py @@ -19,6 +19,31 @@ class SchemaRegistryResource(SyncAPIResource): @cached_property def config(self) -> ConfigResource: + """ + DigitalOcean's [managed database service](https://docs.digitalocean.com/products/databases) + simplifies the creation and management of highly available database clusters. Currently, it + offers support for [PostgreSQL](http://docs.digitalocean.com/products/databases/postgresql/), + [Caching](https://docs.digitalocean.com/products/databases/redis/), + [Valkey](https://docs.digitalocean.com/products/databases/valkey/), + [MySQL](https://docs.digitalocean.com/products/databases/mysql/), + [MongoDB](https://docs.digitalocean.com/products/databases/mongodb/), and + [OpenSearch](https://docs.digitalocean.com/products/databases/opensearch/). + + By sending requests to the `/v2/databases` endpoint, you can list, create, or delete + database clusters as well as scale the size of a cluster, add or remove read-only replicas, + and manage other configuration details. + + Database clusters may be deployed in a multi-node, high-availability configuration. + If your machine type is above the basic nodes, your node plan is above the smallest option, + or you are running MongoDB, you may additionally include up to two standby nodes in your cluster. + + The size of individual nodes in a database cluster is represented by a human-readable slug, + which is used in some of the following requests. Each slug denotes the node's identifier, + CPU count, and amount of RAM, in that order. + + For a list of currently available database slugs and options, use the `/v2/databases/options` endpoint or use the + `doctl databases options` [command](https://docs.digitalocean.com/reference/doctl/reference/databases/options). + """ return ConfigResource(self._client) @cached_property @@ -44,6 +69,31 @@ def with_streaming_response(self) -> SchemaRegistryResourceWithStreamingResponse class AsyncSchemaRegistryResource(AsyncAPIResource): @cached_property def config(self) -> AsyncConfigResource: + """ + DigitalOcean's [managed database service](https://docs.digitalocean.com/products/databases) + simplifies the creation and management of highly available database clusters. Currently, it + offers support for [PostgreSQL](http://docs.digitalocean.com/products/databases/postgresql/), + [Caching](https://docs.digitalocean.com/products/databases/redis/), + [Valkey](https://docs.digitalocean.com/products/databases/valkey/), + [MySQL](https://docs.digitalocean.com/products/databases/mysql/), + [MongoDB](https://docs.digitalocean.com/products/databases/mongodb/), and + [OpenSearch](https://docs.digitalocean.com/products/databases/opensearch/). + + By sending requests to the `/v2/databases` endpoint, you can list, create, or delete + database clusters as well as scale the size of a cluster, add or remove read-only replicas, + and manage other configuration details. + + Database clusters may be deployed in a multi-node, high-availability configuration. + If your machine type is above the basic nodes, your node plan is above the smallest option, + or you are running MongoDB, you may additionally include up to two standby nodes in your cluster. + + The size of individual nodes in a database cluster is represented by a human-readable slug, + which is used in some of the following requests. Each slug denotes the node's identifier, + CPU count, and amount of RAM, in that order. + + For a list of currently available database slugs and options, use the `/v2/databases/options` endpoint or use the + `doctl databases options` [command](https://docs.digitalocean.com/reference/doctl/reference/databases/options). + """ return AsyncConfigResource(self._client) @cached_property @@ -72,6 +122,31 @@ def __init__(self, schema_registry: SchemaRegistryResource) -> None: @cached_property def config(self) -> ConfigResourceWithRawResponse: + """ + DigitalOcean's [managed database service](https://docs.digitalocean.com/products/databases) + simplifies the creation and management of highly available database clusters. Currently, it + offers support for [PostgreSQL](http://docs.digitalocean.com/products/databases/postgresql/), + [Caching](https://docs.digitalocean.com/products/databases/redis/), + [Valkey](https://docs.digitalocean.com/products/databases/valkey/), + [MySQL](https://docs.digitalocean.com/products/databases/mysql/), + [MongoDB](https://docs.digitalocean.com/products/databases/mongodb/), and + [OpenSearch](https://docs.digitalocean.com/products/databases/opensearch/). + + By sending requests to the `/v2/databases` endpoint, you can list, create, or delete + database clusters as well as scale the size of a cluster, add or remove read-only replicas, + and manage other configuration details. + + Database clusters may be deployed in a multi-node, high-availability configuration. + If your machine type is above the basic nodes, your node plan is above the smallest option, + or you are running MongoDB, you may additionally include up to two standby nodes in your cluster. + + The size of individual nodes in a database cluster is represented by a human-readable slug, + which is used in some of the following requests. Each slug denotes the node's identifier, + CPU count, and amount of RAM, in that order. + + For a list of currently available database slugs and options, use the `/v2/databases/options` endpoint or use the + `doctl databases options` [command](https://docs.digitalocean.com/reference/doctl/reference/databases/options). + """ return ConfigResourceWithRawResponse(self._schema_registry.config) @@ -81,6 +156,31 @@ def __init__(self, schema_registry: AsyncSchemaRegistryResource) -> None: @cached_property def config(self) -> AsyncConfigResourceWithRawResponse: + """ + DigitalOcean's [managed database service](https://docs.digitalocean.com/products/databases) + simplifies the creation and management of highly available database clusters. Currently, it + offers support for [PostgreSQL](http://docs.digitalocean.com/products/databases/postgresql/), + [Caching](https://docs.digitalocean.com/products/databases/redis/), + [Valkey](https://docs.digitalocean.com/products/databases/valkey/), + [MySQL](https://docs.digitalocean.com/products/databases/mysql/), + [MongoDB](https://docs.digitalocean.com/products/databases/mongodb/), and + [OpenSearch](https://docs.digitalocean.com/products/databases/opensearch/). + + By sending requests to the `/v2/databases` endpoint, you can list, create, or delete + database clusters as well as scale the size of a cluster, add or remove read-only replicas, + and manage other configuration details. + + Database clusters may be deployed in a multi-node, high-availability configuration. + If your machine type is above the basic nodes, your node plan is above the smallest option, + or you are running MongoDB, you may additionally include up to two standby nodes in your cluster. + + The size of individual nodes in a database cluster is represented by a human-readable slug, + which is used in some of the following requests. Each slug denotes the node's identifier, + CPU count, and amount of RAM, in that order. + + For a list of currently available database slugs and options, use the `/v2/databases/options` endpoint or use the + `doctl databases options` [command](https://docs.digitalocean.com/reference/doctl/reference/databases/options). + """ return AsyncConfigResourceWithRawResponse(self._schema_registry.config) @@ -90,6 +190,31 @@ def __init__(self, schema_registry: SchemaRegistryResource) -> None: @cached_property def config(self) -> ConfigResourceWithStreamingResponse: + """ + DigitalOcean's [managed database service](https://docs.digitalocean.com/products/databases) + simplifies the creation and management of highly available database clusters. Currently, it + offers support for [PostgreSQL](http://docs.digitalocean.com/products/databases/postgresql/), + [Caching](https://docs.digitalocean.com/products/databases/redis/), + [Valkey](https://docs.digitalocean.com/products/databases/valkey/), + [MySQL](https://docs.digitalocean.com/products/databases/mysql/), + [MongoDB](https://docs.digitalocean.com/products/databases/mongodb/), and + [OpenSearch](https://docs.digitalocean.com/products/databases/opensearch/). + + By sending requests to the `/v2/databases` endpoint, you can list, create, or delete + database clusters as well as scale the size of a cluster, add or remove read-only replicas, + and manage other configuration details. + + Database clusters may be deployed in a multi-node, high-availability configuration. + If your machine type is above the basic nodes, your node plan is above the smallest option, + or you are running MongoDB, you may additionally include up to two standby nodes in your cluster. + + The size of individual nodes in a database cluster is represented by a human-readable slug, + which is used in some of the following requests. Each slug denotes the node's identifier, + CPU count, and amount of RAM, in that order. + + For a list of currently available database slugs and options, use the `/v2/databases/options` endpoint or use the + `doctl databases options` [command](https://docs.digitalocean.com/reference/doctl/reference/databases/options). + """ return ConfigResourceWithStreamingResponse(self._schema_registry.config) @@ -99,4 +224,29 @@ def __init__(self, schema_registry: AsyncSchemaRegistryResource) -> None: @cached_property def config(self) -> AsyncConfigResourceWithStreamingResponse: + """ + DigitalOcean's [managed database service](https://docs.digitalocean.com/products/databases) + simplifies the creation and management of highly available database clusters. Currently, it + offers support for [PostgreSQL](http://docs.digitalocean.com/products/databases/postgresql/), + [Caching](https://docs.digitalocean.com/products/databases/redis/), + [Valkey](https://docs.digitalocean.com/products/databases/valkey/), + [MySQL](https://docs.digitalocean.com/products/databases/mysql/), + [MongoDB](https://docs.digitalocean.com/products/databases/mongodb/), and + [OpenSearch](https://docs.digitalocean.com/products/databases/opensearch/). + + By sending requests to the `/v2/databases` endpoint, you can list, create, or delete + database clusters as well as scale the size of a cluster, add or remove read-only replicas, + and manage other configuration details. + + Database clusters may be deployed in a multi-node, high-availability configuration. + If your machine type is above the basic nodes, your node plan is above the smallest option, + or you are running MongoDB, you may additionally include up to two standby nodes in your cluster. + + The size of individual nodes in a database cluster is represented by a human-readable slug, + which is used in some of the following requests. Each slug denotes the node's identifier, + CPU count, and amount of RAM, in that order. + + For a list of currently available database slugs and options, use the `/v2/databases/options` endpoint or use the + `doctl databases options` [command](https://docs.digitalocean.com/reference/doctl/reference/databases/options). + """ return AsyncConfigResourceWithStreamingResponse(self._schema_registry.config) diff --git a/src/gradient/resources/gpu_droplets/account/account.py b/src/gradient/resources/gpu_droplets/account/account.py index 5bcaf269..05f71ea4 100644 --- a/src/gradient/resources/gpu_droplets/account/account.py +++ b/src/gradient/resources/gpu_droplets/account/account.py @@ -19,6 +19,7 @@ class AccountResource(SyncAPIResource): @cached_property def keys(self) -> KeysResource: + """Manage SSH keys available on your account.""" return KeysResource(self._client) @cached_property @@ -44,6 +45,7 @@ def with_streaming_response(self) -> AccountResourceWithStreamingResponse: class AsyncAccountResource(AsyncAPIResource): @cached_property def keys(self) -> AsyncKeysResource: + """Manage SSH keys available on your account.""" return AsyncKeysResource(self._client) @cached_property @@ -72,6 +74,7 @@ def __init__(self, account: AccountResource) -> None: @cached_property def keys(self) -> KeysResourceWithRawResponse: + """Manage SSH keys available on your account.""" return KeysResourceWithRawResponse(self._account.keys) @@ -81,6 +84,7 @@ def __init__(self, account: AsyncAccountResource) -> None: @cached_property def keys(self) -> AsyncKeysResourceWithRawResponse: + """Manage SSH keys available on your account.""" return AsyncKeysResourceWithRawResponse(self._account.keys) @@ -90,6 +94,7 @@ def __init__(self, account: AccountResource) -> None: @cached_property def keys(self) -> KeysResourceWithStreamingResponse: + """Manage SSH keys available on your account.""" return KeysResourceWithStreamingResponse(self._account.keys) @@ -99,4 +104,5 @@ def __init__(self, account: AsyncAccountResource) -> None: @cached_property def keys(self) -> AsyncKeysResourceWithStreamingResponse: + """Manage SSH keys available on your account.""" return AsyncKeysResourceWithStreamingResponse(self._account.keys) diff --git a/src/gradient/resources/gpu_droplets/account/keys.py b/src/gradient/resources/gpu_droplets/account/keys.py index f50b9945..22aa6f0d 100644 --- a/src/gradient/resources/gpu_droplets/account/keys.py +++ b/src/gradient/resources/gpu_droplets/account/keys.py @@ -27,6 +27,8 @@ class KeysResource(SyncAPIResource): + """Manage SSH keys available on your account.""" + @cached_property def with_raw_response(self) -> KeysResourceWithRawResponse: """ @@ -266,6 +268,8 @@ def delete( class AsyncKeysResource(AsyncAPIResource): + """Manage SSH keys available on your account.""" + @cached_property def with_raw_response(self) -> AsyncKeysResourceWithRawResponse: """ diff --git a/src/gradient/resources/gpu_droplets/actions.py b/src/gradient/resources/gpu_droplets/actions.py index a708fb67..dd8e55dc 100644 --- a/src/gradient/resources/gpu_droplets/actions.py +++ b/src/gradient/resources/gpu_droplets/actions.py @@ -29,6 +29,27 @@ class ActionsResource(SyncAPIResource): + """Droplet actions are tasks that can be executed on a Droplet. + + These can be + things like rebooting, resizing, snapshotting, etc. + + Droplet action requests are generally targeted at one of the "actions" + endpoints for a specific Droplet. The specific actions are usually + initiated by sending a POST request with the action and arguments as + parameters. + + Droplet action requests create a Droplet actions object, which can be used + to get information about the status of an action. Creating a Droplet + action is asynchronous: the HTTP call will return the action object before + the action has finished processing on the Droplet. The current status of + an action can be retrieved from either the Droplet actions endpoint or the + global actions endpoint. If a Droplet action is uncompleted it may block + the creation of a subsequent action for that Droplet, the locked attribute + of the Droplet will be true and attempts to create a Droplet action will + fail with a status of 422. + """ + @cached_property def with_raw_response(self) -> ActionsResourceWithRawResponse: """ @@ -1002,6 +1023,27 @@ def initiate( class AsyncActionsResource(AsyncAPIResource): + """Droplet actions are tasks that can be executed on a Droplet. + + These can be + things like rebooting, resizing, snapshotting, etc. + + Droplet action requests are generally targeted at one of the "actions" + endpoints for a specific Droplet. The specific actions are usually + initiated by sending a POST request with the action and arguments as + parameters. + + Droplet action requests create a Droplet actions object, which can be used + to get information about the status of an action. Creating a Droplet + action is asynchronous: the HTTP call will return the action object before + the action has finished processing on the Droplet. The current status of + an action can be retrieved from either the Droplet actions endpoint or the + global actions endpoint. If a Droplet action is uncompleted it may block + the creation of a subsequent action for that Droplet, the locked attribute + of the Droplet will be true and attempts to create a Droplet action will + fail with a status of 422. + """ + @cached_property def with_raw_response(self) -> AsyncActionsResourceWithRawResponse: """ diff --git a/src/gradient/resources/gpu_droplets/autoscale.py b/src/gradient/resources/gpu_droplets/autoscale.py index 8df17f7a..b529d9da 100644 --- a/src/gradient/resources/gpu_droplets/autoscale.py +++ b/src/gradient/resources/gpu_droplets/autoscale.py @@ -34,6 +34,10 @@ class AutoscaleResource(SyncAPIResource): + """ + Droplet autoscale pools manage automatic horizontal scaling for your applications based on resource usage (CPU, memory, or both) or a static configuration. + """ + @cached_property def with_raw_response(self) -> AutoscaleResourceWithRawResponse: """ @@ -441,6 +445,10 @@ def list_members( class AsyncAutoscaleResource(AsyncAPIResource): + """ + Droplet autoscale pools manage automatic horizontal scaling for your applications based on resource usage (CPU, memory, or both) or a static configuration. + """ + @cached_property def with_raw_response(self) -> AsyncAutoscaleResourceWithRawResponse: """ diff --git a/src/gradient/resources/gpu_droplets/backups.py b/src/gradient/resources/gpu_droplets/backups.py index 065aa3d1..a924c93b 100644 --- a/src/gradient/resources/gpu_droplets/backups.py +++ b/src/gradient/resources/gpu_droplets/backups.py @@ -25,6 +25,17 @@ class BackupsResource(SyncAPIResource): + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ + @cached_property def with_raw_response(self) -> BackupsResourceWithRawResponse: """ @@ -207,6 +218,17 @@ def retrieve_policy( class AsyncBackupsResource(AsyncAPIResource): + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ + @cached_property def with_raw_response(self) -> AsyncBackupsResourceWithRawResponse: """ diff --git a/src/gradient/resources/gpu_droplets/destroy_with_associated_resources.py b/src/gradient/resources/gpu_droplets/destroy_with_associated_resources.py index 2ccad852..04c8f5b3 100644 --- a/src/gradient/resources/gpu_droplets/destroy_with_associated_resources.py +++ b/src/gradient/resources/gpu_droplets/destroy_with_associated_resources.py @@ -27,6 +27,17 @@ class DestroyWithAssociatedResourcesResource(SyncAPIResource): + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ + @cached_property def with_raw_response(self) -> DestroyWithAssociatedResourcesResourceWithRawResponse: """ @@ -283,6 +294,17 @@ def retry( class AsyncDestroyWithAssociatedResourcesResource(AsyncAPIResource): + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ + @cached_property def with_raw_response(self) -> AsyncDestroyWithAssociatedResourcesResourceWithRawResponse: """ diff --git a/src/gradient/resources/gpu_droplets/firewalls/droplets.py b/src/gradient/resources/gpu_droplets/firewalls/droplets.py index 90bcb47e..b77bf1dc 100644 --- a/src/gradient/resources/gpu_droplets/firewalls/droplets.py +++ b/src/gradient/resources/gpu_droplets/firewalls/droplets.py @@ -23,6 +23,14 @@ class DropletsResource(SyncAPIResource): + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ + @cached_property def with_raw_response(self) -> DropletsResourceWithRawResponse: """ @@ -136,6 +144,14 @@ def remove( class AsyncDropletsResource(AsyncAPIResource): + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ + @cached_property def with_raw_response(self) -> AsyncDropletsResourceWithRawResponse: """ diff --git a/src/gradient/resources/gpu_droplets/firewalls/firewalls.py b/src/gradient/resources/gpu_droplets/firewalls/firewalls.py index a5fee406..4367941c 100644 --- a/src/gradient/resources/gpu_droplets/firewalls/firewalls.py +++ b/src/gradient/resources/gpu_droplets/firewalls/firewalls.py @@ -50,16 +50,45 @@ class FirewallsResource(SyncAPIResource): + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ + @cached_property def droplets(self) -> DropletsResource: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return DropletsResource(self._client) @cached_property def tags(self) -> TagsResource: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return TagsResource(self._client) @cached_property def rules(self) -> RulesResource: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return RulesResource(self._client) @cached_property @@ -283,16 +312,45 @@ def delete( class AsyncFirewallsResource(AsyncAPIResource): + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ + @cached_property def droplets(self) -> AsyncDropletsResource: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return AsyncDropletsResource(self._client) @cached_property def tags(self) -> AsyncTagsResource: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return AsyncTagsResource(self._client) @cached_property def rules(self) -> AsyncRulesResource: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return AsyncRulesResource(self._client) @cached_property @@ -537,14 +595,35 @@ def __init__(self, firewalls: FirewallsResource) -> None: @cached_property def droplets(self) -> DropletsResourceWithRawResponse: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return DropletsResourceWithRawResponse(self._firewalls.droplets) @cached_property def tags(self) -> TagsResourceWithRawResponse: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return TagsResourceWithRawResponse(self._firewalls.tags) @cached_property def rules(self) -> RulesResourceWithRawResponse: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return RulesResourceWithRawResponse(self._firewalls.rules) @@ -570,14 +649,35 @@ def __init__(self, firewalls: AsyncFirewallsResource) -> None: @cached_property def droplets(self) -> AsyncDropletsResourceWithRawResponse: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return AsyncDropletsResourceWithRawResponse(self._firewalls.droplets) @cached_property def tags(self) -> AsyncTagsResourceWithRawResponse: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return AsyncTagsResourceWithRawResponse(self._firewalls.tags) @cached_property def rules(self) -> AsyncRulesResourceWithRawResponse: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return AsyncRulesResourceWithRawResponse(self._firewalls.rules) @@ -603,14 +703,35 @@ def __init__(self, firewalls: FirewallsResource) -> None: @cached_property def droplets(self) -> DropletsResourceWithStreamingResponse: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return DropletsResourceWithStreamingResponse(self._firewalls.droplets) @cached_property def tags(self) -> TagsResourceWithStreamingResponse: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return TagsResourceWithStreamingResponse(self._firewalls.tags) @cached_property def rules(self) -> RulesResourceWithStreamingResponse: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return RulesResourceWithStreamingResponse(self._firewalls.rules) @@ -636,12 +757,33 @@ def __init__(self, firewalls: AsyncFirewallsResource) -> None: @cached_property def droplets(self) -> AsyncDropletsResourceWithStreamingResponse: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return AsyncDropletsResourceWithStreamingResponse(self._firewalls.droplets) @cached_property def tags(self) -> AsyncTagsResourceWithStreamingResponse: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return AsyncTagsResourceWithStreamingResponse(self._firewalls.tags) @cached_property def rules(self) -> AsyncRulesResourceWithStreamingResponse: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return AsyncRulesResourceWithStreamingResponse(self._firewalls.rules) diff --git a/src/gradient/resources/gpu_droplets/firewalls/rules.py b/src/gradient/resources/gpu_droplets/firewalls/rules.py index f669fc6d..bea27fe4 100644 --- a/src/gradient/resources/gpu_droplets/firewalls/rules.py +++ b/src/gradient/resources/gpu_droplets/firewalls/rules.py @@ -23,6 +23,14 @@ class RulesResource(SyncAPIResource): + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ + @cached_property def with_raw_response(self) -> RulesResourceWithRawResponse: """ @@ -148,6 +156,14 @@ def remove( class AsyncRulesResource(AsyncAPIResource): + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ + @cached_property def with_raw_response(self) -> AsyncRulesResourceWithRawResponse: """ diff --git a/src/gradient/resources/gpu_droplets/firewalls/tags.py b/src/gradient/resources/gpu_droplets/firewalls/tags.py index 82d613fb..c38788be 100644 --- a/src/gradient/resources/gpu_droplets/firewalls/tags.py +++ b/src/gradient/resources/gpu_droplets/firewalls/tags.py @@ -23,6 +23,14 @@ class TagsResource(SyncAPIResource): + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ + @cached_property def with_raw_response(self) -> TagsResourceWithRawResponse: """ @@ -142,6 +150,14 @@ def remove( class AsyncTagsResource(AsyncAPIResource): + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ + @cached_property def with_raw_response(self) -> AsyncTagsResourceWithRawResponse: """ diff --git a/src/gradient/resources/gpu_droplets/floating_ips/actions.py b/src/gradient/resources/gpu_droplets/floating_ips/actions.py index f73d5707..83e0b918 100644 --- a/src/gradient/resources/gpu_droplets/floating_ips/actions.py +++ b/src/gradient/resources/gpu_droplets/floating_ips/actions.py @@ -26,6 +26,28 @@ class ActionsResource(SyncAPIResource): + """ + As of 16 June 2022, we have renamed the Floating IP product to [Reserved IPs](https://docs.digitalocean.com/reference/api/api-reference/#tag/Reserved-IPs). + The Reserved IP product's endpoints function the exact same way as Floating IPs. + The only difference is the name change throughout the URLs and fields. + For example, the `floating_ips` field is now the `reserved_ips` field. + The Floating IP endpoints will remain active until fall 2023 before being + permanently deprecated. + + With the exception of the [Projects API](https://docs.digitalocean.com/reference/api/api-reference/#tag/Projects), + we will reflect this change as an additional field in the responses across the API + where the `floating_ip` field is used. For example, the Droplet metadata response + will contain the field `reserved_ips` in addition to the `floating_ips` field. + Floating IPs retrieved using the Projects API will retain the original name. + + Floating IP actions are commands that can be given to a DigitalOcean + floating IP. These requests are made on the actions endpoint of a specific + floating IP. + + An action object is returned. These objects hold the current status of the + requested action. + """ + @cached_property def with_raw_response(self) -> ActionsResourceWithRawResponse: """ @@ -228,6 +250,28 @@ def list( class AsyncActionsResource(AsyncAPIResource): + """ + As of 16 June 2022, we have renamed the Floating IP product to [Reserved IPs](https://docs.digitalocean.com/reference/api/api-reference/#tag/Reserved-IPs). + The Reserved IP product's endpoints function the exact same way as Floating IPs. + The only difference is the name change throughout the URLs and fields. + For example, the `floating_ips` field is now the `reserved_ips` field. + The Floating IP endpoints will remain active until fall 2023 before being + permanently deprecated. + + With the exception of the [Projects API](https://docs.digitalocean.com/reference/api/api-reference/#tag/Projects), + we will reflect this change as an additional field in the responses across the API + where the `floating_ip` field is used. For example, the Droplet metadata response + will contain the field `reserved_ips` in addition to the `floating_ips` field. + Floating IPs retrieved using the Projects API will retain the original name. + + Floating IP actions are commands that can be given to a DigitalOcean + floating IP. These requests are made on the actions endpoint of a specific + floating IP. + + An action object is returned. These objects hold the current status of the + requested action. + """ + @cached_property def with_raw_response(self) -> AsyncActionsResourceWithRawResponse: """ diff --git a/src/gradient/resources/gpu_droplets/floating_ips/floating_ips.py b/src/gradient/resources/gpu_droplets/floating_ips/floating_ips.py index f55bfd41..0e65e6aa 100644 --- a/src/gradient/resources/gpu_droplets/floating_ips/floating_ips.py +++ b/src/gradient/resources/gpu_droplets/floating_ips/floating_ips.py @@ -34,8 +34,51 @@ class FloatingIPsResource(SyncAPIResource): + """ + As of 16 June 2022, we have renamed the Floating IP product to [Reserved IPs](https://docs.digitalocean.com/reference/api/api-reference/#tag/Reserved-IPs). + The Reserved IP product's endpoints function the exact same way as Floating IPs. + The only difference is the name change throughout the URLs and fields. + For example, the `floating_ips` field is now the `reserved_ips` field. + The Floating IP endpoints will remain active until fall 2023 before being + permanently deprecated. + + With the exception of the [Projects API](https://docs.digitalocean.com/reference/api/api-reference/#tag/Projects), + we will reflect this change as an additional field in the responses across the API + where the `floating_ip` field is used. For example, the Droplet metadata response + will contain the field `reserved_ips` in addition to the `floating_ips` field. + Floating IPs retrieved using the Projects API will retain the original name. + + [DigitalOcean Floating IPs](https://docs.digitalocean.com/products/networking/reserved-ips/) + are publicly-accessible static IP addresses that can be mapped to one of + your Droplets. They can be used to create highly available setups or other + configurations requiring movable addresses. + + Floating IPs are bound to a specific region. + """ + @cached_property def actions(self) -> ActionsResource: + """ + As of 16 June 2022, we have renamed the Floating IP product to [Reserved IPs](https://docs.digitalocean.com/reference/api/api-reference/#tag/Reserved-IPs). + The Reserved IP product's endpoints function the exact same way as Floating IPs. + The only difference is the name change throughout the URLs and fields. + For example, the `floating_ips` field is now the `reserved_ips` field. + The Floating IP endpoints will remain active until fall 2023 before being + permanently deprecated. + + With the exception of the [Projects API](https://docs.digitalocean.com/reference/api/api-reference/#tag/Projects), + we will reflect this change as an additional field in the responses across the API + where the `floating_ip` field is used. For example, the Droplet metadata response + will contain the field `reserved_ips` in addition to the `floating_ips` field. + Floating IPs retrieved using the Projects API will retain the original name. + + Floating IP actions are commands that can be given to a DigitalOcean + floating IP. These requests are made on the actions endpoint of a specific + floating IP. + + An action object is returned. These objects hold the current status of the + requested action. + """ return ActionsResource(self._client) @cached_property @@ -285,8 +328,51 @@ def delete( class AsyncFloatingIPsResource(AsyncAPIResource): + """ + As of 16 June 2022, we have renamed the Floating IP product to [Reserved IPs](https://docs.digitalocean.com/reference/api/api-reference/#tag/Reserved-IPs). + The Reserved IP product's endpoints function the exact same way as Floating IPs. + The only difference is the name change throughout the URLs and fields. + For example, the `floating_ips` field is now the `reserved_ips` field. + The Floating IP endpoints will remain active until fall 2023 before being + permanently deprecated. + + With the exception of the [Projects API](https://docs.digitalocean.com/reference/api/api-reference/#tag/Projects), + we will reflect this change as an additional field in the responses across the API + where the `floating_ip` field is used. For example, the Droplet metadata response + will contain the field `reserved_ips` in addition to the `floating_ips` field. + Floating IPs retrieved using the Projects API will retain the original name. + + [DigitalOcean Floating IPs](https://docs.digitalocean.com/products/networking/reserved-ips/) + are publicly-accessible static IP addresses that can be mapped to one of + your Droplets. They can be used to create highly available setups or other + configurations requiring movable addresses. + + Floating IPs are bound to a specific region. + """ + @cached_property def actions(self) -> AsyncActionsResource: + """ + As of 16 June 2022, we have renamed the Floating IP product to [Reserved IPs](https://docs.digitalocean.com/reference/api/api-reference/#tag/Reserved-IPs). + The Reserved IP product's endpoints function the exact same way as Floating IPs. + The only difference is the name change throughout the URLs and fields. + For example, the `floating_ips` field is now the `reserved_ips` field. + The Floating IP endpoints will remain active until fall 2023 before being + permanently deprecated. + + With the exception of the [Projects API](https://docs.digitalocean.com/reference/api/api-reference/#tag/Projects), + we will reflect this change as an additional field in the responses across the API + where the `floating_ip` field is used. For example, the Droplet metadata response + will contain the field `reserved_ips` in addition to the `floating_ips` field. + Floating IPs retrieved using the Projects API will retain the original name. + + Floating IP actions are commands that can be given to a DigitalOcean + floating IP. These requests are made on the actions endpoint of a specific + floating IP. + + An action object is returned. These objects hold the current status of the + requested action. + """ return AsyncActionsResource(self._client) @cached_property @@ -554,6 +640,27 @@ def __init__(self, floating_ips: FloatingIPsResource) -> None: @cached_property def actions(self) -> ActionsResourceWithRawResponse: + """ + As of 16 June 2022, we have renamed the Floating IP product to [Reserved IPs](https://docs.digitalocean.com/reference/api/api-reference/#tag/Reserved-IPs). + The Reserved IP product's endpoints function the exact same way as Floating IPs. + The only difference is the name change throughout the URLs and fields. + For example, the `floating_ips` field is now the `reserved_ips` field. + The Floating IP endpoints will remain active until fall 2023 before being + permanently deprecated. + + With the exception of the [Projects API](https://docs.digitalocean.com/reference/api/api-reference/#tag/Projects), + we will reflect this change as an additional field in the responses across the API + where the `floating_ip` field is used. For example, the Droplet metadata response + will contain the field `reserved_ips` in addition to the `floating_ips` field. + Floating IPs retrieved using the Projects API will retain the original name. + + Floating IP actions are commands that can be given to a DigitalOcean + floating IP. These requests are made on the actions endpoint of a specific + floating IP. + + An action object is returned. These objects hold the current status of the + requested action. + """ return ActionsResourceWithRawResponse(self._floating_ips.actions) @@ -576,6 +683,27 @@ def __init__(self, floating_ips: AsyncFloatingIPsResource) -> None: @cached_property def actions(self) -> AsyncActionsResourceWithRawResponse: + """ + As of 16 June 2022, we have renamed the Floating IP product to [Reserved IPs](https://docs.digitalocean.com/reference/api/api-reference/#tag/Reserved-IPs). + The Reserved IP product's endpoints function the exact same way as Floating IPs. + The only difference is the name change throughout the URLs and fields. + For example, the `floating_ips` field is now the `reserved_ips` field. + The Floating IP endpoints will remain active until fall 2023 before being + permanently deprecated. + + With the exception of the [Projects API](https://docs.digitalocean.com/reference/api/api-reference/#tag/Projects), + we will reflect this change as an additional field in the responses across the API + where the `floating_ip` field is used. For example, the Droplet metadata response + will contain the field `reserved_ips` in addition to the `floating_ips` field. + Floating IPs retrieved using the Projects API will retain the original name. + + Floating IP actions are commands that can be given to a DigitalOcean + floating IP. These requests are made on the actions endpoint of a specific + floating IP. + + An action object is returned. These objects hold the current status of the + requested action. + """ return AsyncActionsResourceWithRawResponse(self._floating_ips.actions) @@ -598,6 +726,27 @@ def __init__(self, floating_ips: FloatingIPsResource) -> None: @cached_property def actions(self) -> ActionsResourceWithStreamingResponse: + """ + As of 16 June 2022, we have renamed the Floating IP product to [Reserved IPs](https://docs.digitalocean.com/reference/api/api-reference/#tag/Reserved-IPs). + The Reserved IP product's endpoints function the exact same way as Floating IPs. + The only difference is the name change throughout the URLs and fields. + For example, the `floating_ips` field is now the `reserved_ips` field. + The Floating IP endpoints will remain active until fall 2023 before being + permanently deprecated. + + With the exception of the [Projects API](https://docs.digitalocean.com/reference/api/api-reference/#tag/Projects), + we will reflect this change as an additional field in the responses across the API + where the `floating_ip` field is used. For example, the Droplet metadata response + will contain the field `reserved_ips` in addition to the `floating_ips` field. + Floating IPs retrieved using the Projects API will retain the original name. + + Floating IP actions are commands that can be given to a DigitalOcean + floating IP. These requests are made on the actions endpoint of a specific + floating IP. + + An action object is returned. These objects hold the current status of the + requested action. + """ return ActionsResourceWithStreamingResponse(self._floating_ips.actions) @@ -620,4 +769,25 @@ def __init__(self, floating_ips: AsyncFloatingIPsResource) -> None: @cached_property def actions(self) -> AsyncActionsResourceWithStreamingResponse: + """ + As of 16 June 2022, we have renamed the Floating IP product to [Reserved IPs](https://docs.digitalocean.com/reference/api/api-reference/#tag/Reserved-IPs). + The Reserved IP product's endpoints function the exact same way as Floating IPs. + The only difference is the name change throughout the URLs and fields. + For example, the `floating_ips` field is now the `reserved_ips` field. + The Floating IP endpoints will remain active until fall 2023 before being + permanently deprecated. + + With the exception of the [Projects API](https://docs.digitalocean.com/reference/api/api-reference/#tag/Projects), + we will reflect this change as an additional field in the responses across the API + where the `floating_ip` field is used. For example, the Droplet metadata response + will contain the field `reserved_ips` in addition to the `floating_ips` field. + Floating IPs retrieved using the Projects API will retain the original name. + + Floating IP actions are commands that can be given to a DigitalOcean + floating IP. These requests are made on the actions endpoint of a specific + floating IP. + + An action object is returned. These objects hold the current status of the + requested action. + """ return AsyncActionsResourceWithStreamingResponse(self._floating_ips.actions) diff --git a/src/gradient/resources/gpu_droplets/gpu_droplets.py b/src/gradient/resources/gpu_droplets/gpu_droplets.py index c9f84747..5c0b1274 100644 --- a/src/gradient/resources/gpu_droplets/gpu_droplets.py +++ b/src/gradient/resources/gpu_droplets/gpu_droplets.py @@ -135,48 +135,197 @@ class GPUDropletsResource(SyncAPIResource): + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ + @cached_property def backups(self) -> BackupsResource: + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ return BackupsResource(self._client) @cached_property def actions(self) -> ActionsResource: + """Droplet actions are tasks that can be executed on a Droplet. + + These can be + things like rebooting, resizing, snapshotting, etc. + + Droplet action requests are generally targeted at one of the "actions" + endpoints for a specific Droplet. The specific actions are usually + initiated by sending a POST request with the action and arguments as + parameters. + + Droplet action requests create a Droplet actions object, which can be used + to get information about the status of an action. Creating a Droplet + action is asynchronous: the HTTP call will return the action object before + the action has finished processing on the Droplet. The current status of + an action can be retrieved from either the Droplet actions endpoint or the + global actions endpoint. If a Droplet action is uncompleted it may block + the creation of a subsequent action for that Droplet, the locked attribute + of the Droplet will be true and attempts to create a Droplet action will + fail with a status of 422. + """ return ActionsResource(self._client) @cached_property def destroy_with_associated_resources(self) -> DestroyWithAssociatedResourcesResource: + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ return DestroyWithAssociatedResourcesResource(self._client) @cached_property def autoscale(self) -> AutoscaleResource: + """ + Droplet autoscale pools manage automatic horizontal scaling for your applications based on resource usage (CPU, memory, or both) or a static configuration. + """ return AutoscaleResource(self._client) @cached_property def firewalls(self) -> FirewallsResource: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return FirewallsResource(self._client) @cached_property def floating_ips(self) -> FloatingIPsResource: + """ + As of 16 June 2022, we have renamed the Floating IP product to [Reserved IPs](https://docs.digitalocean.com/reference/api/api-reference/#tag/Reserved-IPs). + The Reserved IP product's endpoints function the exact same way as Floating IPs. + The only difference is the name change throughout the URLs and fields. + For example, the `floating_ips` field is now the `reserved_ips` field. + The Floating IP endpoints will remain active until fall 2023 before being + permanently deprecated. + + With the exception of the [Projects API](https://docs.digitalocean.com/reference/api/api-reference/#tag/Projects), + we will reflect this change as an additional field in the responses across the API + where the `floating_ip` field is used. For example, the Droplet metadata response + will contain the field `reserved_ips` in addition to the `floating_ips` field. + Floating IPs retrieved using the Projects API will retain the original name. + + [DigitalOcean Floating IPs](https://docs.digitalocean.com/products/networking/reserved-ips/) + are publicly-accessible static IP addresses that can be mapped to one of + your Droplets. They can be used to create highly available setups or other + configurations requiring movable addresses. + + Floating IPs are bound to a specific region. + """ return FloatingIPsResource(self._client) @cached_property def images(self) -> ImagesResource: + """ + A DigitalOcean [image](https://docs.digitalocean.com/products/images/) can be + used to create a Droplet and may come in a number of flavors. Currently, + there are five types of images: snapshots, backups, applications, + distributions, and custom images. + + * [Snapshots](https://docs.digitalocean.com/products/snapshots/) provide + a full copy of an existing Droplet instance taken on demand. + + * [Backups](https://docs.digitalocean.com/products/backups/) are similar + to snapshots but are created automatically at regular intervals when + enabled for a Droplet. + + * [Custom images](https://docs.digitalocean.com/products/custom-images/) + are Linux-based virtual machine images (raw, qcow2, vhdx, vdi, and vmdk + formats are supported) that you may upload for use on DigitalOcean. + + * Distributions are the public Linux distributions that are available to + be used as a base to create Droplets. + + * Applications, or [1-Click Apps](https://docs.digitalocean.com/products/marketplace/), + are distributions pre-configured with additional software. + + To interact with images, you will generally send requests to the images + endpoint at /v2/images. + """ return ImagesResource(self._client) @cached_property def load_balancers(self) -> LoadBalancersResource: + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ return LoadBalancersResource(self._client) @cached_property def sizes(self) -> SizesResource: + """ + The sizes objects represent different packages of hardware resources that + can be used for Droplets. When a Droplet is created, a size must be + selected so that the correct resources can be allocated. + + Each size represents a plan that bundles together specific sets of + resources. This includes the amount of RAM, the number of virtual CPUs, + disk space, and transfer. The size object also includes the pricing + details and the regions that the size is available in. + """ return SizesResource(self._client) @cached_property def snapshots(self) -> SnapshotsResource: + """ + [Snapshots](https://docs.digitalocean.com/products/snapshots/) are saved + instances of a Droplet or a block storage volume, which is reflected in + the `resource_type` attribute. In order to avoid problems with compressing + filesystems, each defines a `min_disk_size` attribute which is the minimum + size of the Droplet or volume disk when creating a new resource from the + saved snapshot. + + To interact with snapshots, you will generally send requests to the + snapshots endpoint at `/v2/snapshots`. + """ return SnapshotsResource(self._client) @cached_property def volumes(self) -> VolumesResource: + """ + [DigitalOcean Block Storage Volumes](https://docs.digitalocean.com/products/volumes/) + provide expanded storage capacity for your Droplets and can be moved + between Droplets within a specific region. + + Volumes function as raw block devices, meaning they appear to the + operating system as locally attached storage which can be formatted using + any file system supported by the OS. They may be created in sizes from + 1GiB to 16TiB. + + By sending requests to the `/v2/volumes` endpoint, you can list, create, or + delete volumes as well as attach and detach them from Droplets + """ return VolumesResource(self._client) @cached_property @@ -906,48 +1055,197 @@ def list_snapshots( class AsyncGPUDropletsResource(AsyncAPIResource): + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ + @cached_property def backups(self) -> AsyncBackupsResource: + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ return AsyncBackupsResource(self._client) @cached_property def actions(self) -> AsyncActionsResource: + """Droplet actions are tasks that can be executed on a Droplet. + + These can be + things like rebooting, resizing, snapshotting, etc. + + Droplet action requests are generally targeted at one of the "actions" + endpoints for a specific Droplet. The specific actions are usually + initiated by sending a POST request with the action and arguments as + parameters. + + Droplet action requests create a Droplet actions object, which can be used + to get information about the status of an action. Creating a Droplet + action is asynchronous: the HTTP call will return the action object before + the action has finished processing on the Droplet. The current status of + an action can be retrieved from either the Droplet actions endpoint or the + global actions endpoint. If a Droplet action is uncompleted it may block + the creation of a subsequent action for that Droplet, the locked attribute + of the Droplet will be true and attempts to create a Droplet action will + fail with a status of 422. + """ return AsyncActionsResource(self._client) @cached_property def destroy_with_associated_resources(self) -> AsyncDestroyWithAssociatedResourcesResource: + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ return AsyncDestroyWithAssociatedResourcesResource(self._client) @cached_property def autoscale(self) -> AsyncAutoscaleResource: + """ + Droplet autoscale pools manage automatic horizontal scaling for your applications based on resource usage (CPU, memory, or both) or a static configuration. + """ return AsyncAutoscaleResource(self._client) @cached_property def firewalls(self) -> AsyncFirewallsResource: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return AsyncFirewallsResource(self._client) @cached_property def floating_ips(self) -> AsyncFloatingIPsResource: + """ + As of 16 June 2022, we have renamed the Floating IP product to [Reserved IPs](https://docs.digitalocean.com/reference/api/api-reference/#tag/Reserved-IPs). + The Reserved IP product's endpoints function the exact same way as Floating IPs. + The only difference is the name change throughout the URLs and fields. + For example, the `floating_ips` field is now the `reserved_ips` field. + The Floating IP endpoints will remain active until fall 2023 before being + permanently deprecated. + + With the exception of the [Projects API](https://docs.digitalocean.com/reference/api/api-reference/#tag/Projects), + we will reflect this change as an additional field in the responses across the API + where the `floating_ip` field is used. For example, the Droplet metadata response + will contain the field `reserved_ips` in addition to the `floating_ips` field. + Floating IPs retrieved using the Projects API will retain the original name. + + [DigitalOcean Floating IPs](https://docs.digitalocean.com/products/networking/reserved-ips/) + are publicly-accessible static IP addresses that can be mapped to one of + your Droplets. They can be used to create highly available setups or other + configurations requiring movable addresses. + + Floating IPs are bound to a specific region. + """ return AsyncFloatingIPsResource(self._client) @cached_property def images(self) -> AsyncImagesResource: + """ + A DigitalOcean [image](https://docs.digitalocean.com/products/images/) can be + used to create a Droplet and may come in a number of flavors. Currently, + there are five types of images: snapshots, backups, applications, + distributions, and custom images. + + * [Snapshots](https://docs.digitalocean.com/products/snapshots/) provide + a full copy of an existing Droplet instance taken on demand. + + * [Backups](https://docs.digitalocean.com/products/backups/) are similar + to snapshots but are created automatically at regular intervals when + enabled for a Droplet. + + * [Custom images](https://docs.digitalocean.com/products/custom-images/) + are Linux-based virtual machine images (raw, qcow2, vhdx, vdi, and vmdk + formats are supported) that you may upload for use on DigitalOcean. + + * Distributions are the public Linux distributions that are available to + be used as a base to create Droplets. + + * Applications, or [1-Click Apps](https://docs.digitalocean.com/products/marketplace/), + are distributions pre-configured with additional software. + + To interact with images, you will generally send requests to the images + endpoint at /v2/images. + """ return AsyncImagesResource(self._client) @cached_property def load_balancers(self) -> AsyncLoadBalancersResource: + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ return AsyncLoadBalancersResource(self._client) @cached_property def sizes(self) -> AsyncSizesResource: + """ + The sizes objects represent different packages of hardware resources that + can be used for Droplets. When a Droplet is created, a size must be + selected so that the correct resources can be allocated. + + Each size represents a plan that bundles together specific sets of + resources. This includes the amount of RAM, the number of virtual CPUs, + disk space, and transfer. The size object also includes the pricing + details and the regions that the size is available in. + """ return AsyncSizesResource(self._client) @cached_property def snapshots(self) -> AsyncSnapshotsResource: + """ + [Snapshots](https://docs.digitalocean.com/products/snapshots/) are saved + instances of a Droplet or a block storage volume, which is reflected in + the `resource_type` attribute. In order to avoid problems with compressing + filesystems, each defines a `min_disk_size` attribute which is the minimum + size of the Droplet or volume disk when creating a new resource from the + saved snapshot. + + To interact with snapshots, you will generally send requests to the + snapshots endpoint at `/v2/snapshots`. + """ return AsyncSnapshotsResource(self._client) @cached_property def volumes(self) -> AsyncVolumesResource: + """ + [DigitalOcean Block Storage Volumes](https://docs.digitalocean.com/products/volumes/) + provide expanded storage capacity for your Droplets and can be moved + between Droplets within a specific region. + + Volumes function as raw block devices, meaning they appear to the + operating system as locally attached storage which can be formatted using + any file system supported by the OS. They may be created in sizes from + 1GiB to 16TiB. + + By sending requests to the `/v2/volumes` endpoint, you can list, create, or + delete volumes as well as attach and detach them from Droplets + """ return AsyncVolumesResource(self._client) @cached_property @@ -1710,48 +2008,186 @@ def __init__(self, gpu_droplets: GPUDropletsResource) -> None: @cached_property def backups(self) -> BackupsResourceWithRawResponse: + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ return BackupsResourceWithRawResponse(self._gpu_droplets.backups) @cached_property def actions(self) -> ActionsResourceWithRawResponse: + """Droplet actions are tasks that can be executed on a Droplet. + + These can be + things like rebooting, resizing, snapshotting, etc. + + Droplet action requests are generally targeted at one of the "actions" + endpoints for a specific Droplet. The specific actions are usually + initiated by sending a POST request with the action and arguments as + parameters. + + Droplet action requests create a Droplet actions object, which can be used + to get information about the status of an action. Creating a Droplet + action is asynchronous: the HTTP call will return the action object before + the action has finished processing on the Droplet. The current status of + an action can be retrieved from either the Droplet actions endpoint or the + global actions endpoint. If a Droplet action is uncompleted it may block + the creation of a subsequent action for that Droplet, the locked attribute + of the Droplet will be true and attempts to create a Droplet action will + fail with a status of 422. + """ return ActionsResourceWithRawResponse(self._gpu_droplets.actions) @cached_property def destroy_with_associated_resources(self) -> DestroyWithAssociatedResourcesResourceWithRawResponse: + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ return DestroyWithAssociatedResourcesResourceWithRawResponse( self._gpu_droplets.destroy_with_associated_resources ) @cached_property def autoscale(self) -> AutoscaleResourceWithRawResponse: + """ + Droplet autoscale pools manage automatic horizontal scaling for your applications based on resource usage (CPU, memory, or both) or a static configuration. + """ return AutoscaleResourceWithRawResponse(self._gpu_droplets.autoscale) @cached_property def firewalls(self) -> FirewallsResourceWithRawResponse: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return FirewallsResourceWithRawResponse(self._gpu_droplets.firewalls) @cached_property def floating_ips(self) -> FloatingIPsResourceWithRawResponse: + """ + As of 16 June 2022, we have renamed the Floating IP product to [Reserved IPs](https://docs.digitalocean.com/reference/api/api-reference/#tag/Reserved-IPs). + The Reserved IP product's endpoints function the exact same way as Floating IPs. + The only difference is the name change throughout the URLs and fields. + For example, the `floating_ips` field is now the `reserved_ips` field. + The Floating IP endpoints will remain active until fall 2023 before being + permanently deprecated. + + With the exception of the [Projects API](https://docs.digitalocean.com/reference/api/api-reference/#tag/Projects), + we will reflect this change as an additional field in the responses across the API + where the `floating_ip` field is used. For example, the Droplet metadata response + will contain the field `reserved_ips` in addition to the `floating_ips` field. + Floating IPs retrieved using the Projects API will retain the original name. + + [DigitalOcean Floating IPs](https://docs.digitalocean.com/products/networking/reserved-ips/) + are publicly-accessible static IP addresses that can be mapped to one of + your Droplets. They can be used to create highly available setups or other + configurations requiring movable addresses. + + Floating IPs are bound to a specific region. + """ return FloatingIPsResourceWithRawResponse(self._gpu_droplets.floating_ips) @cached_property def images(self) -> ImagesResourceWithRawResponse: + """ + A DigitalOcean [image](https://docs.digitalocean.com/products/images/) can be + used to create a Droplet and may come in a number of flavors. Currently, + there are five types of images: snapshots, backups, applications, + distributions, and custom images. + + * [Snapshots](https://docs.digitalocean.com/products/snapshots/) provide + a full copy of an existing Droplet instance taken on demand. + + * [Backups](https://docs.digitalocean.com/products/backups/) are similar + to snapshots but are created automatically at regular intervals when + enabled for a Droplet. + + * [Custom images](https://docs.digitalocean.com/products/custom-images/) + are Linux-based virtual machine images (raw, qcow2, vhdx, vdi, and vmdk + formats are supported) that you may upload for use on DigitalOcean. + + * Distributions are the public Linux distributions that are available to + be used as a base to create Droplets. + + * Applications, or [1-Click Apps](https://docs.digitalocean.com/products/marketplace/), + are distributions pre-configured with additional software. + + To interact with images, you will generally send requests to the images + endpoint at /v2/images. + """ return ImagesResourceWithRawResponse(self._gpu_droplets.images) @cached_property def load_balancers(self) -> LoadBalancersResourceWithRawResponse: + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ return LoadBalancersResourceWithRawResponse(self._gpu_droplets.load_balancers) @cached_property def sizes(self) -> SizesResourceWithRawResponse: + """ + The sizes objects represent different packages of hardware resources that + can be used for Droplets. When a Droplet is created, a size must be + selected so that the correct resources can be allocated. + + Each size represents a plan that bundles together specific sets of + resources. This includes the amount of RAM, the number of virtual CPUs, + disk space, and transfer. The size object also includes the pricing + details and the regions that the size is available in. + """ return SizesResourceWithRawResponse(self._gpu_droplets.sizes) @cached_property def snapshots(self) -> SnapshotsResourceWithRawResponse: + """ + [Snapshots](https://docs.digitalocean.com/products/snapshots/) are saved + instances of a Droplet or a block storage volume, which is reflected in + the `resource_type` attribute. In order to avoid problems with compressing + filesystems, each defines a `min_disk_size` attribute which is the minimum + size of the Droplet or volume disk when creating a new resource from the + saved snapshot. + + To interact with snapshots, you will generally send requests to the + snapshots endpoint at `/v2/snapshots`. + """ return SnapshotsResourceWithRawResponse(self._gpu_droplets.snapshots) @cached_property def volumes(self) -> VolumesResourceWithRawResponse: + """ + [DigitalOcean Block Storage Volumes](https://docs.digitalocean.com/products/volumes/) + provide expanded storage capacity for your Droplets and can be moved + between Droplets within a specific region. + + Volumes function as raw block devices, meaning they appear to the + operating system as locally attached storage which can be formatted using + any file system supported by the OS. They may be created in sizes from + 1GiB to 16TiB. + + By sending requests to the `/v2/volumes` endpoint, you can list, create, or + delete volumes as well as attach and detach them from Droplets + """ return VolumesResourceWithRawResponse(self._gpu_droplets.volumes) @cached_property @@ -1793,48 +2229,186 @@ def __init__(self, gpu_droplets: AsyncGPUDropletsResource) -> None: @cached_property def backups(self) -> AsyncBackupsResourceWithRawResponse: + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ return AsyncBackupsResourceWithRawResponse(self._gpu_droplets.backups) @cached_property def actions(self) -> AsyncActionsResourceWithRawResponse: + """Droplet actions are tasks that can be executed on a Droplet. + + These can be + things like rebooting, resizing, snapshotting, etc. + + Droplet action requests are generally targeted at one of the "actions" + endpoints for a specific Droplet. The specific actions are usually + initiated by sending a POST request with the action and arguments as + parameters. + + Droplet action requests create a Droplet actions object, which can be used + to get information about the status of an action. Creating a Droplet + action is asynchronous: the HTTP call will return the action object before + the action has finished processing on the Droplet. The current status of + an action can be retrieved from either the Droplet actions endpoint or the + global actions endpoint. If a Droplet action is uncompleted it may block + the creation of a subsequent action for that Droplet, the locked attribute + of the Droplet will be true and attempts to create a Droplet action will + fail with a status of 422. + """ return AsyncActionsResourceWithRawResponse(self._gpu_droplets.actions) @cached_property def destroy_with_associated_resources(self) -> AsyncDestroyWithAssociatedResourcesResourceWithRawResponse: + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ return AsyncDestroyWithAssociatedResourcesResourceWithRawResponse( self._gpu_droplets.destroy_with_associated_resources ) @cached_property def autoscale(self) -> AsyncAutoscaleResourceWithRawResponse: + """ + Droplet autoscale pools manage automatic horizontal scaling for your applications based on resource usage (CPU, memory, or both) or a static configuration. + """ return AsyncAutoscaleResourceWithRawResponse(self._gpu_droplets.autoscale) @cached_property def firewalls(self) -> AsyncFirewallsResourceWithRawResponse: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return AsyncFirewallsResourceWithRawResponse(self._gpu_droplets.firewalls) @cached_property def floating_ips(self) -> AsyncFloatingIPsResourceWithRawResponse: + """ + As of 16 June 2022, we have renamed the Floating IP product to [Reserved IPs](https://docs.digitalocean.com/reference/api/api-reference/#tag/Reserved-IPs). + The Reserved IP product's endpoints function the exact same way as Floating IPs. + The only difference is the name change throughout the URLs and fields. + For example, the `floating_ips` field is now the `reserved_ips` field. + The Floating IP endpoints will remain active until fall 2023 before being + permanently deprecated. + + With the exception of the [Projects API](https://docs.digitalocean.com/reference/api/api-reference/#tag/Projects), + we will reflect this change as an additional field in the responses across the API + where the `floating_ip` field is used. For example, the Droplet metadata response + will contain the field `reserved_ips` in addition to the `floating_ips` field. + Floating IPs retrieved using the Projects API will retain the original name. + + [DigitalOcean Floating IPs](https://docs.digitalocean.com/products/networking/reserved-ips/) + are publicly-accessible static IP addresses that can be mapped to one of + your Droplets. They can be used to create highly available setups or other + configurations requiring movable addresses. + + Floating IPs are bound to a specific region. + """ return AsyncFloatingIPsResourceWithRawResponse(self._gpu_droplets.floating_ips) @cached_property def images(self) -> AsyncImagesResourceWithRawResponse: + """ + A DigitalOcean [image](https://docs.digitalocean.com/products/images/) can be + used to create a Droplet and may come in a number of flavors. Currently, + there are five types of images: snapshots, backups, applications, + distributions, and custom images. + + * [Snapshots](https://docs.digitalocean.com/products/snapshots/) provide + a full copy of an existing Droplet instance taken on demand. + + * [Backups](https://docs.digitalocean.com/products/backups/) are similar + to snapshots but are created automatically at regular intervals when + enabled for a Droplet. + + * [Custom images](https://docs.digitalocean.com/products/custom-images/) + are Linux-based virtual machine images (raw, qcow2, vhdx, vdi, and vmdk + formats are supported) that you may upload for use on DigitalOcean. + + * Distributions are the public Linux distributions that are available to + be used as a base to create Droplets. + + * Applications, or [1-Click Apps](https://docs.digitalocean.com/products/marketplace/), + are distributions pre-configured with additional software. + + To interact with images, you will generally send requests to the images + endpoint at /v2/images. + """ return AsyncImagesResourceWithRawResponse(self._gpu_droplets.images) @cached_property def load_balancers(self) -> AsyncLoadBalancersResourceWithRawResponse: + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ return AsyncLoadBalancersResourceWithRawResponse(self._gpu_droplets.load_balancers) @cached_property def sizes(self) -> AsyncSizesResourceWithRawResponse: + """ + The sizes objects represent different packages of hardware resources that + can be used for Droplets. When a Droplet is created, a size must be + selected so that the correct resources can be allocated. + + Each size represents a plan that bundles together specific sets of + resources. This includes the amount of RAM, the number of virtual CPUs, + disk space, and transfer. The size object also includes the pricing + details and the regions that the size is available in. + """ return AsyncSizesResourceWithRawResponse(self._gpu_droplets.sizes) @cached_property def snapshots(self) -> AsyncSnapshotsResourceWithRawResponse: + """ + [Snapshots](https://docs.digitalocean.com/products/snapshots/) are saved + instances of a Droplet or a block storage volume, which is reflected in + the `resource_type` attribute. In order to avoid problems with compressing + filesystems, each defines a `min_disk_size` attribute which is the minimum + size of the Droplet or volume disk when creating a new resource from the + saved snapshot. + + To interact with snapshots, you will generally send requests to the + snapshots endpoint at `/v2/snapshots`. + """ return AsyncSnapshotsResourceWithRawResponse(self._gpu_droplets.snapshots) @cached_property def volumes(self) -> AsyncVolumesResourceWithRawResponse: + """ + [DigitalOcean Block Storage Volumes](https://docs.digitalocean.com/products/volumes/) + provide expanded storage capacity for your Droplets and can be moved + between Droplets within a specific region. + + Volumes function as raw block devices, meaning they appear to the + operating system as locally attached storage which can be formatted using + any file system supported by the OS. They may be created in sizes from + 1GiB to 16TiB. + + By sending requests to the `/v2/volumes` endpoint, you can list, create, or + delete volumes as well as attach and detach them from Droplets + """ return AsyncVolumesResourceWithRawResponse(self._gpu_droplets.volumes) @cached_property @@ -1876,48 +2450,186 @@ def __init__(self, gpu_droplets: GPUDropletsResource) -> None: @cached_property def backups(self) -> BackupsResourceWithStreamingResponse: + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ return BackupsResourceWithStreamingResponse(self._gpu_droplets.backups) @cached_property def actions(self) -> ActionsResourceWithStreamingResponse: + """Droplet actions are tasks that can be executed on a Droplet. + + These can be + things like rebooting, resizing, snapshotting, etc. + + Droplet action requests are generally targeted at one of the "actions" + endpoints for a specific Droplet. The specific actions are usually + initiated by sending a POST request with the action and arguments as + parameters. + + Droplet action requests create a Droplet actions object, which can be used + to get information about the status of an action. Creating a Droplet + action is asynchronous: the HTTP call will return the action object before + the action has finished processing on the Droplet. The current status of + an action can be retrieved from either the Droplet actions endpoint or the + global actions endpoint. If a Droplet action is uncompleted it may block + the creation of a subsequent action for that Droplet, the locked attribute + of the Droplet will be true and attempts to create a Droplet action will + fail with a status of 422. + """ return ActionsResourceWithStreamingResponse(self._gpu_droplets.actions) @cached_property def destroy_with_associated_resources(self) -> DestroyWithAssociatedResourcesResourceWithStreamingResponse: + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ return DestroyWithAssociatedResourcesResourceWithStreamingResponse( self._gpu_droplets.destroy_with_associated_resources ) @cached_property def autoscale(self) -> AutoscaleResourceWithStreamingResponse: + """ + Droplet autoscale pools manage automatic horizontal scaling for your applications based on resource usage (CPU, memory, or both) or a static configuration. + """ return AutoscaleResourceWithStreamingResponse(self._gpu_droplets.autoscale) @cached_property def firewalls(self) -> FirewallsResourceWithStreamingResponse: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return FirewallsResourceWithStreamingResponse(self._gpu_droplets.firewalls) @cached_property def floating_ips(self) -> FloatingIPsResourceWithStreamingResponse: + """ + As of 16 June 2022, we have renamed the Floating IP product to [Reserved IPs](https://docs.digitalocean.com/reference/api/api-reference/#tag/Reserved-IPs). + The Reserved IP product's endpoints function the exact same way as Floating IPs. + The only difference is the name change throughout the URLs and fields. + For example, the `floating_ips` field is now the `reserved_ips` field. + The Floating IP endpoints will remain active until fall 2023 before being + permanently deprecated. + + With the exception of the [Projects API](https://docs.digitalocean.com/reference/api/api-reference/#tag/Projects), + we will reflect this change as an additional field in the responses across the API + where the `floating_ip` field is used. For example, the Droplet metadata response + will contain the field `reserved_ips` in addition to the `floating_ips` field. + Floating IPs retrieved using the Projects API will retain the original name. + + [DigitalOcean Floating IPs](https://docs.digitalocean.com/products/networking/reserved-ips/) + are publicly-accessible static IP addresses that can be mapped to one of + your Droplets. They can be used to create highly available setups or other + configurations requiring movable addresses. + + Floating IPs are bound to a specific region. + """ return FloatingIPsResourceWithStreamingResponse(self._gpu_droplets.floating_ips) @cached_property def images(self) -> ImagesResourceWithStreamingResponse: + """ + A DigitalOcean [image](https://docs.digitalocean.com/products/images/) can be + used to create a Droplet and may come in a number of flavors. Currently, + there are five types of images: snapshots, backups, applications, + distributions, and custom images. + + * [Snapshots](https://docs.digitalocean.com/products/snapshots/) provide + a full copy of an existing Droplet instance taken on demand. + + * [Backups](https://docs.digitalocean.com/products/backups/) are similar + to snapshots but are created automatically at regular intervals when + enabled for a Droplet. + + * [Custom images](https://docs.digitalocean.com/products/custom-images/) + are Linux-based virtual machine images (raw, qcow2, vhdx, vdi, and vmdk + formats are supported) that you may upload for use on DigitalOcean. + + * Distributions are the public Linux distributions that are available to + be used as a base to create Droplets. + + * Applications, or [1-Click Apps](https://docs.digitalocean.com/products/marketplace/), + are distributions pre-configured with additional software. + + To interact with images, you will generally send requests to the images + endpoint at /v2/images. + """ return ImagesResourceWithStreamingResponse(self._gpu_droplets.images) @cached_property def load_balancers(self) -> LoadBalancersResourceWithStreamingResponse: + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ return LoadBalancersResourceWithStreamingResponse(self._gpu_droplets.load_balancers) @cached_property def sizes(self) -> SizesResourceWithStreamingResponse: + """ + The sizes objects represent different packages of hardware resources that + can be used for Droplets. When a Droplet is created, a size must be + selected so that the correct resources can be allocated. + + Each size represents a plan that bundles together specific sets of + resources. This includes the amount of RAM, the number of virtual CPUs, + disk space, and transfer. The size object also includes the pricing + details and the regions that the size is available in. + """ return SizesResourceWithStreamingResponse(self._gpu_droplets.sizes) @cached_property def snapshots(self) -> SnapshotsResourceWithStreamingResponse: + """ + [Snapshots](https://docs.digitalocean.com/products/snapshots/) are saved + instances of a Droplet or a block storage volume, which is reflected in + the `resource_type` attribute. In order to avoid problems with compressing + filesystems, each defines a `min_disk_size` attribute which is the minimum + size of the Droplet or volume disk when creating a new resource from the + saved snapshot. + + To interact with snapshots, you will generally send requests to the + snapshots endpoint at `/v2/snapshots`. + """ return SnapshotsResourceWithStreamingResponse(self._gpu_droplets.snapshots) @cached_property def volumes(self) -> VolumesResourceWithStreamingResponse: + """ + [DigitalOcean Block Storage Volumes](https://docs.digitalocean.com/products/volumes/) + provide expanded storage capacity for your Droplets and can be moved + between Droplets within a specific region. + + Volumes function as raw block devices, meaning they appear to the + operating system as locally attached storage which can be formatted using + any file system supported by the OS. They may be created in sizes from + 1GiB to 16TiB. + + By sending requests to the `/v2/volumes` endpoint, you can list, create, or + delete volumes as well as attach and detach them from Droplets + """ return VolumesResourceWithStreamingResponse(self._gpu_droplets.volumes) @cached_property @@ -1959,48 +2671,186 @@ def __init__(self, gpu_droplets: AsyncGPUDropletsResource) -> None: @cached_property def backups(self) -> AsyncBackupsResourceWithStreamingResponse: + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ return AsyncBackupsResourceWithStreamingResponse(self._gpu_droplets.backups) @cached_property def actions(self) -> AsyncActionsResourceWithStreamingResponse: + """Droplet actions are tasks that can be executed on a Droplet. + + These can be + things like rebooting, resizing, snapshotting, etc. + + Droplet action requests are generally targeted at one of the "actions" + endpoints for a specific Droplet. The specific actions are usually + initiated by sending a POST request with the action and arguments as + parameters. + + Droplet action requests create a Droplet actions object, which can be used + to get information about the status of an action. Creating a Droplet + action is asynchronous: the HTTP call will return the action object before + the action has finished processing on the Droplet. The current status of + an action can be retrieved from either the Droplet actions endpoint or the + global actions endpoint. If a Droplet action is uncompleted it may block + the creation of a subsequent action for that Droplet, the locked attribute + of the Droplet will be true and attempts to create a Droplet action will + fail with a status of 422. + """ return AsyncActionsResourceWithStreamingResponse(self._gpu_droplets.actions) @cached_property def destroy_with_associated_resources(self) -> AsyncDestroyWithAssociatedResourcesResourceWithStreamingResponse: + """ + A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean + virtual machine. By sending requests to the Droplet endpoint, you can + list, create, or delete Droplets. + + Some of the attributes will have an object value. The `region` and `image` + objects will all contain the standard attributes of their associated + types. Find more information about each of these objects in their + respective sections. + """ return AsyncDestroyWithAssociatedResourcesResourceWithStreamingResponse( self._gpu_droplets.destroy_with_associated_resources ) @cached_property def autoscale(self) -> AsyncAutoscaleResourceWithStreamingResponse: + """ + Droplet autoscale pools manage automatic horizontal scaling for your applications based on resource usage (CPU, memory, or both) or a static configuration. + """ return AsyncAutoscaleResourceWithStreamingResponse(self._gpu_droplets.autoscale) @cached_property def firewalls(self) -> AsyncFirewallsResourceWithStreamingResponse: + """ + [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) + provide the ability to restrict network access to and from a Droplet + allowing you to define which ports will accept inbound or outbound + connections. By sending requests to the `/v2/firewalls` endpoint, you can + list, create, or delete firewalls as well as modify access rules. + """ return AsyncFirewallsResourceWithStreamingResponse(self._gpu_droplets.firewalls) @cached_property def floating_ips(self) -> AsyncFloatingIPsResourceWithStreamingResponse: + """ + As of 16 June 2022, we have renamed the Floating IP product to [Reserved IPs](https://docs.digitalocean.com/reference/api/api-reference/#tag/Reserved-IPs). + The Reserved IP product's endpoints function the exact same way as Floating IPs. + The only difference is the name change throughout the URLs and fields. + For example, the `floating_ips` field is now the `reserved_ips` field. + The Floating IP endpoints will remain active until fall 2023 before being + permanently deprecated. + + With the exception of the [Projects API](https://docs.digitalocean.com/reference/api/api-reference/#tag/Projects), + we will reflect this change as an additional field in the responses across the API + where the `floating_ip` field is used. For example, the Droplet metadata response + will contain the field `reserved_ips` in addition to the `floating_ips` field. + Floating IPs retrieved using the Projects API will retain the original name. + + [DigitalOcean Floating IPs](https://docs.digitalocean.com/products/networking/reserved-ips/) + are publicly-accessible static IP addresses that can be mapped to one of + your Droplets. They can be used to create highly available setups or other + configurations requiring movable addresses. + + Floating IPs are bound to a specific region. + """ return AsyncFloatingIPsResourceWithStreamingResponse(self._gpu_droplets.floating_ips) @cached_property def images(self) -> AsyncImagesResourceWithStreamingResponse: + """ + A DigitalOcean [image](https://docs.digitalocean.com/products/images/) can be + used to create a Droplet and may come in a number of flavors. Currently, + there are five types of images: snapshots, backups, applications, + distributions, and custom images. + + * [Snapshots](https://docs.digitalocean.com/products/snapshots/) provide + a full copy of an existing Droplet instance taken on demand. + + * [Backups](https://docs.digitalocean.com/products/backups/) are similar + to snapshots but are created automatically at regular intervals when + enabled for a Droplet. + + * [Custom images](https://docs.digitalocean.com/products/custom-images/) + are Linux-based virtual machine images (raw, qcow2, vhdx, vdi, and vmdk + formats are supported) that you may upload for use on DigitalOcean. + + * Distributions are the public Linux distributions that are available to + be used as a base to create Droplets. + + * Applications, or [1-Click Apps](https://docs.digitalocean.com/products/marketplace/), + are distributions pre-configured with additional software. + + To interact with images, you will generally send requests to the images + endpoint at /v2/images. + """ return AsyncImagesResourceWithStreamingResponse(self._gpu_droplets.images) @cached_property def load_balancers(self) -> AsyncLoadBalancersResourceWithStreamingResponse: + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ return AsyncLoadBalancersResourceWithStreamingResponse(self._gpu_droplets.load_balancers) @cached_property def sizes(self) -> AsyncSizesResourceWithStreamingResponse: + """ + The sizes objects represent different packages of hardware resources that + can be used for Droplets. When a Droplet is created, a size must be + selected so that the correct resources can be allocated. + + Each size represents a plan that bundles together specific sets of + resources. This includes the amount of RAM, the number of virtual CPUs, + disk space, and transfer. The size object also includes the pricing + details and the regions that the size is available in. + """ return AsyncSizesResourceWithStreamingResponse(self._gpu_droplets.sizes) @cached_property def snapshots(self) -> AsyncSnapshotsResourceWithStreamingResponse: + """ + [Snapshots](https://docs.digitalocean.com/products/snapshots/) are saved + instances of a Droplet or a block storage volume, which is reflected in + the `resource_type` attribute. In order to avoid problems with compressing + filesystems, each defines a `min_disk_size` attribute which is the minimum + size of the Droplet or volume disk when creating a new resource from the + saved snapshot. + + To interact with snapshots, you will generally send requests to the + snapshots endpoint at `/v2/snapshots`. + """ return AsyncSnapshotsResourceWithStreamingResponse(self._gpu_droplets.snapshots) @cached_property def volumes(self) -> AsyncVolumesResourceWithStreamingResponse: + """ + [DigitalOcean Block Storage Volumes](https://docs.digitalocean.com/products/volumes/) + provide expanded storage capacity for your Droplets and can be moved + between Droplets within a specific region. + + Volumes function as raw block devices, meaning they appear to the + operating system as locally attached storage which can be formatted using + any file system supported by the OS. They may be created in sizes from + 1GiB to 16TiB. + + By sending requests to the `/v2/volumes` endpoint, you can list, create, or + delete volumes as well as attach and detach them from Droplets + """ return AsyncVolumesResourceWithStreamingResponse(self._gpu_droplets.volumes) @cached_property diff --git a/src/gradient/resources/gpu_droplets/images/actions.py b/src/gradient/resources/gpu_droplets/images/actions.py index d2d33f11..19c70af8 100644 --- a/src/gradient/resources/gpu_droplets/images/actions.py +++ b/src/gradient/resources/gpu_droplets/images/actions.py @@ -25,6 +25,16 @@ class ActionsResource(SyncAPIResource): + """Image actions are commands that can be given to a DigitalOcean image. + + In + general, these requests are made on the actions endpoint of a specific + image. + + An image action object is returned. These objects hold the current status + of the requested action. + """ + @cached_property def with_raw_response(self) -> ActionsResourceWithRawResponse: """ @@ -263,6 +273,16 @@ def list( class AsyncActionsResource(AsyncAPIResource): + """Image actions are commands that can be given to a DigitalOcean image. + + In + general, these requests are made on the actions endpoint of a specific + image. + + An image action object is returned. These objects hold the current status + of the requested action. + """ + @cached_property def with_raw_response(self) -> AsyncActionsResourceWithRawResponse: """ diff --git a/src/gradient/resources/gpu_droplets/images/images.py b/src/gradient/resources/gpu_droplets/images/images.py index 83e04d13..d9a904cf 100644 --- a/src/gradient/resources/gpu_droplets/images/images.py +++ b/src/gradient/resources/gpu_droplets/images/images.py @@ -36,8 +36,44 @@ class ImagesResource(SyncAPIResource): + """ + A DigitalOcean [image](https://docs.digitalocean.com/products/images/) can be + used to create a Droplet and may come in a number of flavors. Currently, + there are five types of images: snapshots, backups, applications, + distributions, and custom images. + + * [Snapshots](https://docs.digitalocean.com/products/snapshots/) provide + a full copy of an existing Droplet instance taken on demand. + + * [Backups](https://docs.digitalocean.com/products/backups/) are similar + to snapshots but are created automatically at regular intervals when + enabled for a Droplet. + + * [Custom images](https://docs.digitalocean.com/products/custom-images/) + are Linux-based virtual machine images (raw, qcow2, vhdx, vdi, and vmdk + formats are supported) that you may upload for use on DigitalOcean. + + * Distributions are the public Linux distributions that are available to + be used as a base to create Droplets. + + * Applications, or [1-Click Apps](https://docs.digitalocean.com/products/marketplace/), + are distributions pre-configured with additional software. + + To interact with images, you will generally send requests to the images + endpoint at /v2/images. + """ + @cached_property def actions(self) -> ActionsResource: + """Image actions are commands that can be given to a DigitalOcean image. + + In + general, these requests are made on the actions endpoint of a specific + image. + + An image action object is returned. These objects hold the current status + of the requested action. + """ return ActionsResource(self._client) @cached_property @@ -402,8 +438,44 @@ def delete( class AsyncImagesResource(AsyncAPIResource): + """ + A DigitalOcean [image](https://docs.digitalocean.com/products/images/) can be + used to create a Droplet and may come in a number of flavors. Currently, + there are five types of images: snapshots, backups, applications, + distributions, and custom images. + + * [Snapshots](https://docs.digitalocean.com/products/snapshots/) provide + a full copy of an existing Droplet instance taken on demand. + + * [Backups](https://docs.digitalocean.com/products/backups/) are similar + to snapshots but are created automatically at regular intervals when + enabled for a Droplet. + + * [Custom images](https://docs.digitalocean.com/products/custom-images/) + are Linux-based virtual machine images (raw, qcow2, vhdx, vdi, and vmdk + formats are supported) that you may upload for use on DigitalOcean. + + * Distributions are the public Linux distributions that are available to + be used as a base to create Droplets. + + * Applications, or [1-Click Apps](https://docs.digitalocean.com/products/marketplace/), + are distributions pre-configured with additional software. + + To interact with images, you will generally send requests to the images + endpoint at /v2/images. + """ + @cached_property def actions(self) -> AsyncActionsResource: + """Image actions are commands that can be given to a DigitalOcean image. + + In + general, these requests are made on the actions endpoint of a specific + image. + + An image action object is returned. These objects hold the current status + of the requested action. + """ return AsyncActionsResource(self._client) @cached_property @@ -789,6 +861,15 @@ def __init__(self, images: ImagesResource) -> None: @cached_property def actions(self) -> ActionsResourceWithRawResponse: + """Image actions are commands that can be given to a DigitalOcean image. + + In + general, these requests are made on the actions endpoint of a specific + image. + + An image action object is returned. These objects hold the current status + of the requested action. + """ return ActionsResourceWithRawResponse(self._images.actions) @@ -814,6 +895,15 @@ def __init__(self, images: AsyncImagesResource) -> None: @cached_property def actions(self) -> AsyncActionsResourceWithRawResponse: + """Image actions are commands that can be given to a DigitalOcean image. + + In + general, these requests are made on the actions endpoint of a specific + image. + + An image action object is returned. These objects hold the current status + of the requested action. + """ return AsyncActionsResourceWithRawResponse(self._images.actions) @@ -839,6 +929,15 @@ def __init__(self, images: ImagesResource) -> None: @cached_property def actions(self) -> ActionsResourceWithStreamingResponse: + """Image actions are commands that can be given to a DigitalOcean image. + + In + general, these requests are made on the actions endpoint of a specific + image. + + An image action object is returned. These objects hold the current status + of the requested action. + """ return ActionsResourceWithStreamingResponse(self._images.actions) @@ -864,4 +963,13 @@ def __init__(self, images: AsyncImagesResource) -> None: @cached_property def actions(self) -> AsyncActionsResourceWithStreamingResponse: + """Image actions are commands that can be given to a DigitalOcean image. + + In + general, these requests are made on the actions endpoint of a specific + image. + + An image action object is returned. These objects hold the current status + of the requested action. + """ return AsyncActionsResourceWithStreamingResponse(self._images.actions) diff --git a/src/gradient/resources/gpu_droplets/load_balancers/droplets.py b/src/gradient/resources/gpu_droplets/load_balancers/droplets.py index ddcdc63a..9f4b3e5e 100644 --- a/src/gradient/resources/gpu_droplets/load_balancers/droplets.py +++ b/src/gradient/resources/gpu_droplets/load_balancers/droplets.py @@ -23,6 +23,14 @@ class DropletsResource(SyncAPIResource): + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ + @cached_property def with_raw_response(self) -> DropletsResourceWithRawResponse: """ @@ -139,6 +147,14 @@ def remove( class AsyncDropletsResource(AsyncAPIResource): + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ + @cached_property def with_raw_response(self) -> AsyncDropletsResourceWithRawResponse: """ diff --git a/src/gradient/resources/gpu_droplets/load_balancers/forwarding_rules.py b/src/gradient/resources/gpu_droplets/load_balancers/forwarding_rules.py index 8f9092e0..51842e8c 100644 --- a/src/gradient/resources/gpu_droplets/load_balancers/forwarding_rules.py +++ b/src/gradient/resources/gpu_droplets/load_balancers/forwarding_rules.py @@ -24,6 +24,14 @@ class ForwardingRulesResource(SyncAPIResource): + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ + @cached_property def with_raw_response(self) -> ForwardingRulesResourceWithRawResponse: """ @@ -139,6 +147,14 @@ def remove( class AsyncForwardingRulesResource(AsyncAPIResource): + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ + @cached_property def with_raw_response(self) -> AsyncForwardingRulesResourceWithRawResponse: """ diff --git a/src/gradient/resources/gpu_droplets/load_balancers/load_balancers.py b/src/gradient/resources/gpu_droplets/load_balancers/load_balancers.py index 2a1e52d9..1316036b 100644 --- a/src/gradient/resources/gpu_droplets/load_balancers/load_balancers.py +++ b/src/gradient/resources/gpu_droplets/load_balancers/load_balancers.py @@ -54,12 +54,34 @@ class LoadBalancersResource(SyncAPIResource): + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ + @cached_property def droplets(self) -> DropletsResource: + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ return DropletsResource(self._client) @cached_property def forwarding_rules(self) -> ForwardingRulesResource: + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ return ForwardingRulesResource(self._client) @cached_property @@ -1066,12 +1088,34 @@ def delete_cache( class AsyncLoadBalancersResource(AsyncAPIResource): + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ + @cached_property def droplets(self) -> AsyncDropletsResource: + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ return AsyncDropletsResource(self._client) @cached_property def forwarding_rules(self) -> AsyncForwardingRulesResource: + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ return AsyncForwardingRulesResource(self._client) @cached_property @@ -2102,10 +2146,24 @@ def __init__(self, load_balancers: LoadBalancersResource) -> None: @cached_property def droplets(self) -> DropletsResourceWithRawResponse: + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ return DropletsResourceWithRawResponse(self._load_balancers.droplets) @cached_property def forwarding_rules(self) -> ForwardingRulesResourceWithRawResponse: + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ return ForwardingRulesResourceWithRawResponse(self._load_balancers.forwarding_rules) @@ -2134,10 +2192,24 @@ def __init__(self, load_balancers: AsyncLoadBalancersResource) -> None: @cached_property def droplets(self) -> AsyncDropletsResourceWithRawResponse: + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ return AsyncDropletsResourceWithRawResponse(self._load_balancers.droplets) @cached_property def forwarding_rules(self) -> AsyncForwardingRulesResourceWithRawResponse: + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ return AsyncForwardingRulesResourceWithRawResponse(self._load_balancers.forwarding_rules) @@ -2166,10 +2238,24 @@ def __init__(self, load_balancers: LoadBalancersResource) -> None: @cached_property def droplets(self) -> DropletsResourceWithStreamingResponse: + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ return DropletsResourceWithStreamingResponse(self._load_balancers.droplets) @cached_property def forwarding_rules(self) -> ForwardingRulesResourceWithStreamingResponse: + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ return ForwardingRulesResourceWithStreamingResponse(self._load_balancers.forwarding_rules) @@ -2198,8 +2284,22 @@ def __init__(self, load_balancers: AsyncLoadBalancersResource) -> None: @cached_property def droplets(self) -> AsyncDropletsResourceWithStreamingResponse: + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ return AsyncDropletsResourceWithStreamingResponse(self._load_balancers.droplets) @cached_property def forwarding_rules(self) -> AsyncForwardingRulesResourceWithStreamingResponse: + """ + [DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/) + provide a way to distribute traffic across multiple Droplets. By sending + requests to the `/v2/load_balancers` endpoint, you can list, create, or + delete load balancers as well as add or remove Droplets, forwarding rules, + and other configuration details. + """ return AsyncForwardingRulesResourceWithStreamingResponse(self._load_balancers.forwarding_rules) diff --git a/src/gradient/resources/gpu_droplets/sizes.py b/src/gradient/resources/gpu_droplets/sizes.py index 9893903f..83d77052 100644 --- a/src/gradient/resources/gpu_droplets/sizes.py +++ b/src/gradient/resources/gpu_droplets/sizes.py @@ -22,6 +22,17 @@ class SizesResource(SyncAPIResource): + """ + The sizes objects represent different packages of hardware resources that + can be used for Droplets. When a Droplet is created, a size must be + selected so that the correct resources can be allocated. + + Each size represents a plan that bundles together specific sets of + resources. This includes the amount of RAM, the number of virtual CPUs, + disk space, and transfer. The size object also includes the pricing + details and the regions that the size is available in. + """ + @cached_property def with_raw_response(self) -> SizesResourceWithRawResponse: """ @@ -93,6 +104,17 @@ def list( class AsyncSizesResource(AsyncAPIResource): + """ + The sizes objects represent different packages of hardware resources that + can be used for Droplets. When a Droplet is created, a size must be + selected so that the correct resources can be allocated. + + Each size represents a plan that bundles together specific sets of + resources. This includes the amount of RAM, the number of virtual CPUs, + disk space, and transfer. The size object also includes the pricing + details and the regions that the size is available in. + """ + @cached_property def with_raw_response(self) -> AsyncSizesResourceWithRawResponse: """ diff --git a/src/gradient/resources/gpu_droplets/snapshots.py b/src/gradient/resources/gpu_droplets/snapshots.py index 78bd01ac..12cf20da 100644 --- a/src/gradient/resources/gpu_droplets/snapshots.py +++ b/src/gradient/resources/gpu_droplets/snapshots.py @@ -26,6 +26,18 @@ class SnapshotsResource(SyncAPIResource): + """ + [Snapshots](https://docs.digitalocean.com/products/snapshots/) are saved + instances of a Droplet or a block storage volume, which is reflected in + the `resource_type` attribute. In order to avoid problems with compressing + filesystems, each defines a `min_disk_size` attribute which is the minimum + size of the Droplet or volume disk when creating a new resource from the + saved snapshot. + + To interact with snapshots, you will generally send requests to the + snapshots endpoint at `/v2/snapshots`. + """ + @cached_property def with_raw_response(self) -> SnapshotsResourceWithRawResponse: """ @@ -196,6 +208,18 @@ def delete( class AsyncSnapshotsResource(AsyncAPIResource): + """ + [Snapshots](https://docs.digitalocean.com/products/snapshots/) are saved + instances of a Droplet or a block storage volume, which is reflected in + the `resource_type` attribute. In order to avoid problems with compressing + filesystems, each defines a `min_disk_size` attribute which is the minimum + size of the Droplet or volume disk when creating a new resource from the + saved snapshot. + + To interact with snapshots, you will generally send requests to the + snapshots endpoint at `/v2/snapshots`. + """ + @cached_property def with_raw_response(self) -> AsyncSnapshotsResourceWithRawResponse: """ diff --git a/src/gradient/resources/gpu_droplets/volumes/actions.py b/src/gradient/resources/gpu_droplets/volumes/actions.py index 1c0c66a0..9b145567 100644 --- a/src/gradient/resources/gpu_droplets/volumes/actions.py +++ b/src/gradient/resources/gpu_droplets/volumes/actions.py @@ -33,6 +33,16 @@ class ActionsResource(SyncAPIResource): + """ + Block storage actions are commands that can be given to a DigitalOcean + Block Storage Volume. An example would be detaching or attaching a volume + from a Droplet. These requests are made on the + `/v2/volumes/$VOLUME_ID/actions` endpoint. + + An action object is returned. These objects hold the current status of the + requested action. + """ + @cached_property def with_raw_response(self) -> ActionsResourceWithRawResponse: """ @@ -758,6 +768,16 @@ def initiate_by_name( class AsyncActionsResource(AsyncAPIResource): + """ + Block storage actions are commands that can be given to a DigitalOcean + Block Storage Volume. An example would be detaching or attaching a volume + from a Droplet. These requests are made on the + `/v2/volumes/$VOLUME_ID/actions` endpoint. + + An action object is returned. These objects hold the current status of the + requested action. + """ + @cached_property def with_raw_response(self) -> AsyncActionsResourceWithRawResponse: """ diff --git a/src/gradient/resources/gpu_droplets/volumes/snapshots.py b/src/gradient/resources/gpu_droplets/volumes/snapshots.py index 694de074..8e2d6422 100644 --- a/src/gradient/resources/gpu_droplets/volumes/snapshots.py +++ b/src/gradient/resources/gpu_droplets/volumes/snapshots.py @@ -26,6 +26,20 @@ class SnapshotsResource(SyncAPIResource): + """ + [DigitalOcean Block Storage Volumes](https://docs.digitalocean.com/products/volumes/) + provide expanded storage capacity for your Droplets and can be moved + between Droplets within a specific region. + + Volumes function as raw block devices, meaning they appear to the + operating system as locally attached storage which can be formatted using + any file system supported by the OS. They may be created in sizes from + 1GiB to 16TiB. + + By sending requests to the `/v2/volumes` endpoint, you can list, create, or + delete volumes as well as attach and detach them from Droplets + """ + @cached_property def with_raw_response(self) -> SnapshotsResourceWithRawResponse: """ @@ -227,6 +241,20 @@ def delete( class AsyncSnapshotsResource(AsyncAPIResource): + """ + [DigitalOcean Block Storage Volumes](https://docs.digitalocean.com/products/volumes/) + provide expanded storage capacity for your Droplets and can be moved + between Droplets within a specific region. + + Volumes function as raw block devices, meaning they appear to the + operating system as locally attached storage which can be formatted using + any file system supported by the OS. They may be created in sizes from + 1GiB to 16TiB. + + By sending requests to the `/v2/volumes` endpoint, you can list, create, or + delete volumes as well as attach and detach them from Droplets + """ + @cached_property def with_raw_response(self) -> AsyncSnapshotsResourceWithRawResponse: """ diff --git a/src/gradient/resources/gpu_droplets/volumes/volumes.py b/src/gradient/resources/gpu_droplets/volumes/volumes.py index fb86c288..76b1db6b 100644 --- a/src/gradient/resources/gpu_droplets/volumes/volumes.py +++ b/src/gradient/resources/gpu_droplets/volumes/volumes.py @@ -43,12 +43,48 @@ class VolumesResource(SyncAPIResource): + """ + [DigitalOcean Block Storage Volumes](https://docs.digitalocean.com/products/volumes/) + provide expanded storage capacity for your Droplets and can be moved + between Droplets within a specific region. + + Volumes function as raw block devices, meaning they appear to the + operating system as locally attached storage which can be formatted using + any file system supported by the OS. They may be created in sizes from + 1GiB to 16TiB. + + By sending requests to the `/v2/volumes` endpoint, you can list, create, or + delete volumes as well as attach and detach them from Droplets + """ + @cached_property def actions(self) -> ActionsResource: + """ + Block storage actions are commands that can be given to a DigitalOcean + Block Storage Volume. An example would be detaching or attaching a volume + from a Droplet. These requests are made on the + `/v2/volumes/$VOLUME_ID/actions` endpoint. + + An action object is returned. These objects hold the current status of the + requested action. + """ return ActionsResource(self._client) @cached_property def snapshots(self) -> SnapshotsResource: + """ + [DigitalOcean Block Storage Volumes](https://docs.digitalocean.com/products/volumes/) + provide expanded storage capacity for your Droplets and can be moved + between Droplets within a specific region. + + Volumes function as raw block devices, meaning they appear to the + operating system as locally attached storage which can be formatted using + any file system supported by the OS. They may be created in sizes from + 1GiB to 16TiB. + + By sending requests to the `/v2/volumes` endpoint, you can list, create, or + delete volumes as well as attach and detach them from Droplets + """ return SnapshotsResource(self._client) @cached_property @@ -536,12 +572,48 @@ def delete_by_name( class AsyncVolumesResource(AsyncAPIResource): + """ + [DigitalOcean Block Storage Volumes](https://docs.digitalocean.com/products/volumes/) + provide expanded storage capacity for your Droplets and can be moved + between Droplets within a specific region. + + Volumes function as raw block devices, meaning they appear to the + operating system as locally attached storage which can be formatted using + any file system supported by the OS. They may be created in sizes from + 1GiB to 16TiB. + + By sending requests to the `/v2/volumes` endpoint, you can list, create, or + delete volumes as well as attach and detach them from Droplets + """ + @cached_property def actions(self) -> AsyncActionsResource: + """ + Block storage actions are commands that can be given to a DigitalOcean + Block Storage Volume. An example would be detaching or attaching a volume + from a Droplet. These requests are made on the + `/v2/volumes/$VOLUME_ID/actions` endpoint. + + An action object is returned. These objects hold the current status of the + requested action. + """ return AsyncActionsResource(self._client) @cached_property def snapshots(self) -> AsyncSnapshotsResource: + """ + [DigitalOcean Block Storage Volumes](https://docs.digitalocean.com/products/volumes/) + provide expanded storage capacity for your Droplets and can be moved + between Droplets within a specific region. + + Volumes function as raw block devices, meaning they appear to the + operating system as locally attached storage which can be formatted using + any file system supported by the OS. They may be created in sizes from + 1GiB to 16TiB. + + By sending requests to the `/v2/volumes` endpoint, you can list, create, or + delete volumes as well as attach and detach them from Droplets + """ return AsyncSnapshotsResource(self._client) @cached_property @@ -1050,10 +1122,32 @@ def __init__(self, volumes: VolumesResource) -> None: @cached_property def actions(self) -> ActionsResourceWithRawResponse: + """ + Block storage actions are commands that can be given to a DigitalOcean + Block Storage Volume. An example would be detaching or attaching a volume + from a Droplet. These requests are made on the + `/v2/volumes/$VOLUME_ID/actions` endpoint. + + An action object is returned. These objects hold the current status of the + requested action. + """ return ActionsResourceWithRawResponse(self._volumes.actions) @cached_property def snapshots(self) -> SnapshotsResourceWithRawResponse: + """ + [DigitalOcean Block Storage Volumes](https://docs.digitalocean.com/products/volumes/) + provide expanded storage capacity for your Droplets and can be moved + between Droplets within a specific region. + + Volumes function as raw block devices, meaning they appear to the + operating system as locally attached storage which can be formatted using + any file system supported by the OS. They may be created in sizes from + 1GiB to 16TiB. + + By sending requests to the `/v2/volumes` endpoint, you can list, create, or + delete volumes as well as attach and detach them from Droplets + """ return SnapshotsResourceWithRawResponse(self._volumes.snapshots) @@ -1079,10 +1173,32 @@ def __init__(self, volumes: AsyncVolumesResource) -> None: @cached_property def actions(self) -> AsyncActionsResourceWithRawResponse: + """ + Block storage actions are commands that can be given to a DigitalOcean + Block Storage Volume. An example would be detaching or attaching a volume + from a Droplet. These requests are made on the + `/v2/volumes/$VOLUME_ID/actions` endpoint. + + An action object is returned. These objects hold the current status of the + requested action. + """ return AsyncActionsResourceWithRawResponse(self._volumes.actions) @cached_property def snapshots(self) -> AsyncSnapshotsResourceWithRawResponse: + """ + [DigitalOcean Block Storage Volumes](https://docs.digitalocean.com/products/volumes/) + provide expanded storage capacity for your Droplets and can be moved + between Droplets within a specific region. + + Volumes function as raw block devices, meaning they appear to the + operating system as locally attached storage which can be formatted using + any file system supported by the OS. They may be created in sizes from + 1GiB to 16TiB. + + By sending requests to the `/v2/volumes` endpoint, you can list, create, or + delete volumes as well as attach and detach them from Droplets + """ return AsyncSnapshotsResourceWithRawResponse(self._volumes.snapshots) @@ -1108,10 +1224,32 @@ def __init__(self, volumes: VolumesResource) -> None: @cached_property def actions(self) -> ActionsResourceWithStreamingResponse: + """ + Block storage actions are commands that can be given to a DigitalOcean + Block Storage Volume. An example would be detaching or attaching a volume + from a Droplet. These requests are made on the + `/v2/volumes/$VOLUME_ID/actions` endpoint. + + An action object is returned. These objects hold the current status of the + requested action. + """ return ActionsResourceWithStreamingResponse(self._volumes.actions) @cached_property def snapshots(self) -> SnapshotsResourceWithStreamingResponse: + """ + [DigitalOcean Block Storage Volumes](https://docs.digitalocean.com/products/volumes/) + provide expanded storage capacity for your Droplets and can be moved + between Droplets within a specific region. + + Volumes function as raw block devices, meaning they appear to the + operating system as locally attached storage which can be formatted using + any file system supported by the OS. They may be created in sizes from + 1GiB to 16TiB. + + By sending requests to the `/v2/volumes` endpoint, you can list, create, or + delete volumes as well as attach and detach them from Droplets + """ return SnapshotsResourceWithStreamingResponse(self._volumes.snapshots) @@ -1137,8 +1275,30 @@ def __init__(self, volumes: AsyncVolumesResource) -> None: @cached_property def actions(self) -> AsyncActionsResourceWithStreamingResponse: + """ + Block storage actions are commands that can be given to a DigitalOcean + Block Storage Volume. An example would be detaching or attaching a volume + from a Droplet. These requests are made on the + `/v2/volumes/$VOLUME_ID/actions` endpoint. + + An action object is returned. These objects hold the current status of the + requested action. + """ return AsyncActionsResourceWithStreamingResponse(self._volumes.actions) @cached_property def snapshots(self) -> AsyncSnapshotsResourceWithStreamingResponse: + """ + [DigitalOcean Block Storage Volumes](https://docs.digitalocean.com/products/volumes/) + provide expanded storage capacity for your Droplets and can be moved + between Droplets within a specific region. + + Volumes function as raw block devices, meaning they appear to the + operating system as locally attached storage which can be formatted using + any file system supported by the OS. They may be created in sizes from + 1GiB to 16TiB. + + By sending requests to the `/v2/volumes` endpoint, you can list, create, or + delete volumes as well as attach and detach them from Droplets + """ return AsyncSnapshotsResourceWithStreamingResponse(self._volumes.snapshots) diff --git a/src/gradient/resources/images.py b/src/gradient/resources/images.py index 14bbfeaa..c790345a 100644 --- a/src/gradient/resources/images.py +++ b/src/gradient/resources/images.py @@ -27,6 +27,8 @@ class ImagesResource(SyncAPIResource): + """Generate images from text prompts using various AI models.""" + @cached_property def with_raw_response(self) -> ImagesResourceWithRawResponse: """ @@ -349,6 +351,8 @@ def generate( class AsyncImagesResource(AsyncAPIResource): + """Generate images from text prompts using various AI models.""" + @cached_property def with_raw_response(self) -> AsyncImagesResourceWithRawResponse: """ diff --git a/src/gradient/resources/inference/api_keys.py b/src/gradient/resources/inference/api_keys.py index 8dfa54e1..045c6f41 100644 --- a/src/gradient/resources/inference/api_keys.py +++ b/src/gradient/resources/inference/api_keys.py @@ -26,6 +26,10 @@ class APIKeysResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> APIKeysResourceWithRawResponse: """ @@ -252,6 +256,10 @@ def update_regenerate( class AsyncAPIKeysResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> AsyncAPIKeysResourceWithRawResponse: """ diff --git a/src/gradient/resources/inference/inference.py b/src/gradient/resources/inference/inference.py index d22543b3..1da78154 100644 --- a/src/gradient/resources/inference/inference.py +++ b/src/gradient/resources/inference/inference.py @@ -19,6 +19,9 @@ class InferenceResource(SyncAPIResource): @cached_property def api_keys(self) -> APIKeysResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return APIKeysResource(self._client) @cached_property @@ -44,6 +47,9 @@ def with_streaming_response(self) -> InferenceResourceWithStreamingResponse: class AsyncInferenceResource(AsyncAPIResource): @cached_property def api_keys(self) -> AsyncAPIKeysResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncAPIKeysResource(self._client) @cached_property @@ -72,6 +78,9 @@ def __init__(self, inference: InferenceResource) -> None: @cached_property def api_keys(self) -> APIKeysResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return APIKeysResourceWithRawResponse(self._inference.api_keys) @@ -81,6 +90,9 @@ def __init__(self, inference: AsyncInferenceResource) -> None: @cached_property def api_keys(self) -> AsyncAPIKeysResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncAPIKeysResourceWithRawResponse(self._inference.api_keys) @@ -90,6 +102,9 @@ def __init__(self, inference: InferenceResource) -> None: @cached_property def api_keys(self) -> APIKeysResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return APIKeysResourceWithStreamingResponse(self._inference.api_keys) @@ -99,4 +114,7 @@ def __init__(self, inference: AsyncInferenceResource) -> None: @cached_property def api_keys(self) -> AsyncAPIKeysResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncAPIKeysResourceWithStreamingResponse(self._inference.api_keys) diff --git a/src/gradient/resources/knowledge_bases/data_sources.py b/src/gradient/resources/knowledge_bases/data_sources.py index 6c339108..5c6eafd2 100644 --- a/src/gradient/resources/knowledge_bases/data_sources.py +++ b/src/gradient/resources/knowledge_bases/data_sources.py @@ -37,6 +37,10 @@ class DataSourcesResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> DataSourcesResourceWithRawResponse: """ @@ -350,6 +354,10 @@ def create_presigned_urls( class AsyncDataSourcesResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> AsyncDataSourcesResourceWithRawResponse: """ diff --git a/src/gradient/resources/knowledge_bases/indexing_jobs.py b/src/gradient/resources/knowledge_bases/indexing_jobs.py index 2759c3fa..47db5b10 100644 --- a/src/gradient/resources/knowledge_bases/indexing_jobs.py +++ b/src/gradient/resources/knowledge_bases/indexing_jobs.py @@ -35,6 +35,10 @@ class IndexingJobsResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> IndexingJobsResourceWithRawResponse: """ @@ -403,6 +407,10 @@ def wait_for_completion( class AsyncIndexingJobsResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> AsyncIndexingJobsResourceWithRawResponse: """ diff --git a/src/gradient/resources/knowledge_bases/knowledge_bases.py b/src/gradient/resources/knowledge_bases/knowledge_bases.py index 9c22a60c..dd4c3a8f 100644 --- a/src/gradient/resources/knowledge_bases/knowledge_bases.py +++ b/src/gradient/resources/knowledge_bases/knowledge_bases.py @@ -79,12 +79,22 @@ class KnowledgeBaseTimeoutError(Exception): class KnowledgeBasesResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def data_sources(self) -> DataSourcesResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return DataSourcesResource(self._client) @cached_property def indexing_jobs(self) -> IndexingJobsResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return IndexingJobsResource(self._client) @cached_property @@ -507,12 +517,22 @@ def list_indexing_jobs( class AsyncKnowledgeBasesResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def data_sources(self) -> AsyncDataSourcesResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncDataSourcesResource(self._client) @cached_property def indexing_jobs(self) -> AsyncIndexingJobsResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncIndexingJobsResource(self._client) @cached_property @@ -964,10 +984,16 @@ def __init__(self, knowledge_bases: KnowledgeBasesResource) -> None: @cached_property def data_sources(self) -> DataSourcesResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return DataSourcesResourceWithRawResponse(self._knowledge_bases.data_sources) @cached_property def indexing_jobs(self) -> IndexingJobsResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return IndexingJobsResourceWithRawResponse(self._knowledge_bases.indexing_jobs) @@ -999,10 +1025,16 @@ def __init__(self, knowledge_bases: AsyncKnowledgeBasesResource) -> None: @cached_property def data_sources(self) -> AsyncDataSourcesResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncDataSourcesResourceWithRawResponse(self._knowledge_bases.data_sources) @cached_property def indexing_jobs(self) -> AsyncIndexingJobsResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncIndexingJobsResourceWithRawResponse(self._knowledge_bases.indexing_jobs) @@ -1034,10 +1066,16 @@ def __init__(self, knowledge_bases: KnowledgeBasesResource) -> None: @cached_property def data_sources(self) -> DataSourcesResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return DataSourcesResourceWithStreamingResponse(self._knowledge_bases.data_sources) @cached_property def indexing_jobs(self) -> IndexingJobsResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return IndexingJobsResourceWithStreamingResponse(self._knowledge_bases.indexing_jobs) @@ -1069,8 +1107,14 @@ def __init__(self, knowledge_bases: AsyncKnowledgeBasesResource) -> None: @cached_property def data_sources(self) -> AsyncDataSourcesResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncDataSourcesResourceWithStreamingResponse(self._knowledge_bases.data_sources) @cached_property def indexing_jobs(self) -> AsyncIndexingJobsResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncIndexingJobsResourceWithStreamingResponse(self._knowledge_bases.indexing_jobs) diff --git a/src/gradient/resources/models/models.py b/src/gradient/resources/models/models.py index 650c49c9..568fc325 100644 --- a/src/gradient/resources/models/models.py +++ b/src/gradient/resources/models/models.py @@ -33,6 +33,10 @@ class ModelsResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def providers(self) -> ProvidersResource: return ProvidersResource(self._client) @@ -134,6 +138,10 @@ def list( class AsyncModelsResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def providers(self) -> AsyncProvidersResource: return AsyncProvidersResource(self._client) diff --git a/src/gradient/resources/models/providers/anthropic.py b/src/gradient/resources/models/providers/anthropic.py index 33b2ec80..ce44fe06 100644 --- a/src/gradient/resources/models/providers/anthropic.py +++ b/src/gradient/resources/models/providers/anthropic.py @@ -32,6 +32,10 @@ class AnthropicResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> AnthropicResourceWithRawResponse: """ @@ -324,6 +328,10 @@ def list_agents( class AsyncAnthropicResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> AsyncAnthropicResourceWithRawResponse: """ diff --git a/src/gradient/resources/models/providers/openai.py b/src/gradient/resources/models/providers/openai.py index 5bdc3f20..e048a32f 100644 --- a/src/gradient/resources/models/providers/openai.py +++ b/src/gradient/resources/models/providers/openai.py @@ -32,6 +32,10 @@ class OpenAIResource(SyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> OpenAIResourceWithRawResponse: """ @@ -322,6 +326,10 @@ def retrieve_agents( class AsyncOpenAIResource(AsyncAPIResource): + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ + @cached_property def with_raw_response(self) -> AsyncOpenAIResourceWithRawResponse: """ diff --git a/src/gradient/resources/models/providers/providers.py b/src/gradient/resources/models/providers/providers.py index efb71ec5..b77bf5af 100644 --- a/src/gradient/resources/models/providers/providers.py +++ b/src/gradient/resources/models/providers/providers.py @@ -27,10 +27,16 @@ class ProvidersResource(SyncAPIResource): @cached_property def anthropic(self) -> AnthropicResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AnthropicResource(self._client) @cached_property def openai(self) -> OpenAIResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return OpenAIResource(self._client) @cached_property @@ -56,10 +62,16 @@ def with_streaming_response(self) -> ProvidersResourceWithStreamingResponse: class AsyncProvidersResource(AsyncAPIResource): @cached_property def anthropic(self) -> AsyncAnthropicResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncAnthropicResource(self._client) @cached_property def openai(self) -> AsyncOpenAIResource: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncOpenAIResource(self._client) @cached_property @@ -88,10 +100,16 @@ def __init__(self, providers: ProvidersResource) -> None: @cached_property def anthropic(self) -> AnthropicResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AnthropicResourceWithRawResponse(self._providers.anthropic) @cached_property def openai(self) -> OpenAIResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return OpenAIResourceWithRawResponse(self._providers.openai) @@ -101,10 +119,16 @@ def __init__(self, providers: AsyncProvidersResource) -> None: @cached_property def anthropic(self) -> AsyncAnthropicResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncAnthropicResourceWithRawResponse(self._providers.anthropic) @cached_property def openai(self) -> AsyncOpenAIResourceWithRawResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncOpenAIResourceWithRawResponse(self._providers.openai) @@ -114,10 +138,16 @@ def __init__(self, providers: ProvidersResource) -> None: @cached_property def anthropic(self) -> AnthropicResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AnthropicResourceWithStreamingResponse(self._providers.anthropic) @cached_property def openai(self) -> OpenAIResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return OpenAIResourceWithStreamingResponse(self._providers.openai) @@ -127,8 +157,14 @@ def __init__(self, providers: AsyncProvidersResource) -> None: @cached_property def anthropic(self) -> AsyncAnthropicResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncAnthropicResourceWithStreamingResponse(self._providers.anthropic) @cached_property def openai(self) -> AsyncOpenAIResourceWithStreamingResponse: + """ + The API lets you build GPU-powered AI agents with pre-built or custom foundation models, function and agent routes, and RAG pipelines with knowledge bases. + """ return AsyncOpenAIResourceWithStreamingResponse(self._providers.openai) diff --git a/src/gradient/resources/nfs/nfs.py b/src/gradient/resources/nfs/nfs.py index a46df265..a4e47d9c 100644 --- a/src/gradient/resources/nfs/nfs.py +++ b/src/gradient/resources/nfs/nfs.py @@ -37,6 +37,10 @@ class NfsResource(SyncAPIResource): @cached_property def snapshots(self) -> SnapshotsResource: + """ + NFS lets you create fully managed, POSIX-compliant network file storage that delivers secure, + high-performance shared storage right inside your VPC. This enables seamless data sharing across Droplets in a VPC. + """ return SnapshotsResource(self._client) @cached_property @@ -450,6 +454,10 @@ def initiate_action( class AsyncNfsResource(AsyncAPIResource): @cached_property def snapshots(self) -> AsyncSnapshotsResource: + """ + NFS lets you create fully managed, POSIX-compliant network file storage that delivers secure, + high-performance shared storage right inside your VPC. This enables seamless data sharing across Droplets in a VPC. + """ return AsyncSnapshotsResource(self._client) @cached_property @@ -882,6 +890,10 @@ def __init__(self, nfs: NfsResource) -> None: @cached_property def snapshots(self) -> SnapshotsResourceWithRawResponse: + """ + NFS lets you create fully managed, POSIX-compliant network file storage that delivers secure, + high-performance shared storage right inside your VPC. This enables seamless data sharing across Droplets in a VPC. + """ return SnapshotsResourceWithRawResponse(self._nfs.snapshots) @@ -907,6 +919,10 @@ def __init__(self, nfs: AsyncNfsResource) -> None: @cached_property def snapshots(self) -> AsyncSnapshotsResourceWithRawResponse: + """ + NFS lets you create fully managed, POSIX-compliant network file storage that delivers secure, + high-performance shared storage right inside your VPC. This enables seamless data sharing across Droplets in a VPC. + """ return AsyncSnapshotsResourceWithRawResponse(self._nfs.snapshots) @@ -932,6 +948,10 @@ def __init__(self, nfs: NfsResource) -> None: @cached_property def snapshots(self) -> SnapshotsResourceWithStreamingResponse: + """ + NFS lets you create fully managed, POSIX-compliant network file storage that delivers secure, + high-performance shared storage right inside your VPC. This enables seamless data sharing across Droplets in a VPC. + """ return SnapshotsResourceWithStreamingResponse(self._nfs.snapshots) @@ -957,4 +977,8 @@ def __init__(self, nfs: AsyncNfsResource) -> None: @cached_property def snapshots(self) -> AsyncSnapshotsResourceWithStreamingResponse: + """ + NFS lets you create fully managed, POSIX-compliant network file storage that delivers secure, + high-performance shared storage right inside your VPC. This enables seamless data sharing across Droplets in a VPC. + """ return AsyncSnapshotsResourceWithStreamingResponse(self._nfs.snapshots) diff --git a/src/gradient/resources/nfs/snapshots.py b/src/gradient/resources/nfs/snapshots.py index 65b56e03..4e694ce6 100644 --- a/src/gradient/resources/nfs/snapshots.py +++ b/src/gradient/resources/nfs/snapshots.py @@ -23,6 +23,11 @@ class SnapshotsResource(SyncAPIResource): + """ + NFS lets you create fully managed, POSIX-compliant network file storage that delivers secure, + high-performance shared storage right inside your VPC. This enables seamless data sharing across Droplets in a VPC. + """ + @cached_property def with_raw_response(self) -> SnapshotsResourceWithRawResponse: """ @@ -191,6 +196,11 @@ def delete( class AsyncSnapshotsResource(AsyncAPIResource): + """ + NFS lets you create fully managed, POSIX-compliant network file storage that delivers secure, + high-performance shared storage right inside your VPC. This enables seamless data sharing across Droplets in a VPC. + """ + @cached_property def with_raw_response(self) -> AsyncSnapshotsResourceWithRawResponse: """ diff --git a/src/gradient/resources/regions.py b/src/gradient/resources/regions.py index 3b0f22fa..e89f7c0c 100644 --- a/src/gradient/resources/regions.py +++ b/src/gradient/resources/regions.py @@ -22,6 +22,8 @@ class RegionsResource(SyncAPIResource): + """Provides information about DigitalOcean data center regions.""" + @cached_property def with_raw_response(self) -> RegionsResourceWithRawResponse: """ @@ -92,6 +94,8 @@ def list( class AsyncRegionsResource(AsyncAPIResource): + """Provides information about DigitalOcean data center regions.""" + @cached_property def with_raw_response(self) -> AsyncRegionsResourceWithRawResponse: """ diff --git a/src/gradient/resources/responses.py b/src/gradient/resources/responses.py index d0892fa9..936a97a8 100644 --- a/src/gradient/resources/responses.py +++ b/src/gradient/resources/responses.py @@ -27,6 +27,8 @@ class ResponsesResource(SyncAPIResource): + """Generate text-to-text responses from text prompts.""" + @cached_property def with_raw_response(self) -> ResponsesResourceWithRawResponse: """ @@ -426,6 +428,8 @@ def create( class AsyncResponsesResource(AsyncAPIResource): + """Generate text-to-text responses from text prompts.""" + @cached_property def with_raw_response(self) -> AsyncResponsesResourceWithRawResponse: """ From 2d2fa3d054707440486d5674c7c09dd6c5435720 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:15:26 +0000 Subject: [PATCH 83/96] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 0d591538..903f66b5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-2344b44246a44d39ad5b74d3077bd2958745aad67feb15970756532fa0b3f9d6.yml openapi_spec_hash: a1913979235ce152a8dc380fabe5362e -config_hash: 6c9a04f3cc5dd88e1e4f0ae42d98ba9a +config_hash: eba2c4c8469d877f806f66ac2a91f4ec From a789f7cd0b8e6bda94bb6300f759179f99073d25 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2026 13:00:53 +0000 Subject: [PATCH 84/96] chore(internal): codegen related update --- src/gradient/types/response_create_params.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/gradient/types/response_create_params.py b/src/gradient/types/response_create_params.py index 9b870f3c..42716bb3 100644 --- a/src/gradient/types/response_create_params.py +++ b/src/gradient/types/response_create_params.py @@ -130,7 +130,7 @@ class ResponseCreateParamsBase(TypedDict, total=False): """ -class InputUnionMember1UnionMember0ContentTyped(TypedDict, total=False): +class InputUnionMember1UnionMember0Content(TypedDict, total=False, extra_items=object): # type: ignore[call-arg] text: str """The reasoning text content""" @@ -138,10 +138,7 @@ class InputUnionMember1UnionMember0ContentTyped(TypedDict, total=False): """The type of content""" -InputUnionMember1UnionMember0Content: TypeAlias = Union[InputUnionMember1UnionMember0ContentTyped, Dict[str, object]] - - -class InputUnionMember1UnionMember0Typed(TypedDict, total=False): +class InputUnionMember1UnionMember0(TypedDict, total=False, extra_items=object): # type: ignore[call-arg] type: Required[Literal["function_call", "function_call_output", "reasoning"]] """ The type of input item (must be function_call, function_call_output, or @@ -176,9 +173,6 @@ class InputUnionMember1UnionMember0Typed(TypedDict, total=False): """Summary of the reasoning (optional for reasoning)""" -InputUnionMember1UnionMember0: TypeAlias = Union[InputUnionMember1UnionMember0Typed, Dict[str, object]] - - class InputUnionMember1UnionMember1ContentUnionMember1UnionMember0(TypedDict, total=False): text: Required[str] """The text content""" @@ -218,7 +212,7 @@ class InputUnionMember1UnionMember1ToolCall(TypedDict, total=False): """The type of the tool. Currently, only `function` is supported.""" -class InputUnionMember1UnionMember1Typed(TypedDict, total=False): +class InputUnionMember1UnionMember1(TypedDict, total=False, extra_items=object): # type: ignore[call-arg] content: Required[Union[str, Iterable[InputUnionMember1UnionMember1ContentUnionMember1]]] """The content of the message (string or content parts array)""" @@ -235,8 +229,6 @@ class InputUnionMember1UnionMember1Typed(TypedDict, total=False): """Optional type identifier for message items (used by some clients like Codex)""" -InputUnionMember1UnionMember1: TypeAlias = Union[InputUnionMember1UnionMember1Typed, Dict[str, object]] - InputUnionMember1: TypeAlias = Union[InputUnionMember1UnionMember0, InputUnionMember1UnionMember1] From c895bbd126f3e25134d5acec713af75a0cba7015 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 7 Mar 2026 14:58:13 +0000 Subject: [PATCH 85/96] chore(internal): codegen related update --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9fb3fd00..d53cf87b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,14 +61,18 @@ jobs: run: rye build - name: Get GitHub OIDC Token - if: github.repository == 'stainless-sdks/gradient-python' + if: |- + github.repository == 'stainless-sdks/gradient-python' && + !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); - name: Upload tarball - if: github.repository == 'stainless-sdks/gradient-python' + if: |- + github.repository == 'stainless-sdks/gradient-python' && + !startsWith(github.ref, 'refs/heads/stl/') env: URL: https://pkg.stainless.com/s AUTH: ${{ steps.github-oidc.outputs.github_token }} From 0574103b4bbc895271e9ebce7ffef47be26d0c87 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2026 15:38:18 +0000 Subject: [PATCH 86/96] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 903f66b5..ba3a611d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-2344b44246a44d39ad5b74d3077bd2958745aad67feb15970756532fa0b3f9d6.yml openapi_spec_hash: a1913979235ce152a8dc380fabe5362e -config_hash: eba2c4c8469d877f806f66ac2a91f4ec +config_hash: 13e570f98198e8fd1dfcb7ca59d73e0d From ed91ffb3b1e2246403f1250c1a0de24cd90aefe4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 16:19:34 +0000 Subject: [PATCH 87/96] feat(api): update urls for endpoints --- .stats.yml | 6 +- .../resources/agents/chat/completions.py | 28 ++ src/gradient/resources/chat/completions.py | 28 ++ src/gradient/resources/nfs/nfs.py | 264 ++++++++++++------ src/gradient/resources/nfs/snapshots.py | 12 +- .../agents/chat/completion_create_params.py | 112 +++++++- .../types/chat/completion_create_params.py | 112 +++++++- src/gradient/types/nf_create_params.py | 3 + src/gradient/types/nf_delete_params.py | 4 +- .../types/nf_initiate_action_params.py | 48 +++- src/gradient/types/nf_list_params.py | 4 +- src/gradient/types/nf_retrieve_params.py | 4 +- .../types/nfs/snapshot_delete_params.py | 4 +- .../types/nfs/snapshot_list_params.py | 4 +- .../types/nfs/snapshot_retrieve_params.py | 4 +- .../agents/chat/test_completions.py | 4 + tests/api_resources/chat/test_completions.py | 4 + tests/api_resources/nfs/test_snapshots.py | 68 +++-- tests/api_resources/test_nfs.py | 258 ++++++++++++----- 19 files changed, 761 insertions(+), 210 deletions(-) diff --git a/.stats.yml b/.stats.yml index ba3a611d..fa21fe25 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-2344b44246a44d39ad5b74d3077bd2958745aad67feb15970756532fa0b3f9d6.yml -openapi_spec_hash: a1913979235ce152a8dc380fabe5362e -config_hash: 13e570f98198e8fd1dfcb7ca59d73e0d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-93df5cb3d61c1bbcab2a4bbf3f0775454bd185a400bc140c61dbf36e108dbf89.yml +openapi_spec_hash: 0126adf782c5feac3d8e682e466c3cf7 +config_hash: 3f968a57adb20643373c134efc9af01a diff --git a/src/gradient/resources/agents/chat/completions.py b/src/gradient/resources/agents/chat/completions.py index fdad67bb..619a2712 100644 --- a/src/gradient/resources/agents/chat/completions.py +++ b/src/gradient/resources/agents/chat/completions.py @@ -64,6 +64,7 @@ def create( metadata: Optional[Dict[str, str]] | Omit = omit, n: Optional[int] | Omit = omit, presence_penalty: Optional[float] | Omit = omit, + reasoning_effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, stream: Optional[Literal[False]] | Omit = omit, stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, @@ -129,6 +130,9 @@ def create( whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + reasoning_effort: Constrains effort on reasoning for reasoning models. Reducing reasoning effort + can result in faster responses and fewer tokens used on reasoning in a response. + stop: Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. @@ -193,6 +197,7 @@ def create( metadata: Optional[Dict[str, str]] | Omit = omit, n: Optional[int] | Omit = omit, presence_penalty: Optional[float] | Omit = omit, + reasoning_effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, temperature: Optional[float] | Omit = omit, @@ -260,6 +265,9 @@ def create( whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + reasoning_effort: Constrains effort on reasoning for reasoning models. Reducing reasoning effort + can result in faster responses and fewer tokens used on reasoning in a response. + stop: Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. @@ -321,6 +329,7 @@ def create( metadata: Optional[Dict[str, str]] | Omit = omit, n: Optional[int] | Omit = omit, presence_penalty: Optional[float] | Omit = omit, + reasoning_effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, temperature: Optional[float] | Omit = omit, @@ -388,6 +397,9 @@ def create( whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + reasoning_effort: Constrains effort on reasoning for reasoning models. Reducing reasoning effort + can result in faster responses and fewer tokens used on reasoning in a response. + stop: Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. @@ -451,6 +463,7 @@ def create( metadata: Optional[Dict[str, str]] | Omit = omit, n: Optional[int] | Omit = omit, presence_penalty: Optional[float] | Omit = omit, + reasoning_effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, stream: Optional[Literal[False]] | Literal[True] | Omit = omit, stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, @@ -491,6 +504,7 @@ def create( "metadata": metadata, "n": n, "presence_penalty": presence_penalty, + "reasoning_effort": reasoning_effort, "stop": stop, "stream": stream, "stream_options": stream_options, @@ -557,6 +571,7 @@ async def create( metadata: Optional[Dict[str, str]] | Omit = omit, n: Optional[int] | Omit = omit, presence_penalty: Optional[float] | Omit = omit, + reasoning_effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, stream: Optional[Literal[False]] | Omit = omit, stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, @@ -622,6 +637,9 @@ async def create( whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + reasoning_effort: Constrains effort on reasoning for reasoning models. Reducing reasoning effort + can result in faster responses and fewer tokens used on reasoning in a response. + stop: Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. @@ -686,6 +704,7 @@ async def create( metadata: Optional[Dict[str, str]] | Omit = omit, n: Optional[int] | Omit = omit, presence_penalty: Optional[float] | Omit = omit, + reasoning_effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, temperature: Optional[float] | Omit = omit, @@ -753,6 +772,9 @@ async def create( whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + reasoning_effort: Constrains effort on reasoning for reasoning models. Reducing reasoning effort + can result in faster responses and fewer tokens used on reasoning in a response. + stop: Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. @@ -814,6 +836,7 @@ async def create( metadata: Optional[Dict[str, str]] | Omit = omit, n: Optional[int] | Omit = omit, presence_penalty: Optional[float] | Omit = omit, + reasoning_effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, temperature: Optional[float] | Omit = omit, @@ -881,6 +904,9 @@ async def create( whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + reasoning_effort: Constrains effort on reasoning for reasoning models. Reducing reasoning effort + can result in faster responses and fewer tokens used on reasoning in a response. + stop: Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. @@ -941,6 +967,7 @@ async def create( metadata: Optional[Dict[str, str]] | Omit = omit, n: Optional[int] | Omit = omit, presence_penalty: Optional[float] | Omit = omit, + reasoning_effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, stream: Optional[Literal[False]] | Literal[True] | Omit = omit, stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, @@ -981,6 +1008,7 @@ async def create( "metadata": metadata, "n": n, "presence_penalty": presence_penalty, + "reasoning_effort": reasoning_effort, "stop": stop, "stream": stream, "stream_options": stream_options, diff --git a/src/gradient/resources/chat/completions.py b/src/gradient/resources/chat/completions.py index d2ae1071..2052db35 100644 --- a/src/gradient/resources/chat/completions.py +++ b/src/gradient/resources/chat/completions.py @@ -64,6 +64,7 @@ def create( metadata: Optional[Dict[str, str]] | Omit = omit, n: Optional[int] | Omit = omit, presence_penalty: Optional[float] | Omit = omit, + reasoning_effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, stream: Optional[Literal[False]] | Omit = omit, stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, @@ -129,6 +130,9 @@ def create( whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + reasoning_effort: Constrains effort on reasoning for reasoning models. Reducing reasoning effort + can result in faster responses and fewer tokens used on reasoning in a response. + stop: Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. @@ -194,6 +198,7 @@ def create( metadata: Optional[Dict[str, str]] | Omit = omit, n: Optional[int] | Omit = omit, presence_penalty: Optional[float] | Omit = omit, + reasoning_effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, temperature: Optional[float] | Omit = omit, @@ -261,6 +266,9 @@ def create( whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + reasoning_effort: Constrains effort on reasoning for reasoning models. Reducing reasoning effort + can result in faster responses and fewer tokens used on reasoning in a response. + stop: Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. @@ -322,6 +330,7 @@ def create( metadata: Optional[Dict[str, str]] | Omit = omit, n: Optional[int] | Omit = omit, presence_penalty: Optional[float] | Omit = omit, + reasoning_effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, temperature: Optional[float] | Omit = omit, @@ -389,6 +398,9 @@ def create( whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + reasoning_effort: Constrains effort on reasoning for reasoning models. Reducing reasoning effort + can result in faster responses and fewer tokens used on reasoning in a response. + stop: Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. @@ -449,6 +461,7 @@ def create( metadata: Optional[Dict[str, str]] | Omit = omit, n: Optional[int] | Omit = omit, presence_penalty: Optional[float] | Omit = omit, + reasoning_effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, stream: Optional[Literal[False]] | Literal[True] | Omit = omit, stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, @@ -492,6 +505,7 @@ def create( "metadata": metadata, "n": n, "presence_penalty": presence_penalty, + "reasoning_effort": reasoning_effort, "stop": stop, "stream": stream, "stream_options": stream_options, @@ -558,6 +572,7 @@ async def create( metadata: Optional[Dict[str, str]] | Omit = omit, n: Optional[int] | Omit = omit, presence_penalty: Optional[float] | Omit = omit, + reasoning_effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, stream: Optional[Literal[False]] | Omit = omit, stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, @@ -623,6 +638,9 @@ async def create( whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + reasoning_effort: Constrains effort on reasoning for reasoning models. Reducing reasoning effort + can result in faster responses and fewer tokens used on reasoning in a response. + stop: Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. @@ -688,6 +706,7 @@ async def create( metadata: Optional[Dict[str, str]] | Omit = omit, n: Optional[int] | Omit = omit, presence_penalty: Optional[float] | Omit = omit, + reasoning_effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, temperature: Optional[float] | Omit = omit, @@ -755,6 +774,9 @@ async def create( whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + reasoning_effort: Constrains effort on reasoning for reasoning models. Reducing reasoning effort + can result in faster responses and fewer tokens used on reasoning in a response. + stop: Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. @@ -816,6 +838,7 @@ async def create( metadata: Optional[Dict[str, str]] | Omit = omit, n: Optional[int] | Omit = omit, presence_penalty: Optional[float] | Omit = omit, + reasoning_effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, temperature: Optional[float] | Omit = omit, @@ -883,6 +906,9 @@ async def create( whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + reasoning_effort: Constrains effort on reasoning for reasoning models. Reducing reasoning effort + can result in faster responses and fewer tokens used on reasoning in a response. + stop: Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. @@ -943,6 +969,7 @@ async def create( metadata: Optional[Dict[str, str]] | Omit = omit, n: Optional[int] | Omit = omit, presence_penalty: Optional[float] | Omit = omit, + reasoning_effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] | Omit = omit, stop: Union[Optional[str], SequenceNotStr[str], None] | Omit = omit, stream: Optional[Literal[False]] | Literal[True] | Omit = omit, stream_options: Optional[completion_create_params.StreamOptions] | Omit = omit, @@ -986,6 +1013,7 @@ async def create( "metadata": metadata, "n": n, "presence_penalty": presence_penalty, + "reasoning_effort": reasoning_effort, "stop": stop, "stream": stream, "stream_options": stream_options, diff --git a/src/gradient/resources/nfs/nfs.py b/src/gradient/resources/nfs/nfs.py index a4e47d9c..ec50bdf8 100644 --- a/src/gradient/resources/nfs/nfs.py +++ b/src/gradient/resources/nfs/nfs.py @@ -69,6 +69,7 @@ def create( region: str, size_gib: int, vpc_ids: SequenceNotStr[str], + performance_tier: 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, @@ -88,6 +89,8 @@ def create( vpc_ids: List of VPC IDs that should be able to access the share. + performance_tier: The performance tier of the share. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -104,6 +107,7 @@ def create( "region": region, "size_gib": size_gib, "vpc_ids": vpc_ids, + "performance_tier": performance_tier, }, nf_create_params.NfCreateParams, ), @@ -117,7 +121,7 @@ def retrieve( self, nfs_id: str, *, - region: str, + region: 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, @@ -160,7 +164,7 @@ def retrieve( def list( self, *, - region: str, + region: 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, @@ -201,7 +205,7 @@ def delete( self, nfs_id: str, *, - region: str, + region: 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, @@ -248,9 +252,9 @@ def initiate_action( self, nfs_id: str, *, - region: str, type: Literal["resize", "snapshot"], params: nf_initiate_action_params.NfsActionResizeParams | Omit = omit, + region: 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, @@ -263,18 +267,19 @@ def initiate_action( request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the `type` attribute to on of the supported action types: - | Action | Details | - | ----------------------- | -------------------------------------------------------------------------------- | - | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | - | `snapshot` | Takes a snapshot of an NFS share | - | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | - | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + | Action | Details | + | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | + | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + | `switch_performance_tier` | Switches the performance tier of an NFS share. Set the performance_tier attribute to the desired tier (e.g., standard, high) | Args: - region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. - type: The type of action to initiate for the NFS share (such as resize or snapshot). + region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -290,9 +295,9 @@ def initiate_action( self, nfs_id: str, *, - region: str, type: Literal["resize", "snapshot"], params: nf_initiate_action_params.NfsActionSnapshotParams | Omit = omit, + region: 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, @@ -305,18 +310,19 @@ def initiate_action( request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the `type` attribute to on of the supported action types: - | Action | Details | - | ----------------------- | -------------------------------------------------------------------------------- | - | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | - | `snapshot` | Takes a snapshot of an NFS share | - | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | - | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + | Action | Details | + | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | + | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + | `switch_performance_tier` | Switches the performance tier of an NFS share. Set the performance_tier attribute to the desired tier (e.g., standard, high) | Args: - region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. - type: The type of action to initiate for the NFS share (such as resize or snapshot). + region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -332,9 +338,9 @@ def initiate_action( self, nfs_id: str, *, - region: str, type: Literal["resize", "snapshot"], params: nf_initiate_action_params.NfsActionAttachParams | Omit = omit, + region: 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, @@ -347,18 +353,19 @@ def initiate_action( request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the `type` attribute to on of the supported action types: - | Action | Details | - | ----------------------- | -------------------------------------------------------------------------------- | - | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | - | `snapshot` | Takes a snapshot of an NFS share | - | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | - | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + | Action | Details | + | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | + | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + | `switch_performance_tier` | Switches the performance tier of an NFS share. Set the performance_tier attribute to the desired tier (e.g., standard, high) | Args: - region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. - type: The type of action to initiate for the NFS share (such as resize or snapshot). + region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -374,9 +381,9 @@ def initiate_action( self, nfs_id: str, *, - region: str, type: Literal["resize", "snapshot"], params: nf_initiate_action_params.NfsActionDetachParams | Omit = omit, + region: 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, @@ -389,18 +396,62 @@ def initiate_action( request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the `type` attribute to on of the supported action types: - | Action | Details | - | ----------------------- | -------------------------------------------------------------------------------- | - | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | - | `snapshot` | Takes a snapshot of an NFS share | - | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | - | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + | Action | Details | + | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | + | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + | `switch_performance_tier` | Switches the performance tier of an NFS share. Set the performance_tier attribute to the desired tier (e.g., standard, high) | Args: + type: The type of action to initiate for the NFS share (such as resize or snapshot). + region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def initiate_action( + self, + nfs_id: str, + *, + type: Literal["resize", "snapshot"], + params: nf_initiate_action_params.NfsActionSwitchPerformanceTierParams | Omit = omit, + region: 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, + ) -> NfInitiateActionResponse: + """ + To execute an action (such as resize) on a specified NFS share, send a POST + request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the + `type` attribute to on of the supported action types: + + | Action | Details | + | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | + | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + | `switch_performance_tier` | Switches the performance tier of an NFS share. Set the performance_tier attribute to the desired tier (e.g., standard, high) | + + Args: type: The type of action to initiate for the NFS share (such as resize or snapshot). + region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -411,18 +462,19 @@ def initiate_action( """ ... - @required_args(["region", "type"]) + @required_args(["type"]) def initiate_action( self, nfs_id: str, *, - region: str, type: Literal["resize", "snapshot"], params: nf_initiate_action_params.NfsActionResizeParams | nf_initiate_action_params.NfsActionSnapshotParams | nf_initiate_action_params.NfsActionAttachParams | nf_initiate_action_params.NfsActionDetachParams + | nf_initiate_action_params.NfsActionSwitchPerformanceTierParams | Omit = omit, + region: 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, @@ -438,9 +490,9 @@ def initiate_action( else f"https://api.digitalocean.com/v2/nfs/{nfs_id}/actions", body=maybe_transform( { - "region": region, "type": type, "params": params, + "region": region, }, nf_initiate_action_params.NfInitiateActionParams, ), @@ -486,6 +538,7 @@ async def create( region: str, size_gib: int, vpc_ids: SequenceNotStr[str], + performance_tier: 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, @@ -505,6 +558,8 @@ async def create( vpc_ids: List of VPC IDs that should be able to access the share. + performance_tier: The performance tier of the share. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -521,6 +576,7 @@ async def create( "region": region, "size_gib": size_gib, "vpc_ids": vpc_ids, + "performance_tier": performance_tier, }, nf_create_params.NfCreateParams, ), @@ -534,7 +590,7 @@ async def retrieve( self, nfs_id: str, *, - region: str, + region: 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, @@ -577,7 +633,7 @@ async def retrieve( async def list( self, *, - region: str, + region: 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, @@ -618,7 +674,7 @@ async def delete( self, nfs_id: str, *, - region: str, + region: 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, @@ -665,9 +721,9 @@ async def initiate_action( self, nfs_id: str, *, - region: str, type: Literal["resize", "snapshot"], params: nf_initiate_action_params.NfsActionResizeParams | Omit = omit, + region: 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, @@ -680,18 +736,19 @@ async def initiate_action( request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the `type` attribute to on of the supported action types: - | Action | Details | - | ----------------------- | -------------------------------------------------------------------------------- | - | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | - | `snapshot` | Takes a snapshot of an NFS share | - | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | - | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + | Action | Details | + | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | + | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + | `switch_performance_tier` | Switches the performance tier of an NFS share. Set the performance_tier attribute to the desired tier (e.g., standard, high) | Args: - region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. - type: The type of action to initiate for the NFS share (such as resize or snapshot). + region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -707,9 +764,9 @@ async def initiate_action( self, nfs_id: str, *, - region: str, type: Literal["resize", "snapshot"], params: nf_initiate_action_params.NfsActionSnapshotParams | Omit = omit, + region: 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, @@ -722,18 +779,19 @@ async def initiate_action( request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the `type` attribute to on of the supported action types: - | Action | Details | - | ----------------------- | -------------------------------------------------------------------------------- | - | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | - | `snapshot` | Takes a snapshot of an NFS share | - | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | - | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + | Action | Details | + | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | + | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + | `switch_performance_tier` | Switches the performance tier of an NFS share. Set the performance_tier attribute to the desired tier (e.g., standard, high) | Args: - region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. - type: The type of action to initiate for the NFS share (such as resize or snapshot). + region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -749,9 +807,9 @@ async def initiate_action( self, nfs_id: str, *, - region: str, type: Literal["resize", "snapshot"], params: nf_initiate_action_params.NfsActionAttachParams | Omit = omit, + region: 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, @@ -764,18 +822,19 @@ async def initiate_action( request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the `type` attribute to on of the supported action types: - | Action | Details | - | ----------------------- | -------------------------------------------------------------------------------- | - | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | - | `snapshot` | Takes a snapshot of an NFS share | - | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | - | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + | Action | Details | + | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | + | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + | `switch_performance_tier` | Switches the performance tier of an NFS share. Set the performance_tier attribute to the desired tier (e.g., standard, high) | Args: - region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. - type: The type of action to initiate for the NFS share (such as resize or snapshot). + region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -791,9 +850,9 @@ async def initiate_action( self, nfs_id: str, *, - region: str, type: Literal["resize", "snapshot"], params: nf_initiate_action_params.NfsActionDetachParams | Omit = omit, + region: 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, @@ -806,18 +865,62 @@ async def initiate_action( request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the `type` attribute to on of the supported action types: - | Action | Details | - | ----------------------- | -------------------------------------------------------------------------------- | - | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | - | `snapshot` | Takes a snapshot of an NFS share | - | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | - | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + | Action | Details | + | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | + | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + | `switch_performance_tier` | Switches the performance tier of an NFS share. Set the performance_tier attribute to the desired tier (e.g., standard, high) | Args: + type: The type of action to initiate for the NFS share (such as resize or snapshot). + region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def initiate_action( + self, + nfs_id: str, + *, + type: Literal["resize", "snapshot"], + params: nf_initiate_action_params.NfsActionSwitchPerformanceTierParams | Omit = omit, + region: 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, + ) -> NfInitiateActionResponse: + """ + To execute an action (such as resize) on a specified NFS share, send a POST + request to `/v2/nfs/{nfs_id}/actions`. In the JSON body to the request, set the + `type` attribute to on of the supported action types: + + | Action | Details | + | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | + | `resize` | Resizes an NFS share. Set the size_gib attribute to a desired value in GiB | + | `snapshot` | Takes a snapshot of an NFS share | + | `attach` | Attaches an NFS share to a VPC. Set the vpc_id attribute to the desired VPC ID | + | `detach` | Detaches an NFS share from a VPC. Set the vpc_id attribute to the desired VPC ID | + | `switch_performance_tier` | Switches the performance tier of an NFS share. Set the performance_tier attribute to the desired tier (e.g., standard, high) | + + Args: type: The type of action to initiate for the NFS share (such as resize or snapshot). + region: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -828,18 +931,19 @@ async def initiate_action( """ ... - @required_args(["region", "type"]) + @required_args(["type"]) async def initiate_action( self, nfs_id: str, *, - region: str, type: Literal["resize", "snapshot"], params: nf_initiate_action_params.NfsActionResizeParams | nf_initiate_action_params.NfsActionSnapshotParams | nf_initiate_action_params.NfsActionAttachParams | nf_initiate_action_params.NfsActionDetachParams + | nf_initiate_action_params.NfsActionSwitchPerformanceTierParams | Omit = omit, + region: 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, @@ -855,9 +959,9 @@ async def initiate_action( else f"https://api.digitalocean.com/v2/nfs/{nfs_id}/actions", body=await async_maybe_transform( { - "region": region, "type": type, "params": params, + "region": region, }, nf_initiate_action_params.NfInitiateActionParams, ), diff --git a/src/gradient/resources/nfs/snapshots.py b/src/gradient/resources/nfs/snapshots.py index 4e694ce6..209e7da9 100644 --- a/src/gradient/resources/nfs/snapshots.py +++ b/src/gradient/resources/nfs/snapshots.py @@ -51,7 +51,7 @@ def retrieve( self, nfs_snapshot_id: str, *, - region: str, + region: 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, @@ -95,7 +95,7 @@ def retrieve( def list( self, *, - region: str, + region: str | Omit = omit, share_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. @@ -152,7 +152,7 @@ def delete( self, nfs_snapshot_id: str, *, - region: str, + region: 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, @@ -224,7 +224,7 @@ async def retrieve( self, nfs_snapshot_id: str, *, - region: str, + region: 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, @@ -268,7 +268,7 @@ async def retrieve( async def list( self, *, - region: str, + region: str | Omit = omit, share_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. @@ -325,7 +325,7 @@ async def delete( self, nfs_snapshot_id: str, *, - region: str, + region: 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, diff --git a/src/gradient/types/agents/chat/completion_create_params.py b/src/gradient/types/agents/chat/completion_create_params.py index 797c6ea3..f01fa283 100644 --- a/src/gradient/types/agents/chat/completion_create_params.py +++ b/src/gradient/types/agents/chat/completion_create_params.py @@ -28,9 +28,17 @@ "MessageChatCompletionRequestUserMessageContent", "MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartText", "MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartTextCacheControl", + "MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartImageURL", + "MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartImageURLImageURL", + "MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartVideoURL", + "MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartVideoURLVideoURL", "MessageChatCompletionRequestUserMessageContentArrayOfContentPart", "MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartText", "MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl", + "MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartImageURL", + "MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartImageURLImageURL", + "MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartVideoURL", + "MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartVideoURLVideoURL", "MessageChatCompletionRequestAssistantMessage", "MessageChatCompletionRequestAssistantMessageContent", "MessageChatCompletionRequestAssistantMessageContentChatCompletionRequestContentPartText", @@ -128,6 +136,13 @@ class CompletionCreateParamsBase(TypedDict, total=False): far, increasing the model's likelihood to talk about new topics. """ + reasoning_effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] + """Constrains effort on reasoning for reasoning models. + + Reducing reasoning effort can result in faster responses and fewer tokens used + on reasoning in a response. + """ + stop: Union[Optional[str], SequenceNotStr[str], None] """Up to 4 sequences where the API will stop generating further tokens. @@ -364,6 +379,47 @@ class MessageChatCompletionRequestUserMessageContentChatCompletionRequestContent """Cache control settings for the content part.""" +class MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartImageURLImageURL( + TypedDict, total=False +): + """Image URL settings.""" + + url: Required[str] + """A URL or data URL containing image content.""" + + detail: Literal["auto", "low", "high"] + """Optional detail level for image understanding.""" + + +class MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartImageURL(TypedDict, total=False): + """Content part with type and image URL.""" + + image_url: Required[MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartImageURLImageURL] + """Image URL settings.""" + + type: Required[Literal["image_url"]] + """The type of content part""" + + +class MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartVideoURLVideoURL( + TypedDict, total=False +): + """Video URL settings.""" + + url: Required[str] + """A URL or data URL containing video content.""" + + +class MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartVideoURL(TypedDict, total=False): + """Content part with type and video URL.""" + + type: Required[Literal["video_url"]] + """The type of content part""" + + video_url: Required[MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartVideoURLVideoURL] + """Video URL settings.""" + + class MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl( TypedDict, total=False ): @@ -393,13 +449,67 @@ class MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatComple """Cache control settings for the content part.""" +class MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartImageURLImageURL( + TypedDict, total=False +): + """Image URL settings.""" + + url: Required[str] + """A URL or data URL containing image content.""" + + detail: Literal["auto", "low", "high"] + """Optional detail level for image understanding.""" + + +class MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartImageURL( + TypedDict, total=False +): + """Content part with type and image URL.""" + + image_url: Required[ + MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartImageURLImageURL + ] + """Image URL settings.""" + + type: Required[Literal["image_url"]] + """The type of content part""" + + +class MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartVideoURLVideoURL( + TypedDict, total=False +): + """Video URL settings.""" + + url: Required[str] + """A URL or data URL containing video content.""" + + +class MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartVideoURL( + TypedDict, total=False +): + """Content part with type and video URL.""" + + type: Required[Literal["video_url"]] + """The type of content part""" + + video_url: Required[ + MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartVideoURLVideoURL + ] + """Video URL settings.""" + + MessageChatCompletionRequestUserMessageContentArrayOfContentPart: TypeAlias = Union[ - str, MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartText + str, + MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartText, + MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartImageURL, + MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartVideoURL, ] MessageChatCompletionRequestUserMessageContent: TypeAlias = Union[ str, MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartText, + MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartImageURL, + MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartVideoURL, SequenceNotStr[MessageChatCompletionRequestUserMessageContentArrayOfContentPart], ] diff --git a/src/gradient/types/chat/completion_create_params.py b/src/gradient/types/chat/completion_create_params.py index bf5bd49d..925eea7e 100644 --- a/src/gradient/types/chat/completion_create_params.py +++ b/src/gradient/types/chat/completion_create_params.py @@ -28,9 +28,17 @@ "MessageChatCompletionRequestUserMessageContent", "MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartText", "MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartTextCacheControl", + "MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartImageURL", + "MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartImageURLImageURL", + "MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartVideoURL", + "MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartVideoURLVideoURL", "MessageChatCompletionRequestUserMessageContentArrayOfContentPart", "MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartText", "MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl", + "MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartImageURL", + "MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartImageURLImageURL", + "MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartVideoURL", + "MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartVideoURLVideoURL", "MessageChatCompletionRequestAssistantMessage", "MessageChatCompletionRequestAssistantMessageContent", "MessageChatCompletionRequestAssistantMessageContentChatCompletionRequestContentPartText", @@ -128,6 +136,13 @@ class CompletionCreateParamsBase(TypedDict, total=False): far, increasing the model's likelihood to talk about new topics. """ + reasoning_effort: Optional[Literal["none", "minimal", "low", "medium", "high", "xhigh"]] + """Constrains effort on reasoning for reasoning models. + + Reducing reasoning effort can result in faster responses and fewer tokens used + on reasoning in a response. + """ + stop: Union[Optional[str], SequenceNotStr[str], None] """Up to 4 sequences where the API will stop generating further tokens. @@ -364,6 +379,47 @@ class MessageChatCompletionRequestUserMessageContentChatCompletionRequestContent """Cache control settings for the content part.""" +class MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartImageURLImageURL( + TypedDict, total=False +): + """Image URL settings.""" + + url: Required[str] + """A URL or data URL containing image content.""" + + detail: Literal["auto", "low", "high"] + """Optional detail level for image understanding.""" + + +class MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartImageURL(TypedDict, total=False): + """Content part with type and image URL.""" + + image_url: Required[MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartImageURLImageURL] + """Image URL settings.""" + + type: Required[Literal["image_url"]] + """The type of content part""" + + +class MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartVideoURLVideoURL( + TypedDict, total=False +): + """Video URL settings.""" + + url: Required[str] + """A URL or data URL containing video content.""" + + +class MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartVideoURL(TypedDict, total=False): + """Content part with type and video URL.""" + + type: Required[Literal["video_url"]] + """The type of content part""" + + video_url: Required[MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartVideoURLVideoURL] + """Video URL settings.""" + + class MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartTextCacheControl( TypedDict, total=False ): @@ -393,13 +449,67 @@ class MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatComple """Cache control settings for the content part.""" +class MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartImageURLImageURL( + TypedDict, total=False +): + """Image URL settings.""" + + url: Required[str] + """A URL or data URL containing image content.""" + + detail: Literal["auto", "low", "high"] + """Optional detail level for image understanding.""" + + +class MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartImageURL( + TypedDict, total=False +): + """Content part with type and image URL.""" + + image_url: Required[ + MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartImageURLImageURL + ] + """Image URL settings.""" + + type: Required[Literal["image_url"]] + """The type of content part""" + + +class MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartVideoURLVideoURL( + TypedDict, total=False +): + """Video URL settings.""" + + url: Required[str] + """A URL or data URL containing video content.""" + + +class MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartVideoURL( + TypedDict, total=False +): + """Content part with type and video URL.""" + + type: Required[Literal["video_url"]] + """The type of content part""" + + video_url: Required[ + MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartVideoURLVideoURL + ] + """Video URL settings.""" + + MessageChatCompletionRequestUserMessageContentArrayOfContentPart: TypeAlias = Union[ - str, MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartText + str, + MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartText, + MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartImageURL, + MessageChatCompletionRequestUserMessageContentArrayOfContentPartChatCompletionRequestContentPartVideoURL, ] MessageChatCompletionRequestUserMessageContent: TypeAlias = Union[ str, MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartText, + MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartImageURL, + MessageChatCompletionRequestUserMessageContentChatCompletionRequestContentPartVideoURL, SequenceNotStr[MessageChatCompletionRequestUserMessageContentArrayOfContentPart], ] diff --git a/src/gradient/types/nf_create_params.py b/src/gradient/types/nf_create_params.py index 327beb2e..fab12a16 100644 --- a/src/gradient/types/nf_create_params.py +++ b/src/gradient/types/nf_create_params.py @@ -21,3 +21,6 @@ class NfCreateParams(TypedDict, total=False): vpc_ids: Required[SequenceNotStr[str]] """List of VPC IDs that should be able to access the share.""" + + performance_tier: str + """The performance tier of the share.""" diff --git a/src/gradient/types/nf_delete_params.py b/src/gradient/types/nf_delete_params.py index a11474e5..c507a370 100644 --- a/src/gradient/types/nf_delete_params.py +++ b/src/gradient/types/nf_delete_params.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict __all__ = ["NfDeleteParams"] class NfDeleteParams(TypedDict, total=False): - region: Required[str] + region: str """The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides.""" diff --git a/src/gradient/types/nf_initiate_action_params.py b/src/gradient/types/nf_initiate_action_params.py index 4b297210..1080d816 100644 --- a/src/gradient/types/nf_initiate_action_params.py +++ b/src/gradient/types/nf_initiate_action_params.py @@ -15,18 +15,20 @@ "NfsActionAttachParams", "NfsActionDetach", "NfsActionDetachParams", + "NfsActionSwitchPerformanceTier", + "NfsActionSwitchPerformanceTierParams", ] class NfsActionResize(TypedDict, total=False): - region: Required[str] - """The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides.""" - type: Required[Literal["resize", "snapshot"]] """The type of action to initiate for the NFS share (such as resize or snapshot).""" params: NfsActionResizeParams + region: str + """The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides.""" + class NfsActionResizeParams(TypedDict, total=False): size_gib: Required[int] @@ -34,14 +36,14 @@ class NfsActionResizeParams(TypedDict, total=False): class NfsActionSnapshot(TypedDict, total=False): - region: Required[str] - """The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides.""" - type: Required[Literal["resize", "snapshot"]] """The type of action to initiate for the NFS share (such as resize or snapshot).""" params: NfsActionSnapshotParams + region: str + """The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides.""" + class NfsActionSnapshotParams(TypedDict, total=False): name: Required[str] @@ -49,14 +51,14 @@ class NfsActionSnapshotParams(TypedDict, total=False): class NfsActionAttach(TypedDict, total=False): - region: Required[str] - """The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides.""" - type: Required[Literal["resize", "snapshot"]] """The type of action to initiate for the NFS share (such as resize or snapshot).""" params: NfsActionAttachParams + region: str + """The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides.""" + class NfsActionAttachParams(TypedDict, total=False): vpc_id: Required[str] @@ -64,18 +66,38 @@ class NfsActionAttachParams(TypedDict, total=False): class NfsActionDetach(TypedDict, total=False): - region: Required[str] - """The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides.""" - type: Required[Literal["resize", "snapshot"]] """The type of action to initiate for the NFS share (such as resize or snapshot).""" params: NfsActionDetachParams + region: str + """The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides.""" + class NfsActionDetachParams(TypedDict, total=False): vpc_id: Required[str] """The ID of the VPC from which the NFS share will be detached""" -NfInitiateActionParams: TypeAlias = Union[NfsActionResize, NfsActionSnapshot, NfsActionAttach, NfsActionDetach] +class NfsActionSwitchPerformanceTier(TypedDict, total=False): + type: Required[Literal["resize", "snapshot"]] + """The type of action to initiate for the NFS share (such as resize or snapshot).""" + + params: NfsActionSwitchPerformanceTierParams + + region: str + """The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides.""" + + +class NfsActionSwitchPerformanceTierParams(TypedDict, total=False): + performance_tier: Required[str] + """ + The performance tier to which the NFS share will be switched (e.g., standard, + high). + """ + + +NfInitiateActionParams: TypeAlias = Union[ + NfsActionResize, NfsActionSnapshot, NfsActionAttach, NfsActionDetach, NfsActionSwitchPerformanceTier +] diff --git a/src/gradient/types/nf_list_params.py b/src/gradient/types/nf_list_params.py index bc53c284..52b4d96d 100644 --- a/src/gradient/types/nf_list_params.py +++ b/src/gradient/types/nf_list_params.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict __all__ = ["NfListParams"] class NfListParams(TypedDict, total=False): - region: Required[str] + region: str """The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides.""" diff --git a/src/gradient/types/nf_retrieve_params.py b/src/gradient/types/nf_retrieve_params.py index 292053d9..6d7ba724 100644 --- a/src/gradient/types/nf_retrieve_params.py +++ b/src/gradient/types/nf_retrieve_params.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict __all__ = ["NfRetrieveParams"] class NfRetrieveParams(TypedDict, total=False): - region: Required[str] + region: str """The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides.""" diff --git a/src/gradient/types/nfs/snapshot_delete_params.py b/src/gradient/types/nfs/snapshot_delete_params.py index 1b26149e..844da45e 100644 --- a/src/gradient/types/nfs/snapshot_delete_params.py +++ b/src/gradient/types/nfs/snapshot_delete_params.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict __all__ = ["SnapshotDeleteParams"] class SnapshotDeleteParams(TypedDict, total=False): - region: Required[str] + region: str """The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides.""" diff --git a/src/gradient/types/nfs/snapshot_list_params.py b/src/gradient/types/nfs/snapshot_list_params.py index 8c4c6946..64f9543b 100644 --- a/src/gradient/types/nfs/snapshot_list_params.py +++ b/src/gradient/types/nfs/snapshot_list_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict __all__ = ["SnapshotListParams"] class SnapshotListParams(TypedDict, total=False): - region: Required[str] + region: str """The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides.""" share_id: str diff --git a/src/gradient/types/nfs/snapshot_retrieve_params.py b/src/gradient/types/nfs/snapshot_retrieve_params.py index d1e1f8e8..2c3fcda5 100644 --- a/src/gradient/types/nfs/snapshot_retrieve_params.py +++ b/src/gradient/types/nfs/snapshot_retrieve_params.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict __all__ = ["SnapshotRetrieveParams"] class SnapshotRetrieveParams(TypedDict, total=False): - region: Required[str] + region: str """The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides.""" diff --git a/tests/api_resources/agents/chat/test_completions.py b/tests/api_resources/agents/chat/test_completions.py index 30d797ff..7574766e 100644 --- a/tests/api_resources/agents/chat/test_completions.py +++ b/tests/api_resources/agents/chat/test_completions.py @@ -50,6 +50,7 @@ def test_method_create_with_all_params_overload_1(self, client: Gradient) -> Non metadata={"foo": "string"}, n=1, presence_penalty=-2, + reasoning_effort="none", stop="\n", stream=False, stream_options={"include_usage": True}, @@ -144,6 +145,7 @@ def test_method_create_with_all_params_overload_2(self, client: Gradient) -> Non metadata={"foo": "string"}, n=1, presence_penalty=-2, + reasoning_effort="none", stop="\n", stream_options={"include_usage": True}, temperature=1, @@ -245,6 +247,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn metadata={"foo": "string"}, n=1, presence_penalty=-2, + reasoning_effort="none", stop="\n", stream=False, stream_options={"include_usage": True}, @@ -339,6 +342,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn metadata={"foo": "string"}, n=1, presence_penalty=-2, + reasoning_effort="none", stop="\n", stream_options={"include_usage": True}, temperature=1, diff --git a/tests/api_resources/chat/test_completions.py b/tests/api_resources/chat/test_completions.py index 81125c20..54e98640 100644 --- a/tests/api_resources/chat/test_completions.py +++ b/tests/api_resources/chat/test_completions.py @@ -50,6 +50,7 @@ def test_method_create_with_all_params_overload_1(self, client: Gradient) -> Non metadata={"foo": "string"}, n=1, presence_penalty=-2, + reasoning_effort="none", stop="\n", stream=False, stream_options={"include_usage": True}, @@ -144,6 +145,7 @@ def test_method_create_with_all_params_overload_2(self, client: Gradient) -> Non metadata={"foo": "string"}, n=1, presence_penalty=-2, + reasoning_effort="none", stop="\n", stream_options={"include_usage": True}, temperature=1, @@ -242,6 +244,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn metadata={"foo": "string"}, n=1, presence_penalty=-2, + reasoning_effort="none", stop="\n", stream=False, stream_options={"include_usage": True}, @@ -336,6 +339,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn metadata={"foo": "string"}, n=1, presence_penalty=-2, + reasoning_effort="none", stop="\n", stream_options={"include_usage": True}, temperature=1, diff --git a/tests/api_resources/nfs/test_snapshots.py b/tests/api_resources/nfs/test_snapshots.py index 5b229811..5068f951 100644 --- a/tests/api_resources/nfs/test_snapshots.py +++ b/tests/api_resources/nfs/test_snapshots.py @@ -23,6 +23,14 @@ class TestSnapshots: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: + snapshot = client.nfs.snapshots.retrieve( + nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + ) + assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_retrieve_with_all_params(self, client: Gradient) -> None: snapshot = client.nfs.snapshots.retrieve( nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", region="region", @@ -34,7 +42,6 @@ def test_method_retrieve(self, client: Gradient) -> None: def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.nfs.snapshots.with_raw_response.retrieve( nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="region", ) assert response.is_closed is True @@ -47,7 +54,6 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.nfs.snapshots.with_streaming_response.retrieve( nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="region", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -63,15 +69,12 @@ def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_snapshot_id` but received ''"): client.nfs.snapshots.with_raw_response.retrieve( nfs_snapshot_id="", - region="region", ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: - snapshot = client.nfs.snapshots.list( - region="region", - ) + snapshot = client.nfs.snapshots.list() assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -86,9 +89,7 @@ def test_method_list_with_all_params(self, client: Gradient) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: - response = client.nfs.snapshots.with_raw_response.list( - region="region", - ) + response = client.nfs.snapshots.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -98,9 +99,7 @@ def test_raw_response_list(self, client: Gradient) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: - with client.nfs.snapshots.with_streaming_response.list( - region="region", - ) as response: + with client.nfs.snapshots.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -112,6 +111,14 @@ def test_streaming_response_list(self, client: Gradient) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: + snapshot = client.nfs.snapshots.delete( + nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + ) + assert snapshot is None + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_delete_with_all_params(self, client: Gradient) -> None: snapshot = client.nfs.snapshots.delete( nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", region="region", @@ -123,7 +130,6 @@ def test_method_delete(self, client: Gradient) -> None: def test_raw_response_delete(self, client: Gradient) -> None: response = client.nfs.snapshots.with_raw_response.delete( nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="region", ) assert response.is_closed is True @@ -136,7 +142,6 @@ def test_raw_response_delete(self, client: Gradient) -> None: def test_streaming_response_delete(self, client: Gradient) -> None: with client.nfs.snapshots.with_streaming_response.delete( nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="region", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -152,7 +157,6 @@ def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_snapshot_id` but received ''"): client.nfs.snapshots.with_raw_response.delete( nfs_snapshot_id="", - region="region", ) @@ -164,6 +168,14 @@ class TestAsyncSnapshots: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: + snapshot = await async_client.nfs.snapshots.retrieve( + nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + ) + assert_matches_type(SnapshotRetrieveResponse, snapshot, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGradient) -> None: snapshot = await async_client.nfs.snapshots.retrieve( nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", region="region", @@ -175,7 +187,6 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.nfs.snapshots.with_raw_response.retrieve( nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="region", ) assert response.is_closed is True @@ -188,7 +199,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.nfs.snapshots.with_streaming_response.retrieve( nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="region", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -204,15 +214,12 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_snapshot_id` but received ''"): await async_client.nfs.snapshots.with_raw_response.retrieve( nfs_snapshot_id="", - region="region", ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: - snapshot = await async_client.nfs.snapshots.list( - region="region", - ) + snapshot = await async_client.nfs.snapshots.list() assert_matches_type(SnapshotListResponse, snapshot, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -227,9 +234,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: - response = await async_client.nfs.snapshots.with_raw_response.list( - region="region", - ) + response = await async_client.nfs.snapshots.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -239,9 +244,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: - async with async_client.nfs.snapshots.with_streaming_response.list( - region="region", - ) as response: + async with async_client.nfs.snapshots.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -253,6 +256,14 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: + snapshot = await async_client.nfs.snapshots.delete( + nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + ) + assert snapshot is None + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGradient) -> None: snapshot = await async_client.nfs.snapshots.delete( nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", region="region", @@ -264,7 +275,6 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.nfs.snapshots.with_raw_response.delete( nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="region", ) assert response.is_closed is True @@ -277,7 +287,6 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.nfs.snapshots.with_streaming_response.delete( nfs_snapshot_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="region", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -293,5 +302,4 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_snapshot_id` but received ''"): await async_client.nfs.snapshots.with_raw_response.delete( nfs_snapshot_id="", - region="region", ) diff --git a/tests/api_resources/test_nfs.py b/tests/api_resources/test_nfs.py index e60033eb..9a09e99b 100644 --- a/tests/api_resources/test_nfs.py +++ b/tests/api_resources/test_nfs.py @@ -33,6 +33,18 @@ def test_method_create(self, client: Gradient) -> None: ) assert_matches_type(NfCreateResponse, nf, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_create_with_all_params(self, client: Gradient) -> None: + nf = client.nfs.create( + name="sammy-share-drive", + region="atl1", + size_gib=1024, + vpc_ids=["796c6fe3-2a1d-4da2-9f3e-38239827dc91"], + performance_tier="standard", + ) + assert_matches_type(NfCreateResponse, nf, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_create(self, client: Gradient) -> None: @@ -68,6 +80,14 @@ def test_streaming_response_create(self, client: Gradient) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_retrieve(self, client: Gradient) -> None: + nf = client.nfs.retrieve( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + ) + assert_matches_type(NfRetrieveResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_retrieve_with_all_params(self, client: Gradient) -> None: nf = client.nfs.retrieve( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", region="region", @@ -79,7 +99,6 @@ def test_method_retrieve(self, client: Gradient) -> None: def test_raw_response_retrieve(self, client: Gradient) -> None: response = client.nfs.with_raw_response.retrieve( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="region", ) assert response.is_closed is True @@ -92,7 +111,6 @@ def test_raw_response_retrieve(self, client: Gradient) -> None: def test_streaming_response_retrieve(self, client: Gradient) -> None: with client.nfs.with_streaming_response.retrieve( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="region", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -108,12 +126,17 @@ def test_path_params_retrieve(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): client.nfs.with_raw_response.retrieve( nfs_id="", - region="region", ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list(self, client: Gradient) -> None: + nf = client.nfs.list() + assert_matches_type(NfListResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_list_with_all_params(self, client: Gradient) -> None: nf = client.nfs.list( region="region", ) @@ -122,9 +145,7 @@ def test_method_list(self, client: Gradient) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_list(self, client: Gradient) -> None: - response = client.nfs.with_raw_response.list( - region="region", - ) + response = client.nfs.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -134,9 +155,7 @@ def test_raw_response_list(self, client: Gradient) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_streaming_response_list(self, client: Gradient) -> None: - with client.nfs.with_streaming_response.list( - region="region", - ) as response: + with client.nfs.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -148,6 +167,14 @@ def test_streaming_response_list(self, client: Gradient) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_delete(self, client: Gradient) -> None: + nf = client.nfs.delete( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + ) + assert nf is None + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_delete_with_all_params(self, client: Gradient) -> None: nf = client.nfs.delete( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", region="region", @@ -159,7 +186,6 @@ def test_method_delete(self, client: Gradient) -> None: def test_raw_response_delete(self, client: Gradient) -> None: response = client.nfs.with_raw_response.delete( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="region", ) assert response.is_closed is True @@ -172,7 +198,6 @@ def test_raw_response_delete(self, client: Gradient) -> None: def test_streaming_response_delete(self, client: Gradient) -> None: with client.nfs.with_streaming_response.delete( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="region", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -188,7 +213,6 @@ def test_path_params_delete(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): client.nfs.with_raw_response.delete( nfs_id="", - region="region", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -196,7 +220,6 @@ def test_path_params_delete(self, client: Gradient) -> None: def test_method_initiate_action_overload_1(self, client: Gradient) -> None: nf = client.nfs.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) @@ -206,9 +229,9 @@ def test_method_initiate_action_overload_1(self, client: Gradient) -> None: def test_method_initiate_action_with_all_params_overload_1(self, client: Gradient) -> None: nf = client.nfs.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", params={"size_gib": 2048}, + region="atl1", ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) @@ -217,7 +240,6 @@ def test_method_initiate_action_with_all_params_overload_1(self, client: Gradien def test_raw_response_initiate_action_overload_1(self, client: Gradient) -> None: response = client.nfs.with_raw_response.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) @@ -231,7 +253,6 @@ def test_raw_response_initiate_action_overload_1(self, client: Gradient) -> None def test_streaming_response_initiate_action_overload_1(self, client: Gradient) -> None: with client.nfs.with_streaming_response.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) as response: assert not response.is_closed @@ -248,7 +269,6 @@ def test_path_params_initiate_action_overload_1(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): client.nfs.with_raw_response.initiate_action( nfs_id="", - region="atl1", type="resize", ) @@ -257,7 +277,6 @@ def test_path_params_initiate_action_overload_1(self, client: Gradient) -> None: def test_method_initiate_action_overload_2(self, client: Gradient) -> None: nf = client.nfs.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) @@ -267,9 +286,9 @@ def test_method_initiate_action_overload_2(self, client: Gradient) -> None: def test_method_initiate_action_with_all_params_overload_2(self, client: Gradient) -> None: nf = client.nfs.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", params={"name": "daily-backup"}, + region="atl1", ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) @@ -278,7 +297,6 @@ def test_method_initiate_action_with_all_params_overload_2(self, client: Gradien def test_raw_response_initiate_action_overload_2(self, client: Gradient) -> None: response = client.nfs.with_raw_response.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) @@ -292,7 +310,6 @@ def test_raw_response_initiate_action_overload_2(self, client: Gradient) -> None def test_streaming_response_initiate_action_overload_2(self, client: Gradient) -> None: with client.nfs.with_streaming_response.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) as response: assert not response.is_closed @@ -309,7 +326,6 @@ def test_path_params_initiate_action_overload_2(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): client.nfs.with_raw_response.initiate_action( nfs_id="", - region="atl1", type="resize", ) @@ -318,7 +334,6 @@ def test_path_params_initiate_action_overload_2(self, client: Gradient) -> None: def test_method_initiate_action_overload_3(self, client: Gradient) -> None: nf = client.nfs.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) @@ -328,9 +343,9 @@ def test_method_initiate_action_overload_3(self, client: Gradient) -> None: def test_method_initiate_action_with_all_params_overload_3(self, client: Gradient) -> None: nf = client.nfs.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", params={"vpc_id": "vpc-id-123"}, + region="atl1", ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) @@ -339,7 +354,6 @@ def test_method_initiate_action_with_all_params_overload_3(self, client: Gradien def test_raw_response_initiate_action_overload_3(self, client: Gradient) -> None: response = client.nfs.with_raw_response.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) @@ -353,7 +367,6 @@ def test_raw_response_initiate_action_overload_3(self, client: Gradient) -> None def test_streaming_response_initiate_action_overload_3(self, client: Gradient) -> None: with client.nfs.with_streaming_response.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) as response: assert not response.is_closed @@ -370,7 +383,6 @@ def test_path_params_initiate_action_overload_3(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): client.nfs.with_raw_response.initiate_action( nfs_id="", - region="atl1", type="resize", ) @@ -379,7 +391,6 @@ def test_path_params_initiate_action_overload_3(self, client: Gradient) -> None: def test_method_initiate_action_overload_4(self, client: Gradient) -> None: nf = client.nfs.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) @@ -389,9 +400,9 @@ def test_method_initiate_action_overload_4(self, client: Gradient) -> None: def test_method_initiate_action_with_all_params_overload_4(self, client: Gradient) -> None: nf = client.nfs.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", params={"vpc_id": "vpc-id-123"}, + region="atl1", ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) @@ -400,7 +411,6 @@ def test_method_initiate_action_with_all_params_overload_4(self, client: Gradien def test_raw_response_initiate_action_overload_4(self, client: Gradient) -> None: response = client.nfs.with_raw_response.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) @@ -414,7 +424,6 @@ def test_raw_response_initiate_action_overload_4(self, client: Gradient) -> None def test_streaming_response_initiate_action_overload_4(self, client: Gradient) -> None: with client.nfs.with_streaming_response.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) as response: assert not response.is_closed @@ -431,7 +440,63 @@ def test_path_params_initiate_action_overload_4(self, client: Gradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): client.nfs.with_raw_response.initiate_action( nfs_id="", - region="atl1", + type="resize", + ) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_initiate_action_overload_5(self, client: Gradient) -> None: + nf = client.nfs.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + type="resize", + ) + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_initiate_action_with_all_params_overload_5(self, client: Gradient) -> None: + nf = client.nfs.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + type="resize", + params={"performance_tier": "standard"}, + region="atl1", + ) + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_initiate_action_overload_5(self, client: Gradient) -> None: + response = client.nfs.with_raw_response.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + type="resize", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + nf = response.parse() + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_initiate_action_overload_5(self, client: Gradient) -> None: + with client.nfs.with_streaming_response.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + type="resize", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + nf = response.parse() + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_path_params_initiate_action_overload_5(self, client: Gradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): + client.nfs.with_raw_response.initiate_action( + nfs_id="", type="resize", ) @@ -452,6 +517,18 @@ async def test_method_create(self, async_client: AsyncGradient) -> None: ) assert_matches_type(NfCreateResponse, nf, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncGradient) -> None: + nf = await async_client.nfs.create( + name="sammy-share-drive", + region="atl1", + size_gib=1024, + vpc_ids=["796c6fe3-2a1d-4da2-9f3e-38239827dc91"], + performance_tier="standard", + ) + assert_matches_type(NfCreateResponse, nf, path=["response"]) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_create(self, async_client: AsyncGradient) -> None: @@ -487,6 +564,14 @@ async def test_streaming_response_create(self, async_client: AsyncGradient) -> N @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_retrieve(self, async_client: AsyncGradient) -> None: + nf = await async_client.nfs.retrieve( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + ) + assert_matches_type(NfRetrieveResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.retrieve( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", region="region", @@ -498,7 +583,6 @@ async def test_method_retrieve(self, async_client: AsyncGradient) -> None: async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: response = await async_client.nfs.with_raw_response.retrieve( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="region", ) assert response.is_closed is True @@ -511,7 +595,6 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradient) -> None: async def test_streaming_response_retrieve(self, async_client: AsyncGradient) -> None: async with async_client.nfs.with_streaming_response.retrieve( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="region", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -527,12 +610,17 @@ async def test_path_params_retrieve(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): await async_client.nfs.with_raw_response.retrieve( nfs_id="", - region="region", ) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_list(self, async_client: AsyncGradient) -> None: + nf = await async_client.nfs.list() + assert_matches_type(NfListResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.list( region="region", ) @@ -541,9 +629,7 @@ async def test_method_list(self, async_client: AsyncGradient) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_raw_response_list(self, async_client: AsyncGradient) -> None: - response = await async_client.nfs.with_raw_response.list( - region="region", - ) + response = await async_client.nfs.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -553,9 +639,7 @@ async def test_raw_response_list(self, async_client: AsyncGradient) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_streaming_response_list(self, async_client: AsyncGradient) -> None: - async with async_client.nfs.with_streaming_response.list( - region="region", - ) as response: + async with async_client.nfs.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -567,6 +651,14 @@ async def test_streaming_response_list(self, async_client: AsyncGradient) -> Non @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_delete(self, async_client: AsyncGradient) -> None: + nf = await async_client.nfs.delete( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + ) + assert nf is None + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.delete( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", region="region", @@ -578,7 +670,6 @@ async def test_method_delete(self, async_client: AsyncGradient) -> None: async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: response = await async_client.nfs.with_raw_response.delete( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="region", ) assert response.is_closed is True @@ -591,7 +682,6 @@ async def test_raw_response_delete(self, async_client: AsyncGradient) -> None: async def test_streaming_response_delete(self, async_client: AsyncGradient) -> None: async with async_client.nfs.with_streaming_response.delete( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="region", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -607,7 +697,6 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): await async_client.nfs.with_raw_response.delete( nfs_id="", - region="region", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -615,7 +704,6 @@ async def test_path_params_delete(self, async_client: AsyncGradient) -> None: async def test_method_initiate_action_overload_1(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) @@ -625,9 +713,9 @@ async def test_method_initiate_action_overload_1(self, async_client: AsyncGradie async def test_method_initiate_action_with_all_params_overload_1(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", params={"size_gib": 2048}, + region="atl1", ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) @@ -636,7 +724,6 @@ async def test_method_initiate_action_with_all_params_overload_1(self, async_cli async def test_raw_response_initiate_action_overload_1(self, async_client: AsyncGradient) -> None: response = await async_client.nfs.with_raw_response.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) @@ -650,7 +737,6 @@ async def test_raw_response_initiate_action_overload_1(self, async_client: Async async def test_streaming_response_initiate_action_overload_1(self, async_client: AsyncGradient) -> None: async with async_client.nfs.with_streaming_response.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) as response: assert not response.is_closed @@ -667,7 +753,6 @@ async def test_path_params_initiate_action_overload_1(self, async_client: AsyncG with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): await async_client.nfs.with_raw_response.initiate_action( nfs_id="", - region="atl1", type="resize", ) @@ -676,7 +761,6 @@ async def test_path_params_initiate_action_overload_1(self, async_client: AsyncG async def test_method_initiate_action_overload_2(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) @@ -686,9 +770,9 @@ async def test_method_initiate_action_overload_2(self, async_client: AsyncGradie async def test_method_initiate_action_with_all_params_overload_2(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", params={"name": "daily-backup"}, + region="atl1", ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) @@ -697,7 +781,6 @@ async def test_method_initiate_action_with_all_params_overload_2(self, async_cli async def test_raw_response_initiate_action_overload_2(self, async_client: AsyncGradient) -> None: response = await async_client.nfs.with_raw_response.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) @@ -711,7 +794,6 @@ async def test_raw_response_initiate_action_overload_2(self, async_client: Async async def test_streaming_response_initiate_action_overload_2(self, async_client: AsyncGradient) -> None: async with async_client.nfs.with_streaming_response.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) as response: assert not response.is_closed @@ -728,7 +810,6 @@ async def test_path_params_initiate_action_overload_2(self, async_client: AsyncG with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): await async_client.nfs.with_raw_response.initiate_action( nfs_id="", - region="atl1", type="resize", ) @@ -737,7 +818,6 @@ async def test_path_params_initiate_action_overload_2(self, async_client: AsyncG async def test_method_initiate_action_overload_3(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) @@ -747,9 +827,9 @@ async def test_method_initiate_action_overload_3(self, async_client: AsyncGradie async def test_method_initiate_action_with_all_params_overload_3(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", params={"vpc_id": "vpc-id-123"}, + region="atl1", ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) @@ -758,7 +838,6 @@ async def test_method_initiate_action_with_all_params_overload_3(self, async_cli async def test_raw_response_initiate_action_overload_3(self, async_client: AsyncGradient) -> None: response = await async_client.nfs.with_raw_response.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) @@ -772,7 +851,6 @@ async def test_raw_response_initiate_action_overload_3(self, async_client: Async async def test_streaming_response_initiate_action_overload_3(self, async_client: AsyncGradient) -> None: async with async_client.nfs.with_streaming_response.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) as response: assert not response.is_closed @@ -789,7 +867,6 @@ async def test_path_params_initiate_action_overload_3(self, async_client: AsyncG with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): await async_client.nfs.with_raw_response.initiate_action( nfs_id="", - region="atl1", type="resize", ) @@ -798,7 +875,6 @@ async def test_path_params_initiate_action_overload_3(self, async_client: AsyncG async def test_method_initiate_action_overload_4(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) @@ -808,9 +884,9 @@ async def test_method_initiate_action_overload_4(self, async_client: AsyncGradie async def test_method_initiate_action_with_all_params_overload_4(self, async_client: AsyncGradient) -> None: nf = await async_client.nfs.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", params={"vpc_id": "vpc-id-123"}, + region="atl1", ) assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) @@ -819,7 +895,6 @@ async def test_method_initiate_action_with_all_params_overload_4(self, async_cli async def test_raw_response_initiate_action_overload_4(self, async_client: AsyncGradient) -> None: response = await async_client.nfs.with_raw_response.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) @@ -833,7 +908,6 @@ async def test_raw_response_initiate_action_overload_4(self, async_client: Async async def test_streaming_response_initiate_action_overload_4(self, async_client: AsyncGradient) -> None: async with async_client.nfs.with_streaming_response.initiate_action( nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", - region="atl1", type="resize", ) as response: assert not response.is_closed @@ -850,6 +924,62 @@ async def test_path_params_initiate_action_overload_4(self, async_client: AsyncG with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): await async_client.nfs.with_raw_response.initiate_action( nfs_id="", - region="atl1", + type="resize", + ) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_initiate_action_overload_5(self, async_client: AsyncGradient) -> None: + nf = await async_client.nfs.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + type="resize", + ) + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_initiate_action_with_all_params_overload_5(self, async_client: AsyncGradient) -> None: + nf = await async_client.nfs.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + type="resize", + params={"performance_tier": "standard"}, + region="atl1", + ) + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_initiate_action_overload_5(self, async_client: AsyncGradient) -> None: + response = await async_client.nfs.with_raw_response.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + type="resize", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + nf = await response.parse() + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_initiate_action_overload_5(self, async_client: AsyncGradient) -> None: + async with async_client.nfs.with_streaming_response.initiate_action( + nfs_id="0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + type="resize", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + nf = await response.parse() + assert_matches_type(NfInitiateActionResponse, nf, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_path_params_initiate_action_overload_5(self, async_client: AsyncGradient) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `nfs_id` but received ''"): + await async_client.nfs.with_raw_response.initiate_action( + nfs_id="", type="resize", ) From 985ea0ba9ebd9baba77d4ae7879ffa4679374773 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 12:22:30 +0000 Subject: [PATCH 88/96] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index fa21fe25..8fe2fd00 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 193 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-93df5cb3d61c1bbcab2a4bbf3f0775454bd185a400bc140c61dbf36e108dbf89.yml -openapi_spec_hash: 0126adf782c5feac3d8e682e466c3cf7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradient-24bdeb83fbe576e4dd92498321be977e820fd755babee77eb8ff419a6229b22f.yml +openapi_spec_hash: f1faf4e4e0fc37e518fe55ff7c01086d config_hash: 3f968a57adb20643373c134efc9af01a From dba0770aa6f349970f8e45a881ef5d09ae7ce56e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 12:22:54 +0000 Subject: [PATCH 89/96] release: 3.12.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 24 ++++++++++++++++++++++++ pyproject.toml | 2 +- src/gradient/_version.py | 2 +- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 940f2ca3..faa0df4e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.11.0" + ".": "3.12.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e9caf7e3..845ea31c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## 3.12.0 (2026-03-13) + +Full Changelog: [v3.11.0...v3.12.0](https://github.com/digitalocean/gradient-python/compare/v3.11.0...v3.12.0) + +### Features + +* **api:** manual updates ([e139299](https://github.com/digitalocean/gradient-python/commit/e13929984bbfa991d51a56946a40380a909f1d75)) +* **api:** responses ([3277876](https://github.com/digitalocean/gradient-python/commit/32778769c86140d283a9f456568f68803208ae62)) +* **api:** update urls for endpoints ([2d4da01](https://github.com/digitalocean/gradient-python/commit/2d4da01e55e7f7a96aea98232ef05b28ebbcbada)) +* **client:** add support for binary request streaming ([f9706f4](https://github.com/digitalocean/gradient-python/commit/f9706f4b88e6278a5be1057c30a8939fed415767)) + + +### Chores + +* format all `api.md` files ([e103720](https://github.com/digitalocean/gradient-python/commit/e103720daa6eaae0454cbb857d97b1b2e43b405f)) +* **internal:** add request options to SSE classes ([17b88d9](https://github.com/digitalocean/gradient-python/commit/17b88d90dafe6a1d9db3f4ea15f17c7cdf838f81)) +* **internal:** codegen related update ([6f506cb](https://github.com/digitalocean/gradient-python/commit/6f506cb1dae5679b5ed992822658f333e382340e)) +* **internal:** codegen related update ([56acb2e](https://github.com/digitalocean/gradient-python/commit/56acb2e47da30e09ab6cbf42c285bf6480a376fe)) +* **internal:** codegen related update ([865fb4c](https://github.com/digitalocean/gradient-python/commit/865fb4cadfe0ce791ecc4ad38f50ce25b00477ee)) +* **internal:** make `test_proxy_environment_variables` more resilient ([09cfd99](https://github.com/digitalocean/gradient-python/commit/09cfd991d0442077c4f66b47f4d9da34f608692d)) +* **internal:** make `test_proxy_environment_variables` more resilient to env ([f3aa13b](https://github.com/digitalocean/gradient-python/commit/f3aa13b09ca2c1f565cc3277530bfa1775d02dd0)) +* **internal:** remove mock server code ([f774a64](https://github.com/digitalocean/gradient-python/commit/f774a64d51891a10e3d30ddaafe556afdf4502e0)) +* update mock server docs ([fa4da88](https://github.com/digitalocean/gradient-python/commit/fa4da887118bdf9462d74328a81a61dc4c4c30e9)) + ## 3.11.0 (2026-02-17) Full Changelog: [v3.10.1...v3.11.0](https://github.com/digitalocean/gradient-python/compare/v3.10.1...v3.11.0) diff --git a/pyproject.toml b/pyproject.toml index 3295b4c4..3a246099 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gradient" -version = "3.11.0" +version = "3.12.0" description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gradient/_version.py b/src/gradient/_version.py index 07c427f5..3b4b7def 100644 --- a/src/gradient/_version.py +++ b/src/gradient/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gradient" -__version__ = "3.11.0" # x-release-please-version +__version__ = "3.12.0" # x-release-please-version From f8590677fd3dbb78fd5dfc25838a1f76f876aeb4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 17:32:11 +0000 Subject: [PATCH 90/96] fix(pydantic): do not pass `by_alias` unless set --- src/gradient/_compat.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gradient/_compat.py b/src/gradient/_compat.py index 786ff42a..e6690a4f 100644 --- a/src/gradient/_compat.py +++ b/src/gradient/_compat.py @@ -2,7 +2,7 @@ from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload from datetime import date, datetime -from typing_extensions import Self, Literal +from typing_extensions import Self, Literal, TypedDict import pydantic from pydantic.fields import FieldInfo @@ -131,6 +131,10 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str: return model.model_dump_json(indent=indent) +class _ModelDumpKwargs(TypedDict, total=False): + by_alias: bool + + def model_dump( model: pydantic.BaseModel, *, @@ -142,6 +146,9 @@ def model_dump( by_alias: bool | None = None, ) -> dict[str, Any]: if (not PYDANTIC_V1) or hasattr(model, "model_dump"): + kwargs: _ModelDumpKwargs = {} + if by_alias is not None: + kwargs["by_alias"] = by_alias return model.model_dump( mode=mode, exclude=exclude, @@ -149,7 +156,7 @@ def model_dump( exclude_defaults=exclude_defaults, # warnings are not supported in Pydantic v1 warnings=True if PYDANTIC_V1 else warnings, - by_alias=by_alias, + **kwargs, ) return cast( "dict[str, Any]", From e856c00efc62c90064a3a7c51f790bf9e7613b8a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 19:01:19 +0000 Subject: [PATCH 91/96] fix(deps): bump minimum typing-extensions version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3a246099..843aea8a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ authors = [{ name = "DigitalOcean, LLC", email = "dev@digitalocean.com" }] dependencies = [ "httpx>=0.23.0, <1", "pydantic>=1.9.0, <3", - "typing-extensions>=4.10, <5", + "typing-extensions>=4.14, <5", "anyio>=3.5.0, <5", "distro>=1.7.0, <2", "sniffio", From a4ff39d4546649f94e8e5695385424a798890f93 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 20:49:11 +0000 Subject: [PATCH 92/96] chore(internal): tweak CI branches --- .github/workflows/ci.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d53cf87b..a31103b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,14 @@ name: CI on: push: - branches-ignore: - - "generated" - - "codegen/**" - - "integrated/**" - - "stl-preview-head/**" - - "stl-preview-base/**" + branches: + - '**' + - '!integrated/**' + - '!stl-preview-head/**' + - '!stl-preview-base/**' + - '!generated' + - '!codegen/**' + - 'codegen/stl/**' pull_request: branches-ignore: - "stl-preview-head/**" From 32b6f060714d4f0b32be8aa768338da209fa4050 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 20:49:43 +0000 Subject: [PATCH 93/96] release: 3.12.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 14 ++++++++++++++ pyproject.toml | 2 +- src/gradient/_version.py | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index faa0df4e..98828ad7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.12.0" + ".": "3.12.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 845ea31c..7f479f9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 3.12.1 (2026-03-16) + +Full Changelog: [v3.12.0...v3.12.1](https://github.com/digitalocean/gradient-python/compare/v3.12.0...v3.12.1) + +### Bug Fixes + +* **deps:** bump minimum typing-extensions version ([580bdb0](https://github.com/digitalocean/gradient-python/commit/580bdb0bee638c423cfb547b711202080ab3a40f)) +* **pydantic:** do not pass `by_alias` unless set ([715426f](https://github.com/digitalocean/gradient-python/commit/715426f39a35777ffe9cfeb67501b19beae401f7)) + + +### Chores + +* **internal:** tweak CI branches ([c63f621](https://github.com/digitalocean/gradient-python/commit/c63f621dff49de34e7aa2a5ce37eb65972572d41)) + ## 3.12.0 (2026-03-13) Full Changelog: [v3.11.0...v3.12.0](https://github.com/digitalocean/gradient-python/compare/v3.11.0...v3.12.0) diff --git a/pyproject.toml b/pyproject.toml index 843aea8a..8a39bc9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gradient" -version = "3.12.0" +version = "3.12.1" description = "The official Python library for the Gradient API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/gradient/_version.py b/src/gradient/_version.py index 3b4b7def..df3741c3 100644 --- a/src/gradient/_version.py +++ b/src/gradient/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gradient" -__version__ = "3.12.0" # x-release-please-version +__version__ = "3.12.1" # x-release-please-version From 9646da6aaa192fb74487c826334957fc756fc82e Mon Sep 17 00:00:00 2001 From: ypeng Date: Tue, 14 Jul 2026 13:30:31 -0700 Subject: [PATCH 94/96] Add deprecation warning to README for Aug-15 retirement. Co-authored-by: Cursor --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c69fdd1b..761cf1a1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +# **WARNING: This SDK is deprecated and will be retired on Aug-15. Please migrate to the unified DigitalOcean SDK: https://docs.digitalocean.com/reference/libraries/** + ![Header image for the DigitalOcean Gradient AI Agentic Cloud](https://doimages.nyc3.cdn.digitaloceanspaces.com/do_gradient_ai_agentic_cloud.svg) # Gradient Python API library From d48b9723eb0a83ec9ec603bc63c6e92c37fe4922 Mon Sep 17 00:00:00 2001 From: jshah Date: Wed, 29 Jul 2026 15:03:28 -0500 Subject: [PATCH 95/96] =?UTF-8?q?Add=20public=20migration=20guide=20for=20?= =?UTF-8?q?Gradient=20Python=20=E2=86=92=20pydo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Document deprecation/retirement and link a step-by-step MIGRATION.md below the README banner so customer emails can use a public GitHub URL. --- MIGRATION.md | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 10 +++++ 2 files changed, 130 insertions(+) create mode 100644 MIGRATION.md diff --git a/MIGRATION.md b/MIGRATION.md new file mode 100644 index 00000000..a66cabd9 --- /dev/null +++ b/MIGRATION.md @@ -0,0 +1,120 @@ +# Migrate from Gradient SDK (Python) to pydo + +> **This SDK (`gradient`) is deprecated and will be retired on August 15, 2026.** +> Please migrate to the unified DigitalOcean Python SDK: [`pydo`](https://github.com/digitalocean/pydo). +> +> Overview of official DigitalOcean libraries: https://docs.digitalocean.com/reference/libraries/ + +| From | To | +| --- | --- | +| `gradient` | `pydo` | + +## 1. Replace the package + +```sh +pip uninstall gradient +pip install pydo +# optional async extras +pip install "pydo[aio]" +``` + +## 2. Update credentials + +Gradient used several auth modes on one client. Map each to pydo: + +| Use case | Gradient (Python) | Env var (Gradient) | pydo | +| --- | --- | --- | --- | +| DigitalOcean API / GenAI control plane | `access_token=` | `DIGITALOCEAN_ACCESS_TOKEN` | `Client(token=...)` or `Client(api_key=...)` with a DigitalOcean PAT — prefer `DIGITALOCEAN_TOKEN` | +| Serverless inference | `model_access_key=` | `GRADIENT_MODEL_ACCESS_KEY` | `from pydo.inference import Client` → pass the same Model Access Key (or a **full-access** PAT) as `token` / `api_key` | +| Agent inference | `agent_access_key=` + `agent_endpoint=` | `GRADIENT_AGENT_ACCESS_KEY` + `GRADIENT_AGENT_ENDPOINT` | Pass the agent access key as `token` / `api_key` and set `agent_endpoint` on the client | + +Notes: + +- The Model Access Key **value** does not change — only the constructor / env name. +- Limited-scope PATs return **401** on inference; use a full-access PAT or a Model Access Key. +- Update `.env`, CI secrets, and runbooks accordingly. + +## 3. Update client construction + +### Serverless inference + +**Before** + +```python +from gradient import Gradient + +client = Gradient(model_access_key=os.environ["GRADIENT_MODEL_ACCESS_KEY"]) +``` + +**After** + +```python +from pydo.inference import Client + +# Same Model Access Key value as GRADIENT_MODEL_ACCESS_KEY, or a full-access PAT +client = Client(api_key=os.environ["GRADIENT_MODEL_ACCESS_KEY"]) +# equivalently: +# client = Client(token=os.environ["DIGITALOCEAN_TOKEN"]) # must be full-access +``` + +### Control-plane / GenAI management + +**Before** + +```python +from gradient import Gradient + +client = Gradient(access_token=os.environ["DIGITALOCEAN_ACCESS_TOKEN"]) +``` + +**After** + +```python +from pydo import Client + +# Same PAT value as DIGITALOCEAN_ACCESS_TOKEN; preferred env name is DIGITALOCEAN_TOKEN +client = Client(token=os.environ["DIGITALOCEAN_TOKEN"]) +``` + +### Async Python + +- **Before:** `from gradient import AsyncGradient` +- **After:** `from pydo.inference.aio import Client` or `from pydo.aio import Client` (prefer `async with`) + +## 4. Update API call sites + +Chat, streaming, images, and model listing keep a similar OpenAI-style shape. Only the import and client constructor change. + +```python +# pydo inference +resp = client.chat.completions.create( + model="llama3.3-70b-instruct", + messages=[{"role": "user", "content": "Hello"}], +) +``` + +| Capability | Gradient | pydo | +| --- | --- | --- | +| Chat completions | `client.chat.completions.create` | same via `pydo.inference` | +| Streaming | `stream=True` | supported | +| Image generation | Gradient images APIs | `client.images.generate` | +| List models | Gradient models | `client.models.list` | +| Manage agents / GenAI | Gradient API client | top-level `pydo.Client` | + +Rework error handling: Gradient Stainless `APIError` subclasses do not map 1:1 to pydo errors. Re-check retries and timeouts against the new client defaults. + +## 5. Validate and remove Gradient + +1. Confirm the app builds and runs with only `pydo`. +2. Smoke-test non-streaming chat, streaming chat, `models.list`, and images (if used). +3. Verify inference with a full-access PAT and, if applicable, a Model Access Key. +4. Remove `gradient` from lockfiles. +5. After cutover, remove unused Gradient env vars if you renamed them. +6. **Complete migration before August 15, 2026.** + +## References + +- https://docs.digitalocean.com/reference/libraries/ +- https://github.com/digitalocean/pydo +- https://docs.digitalocean.com/reference/pydo/ +- https://github.com/digitalocean/gradient-python (this repo — deprecated) diff --git a/README.md b/README.md index 761cf1a1..e96cdbf4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,15 @@ # **WARNING: This SDK is deprecated and will be retired on Aug-15. Please migrate to the unified DigitalOcean SDK: https://docs.digitalocean.com/reference/libraries/** +## Migrate to pydo (required) + +**This package (`gradient`) is deprecated and retires on August 15, 2026.** + +- **Replace with:** [`pydo`](https://github.com/digitalocean/pydo) (`pip install pydo`) +- **Step-by-step migration guide (public):** [MIGRATION.md](./MIGRATION.md) +- **Official SDK overview:** https://docs.digitalocean.com/reference/libraries/ + +Already-installed copies of this SDK can continue calling existing APIs. New installs, documentation, and ongoing maintenance for this package end on the retirement date. Please complete migration before **August 15, 2026**. + ![Header image for the DigitalOcean Gradient AI Agentic Cloud](https://doimages.nyc3.cdn.digitaloceanspaces.com/do_gradient_ai_agentic_cloud.svg) # Gradient Python API library From d3211f5054fdfe110d9dc80568ed41179aba5e67 Mon Sep 17 00:00:00 2001 From: jshah Date: Thu, 13 Aug 2026 10:49:14 -0500 Subject: [PATCH 96/96] release: 3.12.2 Bump for PyPI deprecation notice before Aug 15 retirement and archive. --- .release-please-manifest.json | 2 +- pyproject.toml | 4 ++-- src/gradient/_version.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 98828ad7..e17ca4d2 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.12.1" + ".": "3.12.2" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 8a39bc9b..74bed50e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "gradient" -version = "3.12.1" -description = "The official Python library for the Gradient API" +version = "3.12.2" +description = "DEPRECATED: Retires Aug 15, 2026. Migrate to pydo — https://docs.digitalocean.com/reference/libraries/" dynamic = ["readme"] license = "Apache-2.0" authors = [{ name = "DigitalOcean, LLC", email = "dev@digitalocean.com" }] diff --git a/src/gradient/_version.py b/src/gradient/_version.py index df3741c3..b8d85e9e 100644 --- a/src/gradient/_version.py +++ b/src/gradient/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gradient" -__version__ = "3.12.1" # x-release-please-version +__version__ = "3.12.2" # x-release-please-version