Class: Zephira::Commands::History
- Inherits:
-
Object
- Object
- Zephira::Commands::History
- Defined in:
- lib/zephira/commands/history.rb
Class Method Summary collapse
Class Method Details
.description ⇒ Object
11 12 13 |
# File 'lib/zephira/commands/history.rb', line 11 def description "Display the conversation history" end |
.name ⇒ Object
7 8 9 |
# File 'lib/zephira/commands/history.rb', line 7 def name "history" end |
.run(agent:, args:) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/zephira/commands/history.rb', line 15 def run(agent:, args:) agent.history..each do || content = [:content].to_s content = "#{content.gsub("\n", "\\n").slice(0, 100)}..." if content.length > 100 puts "[#{[:timestamp]}] #{[:role]}: #{content}" end end |