Class: Charai::AzureOpenaiConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/charai/openai_configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(endpoint_url:, api_key:) ⇒ AzureOpenaiConfiguration

Returns a new instance of AzureOpenaiConfiguration.



23
24
25
26
# File 'lib/charai/openai_configuration.rb', line 23

def initialize(endpoint_url:, api_key:)
  @endpoint_url = endpoint_url
  @api_key = api_key
end

Instance Attribute Details

#endpoint_urlObject (readonly)

Returns the value of attribute endpoint_url.



28
29
30
# File 'lib/charai/openai_configuration.rb', line 28

def endpoint_url
  @endpoint_url
end

Instance Method Details

#add_auth_header(headers) ⇒ Object



30
31
32
33
# File 'lib/charai/openai_configuration.rb', line 30

def add_auth_header(headers)
  headers['api-key'] = @api_key
  headers
end

#decorate_body(payload) ⇒ Object



35
36
37
# File 'lib/charai/openai_configuration.rb', line 35

def decorate_body(payload)
  payload
end