Skip to content
Open
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
308 changes: 154 additions & 154 deletions api-reference/sdk/python/core.mdx
Original file line number Diff line number Diff line change
@@ -1,153 +1,8 @@
<a id="fishaudio.core.client_wrapper"></a>

# fishaudio.core.client\_wrapper

HTTP client wrapper for managing requests and authentication.

<a id="fishaudio.core.client_wrapper.BaseClientWrapper"></a>

## BaseClientWrapper Objects

```python
class BaseClientWrapper()
```

Base wrapper with shared logic for sync/async clients.

<a id="fishaudio.core.client_wrapper.BaseClientWrapper.get_headers"></a>

#### get\_headers

```python
def get_headers(
additional_headers: Optional[dict[str, str]] = None) -> dict[str, str]
```

Build headers including authentication and user agent.

<a id="fishaudio.core.client_wrapper.ClientWrapper"></a>

## ClientWrapper Objects

```python
class ClientWrapper(BaseClientWrapper)
```

Wrapper for httpx.Client that handles authentication and error handling.

<a id="fishaudio.core.client_wrapper.ClientWrapper.request"></a>

#### request

```python
def request(method: str,
path: str,
*,
request_options: Optional[RequestOptions] = None,
**kwargs: Any) -> httpx.Response
```

Make an HTTP request with error handling.

**Arguments**:

- `method` - HTTP method (GET, POST, etc.)
- `path` - API endpoint path
- `request_options` - Optional request-level overrides
- `**kwargs` - Additional arguments to pass to httpx.request


**Returns**:

httpx.Response object


**Raises**:

- `APIError` - On non-2xx responses

<a id="fishaudio.core.client_wrapper.ClientWrapper.client"></a>

#### client

```python
@property
def client() -> httpx.Client
```

Get underlying httpx.Client for advanced usage (e.g., WebSockets).

<a id="fishaudio.core.client_wrapper.ClientWrapper.close"></a>

#### close

```python
def close() -> None
```

Close the HTTP client.

<a id="fishaudio.core.client_wrapper.AsyncClientWrapper"></a>

## AsyncClientWrapper Objects

```python
class AsyncClientWrapper(BaseClientWrapper)
```

Wrapper for httpx.AsyncClient that handles authentication and error handling.

<a id="fishaudio.core.client_wrapper.AsyncClientWrapper.request"></a>

#### request

```python
async def request(method: str,
path: str,
*,
request_options: Optional[RequestOptions] = None,
**kwargs: Any) -> httpx.Response
```

Make an async HTTP request with error handling.

**Arguments**:

- `method` - HTTP method (GET, POST, etc.)
- `path` - API endpoint path
- `request_options` - Optional request-level overrides
- `**kwargs` - Additional arguments to pass to httpx.request


**Returns**:

httpx.Response object


**Raises**:

- `APIError` - On non-2xx responses

<a id="fishaudio.core.client_wrapper.AsyncClientWrapper.client"></a>

#### client

```python
@property
def client() -> httpx.AsyncClient
```

Get underlying httpx.AsyncClient for advanced usage (e.g., WebSockets).

<a id="fishaudio.core.client_wrapper.AsyncClientWrapper.close"></a>

#### close
<a id="fishaudio.core.omit"></a>

```python
async def close() -> None
```
# fishaudio.core.omit

Close the HTTP client.
OMIT sentinel for distinguishing None from not-provided parameters.

<a id="fishaudio.core.request_options"></a>

Expand Down Expand Up @@ -346,6 +201,157 @@
f.write(audio)
```

<a id="fishaudio.core.client_wrapper"></a>

# fishaudio.core.client\_wrapper

HTTP client wrapper for managing requests and authentication.

<a id="fishaudio.core.client_wrapper.BaseClientWrapper"></a>

## BaseClientWrapper Objects

```python
class BaseClientWrapper()
```

Base wrapper with shared logic for sync/async clients.

<a id="fishaudio.core.client_wrapper.BaseClientWrapper.get_headers"></a>

#### get\_headers

```python
def get_headers(
additional_headers: Optional[dict[str, str]] = None) -> dict[str, str]
```

Build headers including authentication and user agent.

<a id="fishaudio.core.client_wrapper.ClientWrapper"></a>

## ClientWrapper Objects

```python
class ClientWrapper(BaseClientWrapper)
```

Wrapper for httpx.Client that handles authentication and error handling.

<a id="fishaudio.core.client_wrapper.ClientWrapper.request"></a>

#### request

```python
def request(method: str,
path: str,
*,
request_options: Optional[RequestOptions] = None,
**kwargs: Any) -> httpx.Response
```

Make an HTTP request with error handling.

**Arguments**:

- `method` - HTTP method (GET, POST, etc.)
- `path` - API endpoint path
- `request_options` - Optional request-level overrides
- `**kwargs` - Additional arguments to pass to httpx.request


**Returns**:

httpx.Response object


**Raises**:

- `APIError` - On non-2xx responses

<a id="fishaudio.core.client_wrapper.ClientWrapper.client"></a>

#### client

```python
@property
def client() -> httpx.Client
```

Get underlying httpx.Client for advanced usage (e.g., WebSockets).

<a id="fishaudio.core.client_wrapper.ClientWrapper.close"></a>

#### close

```python
def close() -> None
```

Close the HTTP client.

<a id="fishaudio.core.client_wrapper.AsyncClientWrapper"></a>

## AsyncClientWrapper Objects

```python
class AsyncClientWrapper(BaseClientWrapper)
```

Wrapper for httpx.AsyncClient that handles authentication and error handling.

<a id="fishaudio.core.client_wrapper.AsyncClientWrapper.request"></a>

#### request

```python
async def request(method: str,
path: str,
*,
request_options: Optional[RequestOptions] = None,
**kwargs: Any) -> httpx.Response
```

Make an async HTTP request with error handling.

**Arguments**:

- `method` - HTTP method (GET, POST, etc.)
- `path` - API endpoint path
- `request_options` - Optional request-level overrides
- `**kwargs` - Additional arguments to pass to httpx.request


**Returns**:

httpx.Response object


**Raises**:

- `APIError` - On non-2xx responses

<a id="fishaudio.core.client_wrapper.AsyncClientWrapper.client"></a>

#### client

```python
@property
def client() -> httpx.AsyncClient
```

Get underlying httpx.AsyncClient for advanced usage (e.g., WebSockets).

<a id="fishaudio.core.client_wrapper.AsyncClientWrapper.close"></a>

#### close

```python
async def close() -> None
```

Close the HTTP client.

<a id="fishaudio.core.websocket_options"></a>

# fishaudio.core.websocket\_options
Expand All @@ -362,7 +368,7 @@

Options for configuring WebSocket connections.

These options are passed directly to httpx_ws's connect_ws/aconnect_ws functions.

Check warning on line 371 in api-reference/sdk/python/core.mdx

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

api-reference/sdk/python/core.mdx#L371

Did you really mean 'httpx_ws's'?
For complete documentation, see https://frankie567.github.io/httpx-ws/reference/httpx_ws/

**Attributes**:
Expand All @@ -382,7 +388,7 @@

**Notes**:

Parameter descriptions adapted from httpx_ws documentation.

Check warning on line 391 in api-reference/sdk/python/core.mdx

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

api-reference/sdk/python/core.mdx#L391

Did you really mean 'httpx_ws'?

<a id="fishaudio.core.websocket_options.WebSocketOptions.to_httpx_ws_kwargs"></a>

Expand All @@ -392,11 +398,5 @@
def to_httpx_ws_kwargs() -> dict[str, Any]
```

Convert to kwargs dict for httpx_ws aconnect_ws/connect_ws.

Check warning on line 401 in api-reference/sdk/python/core.mdx

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

api-reference/sdk/python/core.mdx#L401

Did you really mean 'kwargs'?

Check warning on line 401 in api-reference/sdk/python/core.mdx

View check run for this annotation

Mintlify / Mintlify Validation (hanabiaiinc) - vale-spellcheck

api-reference/sdk/python/core.mdx#L401

Did you really mean 'httpx_ws'?

<a id="fishaudio.core.omit"></a>

# fishaudio.core.omit

OMIT sentinel for distinguishing None from not-provided parameters.

Loading