Class: LLMed::LLM::Test

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

Instance Method Summary collapse

Constructor Details

#initialize ⇒ Test

Returns a new instance of Test.



123
124
125
# File 'lib/llm.rb', line 123

def initialize
  @output = ''
end

Instance Method Details

#chat(messages: []) ⇒ Object



135
136
137
138
# File 'lib/llm.rb', line 135

def chat(messages: [])
  output = messages.map { |m| m[:content] }.join("\n")
  Struct.new(:chat_completion, :total_tokens).new(output, 0)
end

#chat_parameters ⇒ Object



127
128
129
# File 'lib/llm.rb', line 127

def chat_parameters
  { model: 'test' }
end

#model ⇒ Object



131
132
133
# File 'lib/llm.rb', line 131

def model
  'test'
end

#provider ⇒ Object



144
145
146
# File 'lib/llm.rb', line 144

def provider
  :test
end

#source_code(code) ⇒ Object



140
141
142
# File 'lib/llm.rb', line 140

def source_code(code)
  code
end