class RubyLLM::Providers::XAI
xAI API integration
Public Class Methods
Source
# File lib/ruby_llm/providers/xai.rb, line 22 def configuration_options %i[xai_api_key xai_api_base] end
# File lib/ruby_llm/providers/xai.rb, line 26 def configuration_requirements %i[xai_api_key] end
Public Instance Methods
Source
# File lib/ruby_llm/providers/xai.rb, line 10 def api_base @config.xai_api_base || 'https://api.x.ai/v1' end
Source
# File lib/ruby_llm/providers/xai.rb, line 14 def headers { 'Authorization' => "Bearer #{@config.xai_api_key}", 'Content-Type' => 'application/json' } end