Class: Lluminary::Providers::Test

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

Overview

Test provider for development and testing. Returns predefined responses for testing purposes.

Constant Summary collapse

NAME =
:test

Instance Attribute Summary

Attributes inherited from Base

#config

Instance Method Summary collapse

Methods inherited from Base

#initialize, #models

Constructor Details

This class inherits a constructor from Lluminary::Providers::Base

Instance Method Details

#call(_prompt, task) ⇒ Object



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

def call(_prompt, task)
  response = generate_response(task.class.output_fields)
  raw_response = JSON.pretty_generate(response).gsub(/\n\s*/, "")
  { raw: raw_response, parsed: JSON.parse(raw_response) }
end

#modelObject



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

def model
  @model ||= Lluminary::Models::Base.new
end