Class: AgentHarness::Orchestration::Conductor
- Inherits:
-
Object
- Object
- AgentHarness::Orchestration::Conductor
- Defined in:
- lib/agent_harness/orchestration/conductor.rb
Overview
Main orchestration entry point
Provides a simple interface for sending messages while managing provider selection, fallback, retries, and error handling internally.
Instance Attribute Summary collapse
-
#metrics ⇒ Object
readonly
Returns the value of attribute metrics.
-
#provider_manager ⇒ Object
readonly
Returns the value of attribute provider_manager.
Instance Method Summary collapse
-
#execute_direct(prompt, provider:, **options) ⇒ Response
Execute with explicit provider (bypass orchestration).
-
#initialize(config: nil) ⇒ Conductor
constructor
Create a new conductor.
-
#reset! ⇒ void
Reset all orchestration state.
-
#send_message(prompt, provider: nil, model: nil, **options) ⇒ Response
Send a message with full orchestration.
-
#status ⇒ Hash
Get current orchestration status.
Constructor Details
#initialize(config: nil) ⇒ Conductor
Create a new conductor
22 23 24 25 26 |
# File 'lib/agent_harness/orchestration/conductor.rb', line 22 def initialize(config: nil) @config = config || AgentHarness.configuration @provider_manager = ProviderManager.new(@config) @metrics = Metrics.new end |
Instance Attribute Details
#metrics ⇒ Object (readonly)
Returns the value of attribute metrics.
17 18 19 |
# File 'lib/agent_harness/orchestration/conductor.rb', line 17 def metrics @metrics end |
#provider_manager ⇒ Object (readonly)
Returns the value of attribute provider_manager.
17 18 19 |
# File 'lib/agent_harness/orchestration/conductor.rb', line 17 def provider_manager @provider_manager end |
Instance Method Details
#execute_direct(prompt, provider:, **options) ⇒ Response
Execute with explicit provider (bypass orchestration)
53 54 55 56 |
# File 'lib/agent_harness/orchestration/conductor.rb', line 53 def execute_direct(prompt, provider:, **) provider_instance = @provider_manager.get_provider(provider) provider_instance.(prompt: prompt, **) end |
#reset! ⇒ void
This method returns an undefined value.
Reset all orchestration state
73 74 75 76 |
# File 'lib/agent_harness/orchestration/conductor.rb', line 73 def reset! @provider_manager.reset! @metrics.reset! end |
#send_message(prompt, provider: nil, model: nil, **options) ⇒ Response
Send a message with full orchestration
Handles provider selection, fallback, retries, circuit breakers, and error handling transparently.
39 40 41 42 43 44 45 |
# File 'lib/agent_harness/orchestration/conductor.rb', line 39 def (prompt, provider: nil, model: nil, **) provider_name = provider || @config.default_provider with_orchestration(provider_name, model, ) do |selected_provider| selected_provider.(prompt: prompt, model: model, **) end end |
#status ⇒ Hash
Get current orchestration status
61 62 63 64 65 66 67 68 |
# File 'lib/agent_harness/orchestration/conductor.rb', line 61 def status { current_provider: @provider_manager.current_provider, available_providers: @provider_manager.available_providers, health: @provider_manager.health_status, metrics: @metrics.summary } end |