支持ai对话切换通义千问,

This commit is contained in:
XIE7654
2025-07-22 15:14:29 +08:00
parent 890487e5b1
commit 6f3fe91014
5 changed files with 149 additions and 39 deletions

View File

@@ -1,4 +1,4 @@
from langchain_deepseek import ChatDeepSeek
from langchain_community.chat_models import ChatTongyi
from http import HTTPStatus
from urllib.parse import urlparse, unquote
from pathlib import PurePosixPath
@@ -13,7 +13,7 @@ class TongYiAdapter(MultiModalAICapability):
def __init__(self, api_key, model, **kwargs):
self.api_key = api_key
self.model = model
self.llm = ChatDeepSeek(api_key=api_key, model=model, streaming=True)
self.llm = ChatTongyi(api_key=api_key, model=model, streaming=True)
async def chat(self, messages, **kwargs):
# 兼容 DeepSeek 的调用方式