You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Warp API Python library provides convenient access to the Warp API REST API from any Python 3.9+
6
+
The Oz API Python library provides convenient access to the Oz API REST API from any Python 3.9+
7
7
application. The library includes type definitions for all request params and response fields,
8
8
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
9
9
@@ -26,9 +26,9 @@ The full API of this library can be found in [api.md](api.md).
26
26
27
27
```python
28
28
import os
29
-
fromwarp_agent_sdkimportWarpAPI
29
+
fromoz_agent_sdkimportOzAPI
30
30
31
-
client =WarpAPI(
31
+
client =OzAPI(
32
32
api_key=os.environ.get("WARP_API_KEY"), # This is the default and can be omitted
33
33
)
34
34
@@ -103,14 +103,14 @@ so that your API Key is not stored in source control.
103
103
104
104
## Async usage
105
105
106
-
Simply import `AsyncWarpAPI` instead of `WarpAPI` and use `await` with each API call:
106
+
Simply import `AsyncOzAPI` instead of `OzAPI` and use `await` with each API call:
107
107
108
108
```python
109
109
import os
110
110
import asyncio
111
-
fromwarp_agent_sdkimportAsyncWarpAPI
111
+
fromoz_agent_sdkimportAsyncOzAPI
112
112
113
-
client =AsyncWarpAPI(
113
+
client =AsyncOzAPI(
114
114
api_key=os.environ.get("WARP_API_KEY"), # This is the default and can be omitted
115
115
)
116
116
@@ -143,12 +143,12 @@ Then you can enable it by instantiating the client with `http_client=DefaultAioH
143
143
```python
144
144
import os
145
145
import asyncio
146
-
fromwarp_agent_sdkimport DefaultAioHttpClient
147
-
fromwarp_agent_sdkimportAsyncWarpAPI
146
+
fromoz_agent_sdkimport DefaultAioHttpClient
147
+
fromoz_agent_sdkimportAsyncOzAPI
148
148
149
149
150
150
asyncdefmain() -> None:
151
-
asyncwithAsyncWarpAPI(
151
+
asyncwithAsyncOzAPI(
152
152
api_key=os.environ.get("WARP_API_KEY"), # This is the default and can be omitted
153
153
http_client=DefaultAioHttpClient(),
154
154
) as client:
@@ -175,9 +175,9 @@ Typed requests and responses provide autocomplete and documentation within your
175
175
Nested parameters are dictionaries, typed using `TypedDict`, for example:
176
176
177
177
```python
178
-
fromwarp_agent_sdkimportWarpAPI
178
+
fromoz_agent_sdkimportOzAPI
179
179
180
-
client =WarpAPI()
180
+
client =OzAPI()
181
181
182
182
response = client.agent.run(
183
183
config={},
@@ -187,29 +187,29 @@ print(response.config)
187
187
188
188
## Handling errors
189
189
190
-
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.
190
+
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.
191
191
192
192
When the API returns a non-success status code (that is, 4xx or 5xx
193
-
response), a subclass of `warp_agent_sdk.APIStatusError` is raised, containing `status_code` and `response` properties.
193
+
response), a subclass of `oz_agent_sdk.APIStatusError` is raised, containing `status_code` and `response` properties.
194
194
195
-
All errors inherit from `warp_agent_sdk.APIError`.
195
+
All errors inherit from `oz_agent_sdk.APIError`.
196
196
197
197
```python
198
-
importwarp_agent_sdk
199
-
fromwarp_agent_sdkimportWarpAPI
198
+
importoz_agent_sdk
199
+
fromoz_agent_sdkimportOzAPI
200
200
201
-
client =WarpAPI()
201
+
client =OzAPI()
202
202
203
203
try:
204
204
client.agent.run(
205
205
prompt="Fix the bug in auth.go",
206
206
)
207
-
exceptwarp_agent_sdk.APIConnectionError as e:
207
+
exceptoz_agent_sdk.APIConnectionError as e:
208
208
print("The server could not be reached")
209
209
print(e.__cause__) # an underlying Exception, likely raised within httpx.
210
-
exceptwarp_agent_sdk.RateLimitError as e:
210
+
exceptoz_agent_sdk.RateLimitError as e:
211
211
print("A 429 status code was received; we should back off a bit.")
212
-
exceptwarp_agent_sdk.APIStatusError as e:
212
+
exceptoz_agent_sdk.APIStatusError as e:
213
213
print("Another non-200-range status code was received")
214
214
print(e.status_code)
215
215
print(e.response)
@@ -237,10 +237,10 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
237
237
You can use the `max_retries` option to configure or disable retry settings:
238
238
239
239
```python
240
-
fromwarp_agent_sdkimportWarpAPI
240
+
fromoz_agent_sdkimportOzAPI
241
241
242
242
# Configure the default for all requests:
243
-
client =WarpAPI(
243
+
client =OzAPI(
244
244
# default is 2
245
245
max_retries=0,
246
246
)
@@ -257,16 +257,16 @@ By default requests time out after 1 minute. You can configure this with a `time
257
257
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
@@ -286,10 +286,10 @@ Note that requests that time out are [retried twice by default](#retries).
286
286
287
287
We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.
288
288
289
-
You can enable logging by setting the environment variable `WARP_API_LOG` to `info`.
289
+
You can enable logging by setting the environment variable `OZ_API_LOG` to `info`.
290
290
291
291
```shell
292
-
$ exportWARP_API_LOG=info
292
+
$ exportOZ_API_LOG=info
293
293
```
294
294
295
295
Or to `debug` for more verbose logging.
@@ -311,9 +311,9 @@ if response.my_field is None:
311
311
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
312
312
313
313
```py
314
-
fromwarp_agent_sdkimportWarpAPI
314
+
fromoz_agent_sdkimportOzAPI
315
315
316
-
client =WarpAPI()
316
+
client =OzAPI()
317
317
response = client.agent.with_raw_response.run(
318
318
prompt="Fix the bug in auth.go",
319
319
)
@@ -323,9 +323,9 @@ agent = response.parse() # get the object that `agent.run()` would have returne
323
323
print(agent.run_id)
324
324
```
325
325
326
-
These methods return an [`APIResponse`](https://github.com/warpdotdev/oz-sdk-python/tree/main/src/warp_agent_sdk/_response.py) object.
326
+
These methods return an [`APIResponse`](https://github.com/warpdotdev/oz-sdk-python/tree/main/src/oz_agent_sdk/_response.py) object.
327
327
328
-
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.
328
+
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.
329
329
330
330
#### `.with_streaming_response`
331
331
@@ -389,10 +389,10 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
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.
413
413
414
414
```py
415
-
fromwarp_agent_sdkimportWarpAPI
415
+
fromoz_agent_sdkimportOzAPI
416
416
417
-
withWarpAPI() as client:
417
+
withOzAPI() as client:
418
418
# make requests here
419
419
...
420
420
@@ -440,8 +440,8 @@ If you've upgraded to the latest version but aren't seeing any new features you
440
440
You can determine the version that is being used at runtime with:
0 commit comments