Class: Lluminary::Models::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/lluminary/models/base.rb

Overview

Base class for all LLM models. Defines the interface that all model classes must implement and provides default prompt formatting behavior.

Instance Method Summary collapse

Instance Method Details

#compatible_with?(provider_name) ⇒ Boolean

Checks if this model is compatible with a given provider

Parameters:

  • provider_name (Symbol)

    The name of the provider to check

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


12
13
14
# File 'lib/lluminary/models/base.rb', line 12

def compatible_with?(provider_name)
  raise NotImplementedError, "Subclasses must implement #compatible_with?"
end

#format_prompt(task) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/lluminary/models/base.rb', line 22

def format_prompt(task)
  "    \#{task.task_prompt.chomp}\n\n    \#{output_preamble}\n    \n    \#{format_fields_descriptions(task.class.output_fields)}\n    \n    \#{format_additional_validations(task.class.output_custom_validations)}\n\n    \#{json_preamble}\n    \n    \#{generate_example_json_object(task.class.output_fields)}\n  PROMPT\nend\n"

#nameString

Returns the name of the model

Returns:

  • (String)

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/lluminary/models/base.rb', line 18

def name
  raise NotImplementedError, "Subclasses must implement #name"
end