Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.1"
".": "0.2.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 3
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-c4c5f89f67a73e4d17377d2b96fc201a63cd5458cbebaa23e78f92b59b90cc5b.yml
openapi_spec_hash: 931c6189a4fc4ee320963646b1b7edbe
config_hash: f555d17517c40197d3ba9240ca35e1ee
config_hash: fa393af196be851b15bd1394c2eaafaa
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.2.0 (2025-12-17)

Full Changelog: [v0.1.1...v0.2.0](https://github.com/warpdotdev/warp-sdk-python/compare/v0.1.1...v0.2.0)

### Features

* **api:** manual updates ([2fc23de](https://github.com/warpdotdev/warp-sdk-python/commit/2fc23de0e1d42443e691350804605243c5902026))


### Chores

* update SDK settings ([a94be20](https://github.com/warpdotdev/warp-sdk-python/commit/a94be20a45967c6ec5bd95dcc3ffcf457db84305))

## 0.1.1 (2025-12-17)

Full Changelog: [v0.1.0...v0.1.1](https://github.com/warpdotdev/warp-sdk-python/compare/v0.1.0...v0.1.1)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_sdk/lib/` and `examples/` directories.
modify the contents of the `src/warp_agent_sdk/lib/` and `examples/` directories.

## Adding and running examples

Expand Down
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Warp API Python API library

<!-- prettier-ignore -->
[![PyPI version](https://img.shields.io/pypi/v/warp-sdk.svg?label=pypi%20(stable))](https://pypi.org/project/warp-sdk/)
[![PyPI version](https://img.shields.io/pypi/v/warp-agent-sdk.svg?label=pypi%20(stable))](https://pypi.org/project/warp-agent-sdk/)

The Warp API Python library provides convenient access to the Warp API REST API from any Python 3.9+
application. The library includes type definitions for all request params and response fields,
Expand All @@ -17,7 +17,7 @@ The full API of this library can be found in [api.md](api.md).

```sh
# install from PyPI
pip install warp-sdk
pip install warp-agent-sdk
```

## Usage
Expand All @@ -26,7 +26,7 @@ The full API of this library can be found in [api.md](api.md).

```python
import os
from warp_sdk import WarpAPI
from warp_agent_sdk import WarpAPI

client = WarpAPI(
api_key=os.environ.get("WARP_API_KEY"), # This is the default and can be omitted
Expand Down Expand Up @@ -108,7 +108,7 @@ Simply import `AsyncWarpAPI` instead of `WarpAPI` and use `await` with each API
```python
import os
import asyncio
from warp_sdk import AsyncWarpAPI
from warp_agent_sdk import AsyncWarpAPI

client = AsyncWarpAPI(
api_key=os.environ.get("WARP_API_KEY"), # This is the default and can be omitted
Expand All @@ -135,16 +135,16 @@ You can enable this by installing `aiohttp`:

```sh
# install from PyPI
pip install warp-sdk[aiohttp]
pip install warp-agent-sdk[aiohttp]
```

Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:

```python
import os
import asyncio
from warp_sdk import DefaultAioHttpClient
from warp_sdk import AsyncWarpAPI
from warp_agent_sdk import DefaultAioHttpClient
from warp_agent_sdk import AsyncWarpAPI


async def main() -> None:
Expand Down Expand Up @@ -175,7 +175,7 @@ Typed requests and responses provide autocomplete and documentation within your
Nested parameters are dictionaries, typed using `TypedDict`, for example:

```python
from warp_sdk import WarpAPI
from warp_agent_sdk import WarpAPI

client = WarpAPI()

Expand All @@ -188,29 +188,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_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 `warp_agent_sdk.APIConnectionError` is raised.

When the API returns a non-success status code (that is, 4xx or 5xx
response), a subclass of `warp_sdk.APIStatusError` is raised, containing `status_code` and `response` properties.
response), a subclass of `warp_agent_sdk.APIStatusError` is raised, containing `status_code` and `response` properties.

All errors inherit from `warp_sdk.APIError`.
All errors inherit from `warp_agent_sdk.APIError`.

```python
import warp_sdk
from warp_sdk import WarpAPI
import warp_agent_sdk
from warp_agent_sdk import WarpAPI

client = WarpAPI()

try:
client.agent.run(
prompt="Fix the bug in auth.go",
)
except warp_sdk.APIConnectionError as e:
except warp_agent_sdk.APIConnectionError as e:
print("The server could not be reached")
print(e.__cause__) # an underlying Exception, likely raised within httpx.
except warp_sdk.RateLimitError as e:
except warp_agent_sdk.RateLimitError as e:
print("A 429 status code was received; we should back off a bit.")
except warp_sdk.APIStatusError as e:
except warp_agent_sdk.APIStatusError as e:
print("Another non-200-range status code was received")
print(e.status_code)
print(e.response)
Expand Down Expand Up @@ -238,7 +238,7 @@ 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_sdk import WarpAPI
from warp_agent_sdk import WarpAPI

# Configure the default for all requests:
client = WarpAPI(
Expand All @@ -258,7 +258,7 @@ 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_sdk import WarpAPI
from warp_agent_sdk import WarpAPI

# Configure the default for all requests:
client = WarpAPI(
Expand Down Expand Up @@ -312,7 +312,7 @@ 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_sdk import WarpAPI
from warp_agent_sdk import WarpAPI

client = WarpAPI()
response = client.agent.with_raw_response.run(
Expand All @@ -324,9 +324,9 @@ agent = response.parse() # get the object that `agent.run()` would have returne
print(agent.task_id)
```

These methods return an [`APIResponse`](https://github.com/warpdotdev/warp-sdk-python/tree/main/src/warp_sdk/_response.py) object.
These methods return an [`APIResponse`](https://github.com/warpdotdev/warp-sdk-python/tree/main/src/warp_agent_sdk/_response.py) object.

The async client returns an [`AsyncAPIResponse`](https://github.com/warpdotdev/warp-sdk-python/tree/main/src/warp_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/warp-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.

#### `.with_streaming_response`

Expand Down Expand Up @@ -390,7 +390,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c

```python
import httpx
from warp_sdk import WarpAPI, DefaultHttpxClient
from warp_agent_sdk import WarpAPI, DefaultHttpxClient

client = WarpAPI(
# Or use the `WARP_API_BASE_URL` env var
Expand All @@ -413,7 +413,7 @@ 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_sdk import WarpAPI
from warp_agent_sdk import WarpAPI

with WarpAPI() as client:
# make requests here
Expand Down Expand Up @@ -441,8 +441,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_sdk
print(warp_sdk.__version__)
import warp_agent_sdk
print(warp_agent_sdk.__version__)
```

## Requirements
Expand Down
10 changes: 5 additions & 5 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
Types:

```python
from warp_sdk.types import AmbientAgentConfig, AgentRunResponse
from warp_agent_sdk.types import AmbientAgentConfig, AgentRunResponse
```

Methods:

- <code title="post /agent/run">client.agent.<a href="./src/warp_sdk/resources/agent/agent.py">run</a>(\*\*<a href="src/warp_sdk/types/agent_run_params.py">params</a>) -> <a href="./src/warp_sdk/types/agent_run_response.py">AgentRunResponse</a></code>
- <code title="post /agent/run">client.agent.<a href="./src/warp_agent_sdk/resources/agent/agent.py">run</a>(\*\*<a href="src/warp_agent_sdk/types/agent_run_params.py">params</a>) -> <a href="./src/warp_agent_sdk/types/agent_run_response.py">AgentRunResponse</a></code>

## Tasks

Types:

```python
from warp_sdk.types.agent import TaskItem, TaskSourceType, TaskState, TaskListResponse
from warp_agent_sdk.types.agent import TaskItem, TaskSourceType, TaskState, TaskListResponse
```

Methods:

- <code title="get /agent/tasks/{taskId}">client.agent.tasks.<a href="./src/warp_sdk/resources/agent/tasks.py">retrieve</a>(task_id) -> <a href="./src/warp_sdk/types/agent/task_item.py">TaskItem</a></code>
- <code title="get /agent/tasks">client.agent.tasks.<a href="./src/warp_sdk/resources/agent/tasks.py">list</a>(\*\*<a href="src/warp_sdk/types/agent/task_list_params.py">params</a>) -> <a href="./src/warp_sdk/types/agent/task_list_response.py">TaskListResponse</a></code>
- <code title="get /agent/tasks/{taskId}">client.agent.tasks.<a href="./src/warp_agent_sdk/resources/agent/tasks.py">retrieve</a>(task_id) -> <a href="./src/warp_agent_sdk/types/agent/task_item.py">TaskItem</a></code>
- <code title="get /agent/tasks">client.agent.tasks.<a href="./src/warp_agent_sdk/resources/agent/tasks.py">list</a>(\*\*<a href="src/warp_agent_sdk/types/agent/task_list_params.py">params</a>) -> <a href="./src/warp_agent_sdk/types/agent/task_list_response.py">TaskListResponse</a></code>
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "warp-sdk"
version = "0.1.1"
name = "warp-agent-sdk"
version = "0.2.0"
description = "The official Python library for the warp-api API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -86,7 +86,7 @@ include = [
]

[tool.hatch.build.targets.wheel]
packages = ["src/warp_sdk"]
packages = ["src/warp_agent_sdk"]

[tool.hatch.build.targets.sdist]
# Basically everything except hidden files/directories (such as .github, .devcontainers, .python-version, etc)
Expand Down Expand Up @@ -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_sdk/_files.py', '_dev/.*.py', 'tests/.*']
exclude = ['src/warp_agent_sdk/_files.py', '_dev/.*.py', 'tests/.*']

strict_equality = true
implicit_reexport = true
Expand Down Expand Up @@ -246,7 +246,7 @@ length-sort = true
length-sort-straight = true
combine-as-imports = true
extra-standard-library = ["typing_extensions"]
known-first-party = ["warp_sdk", "tests"]
known-first-party = ["warp_agent_sdk", "tests"]

[tool.ruff.lint.per-file-ignores]
"bin/**.py" = ["T201", "T203"]
Expand Down
2 changes: 1 addition & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@
],
"release-type": "python",
"extra-files": [
"src/warp_sdk/_version.py"
"src/warp_agent_sdk/_version.py"
]
}
12 changes: 6 additions & 6 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ annotated-types==0.7.0
anyio==4.12.0
# via
# httpx
# warp-sdk
# warp-agent-sdk
backports-asyncio-runner==1.2.0 ; python_full_version < '3.11'
# via pytest-asyncio
certifi==2025.11.12
Expand All @@ -17,7 +17,7 @@ colorama==0.4.6 ; sys_platform == 'win32'
# via pytest
dirty-equals==0.11
distro==1.9.0
# via warp-sdk
# via warp-agent-sdk
exceptiongroup==1.3.1 ; python_full_version < '3.11'
# via
# anyio
Expand All @@ -31,7 +31,7 @@ httpcore==1.0.9
httpx==0.28.1
# via
# respx
# warp-sdk
# warp-agent-sdk
idna==3.11
# via
# anyio
Expand Down Expand Up @@ -59,7 +59,7 @@ pathspec==0.12.1
pluggy==1.6.0
# via pytest
pydantic==2.12.5
# via warp-sdk
# via warp-agent-sdk
pydantic-core==2.41.5
# via pydantic
pygments==2.19.2
Expand All @@ -86,7 +86,7 @@ ruff==0.14.7
six==1.17.0 ; python_full_version < '3.10'
# via python-dateutil
sniffio==1.3.1
# via warp-sdk
# via warp-agent-sdk
time-machine==2.19.0 ; python_full_version < '3.10'
time-machine==3.1.0 ; python_full_version >= '3.10'
tomli==2.3.0 ; python_full_version < '3.11'
Expand All @@ -103,7 +103,7 @@ typing-extensions==4.15.0
# pyright
# pytest-asyncio
# typing-inspection
# warp-sdk
# warp-agent-sdk
typing-inspection==0.4.2
# via pydantic
zipp==3.23.0
Expand Down
2 changes: 1 addition & 1 deletion scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ echo "==> Running mypy"
uv run mypy .

echo "==> Making sure it imports"
uv run python -c 'import warp_sdk'
uv run python -c 'import warp_agent_sdk'
4 changes: 2 additions & 2 deletions src/warp_sdk/__init__.py → src/warp_agent_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_sdk._exceptions.NotFoundError -> warp_sdk.NotFoundError
# warp_agent_sdk._exceptions.NotFoundError -> warp_agent_sdk.NotFoundError
__locals = locals()
for __name in __all__:
if not __name.startswith("__"):
try:
__locals[__name].__module__ = "warp_sdk"
__locals[__name].__module__ = "warp_agent_sdk"
except (TypeError, AttributeError):
# Some of our exported symbols are builtins which we can't set attributes for.
pass
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,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_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 `warp_agent_sdk.DEFAULT_MAX_RETRIES`"
)

def _enforce_trailing_slash(self, url: URL) -> URL:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading