Class: RubyCoded::Chat::App

Inherits:
Object
  • Object
show all
Includes:
EventDispatch
Defined in:
lib/ruby_coded/chat/app.rb,
lib/ruby_coded/chat/app/event_dispatch.rb

Overview

Main class for the AI chat interface

Defined Under Namespace

Modules: EventDispatch

Constant Summary collapse

IDLE_POLL_TIMEOUT =
0.016
STREAMING_POLL_TIMEOUT =
0.05

Instance Method Summary collapse

Constructor Details

#initialize(model:, user_config: nil) ⇒ App

Returns a new instance of App.



19
20
21
22
23
24
25
26
27
28
# File 'lib/ruby_coded/chat/app.rb', line 19

def initialize(model:, user_config: nil)
  @model = model
  @user_config = user_config
  apply_plugin_extensions!
  @state = State.new(model: model)
  @llm_bridge = LLMBridge.new(@state)
  @input_handler = InputHandler.new(@state)
  @credentials_store = Auth::CredentialsStore.new
  @command_handler = build_command_handler
end

Instance Method Details

#runObject



33
34
35
36
37
38
# File 'lib/ruby_coded/chat/app.rb', line 33

def run
  RatatuiRuby.run do |tui|
    init_tui(tui)
    run_event_loop
  end
end