struct OpenAI::Client::Config

Defined in:

openai/config.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(api_key : String, api_base : String, org_id : String, api_type : ApiType, api_version : String | Nil = nil, empty_msg_limit : Int32 = EMPTY_MESSAGES_LIMIT, model_mapper : Proc(String, String) | Nil = nil, proxy : ProxyConfig | Nil = nil) #

[View source]
def self.new(api_key : String, api_base : String, proxy : OpenAI::Client::ProxyConfig | Nil = nil) #

[View source]

Class Method Detail

def self.azure(api_key : String | Nil, api_base : String | Nil, api_type : ApiType = :azure, model_mapper : Proc(String, String) | Nil = nil, proxy = nil) #

[View source]
def self.default(api_key : String | Nil = nil, proxy = nil) #

[View source]

Instance Method Detail

def api_base : String #

def api_key : String #

def api_type : ApiType #

def api_version : String | Nil #

def azure_deployment_by_model(model : String) : String #

[View source]
def clone #

[View source]
def copy_with(api_key _api_key = @api_key, api_base _api_base = @api_base, org_id _org_id = @org_id, api_type _api_type = @api_type, api_version _api_version = @api_version, empty_msg_limit _empty_msg_limit = @empty_msg_limit, model_mapper _model_mapper = @model_mapper, proxy _proxy = @proxy) #

[View source]
def empty_msg_limit : Int32 #

def model_mapper : Proc(String, String) | Nil #

def org_id : String #

def proxy : ProxyConfig | Nil #

def req_headers #

[View source]
def to_s(io : IO) : Nil #
Description copied from struct Struct

Same as #inspect(io).


[View source]