Understanding the LLM abstraction layer that powers Agenite
LLMProvider
interface, which defines three essential methods:
BaseMessage
interface:
LLMStep
, which handles:
LLMProvider
interface rather than specific provider implementations, allowing you to easily swap providers without changing your agent logic.
BaseLLMProvider
class that simplifies implementing the LLMProvider
interface. It provides a default implementation of the iterate
method based on the generate
and stream
methods:
generate
and stream
methods, making it easier to add support for new LLM services.
iterateFromMethods
utility function that makes it easier to implement the iterate
method required by the LLMProvider
interface:
BaseLLMProvider
, the iterate
method is automatically implemented for you using iterateFromMethods
, which properly handles both streaming and non-streaming generation based on the options provided.