Module: RubyLLM::AiSdk

Defined in:
lib/ruby_llm/ai_sdk.rb,
lib/ruby_llm/ai_sdk/stream.rb,
lib/ruby_llm/ai_sdk/request.rb,
lib/ruby_llm/ai_sdk/version.rb,
lib/ruby_llm/ai_sdk/controller.rb

Overview

Streams RubyLLM chats in the AI SDK UI message stream protocol, so a front end built on the AI SDK's useChat hook can talk to a Ruby backend: text, reasoning, tool calls, tool results, and approvals.

RubyLLM::AiSdk::Stream.new(chat, io).ask "What is the weather in Paris?"

Defined Under Namespace

Modules: Controller Classes: Request, Stream

Constant Summary collapse

HEADERS =

The response headers the AI SDK expects on a UI message stream.

{
  'content-type' => 'text/event-stream',
  'cache-control' => 'no-cache',
  'connection' => 'keep-alive',
  'x-vercel-ai-ui-message-stream' => 'v1',
  'x-accel-buffering' => 'no'
}.freeze
VERSION =

The version of the ruby_llm-ai_sdk gem, as a string.

'0.2.0'