Module: OllamaChat::PromptHandling
- Included in:
- Chat
- Defined in:
- lib/ollama_chat/prompt_handling.rb
Overview
Provides methods for retrieving and iterating over prompt templates stored in the database.
This module is designed to be mixed into the Chat class, allowing it to access prompt overrides stored in the database using the ‘models` helper.
Instance Method Summary collapse
-
#system_prompt(name) ⇒ OllamaChat::Database::Models::Prompt?
Retrieves a specific system prompt by name from the ‘system_prompt’ context.
Instance Method Details
#system_prompt(name) ⇒ OllamaChat::Database::Models::Prompt?
Retrieves a specific system prompt by name from the ‘system_prompt’ context.
13 14 15 |
# File 'lib/ollama_chat/prompt_handling.rb', line 13 def system_prompt(name) models::Prompt.where(context: 'system_prompt', name: name.to_s).first end |