class AI::OpenAI::OpenAIChatLanguageModel

Overview

OpenAI Chat Language Model.

Implements the LanguageModelV3 interface for text generation using OpenAI's chat completions API.

Included Modules

Defined in:

ai/openai/chat/openai_chat_language_model.cr

Constructors

Instance Method Summary

Instance methods inherited from module AI::Provider::LanguageModel::V3

do_generate(options : CallOptions) : GenerateResult do_generate, do_stream(options : CallOptions) : StreamResult do_stream, model_id : String model_id, provider : String provider, specification_version : String specification_version, supported_urls : Hash(String, Array(Regex)) supported_urls

Constructor Detail

def self.new(model_id : OpenAIChatModelId, config : OpenAIConfig, generate_id : Proc(String) = -> do AI::ProviderUtils.generate_id end) #

[View source]

Instance Method Detail

Generates content from the prompt.


[View source]

Streams content from the prompt.


[View source]
def model_id : OpenAIChatModelId #

The model ID.


[View source]
def provider : String #

Returns the provider name.


[View source]
def specification_version : String #

Returns the specification version.


[View source]
def supported_urls : Hash(String, Array(Regex)) #

Returns supported URLs for file access. OpenAI supports image URLs from any HTTPS source.


[View source]