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

find_provider, #generate_text, identifier, #stream_text

Methods included from DependencyHelper

#depends_on

Constructor Details

#initialize(**options) ⇒ Test

Returns a new instance of Test.



9
10
11
12
13
14
# File 'lib/riffer/providers/test.rb', line 9

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.



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

def calls
  @calls
end

Instance Method Details

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



16
17
18
# File 'lib/riffer/providers/test.rb', line 16

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