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()`:
81
82
82
83
```python
83
84
import asyncio
84
-
frompublic_sdkimport DefaultAioHttpClient
85
-
frompublic_sdkimportAsyncPublicSDK
85
+
fromchannel3_sdkimport DefaultAioHttpClient
86
+
fromchannel3_sdkimportAsyncChannel3
86
87
87
88
88
89
asyncdefmain() -> None:
89
-
asyncwithAsyncPublicSDK(
90
+
asyncwithAsyncChannel3(
90
91
api_key="My API Key",
91
92
http_client=DefaultAioHttpClient(),
92
93
) as client:
@@ -110,9 +111,9 @@ Typed requests and responses provide autocomplete and documentation within your
110
111
Nested parameters are dictionaries, typed using `TypedDict`, for example:
111
112
112
113
```python
113
-
frompublic_sdkimportPublicSDK
114
+
fromchannel3_sdkimportChannel3
114
115
115
-
client =PublicSDK()
116
+
client =Channel3()
116
117
117
118
response = client.search.perform(
118
119
config={},
@@ -122,27 +123,27 @@ print(response.config)
122
123
123
124
## Handling errors
124
125
125
-
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `public_sdk.APIConnectionError` is raised.
126
+
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `channel3_sdk.APIConnectionError` is raised.
126
127
127
128
When the API returns a non-success status code (that is, 4xx or 5xx
128
-
response), a subclass of `public_sdk.APIStatusError` is raised, containing `status_code` and `response` properties.
129
+
response), a subclass of `channel3_sdk.APIStatusError` is raised, containing `status_code` and `response` properties.
129
130
130
-
All errors inherit from `public_sdk.APIError`.
131
+
All errors inherit from `channel3_sdk.APIError`.
131
132
132
133
```python
133
-
importpublic_sdk
134
-
frompublic_sdkimportPublicSDK
134
+
importchannel3_sdk
135
+
fromchannel3_sdkimportChannel3
135
136
136
-
client =PublicSDK()
137
+
client =Channel3()
137
138
138
139
try:
139
140
client.search.perform()
140
-
exceptpublic_sdk.APIConnectionError as e:
141
+
exceptchannel3_sdk.APIConnectionError as e:
141
142
print("The server could not be reached")
142
143
print(e.__cause__) # an underlying Exception, likely raised within httpx.
143
-
exceptpublic_sdk.RateLimitError as e:
144
+
exceptchannel3_sdk.RateLimitError as e:
144
145
print("A 429 status code was received; we should back off a bit.")
145
-
exceptpublic_sdk.APIStatusError as e:
146
+
exceptchannel3_sdk.APIStatusError as e:
146
147
print("Another non-200-range status code was received")
147
148
print(e.status_code)
148
149
print(e.response)
@@ -170,10 +171,10 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
170
171
You can use the `max_retries` option to configure or disable retry settings:
171
172
172
173
```python
173
-
frompublic_sdkimportPublicSDK
174
+
fromchannel3_sdkimportChannel3
174
175
175
176
# Configure the default for all requests:
176
-
client =PublicSDK(
177
+
client =Channel3(
177
178
# default is 2
178
179
max_retries=0,
179
180
)
@@ -188,16 +189,16 @@ By default requests time out after 1 minute. You can configure this with a `time
188
189
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
search = response.parse() # get the object that `search.perform()` would have returned
250
251
print(search)
251
252
```
252
253
253
-
These methods return an [`APIResponse`](https://github.com/channel3-ai/sdk-python/tree/main/src/public_sdk/_response.py) object.
254
+
These methods return an [`APIResponse`](https://github.com/channel3-ai/sdk-python/tree/main/src/channel3_sdk/_response.py) object.
254
255
255
-
The async client returns an [`AsyncAPIResponse`](https://github.com/channel3-ai/sdk-python/tree/main/src/public_sdk/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
256
+
The async client returns an [`AsyncAPIResponse`](https://github.com/channel3-ai/sdk-python/tree/main/src/channel3_sdk/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
256
257
257
258
#### `.with_streaming_response`
258
259
@@ -314,10 +315,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.
338
339
339
340
```py
340
-
frompublic_sdkimportPublicSDK
341
+
fromchannel3_sdkimportChannel3
341
342
342
-
withPublicSDK() as client:
343
+
withChannel3() as client:
343
344
# make requests here
344
345
...
345
346
@@ -365,8 +366,8 @@ If you've upgraded to the latest version but aren't seeing any new features you
365
366
You can determine the version that is being used at runtime with:
0 commit comments