Module: OllamaChat::PersonaeManagement
- Included in:
- Chat
- Defined in:
- lib/ollama_chat/personae_management.rb
Overview
Module for managing personas in Ollama chat application
This module provides functionality to manage persona files, including creating, reading, updating, and deleting persona definitions stored as Markdown files in the personae directory.
Instance Method Summary collapse
-
#assistant ⇒ String, ...
Returns the name of the current default persona.
-
#default_persona_profile ⇒ String?
Retrieves the formatted roleplay prompt for the current default persona.
-
#initial_persona_name ⇒ String?
The initial_persona_name method retrieves the initial persona for the chat session.
Instance Method Details
#assistant ⇒ String, ...
Returns the name of the current default persona.
If the default persona is set to :none or is not configured, it returns nil.
31 32 33 34 35 |
# File 'lib/ollama_chat/personae_management.rb', line 31 def assistant if default_persona_name && default_persona_name != :none default_persona_name end end |
#default_persona_profile ⇒ String?
Retrieves the formatted roleplay prompt for the current default persona.
18 19 20 21 22 |
# File 'lib/ollama_chat/personae_management.rb', line 18 def default_persona_profile if persona = default_persona and persona.exist? play_persona(persona) end end |
#initial_persona_name ⇒ String?
The initial_persona_name method retrieves the initial persona for the chat session.
11 12 13 |
# File 'lib/ollama_chat/personae_management.rb', line 11 def initial_persona_name session&.default_persona_name end |