Class: Lluminary::Models::Base
- Inherits:
-
Object
- Object
- Lluminary::Models::Base
- 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.
Direct Known Subclasses
Anthropic::Claude35Sonnet, Lluminary::Models::Bedrock::Base, Google::Gemini20Flash, OpenAi::Gpt35Turbo
Instance Method Summary collapse
-
#compatible_with?(provider_name) ⇒ Boolean
Checks if this model is compatible with a given provider.
- #format_prompt(task) ⇒ Object
-
#name ⇒ String
Returns the name of the model.
Instance Method Details
#compatible_with?(provider_name) ⇒ Boolean
Checks if this model is compatible with a given provider
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" |
#name ⇒ String
Returns the name of the model
18 19 20 |
# File 'lib/lluminary/models/base.rb', line 18 def name raise NotImplementedError, "Subclasses must implement #name" end |