Class: Roast::Cogs::Agent::Provider
- Inherits:
-
Object
- Object
- Roast::Cogs::Agent::Provider
- Defined in:
- lib/roast/cogs/agent/provider.rb
Overview
Abstract base class for agent provider implementations
Providers are responsible for interfacing with specific agent backends (e.g., Claude) to execute agent requests. Each provider must implement the ‘invoke` method to handle agent execution according to their specific API requirements.
Subclasses should override ‘invoke` to provide concrete implementations that communicate with their respective agent services.
Direct Known Subclasses
Roast::Cogs::Agent::Providers::Claude, Roast::Cogs::Agent::Providers::Pi
Instance Method Summary collapse
-
#initialize(config) ⇒ Provider
constructor
Initialize a new provider with the given configuration.
-
#invoke(input) ⇒ Object
Execute an agent request and return the result.
Constructor Details
#initialize(config) ⇒ Provider
Initialize a new provider with the given configuration
Stores the agent configuration for use during invocation. The configuration contains all settings needed to communicate with the agent service, such as API keys, model names, and execution parameters.
#### See Also
-
‘invoke`
: (Config) -> void
26 27 28 29 |
# File 'lib/roast/cogs/agent/provider.rb', line 26 def initialize(config) super() @config = config end |
Instance Method Details
#invoke(input) ⇒ Object
Execute an agent request and return the result
This method must be implemented by subclasses to handle the actual agent execution. Implementations should use the stored configuration to set up the request, send the input to the agent service, and return a properly formatted output.
Raises ‘NotImplementedError` if called on the base Provider class.
#### See Also
-
‘initialize`
: (Input) -> Output
43 44 45 |
# File 'lib/roast/cogs/agent/provider.rb', line 43 def invoke(input) raise NotImplementedError, "Subclasses must implement #invoke" end |