更新python后端
This commit is contained in:
@@ -1,6 +1,34 @@
|
||||
|
||||
from langchain_community.chat_models.tongyi import ChatTongyi
|
||||
from utils.Tools import all_tools
|
||||
from langchain.chat_models import init_chat_model
|
||||
from langchain_openai import ChatOpenAI
|
||||
from openai import OpenAI
|
||||
import os
|
||||
from langchain_openai import OpenAIEmbeddings
|
||||
# 通义千文Key
|
||||
tongyiKey = "sk-9464b2498c184982a9fe9d2c2e725ab5"
|
||||
# DeepSeekKey
|
||||
deepseekKey = "sk-6129a200ae294b9f86553505191fa477"
|
||||
|
||||
llm = ChatTongyi(streaming=False, api_key="sk-fb46eefb6b404382a0a5325202e923a6")
|
||||
llm = ChatTongyi(streaming=False, api_key=tongyiKey)
|
||||
llm_with_tools = llm.bind_tools(all_tools)
|
||||
|
||||
llmThink = ChatOpenAI(
|
||||
api_key=tongyiKey,
|
||||
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
|
||||
model="qwen-max",
|
||||
stream = False
|
||||
)
|
||||
from langchain_community.embeddings import DashScopeEmbeddings
|
||||
embeddings = DashScopeEmbeddings(
|
||||
model="text-embedding-v3",
|
||||
dashscope_api_key= tongyiKey,
|
||||
)
|
||||
|
||||
# from langchain_deepseek import ChatDeepSeek
|
||||
# llm = ChatDeepSeek(
|
||||
# model="deepseek-reasoner",
|
||||
# api_key=deepseekKey,
|
||||
# api_base="https://api.deepseek.com"
|
||||
# )
|
||||
|
||||
Reference in New Issue
Block a user