LLMProvider
The LLMProvider class is part of the automata.config.base module
and serves as a crucial component in the architecture of the library,
enabling the selection of the language learning model provider for an
Automata agent.
Exposed through the AgentConfig.get_llm_provider method, the
LLMProvider enumerates all the possible sources of language learning
models that the library supports.
Usage Example
from automata.config.base import AgentConfig
from automata.config.openai_agent import OpenAIAutomataAgentConfig
# Instantiate the AgentConfig
agent_config = AgentConfig()
# Get the LLM Provider for the agent
provider = agent_config.get_llm_provider()
# Get the LLM Provider for an OpenAI agent
openai_provider = OpenAIAutomataAgentConfig.get_llm_provider()
# Assuming a database provider for LLM Conversation
def set_database_provider(self, provider):
self.provider = provider
Limitations
The LLMProvider class depends directly on the enum definitions provided in the library, restricting its usage to the defined providers only. Any new provider addition would require the library’s codebase modification.
The class also mandates the use of suitable methods that retrieve LLM providers, especially when handling specific agents, implying that the agent classes should adhere to the designated function signatures to ensure compatibility.
Follow-up Questions:
What is the process to introduce additional LLM Providers?
How do we handle LLM Providers unavailability or deprecation in the market? How to reflect these changes in the
LLMProvider?How can custom data providers be registered within the
LLMProviderlist?
Note: The descriptions for some related symbols such as
automata.tests.unit.sample_modules.sample_module_write.CsSWU and
automata.tests.unit.sample_modules.sample_module_write.ldNZI were
generated from placeholder docstrings in the test suites and hence offer
limited information about their roles and usage.