Module: RubyLLM::Providers::XAI::Chat

Included in:
RubyLLM::Providers::XAI
Defined in:
lib/ruby_llm/providers/xai/chat.rb

Overview

Chat implementation for xAI docs.x.ai/docs/api-reference#chat-completions

Instance Method Summary collapse

Instance Method Details

#format_content(content) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/ruby_llm/providers/xai/chat.rb', line 13

def format_content(content)
  OpenAI::Media.format_content(
    content,
    document_attachments: :none,
    image_attachments: true,
    audio_attachments: false
  )
end

#format_role(role) ⇒ Object



9
10
11
# File 'lib/ruby_llm/providers/xai/chat.rb', line 9

def format_role(role)
  role.to_s
end