|
1 | | -<a id="fishaudio.core.omit"></a> |
| 1 | +<a id="fishaudio.core.client_wrapper"></a> |
2 | 2 |
|
3 | | -# fishaudio.core.omit |
| 3 | +# fishaudio.core.client\_wrapper |
4 | 4 |
|
5 | | -OMIT sentinel for distinguishing None from not-provided parameters. |
| 5 | +HTTP client wrapper for managing requests and authentication. |
| 6 | + |
| 7 | +<a id="fishaudio.core.client_wrapper.BaseClientWrapper"></a> |
| 8 | + |
| 9 | +## BaseClientWrapper Objects |
| 10 | + |
| 11 | +```python |
| 12 | +class BaseClientWrapper() |
| 13 | +``` |
| 14 | + |
| 15 | +Base wrapper with shared logic for sync/async clients. |
| 16 | + |
| 17 | +<a id="fishaudio.core.client_wrapper.BaseClientWrapper.get_headers"></a> |
| 18 | + |
| 19 | +#### get\_headers |
| 20 | + |
| 21 | +```python |
| 22 | +def get_headers( |
| 23 | + additional_headers: Optional[dict[str, str]] = None) -> dict[str, str] |
| 24 | +``` |
| 25 | + |
| 26 | +Build headers including authentication and user agent. |
| 27 | + |
| 28 | +<a id="fishaudio.core.client_wrapper.ClientWrapper"></a> |
| 29 | + |
| 30 | +## ClientWrapper Objects |
| 31 | + |
| 32 | +```python |
| 33 | +class ClientWrapper(BaseClientWrapper) |
| 34 | +``` |
| 35 | + |
| 36 | +Wrapper for httpx.Client that handles authentication and error handling. |
| 37 | + |
| 38 | +<a id="fishaudio.core.client_wrapper.ClientWrapper.request"></a> |
| 39 | + |
| 40 | +#### request |
| 41 | + |
| 42 | +```python |
| 43 | +def request(method: str, |
| 44 | + path: str, |
| 45 | + *, |
| 46 | + request_options: Optional[RequestOptions] = None, |
| 47 | + **kwargs: Any) -> httpx.Response |
| 48 | +``` |
| 49 | + |
| 50 | +Make an HTTP request with error handling. |
| 51 | + |
| 52 | +**Arguments**: |
| 53 | + |
| 54 | +- `method` - HTTP method (GET, POST, etc.) |
| 55 | +- `path` - API endpoint path |
| 56 | +- `request_options` - Optional request-level overrides |
| 57 | +- `**kwargs` - Additional arguments to pass to httpx.request |
| 58 | + |
| 59 | + |
| 60 | +**Returns**: |
| 61 | + |
| 62 | + httpx.Response object |
| 63 | + |
| 64 | + |
| 65 | +**Raises**: |
| 66 | + |
| 67 | +- `APIError` - On non-2xx responses |
| 68 | + |
| 69 | +<a id="fishaudio.core.client_wrapper.ClientWrapper.client"></a> |
| 70 | + |
| 71 | +#### client |
| 72 | + |
| 73 | +```python |
| 74 | +@property |
| 75 | +def client() -> httpx.Client |
| 76 | +``` |
| 77 | + |
| 78 | +Get underlying httpx.Client for advanced usage (e.g., WebSockets). |
| 79 | + |
| 80 | +<a id="fishaudio.core.client_wrapper.ClientWrapper.close"></a> |
| 81 | + |
| 82 | +#### close |
| 83 | + |
| 84 | +```python |
| 85 | +def close() -> None |
| 86 | +``` |
| 87 | + |
| 88 | +Close the HTTP client. |
| 89 | + |
| 90 | +<a id="fishaudio.core.client_wrapper.AsyncClientWrapper"></a> |
| 91 | + |
| 92 | +## AsyncClientWrapper Objects |
| 93 | + |
| 94 | +```python |
| 95 | +class AsyncClientWrapper(BaseClientWrapper) |
| 96 | +``` |
| 97 | + |
| 98 | +Wrapper for httpx.AsyncClient that handles authentication and error handling. |
| 99 | + |
| 100 | +<a id="fishaudio.core.client_wrapper.AsyncClientWrapper.request"></a> |
| 101 | + |
| 102 | +#### request |
| 103 | + |
| 104 | +```python |
| 105 | +async def request(method: str, |
| 106 | + path: str, |
| 107 | + *, |
| 108 | + request_options: Optional[RequestOptions] = None, |
| 109 | + **kwargs: Any) -> httpx.Response |
| 110 | +``` |
| 111 | + |
| 112 | +Make an async HTTP request with error handling. |
| 113 | + |
| 114 | +**Arguments**: |
| 115 | + |
| 116 | +- `method` - HTTP method (GET, POST, etc.) |
| 117 | +- `path` - API endpoint path |
| 118 | +- `request_options` - Optional request-level overrides |
| 119 | +- `**kwargs` - Additional arguments to pass to httpx.request |
| 120 | + |
| 121 | + |
| 122 | +**Returns**: |
| 123 | + |
| 124 | + httpx.Response object |
| 125 | + |
| 126 | + |
| 127 | +**Raises**: |
| 128 | + |
| 129 | +- `APIError` - On non-2xx responses |
| 130 | + |
| 131 | +<a id="fishaudio.core.client_wrapper.AsyncClientWrapper.client"></a> |
| 132 | + |
| 133 | +#### client |
| 134 | + |
| 135 | +```python |
| 136 | +@property |
| 137 | +def client() -> httpx.AsyncClient |
| 138 | +``` |
| 139 | + |
| 140 | +Get underlying httpx.AsyncClient for advanced usage (e.g., WebSockets). |
| 141 | + |
| 142 | +<a id="fishaudio.core.client_wrapper.AsyncClientWrapper.close"></a> |
| 143 | + |
| 144 | +#### close |
| 145 | + |
| 146 | +```python |
| 147 | +async def close() -> None |
| 148 | +``` |
| 149 | + |
| 150 | +Close the HTTP client. |
6 | 151 |
|
7 | 152 | <a id="fishaudio.core.request_options"></a> |
8 | 153 |
|
@@ -201,157 +346,6 @@ After calling this method, the iterator cannot be used again. |
201 | 346 | f.write(audio) |
202 | 347 | ``` |
203 | 348 |
|
204 | | -<a id="fishaudio.core.client_wrapper"></a> |
205 | | - |
206 | | -# fishaudio.core.client\_wrapper |
207 | | - |
208 | | -HTTP client wrapper for managing requests and authentication. |
209 | | - |
210 | | -<a id="fishaudio.core.client_wrapper.BaseClientWrapper"></a> |
211 | | - |
212 | | -## BaseClientWrapper Objects |
213 | | - |
214 | | -```python |
215 | | -class BaseClientWrapper() |
216 | | -``` |
217 | | - |
218 | | -Base wrapper with shared logic for sync/async clients. |
219 | | - |
220 | | -<a id="fishaudio.core.client_wrapper.BaseClientWrapper.get_headers"></a> |
221 | | - |
222 | | -#### get\_headers |
223 | | - |
224 | | -```python |
225 | | -def get_headers( |
226 | | - additional_headers: Optional[Dict[str, str]] = None) -> Dict[str, str] |
227 | | -``` |
228 | | - |
229 | | -Build headers including authentication and user agent. |
230 | | - |
231 | | -<a id="fishaudio.core.client_wrapper.ClientWrapper"></a> |
232 | | - |
233 | | -## ClientWrapper Objects |
234 | | - |
235 | | -```python |
236 | | -class ClientWrapper(BaseClientWrapper) |
237 | | -``` |
238 | | - |
239 | | -Wrapper for httpx.Client that handles authentication and error handling. |
240 | | - |
241 | | -<a id="fishaudio.core.client_wrapper.ClientWrapper.request"></a> |
242 | | - |
243 | | -#### request |
244 | | - |
245 | | -```python |
246 | | -def request(method: str, |
247 | | - path: str, |
248 | | - *, |
249 | | - request_options: Optional[RequestOptions] = None, |
250 | | - **kwargs: Any) -> httpx.Response |
251 | | -``` |
252 | | - |
253 | | -Make an HTTP request with error handling. |
254 | | - |
255 | | -**Arguments**: |
256 | | - |
257 | | -- `method` - HTTP method (GET, POST, etc.) |
258 | | -- `path` - API endpoint path |
259 | | -- `request_options` - Optional request-level overrides |
260 | | -- `**kwargs` - Additional arguments to pass to httpx.request |
261 | | - |
262 | | - |
263 | | -**Returns**: |
264 | | - |
265 | | - httpx.Response object |
266 | | - |
267 | | - |
268 | | -**Raises**: |
269 | | - |
270 | | -- `APIError` - On non-2xx responses |
271 | | - |
272 | | -<a id="fishaudio.core.client_wrapper.ClientWrapper.client"></a> |
273 | | - |
274 | | -#### client |
275 | | - |
276 | | -```python |
277 | | -@property |
278 | | -def client() -> httpx.Client |
279 | | -``` |
280 | | - |
281 | | -Get underlying httpx.Client for advanced usage (e.g., WebSockets). |
282 | | - |
283 | | -<a id="fishaudio.core.client_wrapper.ClientWrapper.close"></a> |
284 | | - |
285 | | -#### close |
286 | | - |
287 | | -```python |
288 | | -def close() -> None |
289 | | -``` |
290 | | - |
291 | | -Close the HTTP client. |
292 | | - |
293 | | -<a id="fishaudio.core.client_wrapper.AsyncClientWrapper"></a> |
294 | | - |
295 | | -## AsyncClientWrapper Objects |
296 | | - |
297 | | -```python |
298 | | -class AsyncClientWrapper(BaseClientWrapper) |
299 | | -``` |
300 | | - |
301 | | -Wrapper for httpx.AsyncClient that handles authentication and error handling. |
302 | | - |
303 | | -<a id="fishaudio.core.client_wrapper.AsyncClientWrapper.request"></a> |
304 | | - |
305 | | -#### request |
306 | | - |
307 | | -```python |
308 | | -async def request(method: str, |
309 | | - path: str, |
310 | | - *, |
311 | | - request_options: Optional[RequestOptions] = None, |
312 | | - **kwargs: Any) -> httpx.Response |
313 | | -``` |
314 | | - |
315 | | -Make an async HTTP request with error handling. |
316 | | - |
317 | | -**Arguments**: |
318 | | - |
319 | | -- `method` - HTTP method (GET, POST, etc.) |
320 | | -- `path` - API endpoint path |
321 | | -- `request_options` - Optional request-level overrides |
322 | | -- `**kwargs` - Additional arguments to pass to httpx.request |
323 | | - |
324 | | - |
325 | | -**Returns**: |
326 | | - |
327 | | - httpx.Response object |
328 | | - |
329 | | - |
330 | | -**Raises**: |
331 | | - |
332 | | -- `APIError` - On non-2xx responses |
333 | | - |
334 | | -<a id="fishaudio.core.client_wrapper.AsyncClientWrapper.client"></a> |
335 | | - |
336 | | -#### client |
337 | | - |
338 | | -```python |
339 | | -@property |
340 | | -def client() -> httpx.AsyncClient |
341 | | -``` |
342 | | - |
343 | | -Get underlying httpx.AsyncClient for advanced usage (e.g., WebSockets). |
344 | | - |
345 | | -<a id="fishaudio.core.client_wrapper.AsyncClientWrapper.close"></a> |
346 | | - |
347 | | -#### close |
348 | | - |
349 | | -```python |
350 | | -async def close() -> None |
351 | | -``` |
352 | | - |
353 | | -Close the HTTP client. |
354 | | - |
355 | 349 | <a id="fishaudio.core.websocket_options"></a> |
356 | 350 |
|
357 | 351 | # fishaudio.core.websocket\_options |
@@ -395,8 +389,14 @@ For complete documentation, see https://frankie567.github.io/httpx-ws/reference/ |
395 | 389 | #### to\_httpx\_ws\_kwargs |
396 | 390 |
|
397 | 391 | ```python |
398 | | -def to_httpx_ws_kwargs() -> Dict[str, Any] |
| 392 | +def to_httpx_ws_kwargs() -> dict[str, Any] |
399 | 393 | ``` |
400 | 394 |
|
401 | 395 | Convert to kwargs dict for httpx_ws aconnect_ws/connect_ws. |
402 | 396 |
|
| 397 | +<a id="fishaudio.core.omit"></a> |
| 398 | + |
| 399 | +# fishaudio.core.omit |
| 400 | + |
| 401 | +OMIT sentinel for distinguishing None from not-provided parameters. |
| 402 | + |
0 commit comments