Ragex.AI.Provider.OpenAI
(Ragex v0.10.1)
View Source
OpenAI API provider implementation.
Supports GPT-4, GPT-4-turbo, and GPT-3.5-turbo models via the OpenAI API.
Configuration
config :ragex, :ai_providers,
openai: [
endpoint: "https://api.openai.com/v1",
model: "gpt-4-turbo",
options: [
temperature: 0.7,
max_tokens: 2048
]
]Environment Variables
Requires OPENAI_API_KEY to be set.
Supported Models
gpt-4- Most capable model, best for complex tasksgpt-4-turbo- Faster and cheaper than GPT-4, optimized for chatgpt-4-turbo-preview- Latest preview featuresgpt-3.5-turbo- Fast and cost-effective for simpler tasksgpt-3.5-turbo-16k- Extended context window