LlmEx.ProviderBehaviour behaviour (LlmEx v0.1.0)
View SourceDefines a common behaviour interface for all LLM providers. This module establishes a contract that all LLM provider implementations must fulfill.
Summary
Callbacks
Converts a Message struct to the provider-specific format.
Streams a chat response from the LLM to the given process.
Converts a Tool struct to the provider-specific format.
Functions
Invoked when a module uses LlmEx.ProviderBehaviour. Implements default functionality for the provider.
Callbacks
Converts a Message struct to the provider-specific format.
Parameters
message
- The Message struct to convert
Streams a chat response from the LLM to the given process.
Parameters
messages
- List of Message structs representing the conversation historymessage_id
- ID for the response messagepid
- The process ID to stream the response toopts
- Options for the request (model, temperature, etc.)
Converts a Tool struct to the provider-specific format.
Parameters
tool
- The Tool struct to convert