fix: restore lmstudio/deepseek providers in TS factory, add langchain to extras

- Restore LMStudioEmbedder, LMStudioLLM, DeepSeekLLM in TS factory.ts
  (accidentally removed during graph store cleanup — unrelated to graphs)
- Add langchain>=0.1.0 to Python extras dep group (was transitively
  provided by langchain-neo4j in the removed graph group, still needed
  by mem0/llms/langchain.py and mem0/embeddings/langchain.py)
- Add pytest.importorskip("langchain") to test_langchain.py for graceful
  skip when langchain isn't installed

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Soumil Rathi
2026-04-13 12:55:36 -07:00
parent 1a2edf739d
commit 78cc11ef1f
3 changed files with 12 additions and 0 deletions
+9
View File
@@ -1,5 +1,6 @@
import { OpenAIEmbedder } from "../embeddings/openai";
import { OllamaEmbedder } from "../embeddings/ollama";
import { LMStudioEmbedder } from "../embeddings/lmstudio";
import { OpenAILLM } from "../llms/openai";
import { OpenAIStructuredLLM } from "../llms/openai_structured";
import { AnthropicLLM } from "../llms/anthropic";
@@ -19,6 +20,8 @@ import { Qdrant } from "../vector_stores/qdrant";
import { VectorizeDB } from "../vector_stores/vectorize";
import { RedisDB } from "../vector_stores/redis";
import { OllamaLLM } from "../llms/ollama";
import { LMStudioLLM } from "../llms/lmstudio";
import { DeepSeekLLM } from "../llms/deepseek";
import { SupabaseDB } from "../vector_stores/supabase";
import { SQLiteManager } from "../storage/SQLiteManager";
import { MemoryHistoryManager } from "../storage/MemoryHistoryManager";
@@ -41,6 +44,8 @@ export class EmbedderFactory {
return new OpenAIEmbedder(config);
case "ollama":
return new OllamaEmbedder(config);
case "lmstudio":
return new LMStudioEmbedder(config);
case "google":
case "gemini":
return new GoogleEmbedder(config);
@@ -67,6 +72,8 @@ export class LLMFactory {
return new GroqLLM(config);
case "ollama":
return new OllamaLLM(config);
case "lmstudio":
return new LMStudioLLM(config);
case "google":
case "gemini":
return new GoogleLLM(config);
@@ -76,6 +83,8 @@ export class LLMFactory {
return new MistralLLM(config);
case "langchain":
return new LangchainLLM(config);
case "deepseek":
return new DeepSeekLLM(config);
default:
throw new Error(`Unsupported LLM provider: ${provider}`);
}
+1
View File
@@ -64,6 +64,7 @@ llms = [
]
extras = [
"boto3>=1.34.0",
"langchain>=0.1.0",
"langchain-community>=0.0.0",
"sentence-transformers>=5.0.0",
"elasticsearch>=8.0.0,<9.0.0",
+2
View File
@@ -2,6 +2,8 @@ from unittest.mock import Mock
import pytest
pytest.importorskip("langchain", reason="langchain not installed")
from mem0.configs.llms.base import BaseLlmConfig
from mem0.llms.langchain import LangchainLLM