Class: AIA::ChatLoop
- Inherits:
-
Object
- Object
- AIA::ChatLoop
- Includes:
- ContentExtractor
- Defined in:
- lib/aia/chat_loop.rb
Instance Method Summary collapse
-
#initialize(robot, ui_presenter, directive_processor, session_tracker: nil, alias_registry: nil, filters: {}) ⇒ ChatLoop
constructor
A new instance of ChatLoop.
-
#start(skip_context_files: false) ⇒ Object
Start the interactive chat session.
Methods included from ContentExtractor
#extract_content, #extract_network_content, #format_duration, #output_to_file, #present_result, #store_results_in_memory
Constructor Details
#initialize(robot, ui_presenter, directive_processor, session_tracker: nil, alias_registry: nil, filters: {}) ⇒ ChatLoop
Returns a new instance of ChatLoop.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/aia/chat_loop.rb', line 17 def initialize(robot, ui_presenter, directive_processor, session_tracker: nil, alias_registry: nil, filters: {}) @robot = robot @ui_presenter = ui_presenter @directive_processor = directive_processor @tracker = session_tracker || SessionTracker.new @alias_registry = alias_registry || ModelAliasRegistry.new @model_switch_handler = ModelSwitchHandler.new(@alias_registry, @ui_presenter) @filters = filters @streaming_runner = StreamingRunner.new @mention_router = MentionRouter.new( ui_presenter: @ui_presenter, tracker: @tracker, streaming_runner: @streaming_runner ) @special_mode_handler = SpecialModeHandler.new( robot: @robot, ui_presenter: @ui_presenter, tracker: @tracker ) @tool_filter_strategy = ToolFilterStrategy.new( filters: filters, ui_presenter: @ui_presenter ) end |
Instance Method Details
#start(skip_context_files: false) ⇒ Object
Start the interactive chat session
45 46 47 48 49 50 51 52 53 |
# File 'lib/aia/chat_loop.rb', line 45 def start(skip_context_files: false) setup_session process_initial_context(skip_context_files) run_loop rescue StandardError => e AIA.debug_warn("ChatLoop error: #{e.class}: #{e.}", exc: e) ensure @ui_presenter.display_chat_end end |