GitHub

API reference for client.

Effect's generated OpenAiClient: a method per operation of the OpenAI API, generated from Effect's Generated.ts by scripts/gen_ai_schemas.py; do not edit.

A JSON operation gives its decoded body (with include_response=True, the body and the response); a documented error status fails with OpenAiClientError (tag names the operation and status, cause is the decoded body). ...Sse operations stream the decoded events, ...Stream ones the body's bytes.

Classes

Functions

make

make(http_client, *, transform_client=None) -> OpenAiClient

The client over http_client (requests carry relative paths: prepend the API's URL to the client). transform_client picks the client each operation runs on, per call.

ParameterTypeDescription
http_client_HttpClientService[_HttpClientError]
transform_client_c.ClientTransform | None = None

Returns OpenAiClient

def make(
    http_client: _HttpClientService[_HttpClientError],
    *,
    transform_client: _c.ClientTransform | None = None,
) -> OpenAiClient:
    """The client over ``http_client`` (requests carry relative paths:
    prepend the API's URL to the client). ``transform_client`` picks the
    client each operation runs on, per call."""
    return OpenAiClient(http_client, transform_client)