FalEx.Realtime (fal_ex v0.1.0)

View Source

Realtime client for WebSocket connections to fal.ai.

Provides bidirectional communication with AI models that support real-time interaction.

Summary

Functions

Closes a realtime connection.

Connects to a realtime endpoint.

Creates a new realtime client.

Sends a message through the realtime connection.

Types

t()

@type t() :: %FalEx.Realtime{config: FalEx.Config.t()}

Functions

close(connection)

Closes a realtime connection.

connect(realtime, app_id, opts \\ [])

Connects to a realtime endpoint.

Options

  • :connection_key - Reuse existing connection with this key
  • :throttle_interval - Throttle messages (ms, default: 128)
  • :on_message - Callback for incoming messages
  • :on_error - Callback for errors
  • :on_close - Callback for connection close

Examples

{:ok, conn} = Realtime.connect(realtime, "fal-ai/llava-next",
  on_message: fn message ->
    IO.inspect(message)
  end
)

create(config)

Creates a new realtime client.

send(connection, message)

Sends a message through the realtime connection.