ExBifrost.Api.Responses (ex_bifrost v0.1.0)

Copy Markdown View Source

API calls for all endpoints tagged Responses.

Summary

Functions

Create a response Creates a response using the OpenAI Responses API format. Supports streaming via SSE.

Responses API over WebSocket Upgrades the connection to a WebSocket and runs the OpenAI Responses API in WebSocket Mode. Clients send response.create events on the socket and receive streamed events through the standard inference pipeline (PreLLMHook, key selection, provider call, PostLLMHook). Auth is identical to the HTTP POST variant — Bearer/Basic/Virtual Key/API Key may be supplied as request headers on the upgrade request. The OpenAI SDK can also pass an API key via the openai-insecure-api-key.<key> WebSocket subprotocol. This GET endpoint shares its path with the POST inference endpoint; route selection is based on the Upgrade: websocket request header.

Functions

create_response(connection, responses_request, opts \\ [])

Create a response Creates a response using the OpenAI Responses API format. Supports streaming via SSE.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • responses_request (ResponsesRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.ResponsesResponse.t} on success
  • {:error, Tesla.Env.t} on failure

create_response_web_socket(connection, upgrade, opts \\ [])

@spec create_response_web_socket(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

Responses API over WebSocket Upgrades the connection to a WebSocket and runs the OpenAI Responses API in WebSocket Mode. Clients send response.create events on the socket and receive streamed events through the standard inference pipeline (PreLLMHook, key selection, provider call, PostLLMHook). Auth is identical to the HTTP POST variant — Bearer/Basic/Virtual Key/API Key may be supplied as request headers on the upgrade request. The OpenAI SDK can also pass an API key via the openai-insecure-api-key.<key> WebSocket subprotocol. This GET endpoint shares its path with the POST inference endpoint; route selection is based on the Upgrade: websocket request header.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • upgrade (String.t): Must be websocket
  • opts (keyword): Optional parameters
    • :"Sec-WebSocket-Protocol" (String.t): Optional WebSocket subprotocol. Use openai-insecure-api-key.<key> to authenticate when headers cannot be supplied by the client.

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure