Module: RubyLLM::Test::ResolveWithTestProvider

Defined in:
lib/ruby_llm/test/resolve_with_test_provider.rb

Overview

Extend the RubyLLM::Models class to inject the Test Provider in test environments.

Add the following to your test setup (e.g. in spec_helper.rb or test_helper.rb):

require_relative “ruby_llm/test/resolve_with_test_provider”

RubyLLM::Models.singleton_class.prepend(RubyLLM::Test::ResolveWithTestProvider)

Instance Method Summary collapse

Instance Method Details

#resolveObject



13
14
15
16
# File 'lib/ruby_llm/test/resolve_with_test_provider.rb', line 13

def resolve(...)
  model, provider_instance = super
  [ model, Test::TestProvider.new(provider_instance, RubyLLM::Test) ]
end