From f62a25ae0cfc3fab1d78b2fdc612d354b76c9e98 Mon Sep 17 00:00:00 2001 From: zoubobo Date: Thu, 23 Oct 2025 02:11:58 +0800 Subject: [PATCH] fix deepseek --- tradingagents/agents/utils/memory.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/tradingagents/agents/utils/memory.py b/tradingagents/agents/utils/memory.py index 7eced831..821901d4 100644 --- a/tradingagents/agents/utils/memory.py +++ b/tradingagents/agents/utils/memory.py @@ -11,9 +11,7 @@ class FinancialSituationMemory: backend_url = self.config.get("backend_url", "") # Set embedding model based on backend - if "deepseek" in backend_url: - self.embedding = "deepseek-embed" - elif backend_url == "http://localhost:11434/v1": + if backend_url == "http://localhost:11434/v1": self.embedding = "nomic-embed-text" else: self.embedding = "text-embedding-3-small" @@ -25,17 +23,7 @@ class FinancialSituationMemory: """Get embedding for a text from the configured backend""" backend_url = self.config.get("backend_url", "") - if "deepseek" in backend_url: - client = OpenAI( - api_key=os.environ.get("DEEPSEEK_API_KEY"), - base_url=backend_url - ) - response = client.embeddings.create( - model=self.embedding, - input=text - ) - return response.data[0].embedding - elif os.environ.get("OPENAI_API_KEY") and "openai" in backend_url: + if os.environ.get("OPENAI_API_KEY") and "openai" in backend_url: client = OpenAI() response = client.embeddings.create( model=self.embedding,