The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.
Python agentic-memoryagentic-memory-systemagentsaiai-agentschatgptgenaillmlong-term-memorymemorymemory-managementpythonragstate-management
[Bug fix] import App shouldn't throw other llm deps errors (#837)
Sidharth Mohantya27eeb3255a2
diff --git a/embedchain/llm/llama2.py b/embedchain/llm/llama2.pyindex 0c65ef531..d4f4aa2f5 100644--- a/embedchain/llm/llama2.py+++ b/embedchain/llm/llama2.py@@ -8,18 +8,17 @@ from embedchain.config import BaseLlmConfigfrom embedchain.helper.json_serializable import register_deserializablefrom embedchain.llm.base import BaseLlm-try:- importlib.import_module("replicate")-except ModuleNotFoundError:- raise ModuleNotFoundError(- "The required dependencies for Llama2 are not installed."- 'Please install with `pip install --upgrade "embedchain[llama2]"`'- ) from None-@register_deserializableclass Llama2Llm(BaseLlm):def __init__(self, config: Optional[BaseLlmConfig] = None):+ try:+ importlib.import_module("replicate")+ except ModuleNotFoundError:+ raise ModuleNotFoundError(+ "The required dependencies for Llama2 are not installed."+ 'Please install with `pip install --upgrade "embedchain[llama2]"`'+ ) from Noneif "REPLICATE_API_TOKEN" not in os.environ:raise ValueError("Please set the REPLICATE_API_TOKEN environment variable.")diff --git a/embedchain/llm/vertex_ai.py b/embedchain/llm/vertex_ai.pyindex 98e816211..224c65f16 100644--- a/embedchain/llm/vertex_ai.py+++ b/embedchain/llm/vertex_ai.py@@ -6,18 +6,17 @@ from embedchain.config import BaseLlmConfigfrom embedchain.helper.json_serializable import register_deserializablefrom embedchain.llm.base import BaseLlm-try:- importlib.import_module("vertexai")-except ModuleNotFoundError:- raise ModuleNotFoundError(- "The required dependencies for VertexAI are not installed."- 'Please install with `pip install --upgrade "embedchain[vertexai]"`'- ) from None-@register_deserializableclass VertexAILlm(BaseLlm):def __init__(self, config: Optional[BaseLlmConfig] = None):+ try:+ importlib.import_module("vertexai")+ except ModuleNotFoundError:+ raise ModuleNotFoundError(+ "The required dependencies for VertexAI are not installed."+ 'Please install with `pip install --upgrade "embedchain[vertexai]"`'+ ) from Nonesuper().__init__(config=config)def get_llm_model_answer(self, prompt):