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
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
87
87
88
88
```python
89
89
import os
90
90
import asyncio
91
-
fromwarp_apiimport DefaultAioHttpClient
92
-
fromwarp_apiimport AsyncWarpAPI
91
+
fromwarp_sdkimport DefaultAioHttpClient
92
+
fromwarp_sdkimport AsyncWarpAPI
93
93
94
94
95
95
asyncdefmain() -> None:
@@ -120,7 +120,7 @@ Typed requests and responses provide autocomplete and documentation within your
120
120
Nested parameters are dictionaries, typed using `TypedDict`, for example:
121
121
122
122
```python
123
-
fromwarp_apiimport WarpAPI
123
+
fromwarp_sdkimport WarpAPI
124
124
125
125
client = WarpAPI()
126
126
@@ -133,29 +133,29 @@ print(response.config)
133
133
134
134
## Handling errors
135
135
136
-
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `warp_api.APIConnectionError` is raised.
136
+
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.
137
137
138
138
When the API returns a non-success status code (that is, 4xx or 5xx
139
-
response), a subclass of `warp_api.APIStatusError` is raised, containing `status_code` and `response` properties.
139
+
response), a subclass of `warp_sdk.APIStatusError` is raised, containing `status_code` and `response` properties.
140
140
141
-
All errors inherit from `warp_api.APIError`.
141
+
All errors inherit from `warp_sdk.APIError`.
142
142
143
143
```python
144
-
importwarp_api
145
-
fromwarp_apiimport WarpAPI
144
+
importwarp_sdk
145
+
fromwarp_sdkimport WarpAPI
146
146
147
147
client = WarpAPI()
148
148
149
149
try:
150
150
client.agent.run(
151
151
prompt="Fix the bug in auth.go",
152
152
)
153
-
exceptwarp_api.APIConnectionError as e:
153
+
exceptwarp_sdk.APIConnectionError as e:
154
154
print("The server could not be reached")
155
155
print(e.__cause__) # an underlying Exception, likely raised within httpx.
156
-
exceptwarp_api.RateLimitError as e:
156
+
exceptwarp_sdk.RateLimitError as e:
157
157
print("A 429 status code was received; we should back off a bit.")
158
-
exceptwarp_api.APIStatusError as e:
158
+
exceptwarp_sdk.APIStatusError as e:
159
159
print("Another non-200-range status code was received")
160
160
print(e.status_code)
161
161
print(e.response)
@@ -183,7 +183,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
183
183
You can use the `max_retries` option to configure or disable retry settings:
184
184
185
185
```python
186
-
fromwarp_apiimport WarpAPI
186
+
fromwarp_sdkimport WarpAPI
187
187
188
188
# Configure the default for all requests:
189
189
client = WarpAPI(
@@ -203,7 +203,7 @@ By default requests time out after 1 minute. You can configure this with a `time
203
203
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
204
204
205
205
```python
206
-
fromwarp_apiimport WarpAPI
206
+
fromwarp_sdkimport WarpAPI
207
207
208
208
# Configure the default for all requests:
209
209
client = WarpAPI(
@@ -257,7 +257,7 @@ if response.my_field is None:
257
257
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
258
258
259
259
```py
260
-
fromwarp_apiimport WarpAPI
260
+
fromwarp_sdkimport WarpAPI
261
261
262
262
client = WarpAPI()
263
263
response = client.agent.with_raw_response.run(
@@ -269,9 +269,9 @@ agent = response.parse() # get the object that `agent.run()` would have returne
269
269
print(agent.task_id)
270
270
```
271
271
272
-
These methods return an [`APIResponse`](https://github.com/stainless-sdks/warp-api-python/tree/main/src/warp_api/_response.py) object.
272
+
These methods return an [`APIResponse`](https://github.com/stainless-sdks/warp-api-python/tree/main/src/warp_sdk/_response.py) object.
273
273
274
-
The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/warp-api-python/tree/main/src/warp_api/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
274
+
The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/warp-api-python/tree/main/src/warp_sdk/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
275
275
276
276
#### `.with_streaming_response`
277
277
@@ -335,7 +335,7 @@ 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.
359
359
360
360
```py
361
-
fromwarp_apiimport WarpAPI
361
+
fromwarp_sdkimport WarpAPI
362
362
363
363
with WarpAPI() as client:
364
364
# make requests here
@@ -386,8 +386,8 @@ If you've upgraded to the latest version but aren't seeing any new features you
386
386
You can determine the version that is being used at runtime with:
0 commit comments