LLMAgent.Plugin (llm_agent v0.2.0)
View SourceImplements the AgentForge.Plugin behavior for LLM integrations.
This module provides a plugin implementation that registers LLM-specific tools and allows LLMAgent to integrate with different LLM providers.
Summary
Functions
Calls an LLM provider with the given parameters.
Initializes the LLMAgent plugin.
Returns metadata about the LLMAgent plugin.
Parses an LLM response into a structured format.
Registers LLM-specific primitives with AgentForge.
Registers LLM-specific tools with AgentForge.
Functions
Calls an LLM provider with the given parameters.
Parameters
params
- A map with parameters:provider
- The LLM provider to use (e.g., :openai, a module)messages
- The conversation messagestools
- Available tools for the LLMoptions
- Provider-specific options
Returns
A map with the LLM response.
Initializes the LLMAgent plugin.
Checks that required dependencies are available for the specified provider.
Parameters
opts
- Plugin options including provider selection
Returns
:ok
if initialization succeeds, {:error, reason}
otherwise.
Examples
iex> LLMAgent.Plugin.init(provider: :mock)
:ok
Returns metadata about the LLMAgent plugin.
Returns
A map with plugin metadata.
Parses an LLM response into a structured format.
Parameters
params
- A map with parameters:response
- The raw LLM responseformat
- The desired output format
Returns
A structured representation of the LLM response.
Registers LLM-specific primitives with AgentForge.
Returns
:ok
if registration succeeds.
Registers LLM-specific tools with AgentForge.
Parameters
registry
- The AgentForge tool registry
Returns
:ok
if registration succeeds.