Class: Charai::OllamaConfiguration

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:, model:) ⇒ OllamaConfiguration

Returns a new instance of OllamaConfiguration.



41
42
43
44
# File 'lib/charai/openai_configuration.rb', line 41

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

Instance Attribute Details

#endpoint_urlObject (readonly)

Returns the value of attribute endpoint_url.



46
47
48
# File 'lib/charai/openai_configuration.rb', line 46

def endpoint_url
  @endpoint_url
end

Instance Method Details

#add_auth_header(headers) ⇒ Object



48
49
50
51
# File 'lib/charai/openai_configuration.rb', line 48

def add_auth_header(headers)
  # auth header is not required.
  headers
end

#decorate_body(payload) ⇒ Object



53
54
55
56
# File 'lib/charai/openai_configuration.rb', line 53

def decorate_body(payload)
  payload[:model] = @model
  payload
end