Sha256: 12b1957d68ddf4fc2cc6df456b050d5d031f633310547cc2515e9bd95a83be23
Contents?: true
Size: 683 Bytes
Versions: 12
Compression:
Stored size: 683 Bytes
Contents
module OpenAI module HTTPHeaders def add_headers(headers) @extra_headers = extra_headers.merge(headers.transform_keys(&:to_s)) end private def headers if azure? azure_headers else openai_headers end.merge(extra_headers) end def openai_headers { "Content-Type" => "application/json", "Authorization" => "Bearer #{@access_token}", "OpenAI-Organization" => @organization_id } end def azure_headers { "Content-Type" => "application/json", "api-key" => @access_token } end def extra_headers @extra_headers ||= {} end end end
Version data entries
12 entries across 12 versions & 2 rubygems