perf: Remove unnecessary dependencies

This commit is contained in:
fit2cloud-chenyw
2025-05-28 15:31:15 +08:00
parent 9b7c12f07e
commit b4677e0fd6
2 changed files with 5 additions and 6 deletions
@@ -3,7 +3,7 @@ from typing import Optional, Dict, Any, Type
from abc import ABC, abstractmethod
from langchain_core.language_models import BaseLLM as LangchainBaseLLM
from langchain_openai import ChatOpenAI
from langchain_community.llms import Tongyi, VLLM
# from langchain_community.llms import Tongyi, VLLM
class LLMConfig(BaseModel):
"""Base configuration class for large language models"""
@@ -43,7 +43,7 @@ class OpenAILLM(BaseLLM):
def generate(self, prompt: str) -> str:
return self.llm.invoke(prompt)
class TongyiLLM(BaseLLM):
""" class TongyiLLM(BaseLLM):
def _init_llm(self) -> LangchainBaseLLM:
return Tongyi(
model_name=self.config.model_name,
@@ -62,7 +62,7 @@ class VLLMLLM(BaseLLM):
)
def generate(self, prompt: str) -> str:
return self.llm.invoke(prompt)
return self.llm.invoke(prompt) """
class LLMFactory:
@@ -70,8 +70,8 @@ class LLMFactory:
_llm_types: Dict[str, Type[BaseLLM]] = {
"openai": OpenAILLM,
"tongyi": TongyiLLM,
"vllm": VLLMLLM
"tongyi": OpenAILLM,
"vllm": OpenAILLM
}
@classmethod
-1
View File
@@ -24,7 +24,6 @@ dependencies = [
"langchain-openai>=0.3,<0.4",
"langchain-community>=0.3,<0.4",
"langgraph>=0.3,<0.4",
"vllm>=0.8.5",
"dashscope>=1.14.0,<2.0.0",
"pymysql (>=1.1.1,<2.0.0)",
"cryptography (>=44.0.3,<45.0.0)",