class LittleGhost::Providers::OpenAI
OpenAI connects LittleGhost features to OpenAI models for generation and embeddings. Generation uses the Responses API by default and supports streaming, Tools, and structured results.
provider = LittleGhost::Providers::OpenAI.new( api_key: ENV.fetch("OPENAI_API_KEY"), model: ENV.fetch("OPENAI_MODEL") )
Supply api: :chat_completions only when a model or integration requires the Chat Completions wire API.
Constants
- DEFAULT_BASE_URL
-
The
OpenAIAPI endpoint used whenbase_urlis omitted.
Public Class Methods
# File lib/little_ghost/providers/openai.rb, line 24 def initialize(base_url: DEFAULT_BASE_URL, **arguments) = super
Uses the official OpenAI API base URL by default.
Calls superclass method