Class: RubyCoded::Chat::App

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

Overview

Main class for the AI chat interface

Defined Under Namespace

Modules: EventDispatch, LoginHandler, OAuthHandler

Constant Summary collapse

IDLE_POLL_TIMEOUT =
0.016
STREAMING_POLL_TIMEOUT =
0.05

Constants included from EventDispatch

EventDispatch::LOGIN_ACTIONS, EventDispatch::PLAN_ACTIONS

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of App.



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/ruby_coded/chat/app.rb', line 32

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

Instance Method Details

#runObject



47
48
49
50
51
52
# File 'lib/ruby_coded/chat/app.rb', line 47

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