Class: Askcii::Commands::ChatCommand

Inherits:
BaseCommand show all
Defined in:
lib/askcii/commands/chat_command.rb

Overview

Executes a chat session with the LLM

Instance Attribute Summary

Attributes inherited from BaseCommand

#cli, #config

Instance Method Summary collapse

Methods inherited from BaseCommand

#initialize

Constructor Details

This class inherits a constructor from Askcii::Commands::BaseCommand

Instance Method Details

#executeObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/askcii/commands/chat_command.rb', line 7

def execute
  validate_config!
  display_config_info if cli.verbose?

  # Read from stdin if available
  stdin_input = read_stdin_input

  # Execute the chat
  require_relative '../chat_session'
  session = ChatSession.new(
    config: config,
    private: cli.private?,
    session_context: session_context,
    verbose: cli.verbose?
  )

  session.execute_chat(cli.prompt, stdin_input)
end