Cri::APIClients::OpenAICompatible
Inherits Cri::APIClient < Reference < Object
OpenAI-compatible API client. Provider identity/configuration lives in ProviderRegistration and ProviderRuntime.
Constructors
new(endpoint : String = ENV["CRI_MODEL_URL"]? || "https://api.openai.com/v1/chat/completions", model : String = ENV["CRI_MODEL"]? || "gpt-4o-mini", api_key : String | Nil = ENV["CRI_API_KEY"]?, timeout : Time::Span = 120.seconds, transport : Cri::Transport = Cri::Transports::SSE.new)
SourceInstance methods
client
Sourcecomplete(messages : Array(Message), tools : Array(ToolSpec), settings : ModelSettings = ModelSettings.new) : AssistantResponse
Sourcelist_models
Sourcemodel
Sourcesupports_streaming?
Sourcevalidate_credentials
Source