Class: Riffer::Providers::Test

Inherits:
Base
  • Object
show all
Defined in:
lib/riffer/providers/test.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#generate_text, #stream_text

Methods included from Messages::Converter

#convert_to_message_object

Constructor Details

#initialize(**options) ⇒ Test

Returns a new instance of Test.



6
7
8
9
10
11
# File 'lib/riffer/providers/test.rb', line 6

def initialize(**options)
  @responses = options[:responses] || []
  @current_index = 0
  @calls = []
  @stubbed_response = nil
end

Instance Attribute Details

#callsObject (readonly)

Returns the value of attribute calls.



4
5
6
# File 'lib/riffer/providers/test.rb', line 4

def calls
  @calls
end

Instance Method Details

#stub_response(content, tool_calls: []) ⇒ Object



13
14
15
# File 'lib/riffer/providers/test.rb', line 13

def stub_response(content, tool_calls: [])
  @stubbed_response = {role: "assistant", content: content, tool_calls: tool_calls}
end