Skip to main content

fishaudio.core.omit

OMIT sentinel for distinguishing None from not-provided parameters.

fishaudio.core.request_options

Request-level options for API calls.

RequestOptions Objects

class RequestOptions()
Options that can be provided on a per-request basis to override client defaults. Attributes:
  • timeout - Override the client’s default timeout (in seconds)
  • max_retries - Override the client’s default max retries
  • additional_headers - Additional headers to include in the request
  • additional_query_params - Additional query parameters to include

get_timeout

def get_timeout() -> Optional[httpx.Timeout]
Convert timeout to httpx.Timeout if set.

fishaudio.core.client_wrapper

HTTP client wrapper for managing requests and authentication.

BaseClientWrapper Objects

class BaseClientWrapper()
Base wrapper with shared logic for sync/async clients.

ClientWrapper Objects

class ClientWrapper(BaseClientWrapper)
Wrapper for httpx.Client that handles authentication and error handling.

request

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

client

@property
def client() -> httpx.Client
Get underlying httpx.Client for advanced usage (e.g., WebSockets).

close

def close() -> None
Close the HTTP client.

AsyncClientWrapper Objects

class AsyncClientWrapper(BaseClientWrapper)
Wrapper for httpx.AsyncClient that handles authentication and error handling.

request

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

client

@property
def client() -> httpx.AsyncClient
Get underlying httpx.AsyncClient for advanced usage (e.g., WebSockets).

close

async def close() -> None
Close the HTTP client.