diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2aca35a..4208b5c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.5.0" + ".": "0.6.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 84b24aa..0643054 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 12 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-c99d72d8d845f1eeabf7a716949a12408df952a2a0ca2b97df570da3a7c8bb49.yml openapi_spec_hash: 8a503cbccc8a5741554282327a557114 -config_hash: 38a89a860ee0f5ef4f2cb10d010e4e8f +config_hash: 433e7a5579323a048aa173a0ace06bfc diff --git a/CHANGELOG.md b/CHANGELOG.md index 85ad888..0c199c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.6.0 (2026-02-08) + +Full Changelog: [v0.5.0...v0.6.0](https://github.com/warpdotdev/oz-sdk-python/compare/v0.5.0...v0.6.0) + +### Features + +* **api:** manual updates ([75fe5e5](https://github.com/warpdotdev/oz-sdk-python/commit/75fe5e5c5ea9e044895c1bd7f1c5ab150214c8e7)) + ## 0.5.0 (2026-02-08) Full Changelog: [v0.4.0...v0.5.0](https://github.com/warpdotdev/oz-sdk-python/compare/v0.4.0...v0.5.0) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c748de5..7724c68 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,7 +36,7 @@ $ pip install -r requirements-dev.lock Most of the SDK is generated code. Modifications to code will be persisted between generations, but may result in merge conflicts between manual patches and changes from the generator. The generator will never -modify the contents of the `src/warp_agent_sdk/lib/` and `examples/` directories. +modify the contents of the `src/oz_agent_sdk/lib/` and `examples/` directories. ## Adding and running examples diff --git a/LICENSE b/LICENSE index 93fb21c..c3e6041 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2026 Warp API + Copyright 2026 Oz API 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 53a9dbf..9ea4d38 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# Warp API Python API library +# Oz API Python API library [![PyPI version](https://img.shields.io/pypi/v/oz-agent-sdk.svg?label=pypi%20(stable))](https://pypi.org/project/oz-agent-sdk/) -The Warp API Python library provides convenient access to the Warp API REST API from any Python 3.9+ +The Oz API Python library provides convenient access to the Oz API 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). @@ -26,9 +26,9 @@ The full API of this library can be found in [api.md](api.md). ```python import os -from warp_agent_sdk import WarpAPI +from oz_agent_sdk import OzAPI -client = WarpAPI( +client = OzAPI( api_key=os.environ.get("WARP_API_KEY"), # This is the default and can be omitted ) @@ -103,14 +103,14 @@ so that your API Key is not stored in source control. ## Async usage -Simply import `AsyncWarpAPI` instead of `WarpAPI` and use `await` with each API call: +Simply import `AsyncOzAPI` instead of `OzAPI` and use `await` with each API call: ```python import os import asyncio -from warp_agent_sdk import AsyncWarpAPI +from oz_agent_sdk import AsyncOzAPI -client = AsyncWarpAPI( +client = AsyncOzAPI( api_key=os.environ.get("WARP_API_KEY"), # This is the default and can be omitted ) @@ -143,12 +143,12 @@ Then you can enable it by instantiating the client with `http_client=DefaultAioH ```python import os import asyncio -from warp_agent_sdk import DefaultAioHttpClient -from warp_agent_sdk import AsyncWarpAPI +from oz_agent_sdk import DefaultAioHttpClient +from oz_agent_sdk import AsyncOzAPI async def main() -> None: - async with AsyncWarpAPI( + async with AsyncOzAPI( api_key=os.environ.get("WARP_API_KEY"), # This is the default and can be omitted http_client=DefaultAioHttpClient(), ) as client: @@ -175,9 +175,9 @@ Typed requests and responses provide autocomplete and documentation within your Nested parameters are dictionaries, typed using `TypedDict`, for example: ```python -from warp_agent_sdk import WarpAPI +from oz_agent_sdk import OzAPI -client = WarpAPI() +client = OzAPI() response = client.agent.run( config={}, @@ -187,29 +187,29 @@ print(response.config) ## Handling errors -When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `warp_agent_sdk.APIConnectionError` is raised. +When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `oz_agent_sdk.APIConnectionError` is raised. When the API returns a non-success status code (that is, 4xx or 5xx -response), a subclass of `warp_agent_sdk.APIStatusError` is raised, containing `status_code` and `response` properties. +response), a subclass of `oz_agent_sdk.APIStatusError` is raised, containing `status_code` and `response` properties. -All errors inherit from `warp_agent_sdk.APIError`. +All errors inherit from `oz_agent_sdk.APIError`. ```python -import warp_agent_sdk -from warp_agent_sdk import WarpAPI +import oz_agent_sdk +from oz_agent_sdk import OzAPI -client = WarpAPI() +client = OzAPI() try: client.agent.run( prompt="Fix the bug in auth.go", ) -except warp_agent_sdk.APIConnectionError as e: +except oz_agent_sdk.APIConnectionError as e: print("The server could not be reached") print(e.__cause__) # an underlying Exception, likely raised within httpx. -except warp_agent_sdk.RateLimitError as e: +except oz_agent_sdk.RateLimitError as e: print("A 429 status code was received; we should back off a bit.") -except warp_agent_sdk.APIStatusError as e: +except oz_agent_sdk.APIStatusError as e: print("Another non-200-range status code was received") print(e.status_code) print(e.response) @@ -237,10 +237,10 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ You can use the `max_retries` option to configure or disable retry settings: ```python -from warp_agent_sdk import WarpAPI +from oz_agent_sdk import OzAPI # Configure the default for all requests: -client = WarpAPI( +client = OzAPI( # default is 2 max_retries=0, ) @@ -257,16 +257,16 @@ By default requests time out after 1 minute. You can configure this with a `time which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object: ```python -from warp_agent_sdk import WarpAPI +from oz_agent_sdk import OzAPI # Configure the default for all requests: -client = WarpAPI( +client = OzAPI( # 20 seconds (default is 1 minute) timeout=20.0, ) # More granular control: -client = WarpAPI( +client = OzAPI( timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0), ) @@ -286,10 +286,10 @@ Note that requests that time out are [retried twice by default](#retries). We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module. -You can enable logging by setting the environment variable `WARP_API_LOG` to `info`. +You can enable logging by setting the environment variable `OZ_API_LOG` to `info`. ```shell -$ export WARP_API_LOG=info +$ export OZ_API_LOG=info ``` Or to `debug` for more verbose logging. @@ -311,9 +311,9 @@ if response.my_field is None: The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g., ```py -from warp_agent_sdk import WarpAPI +from oz_agent_sdk import OzAPI -client = WarpAPI() +client = OzAPI() response = client.agent.with_raw_response.run( prompt="Fix the bug in auth.go", ) @@ -323,9 +323,9 @@ agent = response.parse() # get the object that `agent.run()` would have returne print(agent.run_id) ``` -These methods return an [`APIResponse`](https://github.com/warpdotdev/oz-sdk-python/tree/main/src/warp_agent_sdk/_response.py) object. +These methods return an [`APIResponse`](https://github.com/warpdotdev/oz-sdk-python/tree/main/src/oz_agent_sdk/_response.py) object. -The async client returns an [`AsyncAPIResponse`](https://github.com/warpdotdev/oz-sdk-python/tree/main/src/warp_agent_sdk/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. +The async client returns an [`AsyncAPIResponse`](https://github.com/warpdotdev/oz-sdk-python/tree/main/src/oz_agent_sdk/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. #### `.with_streaming_response` @@ -389,10 +389,10 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c ```python import httpx -from warp_agent_sdk import WarpAPI, DefaultHttpxClient +from oz_agent_sdk import OzAPI, DefaultHttpxClient -client = WarpAPI( - # Or use the `WARP_API_BASE_URL` env var +client = OzAPI( + # Or use the `OZ_API_BASE_URL` env var base_url="http://my.test.server.example.com:8083", http_client=DefaultHttpxClient( proxy="http://my.test.proxy.example.com", @@ -412,9 +412,9 @@ client.with_options(http_client=DefaultHttpxClient(...)) By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting. ```py -from warp_agent_sdk import WarpAPI +from oz_agent_sdk import OzAPI -with WarpAPI() as client: +with OzAPI() as client: # make requests here ... @@ -440,8 +440,8 @@ If you've upgraded to the latest version but aren't seeing any new features you You can determine the version that is being used at runtime with: ```py -import warp_agent_sdk -print(warp_agent_sdk.__version__) +import oz_agent_sdk +print(oz_agent_sdk.__version__) ``` ## Requirements diff --git a/SECURITY.md b/SECURITY.md index 431ac4b..221f548 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -16,7 +16,7 @@ before making any information public. ## Reporting Non-SDK Related Security Issues If you encounter security issues that are not directly related to SDKs but pertain to the services -or products provided by Warp API, please follow the respective company's security reporting guidelines. +or products provided by Oz API, please follow the respective company's security reporting guidelines. --- diff --git a/api.md b/api.md index ff6ba6f..b70e6d9 100644 --- a/api.md +++ b/api.md @@ -3,7 +3,7 @@ Types: ```python -from warp_agent_sdk.types import ( +from oz_agent_sdk.types import ( AgentSkill, AmbientAgentConfig, CloudEnvironmentConfig, @@ -16,15 +16,15 @@ from warp_agent_sdk.types import ( Methods: -- client.agent.list(\*\*params) -> AgentListResponse -- client.agent.run(\*\*params) -> AgentRunResponse +- client.agent.list(\*\*params) -> AgentListResponse +- client.agent.run(\*\*params) -> AgentRunResponse ## Runs Types: ```python -from warp_agent_sdk.types.agent import ( +from oz_agent_sdk.types.agent import ( ArtifactItem, RunItem, RunSourceType, @@ -36,16 +36,16 @@ from warp_agent_sdk.types.agent import ( Methods: -- client.agent.runs.retrieve(run_id) -> RunItem -- client.agent.runs.list(\*\*params) -> RunListResponse -- client.agent.runs.cancel(run_id) -> str +- client.agent.runs.retrieve(run_id) -> RunItem +- client.agent.runs.list(\*\*params) -> RunListResponse +- client.agent.runs.cancel(run_id) -> str ## Schedules Types: ```python -from warp_agent_sdk.types.agent import ( +from oz_agent_sdk.types.agent import ( ScheduledAgentItem, ScheduleListResponse, ScheduleDeleteResponse, @@ -54,10 +54,10 @@ from warp_agent_sdk.types.agent import ( Methods: -- client.agent.schedules.create(\*\*params) -> ScheduledAgentItem -- client.agent.schedules.retrieve(schedule_id) -> ScheduledAgentItem -- client.agent.schedules.update(schedule_id, \*\*params) -> ScheduledAgentItem -- client.agent.schedules.list() -> ScheduleListResponse -- client.agent.schedules.delete(schedule_id) -> ScheduleDeleteResponse -- client.agent.schedules.pause(schedule_id) -> ScheduledAgentItem -- client.agent.schedules.resume(schedule_id) -> ScheduledAgentItem +- client.agent.schedules.create(\*\*params) -> ScheduledAgentItem +- client.agent.schedules.retrieve(schedule_id) -> ScheduledAgentItem +- client.agent.schedules.update(schedule_id, \*\*params) -> ScheduledAgentItem +- client.agent.schedules.list() -> ScheduleListResponse +- client.agent.schedules.delete(schedule_id) -> ScheduleDeleteResponse +- client.agent.schedules.pause(schedule_id) -> ScheduledAgentItem +- client.agent.schedules.resume(schedule_id) -> ScheduledAgentItem diff --git a/pyproject.toml b/pyproject.toml index 26a5586..a7b92b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,11 @@ [project] name = "oz-agent-sdk" -version = "0.5.0" -description = "The official Python library for the warp-api API" +version = "0.6.0" +description = "The official Python library for the oz-api API" dynamic = ["readme"] license = "Apache-2.0" authors = [ -{ name = "Warp API", email = "" }, +{ name = "Oz API", email = "" }, ] dependencies = [ @@ -86,7 +86,7 @@ include = [ ] [tool.hatch.build.targets.wheel] -packages = ["src/warp_agent_sdk"] +packages = ["src/oz_agent_sdk"] [tool.hatch.build.targets.sdist] # Basically everything except hidden files/directories (such as .github, .devcontainers, .python-version, etc) @@ -154,7 +154,7 @@ show_error_codes = true # # We also exclude our `tests` as mypy doesn't always infer # types correctly and Pyright will still catch any type errors. -exclude = ['src/warp_agent_sdk/_files.py', '_dev/.*.py', 'tests/.*'] +exclude = ['src/oz_agent_sdk/_files.py', '_dev/.*.py', 'tests/.*'] strict_equality = true implicit_reexport = true @@ -246,7 +246,7 @@ length-sort = true length-sort-straight = true combine-as-imports = true extra-standard-library = ["typing_extensions"] -known-first-party = ["warp_agent_sdk", "tests"] +known-first-party = ["oz_agent_sdk", "tests"] [tool.ruff.lint.per-file-ignores] "bin/**.py" = ["T201", "T203"] diff --git a/release-please-config.json b/release-please-config.json index 1ba0756..37299b0 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -61,6 +61,6 @@ ], "release-type": "python", "extra-files": [ - "src/warp_agent_sdk/_version.py" + "src/oz_agent_sdk/_version.py" ] } \ No newline at end of file diff --git a/scripts/lint b/scripts/lint index 4cfe975..7087a2b 100755 --- a/scripts/lint +++ b/scripts/lint @@ -19,4 +19,4 @@ echo "==> Running mypy" uv run mypy . echo "==> Making sure it imports" -uv run python -c 'import warp_agent_sdk' +uv run python -c 'import oz_agent_sdk' diff --git a/src/warp_agent_sdk/__init__.py b/src/oz_agent_sdk/__init__.py similarity index 87% rename from src/warp_agent_sdk/__init__.py rename to src/oz_agent_sdk/__init__.py index a760aa2..ea8b882 100644 --- a/src/warp_agent_sdk/__init__.py +++ b/src/oz_agent_sdk/__init__.py @@ -5,14 +5,14 @@ from . import types from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given from ._utils import file_from_path -from ._client import Client, Stream, Timeout, WarpAPI, Transport, AsyncClient, AsyncStream, AsyncWarpAPI, RequestOptions +from ._client import OzAPI, Client, Stream, Timeout, Transport, AsyncOzAPI, AsyncClient, AsyncStream, RequestOptions from ._models import BaseModel from ._version import __title__, __version__ from ._response import APIResponse as APIResponse, AsyncAPIResponse as AsyncAPIResponse from ._constants import DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, DEFAULT_CONNECTION_LIMITS from ._exceptions import ( APIError, - WarpAPIError, + OzAPIError, ConflictError, NotFoundError, APIStatusError, @@ -41,7 +41,7 @@ "not_given", "Omit", "omit", - "WarpAPIError", + "OzAPIError", "APIError", "APIStatusError", "APITimeoutError", @@ -61,8 +61,8 @@ "AsyncClient", "Stream", "AsyncStream", - "WarpAPI", - "AsyncWarpAPI", + "OzAPI", + "AsyncOzAPI", "file_from_path", "BaseModel", "DEFAULT_TIMEOUT", @@ -81,12 +81,12 @@ # Update the __module__ attribute for exported symbols so that # error messages point to this module instead of the module # it was originally defined in, e.g. -# warp_agent_sdk._exceptions.NotFoundError -> warp_agent_sdk.NotFoundError +# oz_agent_sdk._exceptions.NotFoundError -> oz_agent_sdk.NotFoundError __locals = locals() for __name in __all__: if not __name.startswith("__"): try: - __locals[__name].__module__ = "warp_agent_sdk" + __locals[__name].__module__ = "oz_agent_sdk" except (TypeError, AttributeError): # Some of our exported symbols are builtins which we can't set attributes for. pass diff --git a/src/warp_agent_sdk/_base_client.py b/src/oz_agent_sdk/_base_client.py similarity index 99% rename from src/warp_agent_sdk/_base_client.py rename to src/oz_agent_sdk/_base_client.py index 61d4df8..d1510d4 100644 --- a/src/warp_agent_sdk/_base_client.py +++ b/src/oz_agent_sdk/_base_client.py @@ -393,7 +393,7 @@ def __init__( if max_retries is None: # pyright: ignore[reportUnnecessaryComparison] raise TypeError( - "max_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `warp_agent_sdk.DEFAULT_MAX_RETRIES`" + "max_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `oz_agent_sdk.DEFAULT_MAX_RETRIES`" ) def _enforce_trailing_slash(self, url: URL) -> URL: diff --git a/src/warp_agent_sdk/_client.py b/src/oz_agent_sdk/_client.py similarity index 91% rename from src/warp_agent_sdk/_client.py rename to src/oz_agent_sdk/_client.py index bd29caa..365d491 100644 --- a/src/warp_agent_sdk/_client.py +++ b/src/oz_agent_sdk/_client.py @@ -23,7 +23,7 @@ from ._compat import cached_property from ._version import __version__ from ._streaming import Stream as Stream, AsyncStream as AsyncStream -from ._exceptions import WarpAPIError, APIStatusError +from ._exceptions import OzAPIError, APIStatusError from ._base_client import ( DEFAULT_MAX_RETRIES, SyncAPIClient, @@ -34,10 +34,10 @@ from .resources import agent from .resources.agent.agent import AgentResource, AsyncAgentResource -__all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "WarpAPI", "AsyncWarpAPI", "Client", "AsyncClient"] +__all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "OzAPI", "AsyncOzAPI", "Client", "AsyncClient"] -class WarpAPI(SyncAPIClient): +class OzAPI(SyncAPIClient): # client options api_key: str @@ -64,20 +64,20 @@ def __init__( # part of our public interface in the future. _strict_response_validation: bool = False, ) -> None: - """Construct a new synchronous WarpAPI client instance. + """Construct a new synchronous OzAPI client instance. This automatically infers the `api_key` argument from the `WARP_API_KEY` environment variable if it is not provided. """ if api_key is None: api_key = os.environ.get("WARP_API_KEY") if api_key is None: - raise WarpAPIError( + raise OzAPIError( "The api_key client option must be set either by passing api_key to the client or by setting the WARP_API_KEY environment variable" ) self.api_key = api_key if base_url is None: - base_url = os.environ.get("WARP_API_BASE_URL") + base_url = os.environ.get("OZ_API_BASE_URL") if base_url is None: base_url = f"https://app.warp.dev/api/v1" @@ -99,12 +99,12 @@ def agent(self) -> AgentResource: return AgentResource(self) @cached_property - def with_raw_response(self) -> WarpAPIWithRawResponse: - return WarpAPIWithRawResponse(self) + def with_raw_response(self) -> OzAPIWithRawResponse: + return OzAPIWithRawResponse(self) @cached_property - def with_streaming_response(self) -> WarpAPIWithStreamedResponse: - return WarpAPIWithStreamedResponse(self) + def with_streaming_response(self) -> OzAPIWithStreamedResponse: + return OzAPIWithStreamedResponse(self) @property @override @@ -211,7 +211,7 @@ def _make_status_error( return APIStatusError(err_msg, response=response, body=body) -class AsyncWarpAPI(AsyncAPIClient): +class AsyncOzAPI(AsyncAPIClient): # client options api_key: str @@ -238,20 +238,20 @@ def __init__( # part of our public interface in the future. _strict_response_validation: bool = False, ) -> None: - """Construct a new async AsyncWarpAPI client instance. + """Construct a new async AsyncOzAPI client instance. This automatically infers the `api_key` argument from the `WARP_API_KEY` environment variable if it is not provided. """ if api_key is None: api_key = os.environ.get("WARP_API_KEY") if api_key is None: - raise WarpAPIError( + raise OzAPIError( "The api_key client option must be set either by passing api_key to the client or by setting the WARP_API_KEY environment variable" ) self.api_key = api_key if base_url is None: - base_url = os.environ.get("WARP_API_BASE_URL") + base_url = os.environ.get("OZ_API_BASE_URL") if base_url is None: base_url = f"https://app.warp.dev/api/v1" @@ -273,12 +273,12 @@ def agent(self) -> AsyncAgentResource: return AsyncAgentResource(self) @cached_property - def with_raw_response(self) -> AsyncWarpAPIWithRawResponse: - return AsyncWarpAPIWithRawResponse(self) + def with_raw_response(self) -> AsyncOzAPIWithRawResponse: + return AsyncOzAPIWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncWarpAPIWithStreamedResponse: - return AsyncWarpAPIWithStreamedResponse(self) + def with_streaming_response(self) -> AsyncOzAPIWithStreamedResponse: + return AsyncOzAPIWithStreamedResponse(self) @property @override @@ -385,10 +385,10 @@ def _make_status_error( return APIStatusError(err_msg, response=response, body=body) -class WarpAPIWithRawResponse: - _client: WarpAPI +class OzAPIWithRawResponse: + _client: OzAPI - def __init__(self, client: WarpAPI) -> None: + def __init__(self, client: OzAPI) -> None: self._client = client @cached_property @@ -398,10 +398,10 @@ def agent(self) -> agent.AgentResourceWithRawResponse: return AgentResourceWithRawResponse(self._client.agent) -class AsyncWarpAPIWithRawResponse: - _client: AsyncWarpAPI +class AsyncOzAPIWithRawResponse: + _client: AsyncOzAPI - def __init__(self, client: AsyncWarpAPI) -> None: + def __init__(self, client: AsyncOzAPI) -> None: self._client = client @cached_property @@ -411,10 +411,10 @@ def agent(self) -> agent.AsyncAgentResourceWithRawResponse: return AsyncAgentResourceWithRawResponse(self._client.agent) -class WarpAPIWithStreamedResponse: - _client: WarpAPI +class OzAPIWithStreamedResponse: + _client: OzAPI - def __init__(self, client: WarpAPI) -> None: + def __init__(self, client: OzAPI) -> None: self._client = client @cached_property @@ -424,10 +424,10 @@ def agent(self) -> agent.AgentResourceWithStreamingResponse: return AgentResourceWithStreamingResponse(self._client.agent) -class AsyncWarpAPIWithStreamedResponse: - _client: AsyncWarpAPI +class AsyncOzAPIWithStreamedResponse: + _client: AsyncOzAPI - def __init__(self, client: AsyncWarpAPI) -> None: + def __init__(self, client: AsyncOzAPI) -> None: self._client = client @cached_property @@ -437,6 +437,6 @@ def agent(self) -> agent.AsyncAgentResourceWithStreamingResponse: return AsyncAgentResourceWithStreamingResponse(self._client.agent) -Client = WarpAPI +Client = OzAPI -AsyncClient = AsyncWarpAPI +AsyncClient = AsyncOzAPI diff --git a/src/warp_agent_sdk/_compat.py b/src/oz_agent_sdk/_compat.py similarity index 100% rename from src/warp_agent_sdk/_compat.py rename to src/oz_agent_sdk/_compat.py diff --git a/src/warp_agent_sdk/_constants.py b/src/oz_agent_sdk/_constants.py similarity index 100% rename from src/warp_agent_sdk/_constants.py rename to src/oz_agent_sdk/_constants.py diff --git a/src/warp_agent_sdk/_exceptions.py b/src/oz_agent_sdk/_exceptions.py similarity index 98% rename from src/warp_agent_sdk/_exceptions.py rename to src/oz_agent_sdk/_exceptions.py index dea75e0..d84512f 100644 --- a/src/warp_agent_sdk/_exceptions.py +++ b/src/oz_agent_sdk/_exceptions.py @@ -18,11 +18,11 @@ ] -class WarpAPIError(Exception): +class OzAPIError(Exception): pass -class APIError(WarpAPIError): +class APIError(OzAPIError): message: str request: httpx.Request diff --git a/src/warp_agent_sdk/_files.py b/src/oz_agent_sdk/_files.py similarity index 100% rename from src/warp_agent_sdk/_files.py rename to src/oz_agent_sdk/_files.py diff --git a/src/warp_agent_sdk/_models.py b/src/oz_agent_sdk/_models.py similarity index 100% rename from src/warp_agent_sdk/_models.py rename to src/oz_agent_sdk/_models.py diff --git a/src/warp_agent_sdk/_qs.py b/src/oz_agent_sdk/_qs.py similarity index 100% rename from src/warp_agent_sdk/_qs.py rename to src/oz_agent_sdk/_qs.py diff --git a/src/warp_agent_sdk/_resource.py b/src/oz_agent_sdk/_resource.py similarity index 82% rename from src/warp_agent_sdk/_resource.py rename to src/oz_agent_sdk/_resource.py index a152ad1..b875682 100644 --- a/src/warp_agent_sdk/_resource.py +++ b/src/oz_agent_sdk/_resource.py @@ -8,13 +8,13 @@ import anyio if TYPE_CHECKING: - from ._client import WarpAPI, AsyncWarpAPI + from ._client import OzAPI, AsyncOzAPI class SyncAPIResource: - _client: WarpAPI + _client: OzAPI - def __init__(self, client: WarpAPI) -> None: + def __init__(self, client: OzAPI) -> None: self._client = client self._get = client.get self._post = client.post @@ -28,9 +28,9 @@ def _sleep(self, seconds: float) -> None: class AsyncAPIResource: - _client: AsyncWarpAPI + _client: AsyncOzAPI - def __init__(self, client: AsyncWarpAPI) -> None: + def __init__(self, client: AsyncOzAPI) -> None: self._client = client self._get = client.get self._post = client.post diff --git a/src/warp_agent_sdk/_response.py b/src/oz_agent_sdk/_response.py similarity index 98% rename from src/warp_agent_sdk/_response.py rename to src/oz_agent_sdk/_response.py index 0b0ae70..38939d2 100644 --- a/src/warp_agent_sdk/_response.py +++ b/src/oz_agent_sdk/_response.py @@ -29,7 +29,7 @@ from ._models import BaseModel, is_basemodel from ._constants import RAW_RESPONSE_HEADER, OVERRIDE_CAST_TO_HEADER from ._streaming import Stream, AsyncStream, is_stream_class_type, extract_stream_chunk_type -from ._exceptions import WarpAPIError, APIResponseValidationError +from ._exceptions import OzAPIError, APIResponseValidationError if TYPE_CHECKING: from ._models import FinalRequestOptions @@ -218,7 +218,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: and issubclass(origin, pydantic.BaseModel) ): raise TypeError( - "Pydantic models must subclass our base model type, e.g. `from warp_agent_sdk import BaseModel`" + "Pydantic models must subclass our base model type, e.g. `from oz_agent_sdk import BaseModel`" ) if ( @@ -285,7 +285,7 @@ def parse(self, *, to: type[_T] | None = None) -> R | _T: the `to` argument, e.g. ```py - from warp_agent_sdk import BaseModel + from oz_agent_sdk import BaseModel class MyModel(BaseModel): @@ -387,7 +387,7 @@ async def parse(self, *, to: type[_T] | None = None) -> R | _T: the `to` argument, e.g. ```py - from warp_agent_sdk import BaseModel + from oz_agent_sdk import BaseModel class MyModel(BaseModel): @@ -558,11 +558,11 @@ async def stream_to_file( class MissingStreamClassError(TypeError): def __init__(self) -> None: super().__init__( - "The `stream` argument was set to `True` but the `stream_cls` argument was not given. See `warp_agent_sdk._streaming` for reference", + "The `stream` argument was set to `True` but the `stream_cls` argument was not given. See `oz_agent_sdk._streaming` for reference", ) -class StreamAlreadyConsumed(WarpAPIError): +class StreamAlreadyConsumed(OzAPIError): """ Attempted to read or stream content, but the content has already been streamed. diff --git a/src/warp_agent_sdk/_streaming.py b/src/oz_agent_sdk/_streaming.py similarity index 99% rename from src/warp_agent_sdk/_streaming.py rename to src/oz_agent_sdk/_streaming.py index 1ce5bea..38976b7 100644 --- a/src/warp_agent_sdk/_streaming.py +++ b/src/oz_agent_sdk/_streaming.py @@ -12,7 +12,7 @@ from ._utils import extract_type_var_from_base if TYPE_CHECKING: - from ._client import WarpAPI, AsyncWarpAPI + from ._client import OzAPI, AsyncOzAPI _T = TypeVar("_T") @@ -30,7 +30,7 @@ def __init__( *, cast_to: type[_T], response: httpx.Response, - client: WarpAPI, + client: OzAPI, ) -> None: self.response = response self._cast_to = cast_to @@ -93,7 +93,7 @@ def __init__( *, cast_to: type[_T], response: httpx.Response, - client: AsyncWarpAPI, + client: AsyncOzAPI, ) -> None: self.response = response self._cast_to = cast_to diff --git a/src/warp_agent_sdk/_types.py b/src/oz_agent_sdk/_types.py similarity index 99% rename from src/warp_agent_sdk/_types.py rename to src/oz_agent_sdk/_types.py index 39b1522..eac5f8b 100644 --- a/src/warp_agent_sdk/_types.py +++ b/src/oz_agent_sdk/_types.py @@ -101,7 +101,7 @@ # This unfortunately means that you will either have # to import this type and pass it explicitly: # -# from warp_agent_sdk import NoneType +# from oz_agent_sdk import NoneType # client.get('/foo', cast_to=NoneType) # # or build it yourself: diff --git a/src/warp_agent_sdk/_utils/__init__.py b/src/oz_agent_sdk/_utils/__init__.py similarity index 100% rename from src/warp_agent_sdk/_utils/__init__.py rename to src/oz_agent_sdk/_utils/__init__.py diff --git a/src/warp_agent_sdk/_utils/_compat.py b/src/oz_agent_sdk/_utils/_compat.py similarity index 100% rename from src/warp_agent_sdk/_utils/_compat.py rename to src/oz_agent_sdk/_utils/_compat.py diff --git a/src/warp_agent_sdk/_utils/_datetime_parse.py b/src/oz_agent_sdk/_utils/_datetime_parse.py similarity index 100% rename from src/warp_agent_sdk/_utils/_datetime_parse.py rename to src/oz_agent_sdk/_utils/_datetime_parse.py diff --git a/src/warp_agent_sdk/_utils/_json.py b/src/oz_agent_sdk/_utils/_json.py similarity index 100% rename from src/warp_agent_sdk/_utils/_json.py rename to src/oz_agent_sdk/_utils/_json.py diff --git a/src/warp_agent_sdk/_utils/_logs.py b/src/oz_agent_sdk/_utils/_logs.py similarity index 70% rename from src/warp_agent_sdk/_utils/_logs.py rename to src/oz_agent_sdk/_utils/_logs.py index fdb4b91..5bba9a5 100644 --- a/src/warp_agent_sdk/_utils/_logs.py +++ b/src/oz_agent_sdk/_utils/_logs.py @@ -1,12 +1,12 @@ import os import logging -logger: logging.Logger = logging.getLogger("warp_agent_sdk") +logger: logging.Logger = logging.getLogger("oz_agent_sdk") httpx_logger: logging.Logger = logging.getLogger("httpx") def _basic_config() -> None: - # e.g. [2023-10-05 14:12:26 - warp_agent_sdk._base_client:818 - DEBUG] HTTP Request: POST http://127.0.0.1:4010/foo/bar "200 OK" + # e.g. [2023-10-05 14:12:26 - oz_agent_sdk._base_client:818 - DEBUG] HTTP Request: POST http://127.0.0.1:4010/foo/bar "200 OK" logging.basicConfig( format="[%(asctime)s - %(name)s:%(lineno)d - %(levelname)s] %(message)s", datefmt="%Y-%m-%d %H:%M:%S", @@ -14,7 +14,7 @@ def _basic_config() -> None: def setup_logging() -> None: - env = os.environ.get("WARP_API_LOG") + env = os.environ.get("OZ_API_LOG") if env == "debug": _basic_config() logger.setLevel(logging.DEBUG) diff --git a/src/warp_agent_sdk/_utils/_proxy.py b/src/oz_agent_sdk/_utils/_proxy.py similarity index 100% rename from src/warp_agent_sdk/_utils/_proxy.py rename to src/oz_agent_sdk/_utils/_proxy.py diff --git a/src/warp_agent_sdk/_utils/_reflection.py b/src/oz_agent_sdk/_utils/_reflection.py similarity index 100% rename from src/warp_agent_sdk/_utils/_reflection.py rename to src/oz_agent_sdk/_utils/_reflection.py diff --git a/src/warp_agent_sdk/_utils/_resources_proxy.py b/src/oz_agent_sdk/_utils/_resources_proxy.py similarity index 50% rename from src/warp_agent_sdk/_utils/_resources_proxy.py rename to src/oz_agent_sdk/_utils/_resources_proxy.py index 63256ef..961a666 100644 --- a/src/warp_agent_sdk/_utils/_resources_proxy.py +++ b/src/oz_agent_sdk/_utils/_resources_proxy.py @@ -7,17 +7,17 @@ class ResourcesProxy(LazyProxy[Any]): - """A proxy for the `warp_agent_sdk.resources` module. + """A proxy for the `oz_agent_sdk.resources` module. - This is used so that we can lazily import `warp_agent_sdk.resources` only when - needed *and* so that users can just import `warp_agent_sdk` and reference `warp_agent_sdk.resources` + This is used so that we can lazily import `oz_agent_sdk.resources` only when + needed *and* so that users can just import `oz_agent_sdk` and reference `oz_agent_sdk.resources` """ @override def __load__(self) -> Any: import importlib - mod = importlib.import_module("warp_agent_sdk.resources") + mod = importlib.import_module("oz_agent_sdk.resources") return mod diff --git a/src/warp_agent_sdk/_utils/_streams.py b/src/oz_agent_sdk/_utils/_streams.py similarity index 100% rename from src/warp_agent_sdk/_utils/_streams.py rename to src/oz_agent_sdk/_utils/_streams.py diff --git a/src/warp_agent_sdk/_utils/_sync.py b/src/oz_agent_sdk/_utils/_sync.py similarity index 100% rename from src/warp_agent_sdk/_utils/_sync.py rename to src/oz_agent_sdk/_utils/_sync.py diff --git a/src/warp_agent_sdk/_utils/_transform.py b/src/oz_agent_sdk/_utils/_transform.py similarity index 100% rename from src/warp_agent_sdk/_utils/_transform.py rename to src/oz_agent_sdk/_utils/_transform.py diff --git a/src/warp_agent_sdk/_utils/_typing.py b/src/oz_agent_sdk/_utils/_typing.py similarity index 100% rename from src/warp_agent_sdk/_utils/_typing.py rename to src/oz_agent_sdk/_utils/_typing.py diff --git a/src/warp_agent_sdk/_utils/_utils.py b/src/oz_agent_sdk/_utils/_utils.py similarity index 100% rename from src/warp_agent_sdk/_utils/_utils.py rename to src/oz_agent_sdk/_utils/_utils.py diff --git a/src/warp_agent_sdk/_version.py b/src/oz_agent_sdk/_version.py similarity index 52% rename from src/warp_agent_sdk/_version.py rename to src/oz_agent_sdk/_version.py index 17870c5..233c47e 100644 --- a/src/warp_agent_sdk/_version.py +++ b/src/oz_agent_sdk/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -__title__ = "warp_agent_sdk" -__version__ = "0.5.0" # x-release-please-version +__title__ = "oz_agent_sdk" +__version__ = "0.6.0" # x-release-please-version diff --git a/src/oz_agent_sdk/lib/.keep b/src/oz_agent_sdk/lib/.keep new file mode 100644 index 0000000..5e2c99f --- /dev/null +++ b/src/oz_agent_sdk/lib/.keep @@ -0,0 +1,4 @@ +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/warp_agent_sdk/py.typed b/src/oz_agent_sdk/py.typed similarity index 100% rename from src/warp_agent_sdk/py.typed rename to src/oz_agent_sdk/py.typed diff --git a/src/warp_agent_sdk/resources/__init__.py b/src/oz_agent_sdk/resources/__init__.py similarity index 100% rename from src/warp_agent_sdk/resources/__init__.py rename to src/oz_agent_sdk/resources/__init__.py diff --git a/src/warp_agent_sdk/resources/agent/__init__.py b/src/oz_agent_sdk/resources/agent/__init__.py similarity index 100% rename from src/warp_agent_sdk/resources/agent/__init__.py rename to src/oz_agent_sdk/resources/agent/__init__.py diff --git a/src/warp_agent_sdk/resources/agent/agent.py b/src/oz_agent_sdk/resources/agent/agent.py similarity index 100% rename from src/warp_agent_sdk/resources/agent/agent.py rename to src/oz_agent_sdk/resources/agent/agent.py diff --git a/src/warp_agent_sdk/resources/agent/runs.py b/src/oz_agent_sdk/resources/agent/runs.py similarity index 100% rename from src/warp_agent_sdk/resources/agent/runs.py rename to src/oz_agent_sdk/resources/agent/runs.py diff --git a/src/warp_agent_sdk/resources/agent/schedules.py b/src/oz_agent_sdk/resources/agent/schedules.py similarity index 100% rename from src/warp_agent_sdk/resources/agent/schedules.py rename to src/oz_agent_sdk/resources/agent/schedules.py diff --git a/src/warp_agent_sdk/types/__init__.py b/src/oz_agent_sdk/types/__init__.py similarity index 100% rename from src/warp_agent_sdk/types/__init__.py rename to src/oz_agent_sdk/types/__init__.py diff --git a/src/warp_agent_sdk/types/agent/__init__.py b/src/oz_agent_sdk/types/agent/__init__.py similarity index 100% rename from src/warp_agent_sdk/types/agent/__init__.py rename to src/oz_agent_sdk/types/agent/__init__.py diff --git a/src/warp_agent_sdk/types/agent/artifact_item.py b/src/oz_agent_sdk/types/agent/artifact_item.py similarity index 100% rename from src/warp_agent_sdk/types/agent/artifact_item.py rename to src/oz_agent_sdk/types/agent/artifact_item.py diff --git a/src/warp_agent_sdk/types/agent/run_cancel_response.py b/src/oz_agent_sdk/types/agent/run_cancel_response.py similarity index 100% rename from src/warp_agent_sdk/types/agent/run_cancel_response.py rename to src/oz_agent_sdk/types/agent/run_cancel_response.py diff --git a/src/warp_agent_sdk/types/agent/run_item.py b/src/oz_agent_sdk/types/agent/run_item.py similarity index 100% rename from src/warp_agent_sdk/types/agent/run_item.py rename to src/oz_agent_sdk/types/agent/run_item.py diff --git a/src/warp_agent_sdk/types/agent/run_list_params.py b/src/oz_agent_sdk/types/agent/run_list_params.py similarity index 100% rename from src/warp_agent_sdk/types/agent/run_list_params.py rename to src/oz_agent_sdk/types/agent/run_list_params.py diff --git a/src/warp_agent_sdk/types/agent/run_list_response.py b/src/oz_agent_sdk/types/agent/run_list_response.py similarity index 100% rename from src/warp_agent_sdk/types/agent/run_list_response.py rename to src/oz_agent_sdk/types/agent/run_list_response.py diff --git a/src/warp_agent_sdk/types/agent/run_source_type.py b/src/oz_agent_sdk/types/agent/run_source_type.py similarity index 100% rename from src/warp_agent_sdk/types/agent/run_source_type.py rename to src/oz_agent_sdk/types/agent/run_source_type.py diff --git a/src/warp_agent_sdk/types/agent/run_state.py b/src/oz_agent_sdk/types/agent/run_state.py similarity index 100% rename from src/warp_agent_sdk/types/agent/run_state.py rename to src/oz_agent_sdk/types/agent/run_state.py diff --git a/src/warp_agent_sdk/types/agent/schedule_create_params.py b/src/oz_agent_sdk/types/agent/schedule_create_params.py similarity index 100% rename from src/warp_agent_sdk/types/agent/schedule_create_params.py rename to src/oz_agent_sdk/types/agent/schedule_create_params.py diff --git a/src/warp_agent_sdk/types/agent/schedule_delete_response.py b/src/oz_agent_sdk/types/agent/schedule_delete_response.py similarity index 100% rename from src/warp_agent_sdk/types/agent/schedule_delete_response.py rename to src/oz_agent_sdk/types/agent/schedule_delete_response.py diff --git a/src/warp_agent_sdk/types/agent/schedule_list_response.py b/src/oz_agent_sdk/types/agent/schedule_list_response.py similarity index 100% rename from src/warp_agent_sdk/types/agent/schedule_list_response.py rename to src/oz_agent_sdk/types/agent/schedule_list_response.py diff --git a/src/warp_agent_sdk/types/agent/schedule_update_params.py b/src/oz_agent_sdk/types/agent/schedule_update_params.py similarity index 100% rename from src/warp_agent_sdk/types/agent/schedule_update_params.py rename to src/oz_agent_sdk/types/agent/schedule_update_params.py diff --git a/src/warp_agent_sdk/types/agent/scheduled_agent_item.py b/src/oz_agent_sdk/types/agent/scheduled_agent_item.py similarity index 100% rename from src/warp_agent_sdk/types/agent/scheduled_agent_item.py rename to src/oz_agent_sdk/types/agent/scheduled_agent_item.py diff --git a/src/warp_agent_sdk/types/agent_list_params.py b/src/oz_agent_sdk/types/agent_list_params.py similarity index 100% rename from src/warp_agent_sdk/types/agent_list_params.py rename to src/oz_agent_sdk/types/agent_list_params.py diff --git a/src/warp_agent_sdk/types/agent_list_response.py b/src/oz_agent_sdk/types/agent_list_response.py similarity index 100% rename from src/warp_agent_sdk/types/agent_list_response.py rename to src/oz_agent_sdk/types/agent_list_response.py diff --git a/src/warp_agent_sdk/types/agent_run_params.py b/src/oz_agent_sdk/types/agent_run_params.py similarity index 100% rename from src/warp_agent_sdk/types/agent_run_params.py rename to src/oz_agent_sdk/types/agent_run_params.py diff --git a/src/warp_agent_sdk/types/agent_run_response.py b/src/oz_agent_sdk/types/agent_run_response.py similarity index 100% rename from src/warp_agent_sdk/types/agent_run_response.py rename to src/oz_agent_sdk/types/agent_run_response.py diff --git a/src/warp_agent_sdk/types/agent_skill.py b/src/oz_agent_sdk/types/agent_skill.py similarity index 100% rename from src/warp_agent_sdk/types/agent_skill.py rename to src/oz_agent_sdk/types/agent_skill.py diff --git a/src/warp_agent_sdk/types/ambient_agent_config.py b/src/oz_agent_sdk/types/ambient_agent_config.py similarity index 100% rename from src/warp_agent_sdk/types/ambient_agent_config.py rename to src/oz_agent_sdk/types/ambient_agent_config.py diff --git a/src/warp_agent_sdk/types/ambient_agent_config_param.py b/src/oz_agent_sdk/types/ambient_agent_config_param.py similarity index 100% rename from src/warp_agent_sdk/types/ambient_agent_config_param.py rename to src/oz_agent_sdk/types/ambient_agent_config_param.py diff --git a/src/warp_agent_sdk/types/cloud_environment_config.py b/src/oz_agent_sdk/types/cloud_environment_config.py similarity index 100% rename from src/warp_agent_sdk/types/cloud_environment_config.py rename to src/oz_agent_sdk/types/cloud_environment_config.py diff --git a/src/warp_agent_sdk/types/mcp_server_config.py b/src/oz_agent_sdk/types/mcp_server_config.py similarity index 100% rename from src/warp_agent_sdk/types/mcp_server_config.py rename to src/oz_agent_sdk/types/mcp_server_config.py diff --git a/src/warp_agent_sdk/types/mcp_server_config_param.py b/src/oz_agent_sdk/types/mcp_server_config_param.py similarity index 100% rename from src/warp_agent_sdk/types/mcp_server_config_param.py rename to src/oz_agent_sdk/types/mcp_server_config_param.py diff --git a/src/warp_agent_sdk/types/user_profile.py b/src/oz_agent_sdk/types/user_profile.py similarity index 100% rename from src/warp_agent_sdk/types/user_profile.py rename to src/oz_agent_sdk/types/user_profile.py diff --git a/tests/api_resources/agent/test_runs.py b/tests/api_resources/agent/test_runs.py index 40cdbc0..9bf78b7 100644 --- a/tests/api_resources/agent/test_runs.py +++ b/tests/api_resources/agent/test_runs.py @@ -8,9 +8,9 @@ import pytest from tests.utils import assert_matches_type -from warp_agent_sdk import WarpAPI, AsyncWarpAPI -from warp_agent_sdk._utils import parse_datetime -from warp_agent_sdk.types.agent import RunItem, RunListResponse +from oz_agent_sdk import OzAPI, AsyncOzAPI +from oz_agent_sdk._utils import parse_datetime +from oz_agent_sdk.types.agent import RunItem, RunListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -20,7 +20,7 @@ class TestRuns: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_method_retrieve(self, client: WarpAPI) -> None: + def test_method_retrieve(self, client: OzAPI) -> None: run = client.agent.runs.retrieve( "runId", ) @@ -28,7 +28,7 @@ def test_method_retrieve(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_raw_response_retrieve(self, client: WarpAPI) -> None: + def test_raw_response_retrieve(self, client: OzAPI) -> None: response = client.agent.runs.with_raw_response.retrieve( "runId", ) @@ -40,7 +40,7 @@ def test_raw_response_retrieve(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_streaming_response_retrieve(self, client: WarpAPI) -> None: + def test_streaming_response_retrieve(self, client: OzAPI) -> None: with client.agent.runs.with_streaming_response.retrieve( "runId", ) as response: @@ -54,7 +54,7 @@ def test_streaming_response_retrieve(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_path_params_retrieve(self, client: WarpAPI) -> None: + def test_path_params_retrieve(self, client: OzAPI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"): client.agent.runs.with_raw_response.retrieve( "", @@ -62,13 +62,13 @@ def test_path_params_retrieve(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_method_list(self, client: WarpAPI) -> None: + def test_method_list(self, client: OzAPI) -> None: run = client.agent.runs.list() assert_matches_type(RunListResponse, run, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_method_list_with_all_params(self, client: WarpAPI) -> None: + def test_method_list_with_all_params(self, client: OzAPI) -> None: run = client.agent.runs.list( artifact_type="PLAN", created_after=parse_datetime("2019-12-27T18:11:19.117Z"), @@ -91,7 +91,7 @@ def test_method_list_with_all_params(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_raw_response_list(self, client: WarpAPI) -> None: + def test_raw_response_list(self, client: OzAPI) -> None: response = client.agent.runs.with_raw_response.list() assert response.is_closed is True @@ -101,7 +101,7 @@ def test_raw_response_list(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_streaming_response_list(self, client: WarpAPI) -> None: + def test_streaming_response_list(self, client: OzAPI) -> None: with client.agent.runs.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -113,7 +113,7 @@ def test_streaming_response_list(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_method_cancel(self, client: WarpAPI) -> None: + def test_method_cancel(self, client: OzAPI) -> None: run = client.agent.runs.cancel( "runId", ) @@ -121,7 +121,7 @@ def test_method_cancel(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_raw_response_cancel(self, client: WarpAPI) -> None: + def test_raw_response_cancel(self, client: OzAPI) -> None: response = client.agent.runs.with_raw_response.cancel( "runId", ) @@ -133,7 +133,7 @@ def test_raw_response_cancel(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_streaming_response_cancel(self, client: WarpAPI) -> None: + def test_streaming_response_cancel(self, client: OzAPI) -> None: with client.agent.runs.with_streaming_response.cancel( "runId", ) as response: @@ -147,7 +147,7 @@ def test_streaming_response_cancel(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_path_params_cancel(self, client: WarpAPI) -> None: + def test_path_params_cancel(self, client: OzAPI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"): client.agent.runs.with_raw_response.cancel( "", @@ -161,7 +161,7 @@ class TestAsyncRuns: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_method_retrieve(self, async_client: AsyncWarpAPI) -> None: + async def test_method_retrieve(self, async_client: AsyncOzAPI) -> None: run = await async_client.agent.runs.retrieve( "runId", ) @@ -169,7 +169,7 @@ async def test_method_retrieve(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncWarpAPI) -> None: + async def test_raw_response_retrieve(self, async_client: AsyncOzAPI) -> None: response = await async_client.agent.runs.with_raw_response.retrieve( "runId", ) @@ -181,7 +181,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncWarpAPI) -> None: + async def test_streaming_response_retrieve(self, async_client: AsyncOzAPI) -> None: async with async_client.agent.runs.with_streaming_response.retrieve( "runId", ) as response: @@ -195,7 +195,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncWarpAPI) -> @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_path_params_retrieve(self, async_client: AsyncWarpAPI) -> None: + async def test_path_params_retrieve(self, async_client: AsyncOzAPI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"): await async_client.agent.runs.with_raw_response.retrieve( "", @@ -203,13 +203,13 @@ async def test_path_params_retrieve(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_method_list(self, async_client: AsyncWarpAPI) -> None: + async def test_method_list(self, async_client: AsyncOzAPI) -> None: run = await async_client.agent.runs.list() assert_matches_type(RunListResponse, run, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncWarpAPI) -> None: + async def test_method_list_with_all_params(self, async_client: AsyncOzAPI) -> None: run = await async_client.agent.runs.list( artifact_type="PLAN", created_after=parse_datetime("2019-12-27T18:11:19.117Z"), @@ -232,7 +232,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncWarpAPI) -> @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_raw_response_list(self, async_client: AsyncWarpAPI) -> None: + async def test_raw_response_list(self, async_client: AsyncOzAPI) -> None: response = await async_client.agent.runs.with_raw_response.list() assert response.is_closed is True @@ -242,7 +242,7 @@ async def test_raw_response_list(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_streaming_response_list(self, async_client: AsyncWarpAPI) -> None: + async def test_streaming_response_list(self, async_client: AsyncOzAPI) -> None: async with async_client.agent.runs.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -254,7 +254,7 @@ async def test_streaming_response_list(self, async_client: AsyncWarpAPI) -> None @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_method_cancel(self, async_client: AsyncWarpAPI) -> None: + async def test_method_cancel(self, async_client: AsyncOzAPI) -> None: run = await async_client.agent.runs.cancel( "runId", ) @@ -262,7 +262,7 @@ async def test_method_cancel(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_raw_response_cancel(self, async_client: AsyncWarpAPI) -> None: + async def test_raw_response_cancel(self, async_client: AsyncOzAPI) -> None: response = await async_client.agent.runs.with_raw_response.cancel( "runId", ) @@ -274,7 +274,7 @@ async def test_raw_response_cancel(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_streaming_response_cancel(self, async_client: AsyncWarpAPI) -> None: + async def test_streaming_response_cancel(self, async_client: AsyncOzAPI) -> None: async with async_client.agent.runs.with_streaming_response.cancel( "runId", ) as response: @@ -288,7 +288,7 @@ async def test_streaming_response_cancel(self, async_client: AsyncWarpAPI) -> No @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_path_params_cancel(self, async_client: AsyncWarpAPI) -> None: + async def test_path_params_cancel(self, async_client: AsyncOzAPI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `run_id` but received ''"): await async_client.agent.runs.with_raw_response.cancel( "", diff --git a/tests/api_resources/agent/test_schedules.py b/tests/api_resources/agent/test_schedules.py index b935a5f..a21ea09 100644 --- a/tests/api_resources/agent/test_schedules.py +++ b/tests/api_resources/agent/test_schedules.py @@ -8,8 +8,8 @@ import pytest from tests.utils import assert_matches_type -from warp_agent_sdk import WarpAPI, AsyncWarpAPI -from warp_agent_sdk.types.agent import ( +from oz_agent_sdk import OzAPI, AsyncOzAPI +from oz_agent_sdk.types.agent import ( ScheduledAgentItem, ScheduleListResponse, ScheduleDeleteResponse, @@ -23,7 +23,7 @@ class TestSchedules: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_method_create(self, client: WarpAPI) -> None: + def test_method_create(self, client: OzAPI) -> None: schedule = client.agent.schedules.create( cron_schedule="0 9 * * *", name="Daily Code Review", @@ -33,7 +33,7 @@ def test_method_create(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_method_create_with_all_params(self, client: WarpAPI) -> None: + def test_method_create_with_all_params(self, client: OzAPI) -> None: schedule = client.agent.schedules.create( cron_schedule="0 9 * * *", name="Daily Code Review", @@ -64,7 +64,7 @@ def test_method_create_with_all_params(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_raw_response_create(self, client: WarpAPI) -> None: + def test_raw_response_create(self, client: OzAPI) -> None: response = client.agent.schedules.with_raw_response.create( cron_schedule="0 9 * * *", name="Daily Code Review", @@ -78,7 +78,7 @@ def test_raw_response_create(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_streaming_response_create(self, client: WarpAPI) -> None: + def test_streaming_response_create(self, client: OzAPI) -> None: with client.agent.schedules.with_streaming_response.create( cron_schedule="0 9 * * *", name="Daily Code Review", @@ -94,7 +94,7 @@ def test_streaming_response_create(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_method_retrieve(self, client: WarpAPI) -> None: + def test_method_retrieve(self, client: OzAPI) -> None: schedule = client.agent.schedules.retrieve( "scheduleId", ) @@ -102,7 +102,7 @@ def test_method_retrieve(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_raw_response_retrieve(self, client: WarpAPI) -> None: + def test_raw_response_retrieve(self, client: OzAPI) -> None: response = client.agent.schedules.with_raw_response.retrieve( "scheduleId", ) @@ -114,7 +114,7 @@ def test_raw_response_retrieve(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_streaming_response_retrieve(self, client: WarpAPI) -> None: + def test_streaming_response_retrieve(self, client: OzAPI) -> None: with client.agent.schedules.with_streaming_response.retrieve( "scheduleId", ) as response: @@ -128,7 +128,7 @@ def test_streaming_response_retrieve(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_path_params_retrieve(self, client: WarpAPI) -> None: + def test_path_params_retrieve(self, client: OzAPI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schedule_id` but received ''"): client.agent.schedules.with_raw_response.retrieve( "", @@ -136,7 +136,7 @@ def test_path_params_retrieve(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_method_update(self, client: WarpAPI) -> None: + def test_method_update(self, client: OzAPI) -> None: schedule = client.agent.schedules.update( schedule_id="scheduleId", cron_schedule="cron_schedule", @@ -148,7 +148,7 @@ def test_method_update(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_method_update_with_all_params(self, client: WarpAPI) -> None: + def test_method_update_with_all_params(self, client: OzAPI) -> None: schedule = client.agent.schedules.update( schedule_id="scheduleId", cron_schedule="cron_schedule", @@ -179,7 +179,7 @@ def test_method_update_with_all_params(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_raw_response_update(self, client: WarpAPI) -> None: + def test_raw_response_update(self, client: OzAPI) -> None: response = client.agent.schedules.with_raw_response.update( schedule_id="scheduleId", cron_schedule="cron_schedule", @@ -195,7 +195,7 @@ def test_raw_response_update(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_streaming_response_update(self, client: WarpAPI) -> None: + def test_streaming_response_update(self, client: OzAPI) -> None: with client.agent.schedules.with_streaming_response.update( schedule_id="scheduleId", cron_schedule="cron_schedule", @@ -213,7 +213,7 @@ def test_streaming_response_update(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_path_params_update(self, client: WarpAPI) -> None: + def test_path_params_update(self, client: OzAPI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schedule_id` but received ''"): client.agent.schedules.with_raw_response.update( schedule_id="", @@ -225,13 +225,13 @@ def test_path_params_update(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_method_list(self, client: WarpAPI) -> None: + def test_method_list(self, client: OzAPI) -> None: schedule = client.agent.schedules.list() assert_matches_type(ScheduleListResponse, schedule, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_raw_response_list(self, client: WarpAPI) -> None: + def test_raw_response_list(self, client: OzAPI) -> None: response = client.agent.schedules.with_raw_response.list() assert response.is_closed is True @@ -241,7 +241,7 @@ def test_raw_response_list(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_streaming_response_list(self, client: WarpAPI) -> None: + def test_streaming_response_list(self, client: OzAPI) -> None: with client.agent.schedules.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -253,7 +253,7 @@ def test_streaming_response_list(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_method_delete(self, client: WarpAPI) -> None: + def test_method_delete(self, client: OzAPI) -> None: schedule = client.agent.schedules.delete( "scheduleId", ) @@ -261,7 +261,7 @@ def test_method_delete(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_raw_response_delete(self, client: WarpAPI) -> None: + def test_raw_response_delete(self, client: OzAPI) -> None: response = client.agent.schedules.with_raw_response.delete( "scheduleId", ) @@ -273,7 +273,7 @@ def test_raw_response_delete(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_streaming_response_delete(self, client: WarpAPI) -> None: + def test_streaming_response_delete(self, client: OzAPI) -> None: with client.agent.schedules.with_streaming_response.delete( "scheduleId", ) as response: @@ -287,7 +287,7 @@ def test_streaming_response_delete(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_path_params_delete(self, client: WarpAPI) -> None: + def test_path_params_delete(self, client: OzAPI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schedule_id` but received ''"): client.agent.schedules.with_raw_response.delete( "", @@ -295,7 +295,7 @@ def test_path_params_delete(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_method_pause(self, client: WarpAPI) -> None: + def test_method_pause(self, client: OzAPI) -> None: schedule = client.agent.schedules.pause( "scheduleId", ) @@ -303,7 +303,7 @@ def test_method_pause(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_raw_response_pause(self, client: WarpAPI) -> None: + def test_raw_response_pause(self, client: OzAPI) -> None: response = client.agent.schedules.with_raw_response.pause( "scheduleId", ) @@ -315,7 +315,7 @@ def test_raw_response_pause(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_streaming_response_pause(self, client: WarpAPI) -> None: + def test_streaming_response_pause(self, client: OzAPI) -> None: with client.agent.schedules.with_streaming_response.pause( "scheduleId", ) as response: @@ -329,7 +329,7 @@ def test_streaming_response_pause(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_path_params_pause(self, client: WarpAPI) -> None: + def test_path_params_pause(self, client: OzAPI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schedule_id` but received ''"): client.agent.schedules.with_raw_response.pause( "", @@ -337,7 +337,7 @@ def test_path_params_pause(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_method_resume(self, client: WarpAPI) -> None: + def test_method_resume(self, client: OzAPI) -> None: schedule = client.agent.schedules.resume( "scheduleId", ) @@ -345,7 +345,7 @@ def test_method_resume(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_raw_response_resume(self, client: WarpAPI) -> None: + def test_raw_response_resume(self, client: OzAPI) -> None: response = client.agent.schedules.with_raw_response.resume( "scheduleId", ) @@ -357,7 +357,7 @@ def test_raw_response_resume(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_streaming_response_resume(self, client: WarpAPI) -> None: + def test_streaming_response_resume(self, client: OzAPI) -> None: with client.agent.schedules.with_streaming_response.resume( "scheduleId", ) as response: @@ -371,7 +371,7 @@ def test_streaming_response_resume(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_path_params_resume(self, client: WarpAPI) -> None: + def test_path_params_resume(self, client: OzAPI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schedule_id` but received ''"): client.agent.schedules.with_raw_response.resume( "", @@ -385,7 +385,7 @@ class TestAsyncSchedules: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_method_create(self, async_client: AsyncWarpAPI) -> None: + async def test_method_create(self, async_client: AsyncOzAPI) -> None: schedule = await async_client.agent.schedules.create( cron_schedule="0 9 * * *", name="Daily Code Review", @@ -395,7 +395,7 @@ async def test_method_create(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncWarpAPI) -> None: + async def test_method_create_with_all_params(self, async_client: AsyncOzAPI) -> None: schedule = await async_client.agent.schedules.create( cron_schedule="0 9 * * *", name="Daily Code Review", @@ -426,7 +426,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncWarpAPI) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_raw_response_create(self, async_client: AsyncWarpAPI) -> None: + async def test_raw_response_create(self, async_client: AsyncOzAPI) -> None: response = await async_client.agent.schedules.with_raw_response.create( cron_schedule="0 9 * * *", name="Daily Code Review", @@ -440,7 +440,7 @@ async def test_raw_response_create(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_streaming_response_create(self, async_client: AsyncWarpAPI) -> None: + async def test_streaming_response_create(self, async_client: AsyncOzAPI) -> None: async with async_client.agent.schedules.with_streaming_response.create( cron_schedule="0 9 * * *", name="Daily Code Review", @@ -456,7 +456,7 @@ async def test_streaming_response_create(self, async_client: AsyncWarpAPI) -> No @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_method_retrieve(self, async_client: AsyncWarpAPI) -> None: + async def test_method_retrieve(self, async_client: AsyncOzAPI) -> None: schedule = await async_client.agent.schedules.retrieve( "scheduleId", ) @@ -464,7 +464,7 @@ async def test_method_retrieve(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncWarpAPI) -> None: + async def test_raw_response_retrieve(self, async_client: AsyncOzAPI) -> None: response = await async_client.agent.schedules.with_raw_response.retrieve( "scheduleId", ) @@ -476,7 +476,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncWarpAPI) -> None: + async def test_streaming_response_retrieve(self, async_client: AsyncOzAPI) -> None: async with async_client.agent.schedules.with_streaming_response.retrieve( "scheduleId", ) as response: @@ -490,7 +490,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncWarpAPI) -> @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_path_params_retrieve(self, async_client: AsyncWarpAPI) -> None: + async def test_path_params_retrieve(self, async_client: AsyncOzAPI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schedule_id` but received ''"): await async_client.agent.schedules.with_raw_response.retrieve( "", @@ -498,7 +498,7 @@ async def test_path_params_retrieve(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_method_update(self, async_client: AsyncWarpAPI) -> None: + async def test_method_update(self, async_client: AsyncOzAPI) -> None: schedule = await async_client.agent.schedules.update( schedule_id="scheduleId", cron_schedule="cron_schedule", @@ -510,7 +510,7 @@ async def test_method_update(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_method_update_with_all_params(self, async_client: AsyncWarpAPI) -> None: + async def test_method_update_with_all_params(self, async_client: AsyncOzAPI) -> None: schedule = await async_client.agent.schedules.update( schedule_id="scheduleId", cron_schedule="cron_schedule", @@ -541,7 +541,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncWarpAPI) - @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_raw_response_update(self, async_client: AsyncWarpAPI) -> None: + async def test_raw_response_update(self, async_client: AsyncOzAPI) -> None: response = await async_client.agent.schedules.with_raw_response.update( schedule_id="scheduleId", cron_schedule="cron_schedule", @@ -557,7 +557,7 @@ async def test_raw_response_update(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_streaming_response_update(self, async_client: AsyncWarpAPI) -> None: + async def test_streaming_response_update(self, async_client: AsyncOzAPI) -> None: async with async_client.agent.schedules.with_streaming_response.update( schedule_id="scheduleId", cron_schedule="cron_schedule", @@ -575,7 +575,7 @@ async def test_streaming_response_update(self, async_client: AsyncWarpAPI) -> No @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_path_params_update(self, async_client: AsyncWarpAPI) -> None: + async def test_path_params_update(self, async_client: AsyncOzAPI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schedule_id` but received ''"): await async_client.agent.schedules.with_raw_response.update( schedule_id="", @@ -587,13 +587,13 @@ async def test_path_params_update(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_method_list(self, async_client: AsyncWarpAPI) -> None: + async def test_method_list(self, async_client: AsyncOzAPI) -> None: schedule = await async_client.agent.schedules.list() assert_matches_type(ScheduleListResponse, schedule, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_raw_response_list(self, async_client: AsyncWarpAPI) -> None: + async def test_raw_response_list(self, async_client: AsyncOzAPI) -> None: response = await async_client.agent.schedules.with_raw_response.list() assert response.is_closed is True @@ -603,7 +603,7 @@ async def test_raw_response_list(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_streaming_response_list(self, async_client: AsyncWarpAPI) -> None: + async def test_streaming_response_list(self, async_client: AsyncOzAPI) -> None: async with async_client.agent.schedules.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -615,7 +615,7 @@ async def test_streaming_response_list(self, async_client: AsyncWarpAPI) -> None @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_method_delete(self, async_client: AsyncWarpAPI) -> None: + async def test_method_delete(self, async_client: AsyncOzAPI) -> None: schedule = await async_client.agent.schedules.delete( "scheduleId", ) @@ -623,7 +623,7 @@ async def test_method_delete(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_raw_response_delete(self, async_client: AsyncWarpAPI) -> None: + async def test_raw_response_delete(self, async_client: AsyncOzAPI) -> None: response = await async_client.agent.schedules.with_raw_response.delete( "scheduleId", ) @@ -635,7 +635,7 @@ async def test_raw_response_delete(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_streaming_response_delete(self, async_client: AsyncWarpAPI) -> None: + async def test_streaming_response_delete(self, async_client: AsyncOzAPI) -> None: async with async_client.agent.schedules.with_streaming_response.delete( "scheduleId", ) as response: @@ -649,7 +649,7 @@ async def test_streaming_response_delete(self, async_client: AsyncWarpAPI) -> No @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_path_params_delete(self, async_client: AsyncWarpAPI) -> None: + async def test_path_params_delete(self, async_client: AsyncOzAPI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schedule_id` but received ''"): await async_client.agent.schedules.with_raw_response.delete( "", @@ -657,7 +657,7 @@ async def test_path_params_delete(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_method_pause(self, async_client: AsyncWarpAPI) -> None: + async def test_method_pause(self, async_client: AsyncOzAPI) -> None: schedule = await async_client.agent.schedules.pause( "scheduleId", ) @@ -665,7 +665,7 @@ async def test_method_pause(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_raw_response_pause(self, async_client: AsyncWarpAPI) -> None: + async def test_raw_response_pause(self, async_client: AsyncOzAPI) -> None: response = await async_client.agent.schedules.with_raw_response.pause( "scheduleId", ) @@ -677,7 +677,7 @@ async def test_raw_response_pause(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_streaming_response_pause(self, async_client: AsyncWarpAPI) -> None: + async def test_streaming_response_pause(self, async_client: AsyncOzAPI) -> None: async with async_client.agent.schedules.with_streaming_response.pause( "scheduleId", ) as response: @@ -691,7 +691,7 @@ async def test_streaming_response_pause(self, async_client: AsyncWarpAPI) -> Non @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_path_params_pause(self, async_client: AsyncWarpAPI) -> None: + async def test_path_params_pause(self, async_client: AsyncOzAPI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schedule_id` but received ''"): await async_client.agent.schedules.with_raw_response.pause( "", @@ -699,7 +699,7 @@ async def test_path_params_pause(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_method_resume(self, async_client: AsyncWarpAPI) -> None: + async def test_method_resume(self, async_client: AsyncOzAPI) -> None: schedule = await async_client.agent.schedules.resume( "scheduleId", ) @@ -707,7 +707,7 @@ async def test_method_resume(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_raw_response_resume(self, async_client: AsyncWarpAPI) -> None: + async def test_raw_response_resume(self, async_client: AsyncOzAPI) -> None: response = await async_client.agent.schedules.with_raw_response.resume( "scheduleId", ) @@ -719,7 +719,7 @@ async def test_raw_response_resume(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_streaming_response_resume(self, async_client: AsyncWarpAPI) -> None: + async def test_streaming_response_resume(self, async_client: AsyncOzAPI) -> None: async with async_client.agent.schedules.with_streaming_response.resume( "scheduleId", ) as response: @@ -733,7 +733,7 @@ async def test_streaming_response_resume(self, async_client: AsyncWarpAPI) -> No @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_path_params_resume(self, async_client: AsyncWarpAPI) -> None: + async def test_path_params_resume(self, async_client: AsyncOzAPI) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `schedule_id` but received ''"): await async_client.agent.schedules.with_raw_response.resume( "", diff --git a/tests/api_resources/test_agent.py b/tests/api_resources/test_agent.py index 8a53617..bbe226c 100644 --- a/tests/api_resources/test_agent.py +++ b/tests/api_resources/test_agent.py @@ -8,8 +8,8 @@ import pytest from tests.utils import assert_matches_type -from warp_agent_sdk import WarpAPI, AsyncWarpAPI -from warp_agent_sdk.types import ( +from oz_agent_sdk import OzAPI, AsyncOzAPI +from oz_agent_sdk.types import ( AgentRunResponse, AgentListResponse, ) @@ -22,13 +22,13 @@ class TestAgent: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_method_list(self, client: WarpAPI) -> None: + def test_method_list(self, client: OzAPI) -> None: agent = client.agent.list() assert_matches_type(AgentListResponse, agent, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_method_list_with_all_params(self, client: WarpAPI) -> None: + def test_method_list_with_all_params(self, client: OzAPI) -> None: agent = client.agent.list( refresh=True, repo="repo", @@ -38,7 +38,7 @@ def test_method_list_with_all_params(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_raw_response_list(self, client: WarpAPI) -> None: + def test_raw_response_list(self, client: OzAPI) -> None: response = client.agent.with_raw_response.list() assert response.is_closed is True @@ -48,7 +48,7 @@ def test_raw_response_list(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_streaming_response_list(self, client: WarpAPI) -> None: + def test_streaming_response_list(self, client: OzAPI) -> None: with client.agent.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -60,13 +60,13 @@ def test_streaming_response_list(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_method_run(self, client: WarpAPI) -> None: + def test_method_run(self, client: OzAPI) -> None: agent = client.agent.run() assert_matches_type(AgentRunResponse, agent, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_method_run_with_all_params(self, client: WarpAPI) -> None: + def test_method_run_with_all_params(self, client: OzAPI) -> None: agent = client.agent.run( config={ "base_prompt": "base_prompt", @@ -103,7 +103,7 @@ def test_method_run_with_all_params(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_raw_response_run(self, client: WarpAPI) -> None: + def test_raw_response_run(self, client: OzAPI) -> None: response = client.agent.with_raw_response.run() assert response.is_closed is True @@ -113,7 +113,7 @@ def test_raw_response_run(self, client: WarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - def test_streaming_response_run(self, client: WarpAPI) -> None: + def test_streaming_response_run(self, client: OzAPI) -> None: with client.agent.with_streaming_response.run() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -131,13 +131,13 @@ class TestAsyncAgent: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_method_list(self, async_client: AsyncWarpAPI) -> None: + async def test_method_list(self, async_client: AsyncOzAPI) -> None: agent = await async_client.agent.list() assert_matches_type(AgentListResponse, agent, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncWarpAPI) -> None: + async def test_method_list_with_all_params(self, async_client: AsyncOzAPI) -> None: agent = await async_client.agent.list( refresh=True, repo="repo", @@ -147,7 +147,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncWarpAPI) -> @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_raw_response_list(self, async_client: AsyncWarpAPI) -> None: + async def test_raw_response_list(self, async_client: AsyncOzAPI) -> None: response = await async_client.agent.with_raw_response.list() assert response.is_closed is True @@ -157,7 +157,7 @@ async def test_raw_response_list(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_streaming_response_list(self, async_client: AsyncWarpAPI) -> None: + async def test_streaming_response_list(self, async_client: AsyncOzAPI) -> None: async with async_client.agent.with_streaming_response.list() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -169,13 +169,13 @@ async def test_streaming_response_list(self, async_client: AsyncWarpAPI) -> None @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_method_run(self, async_client: AsyncWarpAPI) -> None: + async def test_method_run(self, async_client: AsyncOzAPI) -> None: agent = await async_client.agent.run() assert_matches_type(AgentRunResponse, agent, path=["response"]) @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_method_run_with_all_params(self, async_client: AsyncWarpAPI) -> None: + async def test_method_run_with_all_params(self, async_client: AsyncOzAPI) -> None: agent = await async_client.agent.run( config={ "base_prompt": "base_prompt", @@ -212,7 +212,7 @@ async def test_method_run_with_all_params(self, async_client: AsyncWarpAPI) -> N @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_raw_response_run(self, async_client: AsyncWarpAPI) -> None: + async def test_raw_response_run(self, async_client: AsyncOzAPI) -> None: response = await async_client.agent.with_raw_response.run() assert response.is_closed is True @@ -222,7 +222,7 @@ async def test_raw_response_run(self, async_client: AsyncWarpAPI) -> None: @pytest.mark.skip(reason="Prism tests are disabled") @parametrize - async def test_streaming_response_run(self, async_client: AsyncWarpAPI) -> None: + async def test_streaming_response_run(self, async_client: AsyncOzAPI) -> None: async with async_client.agent.with_streaming_response.run() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/conftest.py b/tests/conftest.py index 6241e82..5884465 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,15 +10,15 @@ import pytest from pytest_asyncio import is_async_test -from warp_agent_sdk import WarpAPI, AsyncWarpAPI, DefaultAioHttpClient -from warp_agent_sdk._utils import is_dict +from oz_agent_sdk import OzAPI, AsyncOzAPI, DefaultAioHttpClient +from oz_agent_sdk._utils import is_dict if TYPE_CHECKING: from _pytest.fixtures import FixtureRequest # pyright: ignore[reportPrivateImportUsage] pytest.register_assert_rewrite("tests.utils") -logging.getLogger("warp_agent_sdk").setLevel(logging.DEBUG) +logging.getLogger("oz_agent_sdk").setLevel(logging.DEBUG) # automatically add `pytest.mark.asyncio()` to all of our async tests @@ -49,17 +49,17 @@ def pytest_collection_modifyitems(items: list[pytest.Function]) -> None: @pytest.fixture(scope="session") -def client(request: FixtureRequest) -> Iterator[WarpAPI]: +def client(request: FixtureRequest) -> Iterator[OzAPI]: strict = getattr(request, "param", True) if not isinstance(strict, bool): raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") - with WarpAPI(base_url=base_url, api_key=api_key, _strict_response_validation=strict) as client: + with OzAPI(base_url=base_url, api_key=api_key, _strict_response_validation=strict) as client: yield client @pytest.fixture(scope="session") -async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncWarpAPI]: +async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncOzAPI]: param = getattr(request, "param", True) # defaults @@ -78,7 +78,7 @@ async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncWarpAPI]: else: raise TypeError(f"Unexpected fixture parameter type {type(param)}, expected bool or dict") - async with AsyncWarpAPI( + async with AsyncOzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=strict, http_client=http_client ) as client: yield client diff --git a/tests/test_client.py b/tests/test_client.py index 6713c2c..256da4b 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -19,12 +19,12 @@ from respx import MockRouter from pydantic import ValidationError -from warp_agent_sdk import WarpAPI, AsyncWarpAPI, APIResponseValidationError -from warp_agent_sdk._types import Omit -from warp_agent_sdk._utils import asyncify -from warp_agent_sdk._models import BaseModel, FinalRequestOptions -from warp_agent_sdk._exceptions import WarpAPIError, APIStatusError, APITimeoutError, APIResponseValidationError -from warp_agent_sdk._base_client import ( +from oz_agent_sdk import OzAPI, AsyncOzAPI, APIResponseValidationError +from oz_agent_sdk._types import Omit +from oz_agent_sdk._utils import asyncify +from oz_agent_sdk._models import BaseModel, FinalRequestOptions +from oz_agent_sdk._exceptions import OzAPIError, APIStatusError, APITimeoutError, APIResponseValidationError +from oz_agent_sdk._base_client import ( DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, @@ -103,7 +103,7 @@ async def _make_async_iterator(iterable: Iterable[T], counter: Optional[Counter] yield item -def _get_open_connections(client: WarpAPI | AsyncWarpAPI) -> int: +def _get_open_connections(client: OzAPI | AsyncOzAPI) -> int: transport = client._client._transport assert isinstance(transport, httpx.HTTPTransport) or isinstance(transport, httpx.AsyncHTTPTransport) @@ -111,9 +111,9 @@ def _get_open_connections(client: WarpAPI | AsyncWarpAPI) -> int: return len(pool._requests) -class TestWarpAPI: +class TestOzAPI: @pytest.mark.respx(base_url=base_url) - def test_raw_response(self, respx_mock: MockRouter, client: WarpAPI) -> None: + def test_raw_response(self, respx_mock: MockRouter, client: OzAPI) -> None: respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) response = client.post("/foo", cast_to=httpx.Response) @@ -122,7 +122,7 @@ def test_raw_response(self, respx_mock: MockRouter, client: WarpAPI) -> None: assert response.json() == {"foo": "bar"} @pytest.mark.respx(base_url=base_url) - def test_raw_response_for_binary(self, respx_mock: MockRouter, client: WarpAPI) -> None: + def test_raw_response_for_binary(self, respx_mock: MockRouter, client: OzAPI) -> None: respx_mock.post("/foo").mock( return_value=httpx.Response(200, headers={"Content-Type": "application/binary"}, content='{"foo": "bar"}') ) @@ -132,7 +132,7 @@ def test_raw_response_for_binary(self, respx_mock: MockRouter, client: WarpAPI) assert isinstance(response, httpx.Response) assert response.json() == {"foo": "bar"} - def test_copy(self, client: WarpAPI) -> None: + def test_copy(self, client: OzAPI) -> None: copied = client.copy() assert id(copied) != id(client) @@ -140,7 +140,7 @@ def test_copy(self, client: WarpAPI) -> None: assert copied.api_key == "another My API Key" assert client.api_key == "My API Key" - def test_copy_default_options(self, client: WarpAPI) -> None: + def test_copy_default_options(self, client: OzAPI) -> None: # options that have a default are overridden correctly copied = client.copy(max_retries=7) assert copied.max_retries == 7 @@ -157,7 +157,7 @@ def test_copy_default_options(self, client: WarpAPI) -> None: assert isinstance(client.timeout, httpx.Timeout) def test_copy_default_headers(self) -> None: - client = WarpAPI( + client = OzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"} ) assert client.default_headers["X-Foo"] == "bar" @@ -192,7 +192,7 @@ def test_copy_default_headers(self) -> None: client.close() def test_copy_default_query(self) -> None: - client = WarpAPI( + client = OzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={"foo": "bar"} ) assert _get_params(client)["foo"] == "bar" @@ -229,7 +229,7 @@ def test_copy_default_query(self) -> None: client.close() - def test_copy_signature(self, client: WarpAPI) -> None: + def test_copy_signature(self, client: OzAPI) -> 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. @@ -246,7 +246,7 @@ def test_copy_signature(self, client: WarpAPI) -> None: assert copy_param is not None, f"copy() signature is missing the {name} param" @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12") - def test_copy_build_request(self, client: WarpAPI) -> None: + def test_copy_build_request(self, client: OzAPI) -> None: options = FinalRequestOptions(method="get", url="/foo") def build_request(options: FinalRequestOptions) -> None: @@ -286,10 +286,10 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic # to_raw_response_wrapper leaks through the @functools.wraps() decorator. # # removing the decorator fixes the leak for reasons we don't understand. - "warp_agent_sdk/_legacy_response.py", - "warp_agent_sdk/_response.py", + "oz_agent_sdk/_legacy_response.py", + "oz_agent_sdk/_response.py", # pydantic.BaseModel.model_dump || pydantic.BaseModel.dict leak memory for some reason. - "warp_agent_sdk/_compat.py", + "oz_agent_sdk/_compat.py", # Standard library leaks we don't care about. "/logging/__init__.py", ] @@ -308,7 +308,7 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic print(frame) raise AssertionError() - def test_request_timeout(self, client: WarpAPI) -> None: + def test_request_timeout(self, client: OzAPI) -> None: request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT @@ -318,7 +318,7 @@ def test_request_timeout(self, client: WarpAPI) -> None: assert timeout == httpx.Timeout(100.0) def test_client_timeout_option(self) -> None: - client = WarpAPI(base_url=base_url, api_key=api_key, _strict_response_validation=True, timeout=httpx.Timeout(0)) + client = OzAPI(base_url=base_url, api_key=api_key, _strict_response_validation=True, timeout=httpx.Timeout(0)) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -329,7 +329,7 @@ def test_client_timeout_option(self) -> None: 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: - client = WarpAPI( + client = OzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client ) @@ -341,7 +341,7 @@ def test_http_client_timeout_option(self) -> None: # no timeout given to the httpx client should not use the httpx default with httpx.Client() as http_client: - client = WarpAPI( + client = OzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client ) @@ -353,7 +353,7 @@ def test_http_client_timeout_option(self) -> None: # explicitly passing the default timeout currently results in it being ignored with httpx.Client(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: - client = WarpAPI( + client = OzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client ) @@ -366,7 +366,7 @@ def test_http_client_timeout_option(self) -> None: async def test_invalid_http_client(self) -> None: with pytest.raises(TypeError, match="Invalid `http_client` arg"): async with httpx.AsyncClient() as http_client: - WarpAPI( + OzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, @@ -374,14 +374,14 @@ async def test_invalid_http_client(self) -> None: ) def test_default_headers_option(self) -> None: - test_client = WarpAPI( + test_client = OzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"} ) 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" - test_client2 = WarpAPI( + test_client2 = OzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, @@ -398,17 +398,17 @@ def test_default_headers_option(self) -> None: test_client2.close() def test_validate_headers(self) -> None: - client = WarpAPI(base_url=base_url, api_key=api_key, _strict_response_validation=True) + client = OzAPI(base_url=base_url, api_key=api_key, _strict_response_validation=True) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("Authorization") == f"Bearer {api_key}" - with pytest.raises(WarpAPIError): + with pytest.raises(OzAPIError): with update_env(**{"WARP_API_KEY": Omit()}): - client2 = WarpAPI(base_url=base_url, api_key=None, _strict_response_validation=True) + client2 = OzAPI(base_url=base_url, api_key=None, _strict_response_validation=True) _ = client2 def test_default_query_option(self) -> None: - client = WarpAPI( + client = OzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={"query_param": "bar"} ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -427,7 +427,7 @@ def test_default_query_option(self) -> None: client.close() - def test_request_extra_json(self, client: WarpAPI) -> None: + def test_request_extra_json(self, client: OzAPI) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -461,7 +461,7 @@ def test_request_extra_json(self, client: WarpAPI) -> None: data = json.loads(request.content.decode("utf-8")) assert data == {"foo": "bar", "baz": None} - def test_request_extra_headers(self, client: WarpAPI) -> None: + def test_request_extra_headers(self, client: OzAPI) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -483,7 +483,7 @@ def test_request_extra_headers(self, client: WarpAPI) -> None: ) assert request.headers.get("X-Bar") == "false" - def test_request_extra_query(self, client: WarpAPI) -> None: + def test_request_extra_query(self, client: OzAPI) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -524,7 +524,7 @@ def test_request_extra_query(self, client: WarpAPI) -> None: params = dict(request.url.params) assert params == {"foo": "2"} - def test_multipart_repeating_array(self, client: WarpAPI) -> None: + def test_multipart_repeating_array(self, client: OzAPI) -> None: request = client._build_request( FinalRequestOptions.construct( method="post", @@ -554,7 +554,7 @@ def test_multipart_repeating_array(self, client: WarpAPI) -> None: ] @pytest.mark.respx(base_url=base_url) - def test_binary_content_upload(self, respx_mock: MockRouter, client: WarpAPI) -> None: + def test_binary_content_upload(self, respx_mock: MockRouter, client: OzAPI) -> None: respx_mock.post("/upload").mock(side_effect=mirror_request_content) file_content = b"Hello, this is a test file." @@ -579,7 +579,7 @@ 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 WarpAPI( + with OzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, @@ -598,7 +598,7 @@ def mock_handler(request: httpx.Request) -> httpx.Response: 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: WarpAPI) -> None: + def test_binary_content_upload_with_body_is_deprecated(self, respx_mock: MockRouter, client: OzAPI) -> None: respx_mock.post("/upload").mock(side_effect=mirror_request_content) file_content = b"Hello, this is a test file." @@ -618,7 +618,7 @@ def test_binary_content_upload_with_body_is_deprecated(self, respx_mock: MockRou assert response.content == file_content @pytest.mark.respx(base_url=base_url) - def test_basic_union_response(self, respx_mock: MockRouter, client: WarpAPI) -> None: + def test_basic_union_response(self, respx_mock: MockRouter, client: OzAPI) -> None: class Model1(BaseModel): name: str @@ -632,7 +632,7 @@ class Model2(BaseModel): assert response.foo == "bar" @pytest.mark.respx(base_url=base_url) - def test_union_response_different_types(self, respx_mock: MockRouter, client: WarpAPI) -> None: + def test_union_response_different_types(self, respx_mock: MockRouter, client: OzAPI) -> None: """Union of objects with the same field name using a different type""" class Model1(BaseModel): @@ -654,7 +654,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: WarpAPI) -> None: + def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter, client: OzAPI) -> None: """ Response that sets Content-Type to something other than application/json but returns json data """ @@ -675,7 +675,7 @@ class Model(BaseModel): assert response.foo == 2 def test_base_url_setter(self) -> None: - client = WarpAPI(base_url="https://example.com/from_init", api_key=api_key, _strict_response_validation=True) + client = OzAPI(base_url="https://example.com/from_init", api_key=api_key, _strict_response_validation=True) assert client.base_url == "https://example.com/from_init/" client.base_url = "https://example.com/from_setter" # type: ignore[assignment] @@ -685,15 +685,15 @@ def test_base_url_setter(self) -> None: client.close() def test_base_url_env(self) -> None: - with update_env(WARP_API_BASE_URL="http://localhost:5000/from/env"): - client = WarpAPI(api_key=api_key, _strict_response_validation=True) + with update_env(OZ_API_BASE_URL="http://localhost:5000/from/env"): + client = OzAPI(api_key=api_key, _strict_response_validation=True) assert client.base_url == "http://localhost:5000/from/env/" @pytest.mark.parametrize( "client", [ - WarpAPI(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True), - WarpAPI( + OzAPI(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True), + OzAPI( base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True, @@ -702,7 +702,7 @@ def test_base_url_env(self) -> None: ], ids=["standard", "custom http client"], ) - def test_base_url_trailing_slash(self, client: WarpAPI) -> None: + def test_base_url_trailing_slash(self, client: OzAPI) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -716,8 +716,8 @@ def test_base_url_trailing_slash(self, client: WarpAPI) -> None: @pytest.mark.parametrize( "client", [ - WarpAPI(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True), - WarpAPI( + OzAPI(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True), + OzAPI( base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True, @@ -726,7 +726,7 @@ def test_base_url_trailing_slash(self, client: WarpAPI) -> None: ], ids=["standard", "custom http client"], ) - def test_base_url_no_trailing_slash(self, client: WarpAPI) -> None: + def test_base_url_no_trailing_slash(self, client: OzAPI) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -740,8 +740,8 @@ def test_base_url_no_trailing_slash(self, client: WarpAPI) -> None: @pytest.mark.parametrize( "client", [ - WarpAPI(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True), - WarpAPI( + OzAPI(base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True), + OzAPI( base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True, @@ -750,7 +750,7 @@ def test_base_url_no_trailing_slash(self, client: WarpAPI) -> None: ], ids=["standard", "custom http client"], ) - def test_absolute_request_url(self, client: WarpAPI) -> None: + def test_absolute_request_url(self, client: OzAPI) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -762,7 +762,7 @@ def test_absolute_request_url(self, client: WarpAPI) -> None: client.close() def test_copied_client_does_not_close_http(self) -> None: - test_client = WarpAPI(base_url=base_url, api_key=api_key, _strict_response_validation=True) + test_client = OzAPI(base_url=base_url, api_key=api_key, _strict_response_validation=True) assert not test_client.is_closed() copied = test_client.copy() @@ -773,7 +773,7 @@ def test_copied_client_does_not_close_http(self) -> None: assert not test_client.is_closed() def test_client_context_manager(self) -> None: - test_client = WarpAPI(base_url=base_url, api_key=api_key, _strict_response_validation=True) + test_client = OzAPI(base_url=base_url, api_key=api_key, _strict_response_validation=True) with test_client as c2: assert c2 is test_client assert not c2.is_closed() @@ -781,7 +781,7 @@ 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: WarpAPI) -> None: + def test_client_response_validation_error(self, respx_mock: MockRouter, client: OzAPI) -> None: class Model(BaseModel): foo: str @@ -794,7 +794,7 @@ class Model(BaseModel): def test_client_max_retries_validation(self) -> None: with pytest.raises(TypeError, match=r"max_retries cannot be None"): - WarpAPI(base_url=base_url, api_key=api_key, _strict_response_validation=True, max_retries=cast(Any, None)) + OzAPI(base_url=base_url, api_key=api_key, _strict_response_validation=True, max_retries=cast(Any, None)) @pytest.mark.respx(base_url=base_url) def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None: @@ -803,12 +803,12 @@ class Model(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format")) - strict_client = WarpAPI(base_url=base_url, api_key=api_key, _strict_response_validation=True) + strict_client = OzAPI(base_url=base_url, api_key=api_key, _strict_response_validation=True) with pytest.raises(APIResponseValidationError): strict_client.get("/foo", cast_to=Model) - non_strict_client = WarpAPI(base_url=base_url, api_key=api_key, _strict_response_validation=False) + non_strict_client = OzAPI(base_url=base_url, api_key=api_key, _strict_response_validation=False) response = non_strict_client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] @@ -839,16 +839,16 @@ 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, client: WarpAPI + self, remaining_retries: int, retry_after: str, timeout: float, client: OzAPI ) -> None: headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) calculated = client._calculate_retry_timeout(remaining_retries, options, headers) assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] - @mock.patch("warp_agent_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("oz_agent_sdk._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: WarpAPI) -> None: + def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, client: OzAPI) -> None: respx_mock.post("/agent/run").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): @@ -856,9 +856,9 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, clien assert _get_open_connections(client) == 0 - @mock.patch("warp_agent_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("oz_agent_sdk._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: WarpAPI) -> None: + def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client: OzAPI) -> None: respx_mock.post("/agent/run").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): @@ -866,12 +866,12 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client assert _get_open_connections(client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) - @mock.patch("warp_agent_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("oz_agent_sdk._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( self, - client: WarpAPI, + client: OzAPI, failures_before_success: int, failure_mode: Literal["status", "exception"], respx_mock: MockRouter, @@ -897,11 +897,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: 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("warp_agent_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("oz_agent_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - def test_omit_retry_count_header( - self, client: WarpAPI, failures_before_success: int, respx_mock: MockRouter - ) -> None: + def test_omit_retry_count_header(self, client: OzAPI, failures_before_success: int, respx_mock: MockRouter) -> None: client = client.with_options(max_retries=4) nb_retries = 0 @@ -920,10 +918,10 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) - @mock.patch("warp_agent_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("oz_agent_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) def test_overwrite_retry_count_header( - self, client: WarpAPI, failures_before_success: int, respx_mock: MockRouter + self, client: OzAPI, failures_before_success: int, respx_mock: MockRouter ) -> None: client = client.with_options(max_retries=4) @@ -965,7 +963,7 @@ def test_default_client_creation(self) -> None: ) @pytest.mark.respx(base_url=base_url) - def test_follow_redirects(self, respx_mock: MockRouter, client: WarpAPI) -> None: + def test_follow_redirects(self, respx_mock: MockRouter, client: OzAPI) -> 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"}) @@ -977,7 +975,7 @@ def test_follow_redirects(self, respx_mock: MockRouter, client: WarpAPI) -> None assert response.json() == {"status": "ok"} @pytest.mark.respx(base_url=base_url) - def test_follow_redirects_disabled(self, respx_mock: MockRouter, client: WarpAPI) -> None: + def test_follow_redirects_disabled(self, respx_mock: MockRouter, client: OzAPI) -> 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"}) @@ -990,9 +988,9 @@ def test_follow_redirects_disabled(self, respx_mock: MockRouter, client: WarpAPI assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected" -class TestAsyncWarpAPI: +class TestAsyncOzAPI: @pytest.mark.respx(base_url=base_url) - async def test_raw_response(self, respx_mock: MockRouter, async_client: AsyncWarpAPI) -> None: + async def test_raw_response(self, respx_mock: MockRouter, async_client: AsyncOzAPI) -> None: respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) response = await async_client.post("/foo", cast_to=httpx.Response) @@ -1001,7 +999,7 @@ async def test_raw_response(self, respx_mock: MockRouter, async_client: AsyncWar 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: AsyncWarpAPI) -> None: + async def test_raw_response_for_binary(self, respx_mock: MockRouter, async_client: AsyncOzAPI) -> None: respx_mock.post("/foo").mock( return_value=httpx.Response(200, headers={"Content-Type": "application/binary"}, content='{"foo": "bar"}') ) @@ -1011,7 +1009,7 @@ async def test_raw_response_for_binary(self, respx_mock: MockRouter, async_clien assert isinstance(response, httpx.Response) assert response.json() == {"foo": "bar"} - def test_copy(self, async_client: AsyncWarpAPI) -> None: + def test_copy(self, async_client: AsyncOzAPI) -> None: copied = async_client.copy() assert id(copied) != id(async_client) @@ -1019,7 +1017,7 @@ def test_copy(self, async_client: AsyncWarpAPI) -> None: assert copied.api_key == "another My API Key" assert async_client.api_key == "My API Key" - def test_copy_default_options(self, async_client: AsyncWarpAPI) -> None: + def test_copy_default_options(self, async_client: AsyncOzAPI) -> None: # options that have a default are overridden correctly copied = async_client.copy(max_retries=7) assert copied.max_retries == 7 @@ -1036,7 +1034,7 @@ def test_copy_default_options(self, async_client: AsyncWarpAPI) -> None: assert isinstance(async_client.timeout, httpx.Timeout) async def test_copy_default_headers(self) -> None: - client = AsyncWarpAPI( + client = AsyncOzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"} ) assert client.default_headers["X-Foo"] == "bar" @@ -1071,7 +1069,7 @@ async def test_copy_default_headers(self) -> None: await client.close() async def test_copy_default_query(self) -> None: - client = AsyncWarpAPI( + client = AsyncOzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={"foo": "bar"} ) assert _get_params(client)["foo"] == "bar" @@ -1108,7 +1106,7 @@ async def test_copy_default_query(self) -> None: await client.close() - def test_copy_signature(self, async_client: AsyncWarpAPI) -> None: + def test_copy_signature(self, async_client: AsyncOzAPI) -> 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. @@ -1125,7 +1123,7 @@ def test_copy_signature(self, async_client: AsyncWarpAPI) -> None: assert copy_param is not None, f"copy() signature is missing the {name} param" @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12") - def test_copy_build_request(self, async_client: AsyncWarpAPI) -> None: + def test_copy_build_request(self, async_client: AsyncOzAPI) -> None: options = FinalRequestOptions(method="get", url="/foo") def build_request(options: FinalRequestOptions) -> None: @@ -1165,10 +1163,10 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic # to_raw_response_wrapper leaks through the @functools.wraps() decorator. # # removing the decorator fixes the leak for reasons we don't understand. - "warp_agent_sdk/_legacy_response.py", - "warp_agent_sdk/_response.py", + "oz_agent_sdk/_legacy_response.py", + "oz_agent_sdk/_response.py", # pydantic.BaseModel.model_dump || pydantic.BaseModel.dict leak memory for some reason. - "warp_agent_sdk/_compat.py", + "oz_agent_sdk/_compat.py", # Standard library leaks we don't care about. "/logging/__init__.py", ] @@ -1187,7 +1185,7 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic print(frame) raise AssertionError() - async def test_request_timeout(self, async_client: AsyncWarpAPI) -> None: + async def test_request_timeout(self, async_client: AsyncOzAPI) -> None: request = async_client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT @@ -1199,7 +1197,7 @@ async def test_request_timeout(self, async_client: AsyncWarpAPI) -> None: assert timeout == httpx.Timeout(100.0) async def test_client_timeout_option(self) -> None: - client = AsyncWarpAPI( + client = AsyncOzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, timeout=httpx.Timeout(0) ) @@ -1212,7 +1210,7 @@ async def test_client_timeout_option(self) -> None: 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: - client = AsyncWarpAPI( + client = AsyncOzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client ) @@ -1224,7 +1222,7 @@ async def test_http_client_timeout_option(self) -> None: # no timeout given to the httpx client should not use the httpx default async with httpx.AsyncClient() as http_client: - client = AsyncWarpAPI( + client = AsyncOzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client ) @@ -1236,7 +1234,7 @@ async def test_http_client_timeout_option(self) -> None: # explicitly passing the default timeout currently results in it being ignored async with httpx.AsyncClient(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: - client = AsyncWarpAPI( + client = AsyncOzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, http_client=http_client ) @@ -1249,7 +1247,7 @@ async def test_http_client_timeout_option(self) -> None: def test_invalid_http_client(self) -> None: with pytest.raises(TypeError, match="Invalid `http_client` arg"): with httpx.Client() as http_client: - AsyncWarpAPI( + AsyncOzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, @@ -1257,14 +1255,14 @@ def test_invalid_http_client(self) -> None: ) async def test_default_headers_option(self) -> None: - test_client = AsyncWarpAPI( + test_client = AsyncOzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, default_headers={"X-Foo": "bar"} ) 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" - test_client2 = AsyncWarpAPI( + test_client2 = AsyncOzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, @@ -1281,17 +1279,17 @@ async def test_default_headers_option(self) -> None: await test_client2.close() def test_validate_headers(self) -> None: - client = AsyncWarpAPI(base_url=base_url, api_key=api_key, _strict_response_validation=True) + client = AsyncOzAPI(base_url=base_url, api_key=api_key, _strict_response_validation=True) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("Authorization") == f"Bearer {api_key}" - with pytest.raises(WarpAPIError): + with pytest.raises(OzAPIError): with update_env(**{"WARP_API_KEY": Omit()}): - client2 = AsyncWarpAPI(base_url=base_url, api_key=None, _strict_response_validation=True) + client2 = AsyncOzAPI(base_url=base_url, api_key=None, _strict_response_validation=True) _ = client2 async def test_default_query_option(self) -> None: - client = AsyncWarpAPI( + client = AsyncOzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, default_query={"query_param": "bar"} ) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -1310,7 +1308,7 @@ async def test_default_query_option(self) -> None: await client.close() - def test_request_extra_json(self, client: WarpAPI) -> None: + def test_request_extra_json(self, client: OzAPI) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1344,7 +1342,7 @@ def test_request_extra_json(self, client: WarpAPI) -> None: data = json.loads(request.content.decode("utf-8")) assert data == {"foo": "bar", "baz": None} - def test_request_extra_headers(self, client: WarpAPI) -> None: + def test_request_extra_headers(self, client: OzAPI) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1366,7 +1364,7 @@ def test_request_extra_headers(self, client: WarpAPI) -> None: ) assert request.headers.get("X-Bar") == "false" - def test_request_extra_query(self, client: WarpAPI) -> None: + def test_request_extra_query(self, client: OzAPI) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1407,7 +1405,7 @@ def test_request_extra_query(self, client: WarpAPI) -> None: params = dict(request.url.params) assert params == {"foo": "2"} - def test_multipart_repeating_array(self, async_client: AsyncWarpAPI) -> None: + def test_multipart_repeating_array(self, async_client: AsyncOzAPI) -> None: request = async_client._build_request( FinalRequestOptions.construct( method="post", @@ -1437,7 +1435,7 @@ def test_multipart_repeating_array(self, async_client: AsyncWarpAPI) -> None: ] @pytest.mark.respx(base_url=base_url) - async def test_binary_content_upload(self, respx_mock: MockRouter, async_client: AsyncWarpAPI) -> None: + async def test_binary_content_upload(self, respx_mock: MockRouter, async_client: AsyncOzAPI) -> None: respx_mock.post("/upload").mock(side_effect=mirror_request_content) file_content = b"Hello, this is a test file." @@ -1462,7 +1460,7 @@ 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 AsyncWarpAPI( + async with AsyncOzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, @@ -1482,7 +1480,7 @@ async def mock_handler(request: httpx.Request) -> httpx.Response: @pytest.mark.respx(base_url=base_url) async def test_binary_content_upload_with_body_is_deprecated( - self, respx_mock: MockRouter, async_client: AsyncWarpAPI + self, respx_mock: MockRouter, async_client: AsyncOzAPI ) -> None: respx_mock.post("/upload").mock(side_effect=mirror_request_content) @@ -1503,7 +1501,7 @@ async def test_binary_content_upload_with_body_is_deprecated( assert response.content == file_content @pytest.mark.respx(base_url=base_url) - async def test_basic_union_response(self, respx_mock: MockRouter, async_client: AsyncWarpAPI) -> None: + async def test_basic_union_response(self, respx_mock: MockRouter, async_client: AsyncOzAPI) -> None: class Model1(BaseModel): name: str @@ -1517,7 +1515,7 @@ class Model2(BaseModel): assert response.foo == "bar" @pytest.mark.respx(base_url=base_url) - async def test_union_response_different_types(self, respx_mock: MockRouter, async_client: AsyncWarpAPI) -> None: + async def test_union_response_different_types(self, respx_mock: MockRouter, async_client: AsyncOzAPI) -> None: """Union of objects with the same field name using a different type""" class Model1(BaseModel): @@ -1540,7 +1538,7 @@ class Model2(BaseModel): @pytest.mark.respx(base_url=base_url) async def test_non_application_json_content_type_for_json_data( - self, respx_mock: MockRouter, async_client: AsyncWarpAPI + self, respx_mock: MockRouter, async_client: AsyncOzAPI ) -> None: """ Response that sets Content-Type to something other than application/json but returns json data @@ -1562,9 +1560,7 @@ class Model(BaseModel): assert response.foo == 2 async def test_base_url_setter(self) -> None: - client = AsyncWarpAPI( - base_url="https://example.com/from_init", api_key=api_key, _strict_response_validation=True - ) + client = AsyncOzAPI(base_url="https://example.com/from_init", api_key=api_key, _strict_response_validation=True) assert client.base_url == "https://example.com/from_init/" client.base_url = "https://example.com/from_setter" # type: ignore[assignment] @@ -1574,17 +1570,17 @@ async def test_base_url_setter(self) -> None: await client.close() async def test_base_url_env(self) -> None: - with update_env(WARP_API_BASE_URL="http://localhost:5000/from/env"): - client = AsyncWarpAPI(api_key=api_key, _strict_response_validation=True) + with update_env(OZ_API_BASE_URL="http://localhost:5000/from/env"): + client = AsyncOzAPI(api_key=api_key, _strict_response_validation=True) assert client.base_url == "http://localhost:5000/from/env/" @pytest.mark.parametrize( "client", [ - AsyncWarpAPI( + AsyncOzAPI( base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True ), - AsyncWarpAPI( + AsyncOzAPI( base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True, @@ -1593,7 +1589,7 @@ async def test_base_url_env(self) -> None: ], ids=["standard", "custom http client"], ) - async def test_base_url_trailing_slash(self, client: AsyncWarpAPI) -> None: + async def test_base_url_trailing_slash(self, client: AsyncOzAPI) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1607,10 +1603,10 @@ async def test_base_url_trailing_slash(self, client: AsyncWarpAPI) -> None: @pytest.mark.parametrize( "client", [ - AsyncWarpAPI( + AsyncOzAPI( base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True ), - AsyncWarpAPI( + AsyncOzAPI( base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True, @@ -1619,7 +1615,7 @@ async def test_base_url_trailing_slash(self, client: AsyncWarpAPI) -> None: ], ids=["standard", "custom http client"], ) - async def test_base_url_no_trailing_slash(self, client: AsyncWarpAPI) -> None: + async def test_base_url_no_trailing_slash(self, client: AsyncOzAPI) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1633,10 +1629,10 @@ async def test_base_url_no_trailing_slash(self, client: AsyncWarpAPI) -> None: @pytest.mark.parametrize( "client", [ - AsyncWarpAPI( + AsyncOzAPI( base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True ), - AsyncWarpAPI( + AsyncOzAPI( base_url="http://localhost:5000/custom/path/", api_key=api_key, _strict_response_validation=True, @@ -1645,7 +1641,7 @@ async def test_base_url_no_trailing_slash(self, client: AsyncWarpAPI) -> None: ], ids=["standard", "custom http client"], ) - async def test_absolute_request_url(self, client: AsyncWarpAPI) -> None: + async def test_absolute_request_url(self, client: AsyncOzAPI) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1657,7 +1653,7 @@ async def test_absolute_request_url(self, client: AsyncWarpAPI) -> None: await client.close() async def test_copied_client_does_not_close_http(self) -> None: - test_client = AsyncWarpAPI(base_url=base_url, api_key=api_key, _strict_response_validation=True) + test_client = AsyncOzAPI(base_url=base_url, api_key=api_key, _strict_response_validation=True) assert not test_client.is_closed() copied = test_client.copy() @@ -1669,7 +1665,7 @@ async def test_copied_client_does_not_close_http(self) -> None: assert not test_client.is_closed() async def test_client_context_manager(self) -> None: - test_client = AsyncWarpAPI(base_url=base_url, api_key=api_key, _strict_response_validation=True) + test_client = AsyncOzAPI(base_url=base_url, api_key=api_key, _strict_response_validation=True) async with test_client as c2: assert c2 is test_client assert not c2.is_closed() @@ -1677,7 +1673,7 @@ 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: AsyncWarpAPI) -> None: + async def test_client_response_validation_error(self, respx_mock: MockRouter, async_client: AsyncOzAPI) -> None: class Model(BaseModel): foo: str @@ -1690,7 +1686,7 @@ class Model(BaseModel): async def test_client_max_retries_validation(self) -> None: with pytest.raises(TypeError, match=r"max_retries cannot be None"): - AsyncWarpAPI( + AsyncOzAPI( base_url=base_url, api_key=api_key, _strict_response_validation=True, max_retries=cast(Any, None) ) @@ -1701,12 +1697,12 @@ class Model(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format")) - strict_client = AsyncWarpAPI(base_url=base_url, api_key=api_key, _strict_response_validation=True) + strict_client = AsyncOzAPI(base_url=base_url, api_key=api_key, _strict_response_validation=True) with pytest.raises(APIResponseValidationError): await strict_client.get("/foo", cast_to=Model) - non_strict_client = AsyncWarpAPI(base_url=base_url, api_key=api_key, _strict_response_validation=False) + non_strict_client = AsyncOzAPI(base_url=base_url, api_key=api_key, _strict_response_validation=False) response = await non_strict_client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] @@ -1737,18 +1733,16 @@ class Model(BaseModel): ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) async def test_parse_retry_after_header( - self, remaining_retries: int, retry_after: str, timeout: float, async_client: AsyncWarpAPI + self, remaining_retries: int, retry_after: str, timeout: float, async_client: AsyncOzAPI ) -> None: 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) assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] - @mock.patch("warp_agent_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("oz_agent_sdk._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: AsyncWarpAPI - ) -> None: + async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, async_client: AsyncOzAPI) -> None: respx_mock.post("/agent/run").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): @@ -1756,9 +1750,9 @@ async def test_retrying_timeout_errors_doesnt_leak( assert _get_open_connections(async_client) == 0 - @mock.patch("warp_agent_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("oz_agent_sdk._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: AsyncWarpAPI) -> None: + async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, async_client: AsyncOzAPI) -> None: respx_mock.post("/agent/run").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): @@ -1766,12 +1760,12 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, assert _get_open_connections(async_client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) - @mock.patch("warp_agent_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("oz_agent_sdk._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( self, - async_client: AsyncWarpAPI, + async_client: AsyncOzAPI, failures_before_success: int, failure_mode: Literal["status", "exception"], respx_mock: MockRouter, @@ -1797,10 +1791,10 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: 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("warp_agent_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("oz_agent_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) async def test_omit_retry_count_header( - self, async_client: AsyncWarpAPI, failures_before_success: int, respx_mock: MockRouter + self, async_client: AsyncOzAPI, failures_before_success: int, respx_mock: MockRouter ) -> None: client = async_client.with_options(max_retries=4) @@ -1820,10 +1814,10 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) - @mock.patch("warp_agent_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("oz_agent_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) async def test_overwrite_retry_count_header( - self, async_client: AsyncWarpAPI, failures_before_success: int, respx_mock: MockRouter + self, async_client: AsyncOzAPI, failures_before_success: int, respx_mock: MockRouter ) -> None: client = async_client.with_options(max_retries=4) @@ -1869,7 +1863,7 @@ 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: AsyncWarpAPI) -> None: + async def test_follow_redirects(self, respx_mock: MockRouter, async_client: AsyncOzAPI) -> 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"}) @@ -1881,7 +1875,7 @@ async def test_follow_redirects(self, respx_mock: MockRouter, async_client: Asyn assert response.json() == {"status": "ok"} @pytest.mark.respx(base_url=base_url) - async def test_follow_redirects_disabled(self, respx_mock: MockRouter, async_client: AsyncWarpAPI) -> None: + async def test_follow_redirects_disabled(self, respx_mock: MockRouter, async_client: AsyncOzAPI) -> 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"}) diff --git a/tests/test_deepcopy.py b/tests/test_deepcopy.py index dc69518..009b9b9 100644 --- a/tests/test_deepcopy.py +++ b/tests/test_deepcopy.py @@ -1,4 +1,4 @@ -from warp_agent_sdk._utils import deepcopy_minimal +from oz_agent_sdk._utils import deepcopy_minimal def assert_different_identities(obj1: object, obj2: object) -> None: diff --git a/tests/test_extract_files.py b/tests/test_extract_files.py index 12e42e0..95b71bd 100644 --- a/tests/test_extract_files.py +++ b/tests/test_extract_files.py @@ -4,8 +4,8 @@ import pytest -from warp_agent_sdk._types import FileTypes -from warp_agent_sdk._utils import extract_files +from oz_agent_sdk._types import FileTypes +from oz_agent_sdk._utils import extract_files def test_removes_files_from_input() -> None: diff --git a/tests/test_files.py b/tests/test_files.py index 9b9c446..a1255cc 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -4,7 +4,7 @@ import pytest from dirty_equals import IsDict, IsList, IsBytes, IsTuple -from warp_agent_sdk._files import to_httpx_files, async_to_httpx_files +from oz_agent_sdk._files import to_httpx_files, async_to_httpx_files readme_path = Path(__file__).parent.parent.joinpath("README.md") diff --git a/tests/test_models.py b/tests/test_models.py index d191086..c0b225d 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -7,9 +7,9 @@ import pydantic from pydantic import Field -from warp_agent_sdk._utils import PropertyInfo -from warp_agent_sdk._compat import PYDANTIC_V1, parse_obj, model_dump, model_json -from warp_agent_sdk._models import DISCRIMINATOR_CACHE, BaseModel, construct_type +from oz_agent_sdk._utils import PropertyInfo +from oz_agent_sdk._compat import PYDANTIC_V1, parse_obj, model_dump, model_json +from oz_agent_sdk._models import DISCRIMINATOR_CACHE, BaseModel, construct_type class BasicModel(BaseModel): diff --git a/tests/test_qs.py b/tests/test_qs.py index 2d4f80f..23508d8 100644 --- a/tests/test_qs.py +++ b/tests/test_qs.py @@ -4,7 +4,7 @@ import pytest -from warp_agent_sdk._qs import Querystring, stringify +from oz_agent_sdk._qs import Querystring, stringify def test_empty() -> None: diff --git a/tests/test_required_args.py b/tests/test_required_args.py index ac42a06..78ff0bf 100644 --- a/tests/test_required_args.py +++ b/tests/test_required_args.py @@ -2,7 +2,7 @@ import pytest -from warp_agent_sdk._utils import required_args +from oz_agent_sdk._utils import required_args def test_too_many_positional_params() -> None: diff --git a/tests/test_response.py b/tests/test_response.py index 4c4d81b..b81481c 100644 --- a/tests/test_response.py +++ b/tests/test_response.py @@ -6,8 +6,8 @@ import pytest import pydantic -from warp_agent_sdk import WarpAPI, BaseModel, AsyncWarpAPI -from warp_agent_sdk._response import ( +from oz_agent_sdk import OzAPI, BaseModel, AsyncOzAPI +from oz_agent_sdk._response import ( APIResponse, BaseAPIResponse, AsyncAPIResponse, @@ -15,8 +15,8 @@ AsyncBinaryAPIResponse, extract_response_type, ) -from warp_agent_sdk._streaming import Stream -from warp_agent_sdk._base_client import FinalRequestOptions +from oz_agent_sdk._streaming import Stream +from oz_agent_sdk._base_client import FinalRequestOptions class ConcreteBaseAPIResponse(APIResponse[bytes]): ... @@ -37,7 +37,7 @@ def test_extract_response_type_direct_classes() -> None: def test_extract_response_type_direct_class_missing_type_arg() -> None: with pytest.raises( RuntimeError, - match="Expected type to have a type argument at index 0 but it did not", + match="Expected type to have a type argument at index 0 but it did not", ): extract_response_type(AsyncAPIResponse) @@ -56,7 +56,7 @@ def test_extract_response_type_binary_response() -> None: class PydanticModel(pydantic.BaseModel): ... -def test_response_parse_mismatched_basemodel(client: WarpAPI) -> None: +def test_response_parse_mismatched_basemodel(client: OzAPI) -> None: response = APIResponse( raw=httpx.Response(200, content=b"foo"), client=client, @@ -68,13 +68,13 @@ def test_response_parse_mismatched_basemodel(client: WarpAPI) -> None: with pytest.raises( TypeError, - match="Pydantic models must subclass our base model type, e.g. `from warp_agent_sdk import BaseModel`", + match="Pydantic models must subclass our base model type, e.g. `from oz_agent_sdk import BaseModel`", ): response.parse(to=PydanticModel) @pytest.mark.asyncio -async def test_async_response_parse_mismatched_basemodel(async_client: AsyncWarpAPI) -> None: +async def test_async_response_parse_mismatched_basemodel(async_client: AsyncOzAPI) -> None: response = AsyncAPIResponse( raw=httpx.Response(200, content=b"foo"), client=async_client, @@ -86,12 +86,12 @@ async def test_async_response_parse_mismatched_basemodel(async_client: AsyncWarp with pytest.raises( TypeError, - match="Pydantic models must subclass our base model type, e.g. `from warp_agent_sdk import BaseModel`", + match="Pydantic models must subclass our base model type, e.g. `from oz_agent_sdk import BaseModel`", ): await response.parse(to=PydanticModel) -def test_response_parse_custom_stream(client: WarpAPI) -> None: +def test_response_parse_custom_stream(client: OzAPI) -> None: response = APIResponse( raw=httpx.Response(200, content=b"foo"), client=client, @@ -106,7 +106,7 @@ def test_response_parse_custom_stream(client: WarpAPI) -> None: @pytest.mark.asyncio -async def test_async_response_parse_custom_stream(async_client: AsyncWarpAPI) -> None: +async def test_async_response_parse_custom_stream(async_client: AsyncOzAPI) -> None: response = AsyncAPIResponse( raw=httpx.Response(200, content=b"foo"), client=async_client, @@ -125,7 +125,7 @@ class CustomModel(BaseModel): bar: int -def test_response_parse_custom_model(client: WarpAPI) -> None: +def test_response_parse_custom_model(client: OzAPI) -> None: response = APIResponse( raw=httpx.Response(200, content=json.dumps({"foo": "hello!", "bar": 2})), client=client, @@ -141,7 +141,7 @@ def test_response_parse_custom_model(client: WarpAPI) -> None: @pytest.mark.asyncio -async def test_async_response_parse_custom_model(async_client: AsyncWarpAPI) -> None: +async def test_async_response_parse_custom_model(async_client: AsyncOzAPI) -> None: response = AsyncAPIResponse( raw=httpx.Response(200, content=json.dumps({"foo": "hello!", "bar": 2})), client=async_client, @@ -156,7 +156,7 @@ async def test_async_response_parse_custom_model(async_client: AsyncWarpAPI) -> assert obj.bar == 2 -def test_response_parse_annotated_type(client: WarpAPI) -> None: +def test_response_parse_annotated_type(client: OzAPI) -> None: response = APIResponse( raw=httpx.Response(200, content=json.dumps({"foo": "hello!", "bar": 2})), client=client, @@ -173,7 +173,7 @@ def test_response_parse_annotated_type(client: WarpAPI) -> None: assert obj.bar == 2 -async def test_async_response_parse_annotated_type(async_client: AsyncWarpAPI) -> None: +async def test_async_response_parse_annotated_type(async_client: AsyncOzAPI) -> None: response = AsyncAPIResponse( raw=httpx.Response(200, content=json.dumps({"foo": "hello!", "bar": 2})), client=async_client, @@ -201,7 +201,7 @@ async def test_async_response_parse_annotated_type(async_client: AsyncWarpAPI) - ("FalSe", False), ], ) -def test_response_parse_bool(client: WarpAPI, content: str, expected: bool) -> None: +def test_response_parse_bool(client: OzAPI, content: str, expected: bool) -> None: response = APIResponse( raw=httpx.Response(200, content=content), client=client, @@ -226,7 +226,7 @@ def test_response_parse_bool(client: WarpAPI, content: str, expected: bool) -> N ("FalSe", False), ], ) -async def test_async_response_parse_bool(client: AsyncWarpAPI, content: str, expected: bool) -> None: +async def test_async_response_parse_bool(client: AsyncOzAPI, content: str, expected: bool) -> None: response = AsyncAPIResponse( raw=httpx.Response(200, content=content), client=client, @@ -245,7 +245,7 @@ class OtherModel(BaseModel): @pytest.mark.parametrize("client", [False], indirect=True) # loose validation -def test_response_parse_expect_model_union_non_json_content(client: WarpAPI) -> None: +def test_response_parse_expect_model_union_non_json_content(client: OzAPI) -> None: response = APIResponse( raw=httpx.Response(200, content=b"foo", headers={"Content-Type": "application/text"}), client=client, @@ -262,7 +262,7 @@ def test_response_parse_expect_model_union_non_json_content(client: WarpAPI) -> @pytest.mark.asyncio @pytest.mark.parametrize("async_client", [False], indirect=True) # loose validation -async def test_async_response_parse_expect_model_union_non_json_content(async_client: AsyncWarpAPI) -> None: +async def test_async_response_parse_expect_model_union_non_json_content(async_client: AsyncOzAPI) -> None: response = AsyncAPIResponse( raw=httpx.Response(200, content=b"foo", headers={"Content-Type": "application/text"}), client=async_client, diff --git a/tests/test_streaming.py b/tests/test_streaming.py index 2e7b1e6..b9b682f 100644 --- a/tests/test_streaming.py +++ b/tests/test_streaming.py @@ -5,13 +5,13 @@ import httpx import pytest -from warp_agent_sdk import WarpAPI, AsyncWarpAPI -from warp_agent_sdk._streaming import Stream, AsyncStream, ServerSentEvent +from oz_agent_sdk import OzAPI, AsyncOzAPI +from oz_agent_sdk._streaming import Stream, AsyncStream, ServerSentEvent @pytest.mark.asyncio @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) -async def test_basic(sync: bool, client: WarpAPI, async_client: AsyncWarpAPI) -> None: +async def test_basic(sync: bool, client: OzAPI, async_client: AsyncOzAPI) -> None: def body() -> Iterator[bytes]: yield b"event: completion\n" yield b'data: {"foo":true}\n' @@ -28,7 +28,7 @@ def body() -> Iterator[bytes]: @pytest.mark.asyncio @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) -async def test_data_missing_event(sync: bool, client: WarpAPI, async_client: AsyncWarpAPI) -> None: +async def test_data_missing_event(sync: bool, client: OzAPI, async_client: AsyncOzAPI) -> None: def body() -> Iterator[bytes]: yield b'data: {"foo":true}\n' yield b"\n" @@ -44,7 +44,7 @@ def body() -> Iterator[bytes]: @pytest.mark.asyncio @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) -async def test_event_missing_data(sync: bool, client: WarpAPI, async_client: AsyncWarpAPI) -> None: +async def test_event_missing_data(sync: bool, client: OzAPI, async_client: AsyncOzAPI) -> None: def body() -> Iterator[bytes]: yield b"event: ping\n" yield b"\n" @@ -60,7 +60,7 @@ def body() -> Iterator[bytes]: @pytest.mark.asyncio @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) -async def test_multiple_events(sync: bool, client: WarpAPI, async_client: AsyncWarpAPI) -> None: +async def test_multiple_events(sync: bool, client: OzAPI, async_client: AsyncOzAPI) -> None: def body() -> Iterator[bytes]: yield b"event: ping\n" yield b"\n" @@ -82,7 +82,7 @@ def body() -> Iterator[bytes]: @pytest.mark.asyncio @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) -async def test_multiple_events_with_data(sync: bool, client: WarpAPI, async_client: AsyncWarpAPI) -> None: +async def test_multiple_events_with_data(sync: bool, client: OzAPI, async_client: AsyncOzAPI) -> None: def body() -> Iterator[bytes]: yield b"event: ping\n" yield b'data: {"foo":true}\n' @@ -106,7 +106,7 @@ def body() -> Iterator[bytes]: @pytest.mark.asyncio @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) -async def test_multiple_data_lines_with_empty_line(sync: bool, client: WarpAPI, async_client: AsyncWarpAPI) -> None: +async def test_multiple_data_lines_with_empty_line(sync: bool, client: OzAPI, async_client: AsyncOzAPI) -> None: def body() -> Iterator[bytes]: yield b"event: ping\n" yield b"data: {\n" @@ -128,7 +128,7 @@ def body() -> Iterator[bytes]: @pytest.mark.asyncio @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) -async def test_data_json_escaped_double_new_line(sync: bool, client: WarpAPI, async_client: AsyncWarpAPI) -> None: +async def test_data_json_escaped_double_new_line(sync: bool, client: OzAPI, async_client: AsyncOzAPI) -> None: def body() -> Iterator[bytes]: yield b"event: ping\n" yield b'data: {"foo": "my long\\n\\ncontent"}' @@ -145,7 +145,7 @@ def body() -> Iterator[bytes]: @pytest.mark.asyncio @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) -async def test_multiple_data_lines(sync: bool, client: WarpAPI, async_client: AsyncWarpAPI) -> None: +async def test_multiple_data_lines(sync: bool, client: OzAPI, async_client: AsyncOzAPI) -> None: def body() -> Iterator[bytes]: yield b"event: ping\n" yield b"data: {\n" @@ -165,8 +165,8 @@ def body() -> Iterator[bytes]: @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) async def test_special_new_line_character( sync: bool, - client: WarpAPI, - async_client: AsyncWarpAPI, + client: OzAPI, + async_client: AsyncOzAPI, ) -> None: def body() -> Iterator[bytes]: yield b'data: {"content":" culpa"}\n' @@ -196,8 +196,8 @@ def body() -> Iterator[bytes]: @pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) async def test_multi_byte_character_multiple_chunks( sync: bool, - client: WarpAPI, - async_client: AsyncWarpAPI, + client: OzAPI, + async_client: AsyncOzAPI, ) -> None: def body() -> Iterator[bytes]: yield b'data: {"content":"' @@ -237,8 +237,8 @@ def make_event_iterator( content: Iterator[bytes], *, sync: bool, - client: WarpAPI, - async_client: AsyncWarpAPI, + client: OzAPI, + async_client: AsyncOzAPI, ) -> Iterator[ServerSentEvent] | AsyncIterator[ServerSentEvent]: if sync: return Stream(cast_to=object, client=client, response=httpx.Response(200, content=content))._iter_events() diff --git a/tests/test_transform.py b/tests/test_transform.py index a40b00b..6b1bb6b 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -8,15 +8,15 @@ import pytest -from warp_agent_sdk._types import Base64FileInput, omit, not_given -from warp_agent_sdk._utils import ( +from oz_agent_sdk._types import Base64FileInput, omit, not_given +from oz_agent_sdk._utils import ( PropertyInfo, transform as _transform, parse_datetime, async_transform as _async_transform, ) -from warp_agent_sdk._compat import PYDANTIC_V1 -from warp_agent_sdk._models import BaseModel +from oz_agent_sdk._compat import PYDANTIC_V1 +from oz_agent_sdk._models import BaseModel _T = TypeVar("_T") diff --git a/tests/test_utils/test_datetime_parse.py b/tests/test_utils/test_datetime_parse.py index 0a959d0..de12854 100644 --- a/tests/test_utils/test_datetime_parse.py +++ b/tests/test_utils/test_datetime_parse.py @@ -8,7 +8,7 @@ import pytest -from warp_agent_sdk._utils import parse_date, parse_datetime +from oz_agent_sdk._utils import parse_date, parse_datetime def create_tz(minutes: int) -> timezone: diff --git a/tests/test_utils/test_json.py b/tests/test_utils/test_json.py index 354d1d8..b8a430e 100644 --- a/tests/test_utils/test_json.py +++ b/tests/test_utils/test_json.py @@ -5,8 +5,8 @@ import pydantic -from warp_agent_sdk import _compat -from warp_agent_sdk._utils._json import openapi_dumps +from oz_agent_sdk import _compat +from oz_agent_sdk._utils._json import openapi_dumps class TestOpenapiDumps: diff --git a/tests/test_utils/test_proxy.py b/tests/test_utils/test_proxy.py index bc3bfdc..7b3b2ff 100644 --- a/tests/test_utils/test_proxy.py +++ b/tests/test_utils/test_proxy.py @@ -2,7 +2,7 @@ from typing import Any from typing_extensions import override -from warp_agent_sdk._utils import LazyProxy +from oz_agent_sdk._utils import LazyProxy class RecursiveLazyProxy(LazyProxy[Any]): diff --git a/tests/test_utils/test_typing.py b/tests/test_utils/test_typing.py index 1fb1a71..b55367e 100644 --- a/tests/test_utils/test_typing.py +++ b/tests/test_utils/test_typing.py @@ -2,7 +2,7 @@ from typing import Generic, TypeVar, cast -from warp_agent_sdk._utils import extract_type_var_from_base +from oz_agent_sdk._utils import extract_type_var_from_base _T = TypeVar("_T") _T2 = TypeVar("_T2") diff --git a/tests/utils.py b/tests/utils.py index 5dd2c41..3e9d221 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -8,8 +8,8 @@ from datetime import date, datetime from typing_extensions import Literal, get_args, get_origin, assert_type -from warp_agent_sdk._types import Omit, NoneType -from warp_agent_sdk._utils import ( +from oz_agent_sdk._types import Omit, NoneType +from oz_agent_sdk._utils import ( is_dict, is_list, is_list_type, @@ -19,8 +19,8 @@ is_annotated_type, is_type_alias_type, ) -from warp_agent_sdk._compat import PYDANTIC_V1, field_outer_type, get_model_fields -from warp_agent_sdk._models import BaseModel +from oz_agent_sdk._compat import PYDANTIC_V1, field_outer_type, get_model_fields +from oz_agent_sdk._models import BaseModel BaseModelT = TypeVar("BaseModelT", bound=BaseModel)