Class: RubyCoded::Chat::BridgeFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_coded/chat/bridge_factory.rb

Overview

Decides which bridge (LLMBridge vs CodexBridge) to instantiate based on the stored OpenAI credentials.

Extracted from Chat::App so that backend selection remains a single, testable responsibility and App stays focused on orchestration.

Instance Method Summary collapse

Constructor Details

#initialize(state:, credentials_store:, auth_manager:, skill_catalog:, user_config: nil) ⇒ BridgeFactory

Returns a new instance of BridgeFactory.



16
17
18
19
20
21
22
# File 'lib/ruby_coded/chat/bridge_factory.rb', line 16

def initialize(state:, credentials_store:, auth_manager:, skill_catalog:, user_config: nil)
  @state = state
  @credentials_store = credentials_store
  @auth_manager = auth_manager
  @skill_catalog = skill_catalog
  @user_config = user_config
end

Instance Method Details

#buildObject



24
25
26
27
28
# File 'lib/ruby_coded/chat/bridge_factory.rb', line 24

def build
  return build_llm_bridge unless codex_backend?

  build_codex_bridge
end