Class: Observ::AgentSelectionService
- Inherits:
-
Object
- Object
- Observ::AgentSelectionService
- Defined in:
- app/services/observ/agent_selection_service.rb
Overview
Service for providing agent selection options in the Observ domain
This service encapsulates the workflow of:
1. Discovering available agents (via Observ::AgentProvider)
2. Formatting them for UI presentation (via AgentSelectPresenter)
This service acts as the single entry point for agent selection, hiding the complexity of agent discovery and presentation from controllers and views.
Usage in controllers:
@agent_select_options = Observ::AgentSelectionService.
Usage in helpers:
def
Observ::AgentSelectionService.
end
Example output:
[
["Default Agent", ""],
["Deep Research", "DeepResearchAgent"],
["Simple Research", "ResearchAgent"]
]
Class Method Summary collapse
-
.all_agents ⇒ Array<Class>
Returns all available agents (pass-through to Observ::AgentProvider).
-
.options ⇒ Array<Array<String>>
Returns formatted select options for agent selection dropdown.
Class Method Details
.all_agents ⇒ Array<Class>
Returns all available agents (pass-through to Observ::AgentProvider)
Useful when you need the raw agent classes instead of formatted options. For most UI purposes, prefer using .options instead.
48 49 50 |
# File 'app/services/observ/agent_selection_service.rb', line 48 def all_agents Observ::AgentProvider.all_agents end |
.options ⇒ Array<Array<String>>
Returns formatted select options for agent selection dropdown
This method orchestrates the entire agent selection workflow:
- Discovers all available agents
- Formats them for use in Rails select helpers
38 39 40 |
# File 'app/services/observ/agent_selection_service.rb', line 38 def AgentSelectPresenter.(agents: Observ::AgentProvider.all_agents) end |