Class: RubyCoded::Chat::App
- Inherits:
-
Object
- Object
- RubyCoded::Chat::App
- 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
-
#initialize(model:, user_config: nil) ⇒ App
constructor
A new instance of App.
- #run ⇒ Object
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
#run ⇒ Object
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 |