40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
|
|
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
|
|
from langchain_community.embeddings import DashScopeEmbeddings
|
|
|
|
# 通义千文Key
|
|
tongyiKey = "sk-9464b2498c184982a9fe9d2c2e725ab5"
|
|
# DeepSeekKey
|
|
deepseekKey = "sk-6129a200ae294b9f86553505191fa477"
|
|
|
|
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",
|
|
)
|
|
llmEmbeddings = DashScopeEmbeddings(
|
|
model="text-embedding-v3",
|
|
dashscope_api_key= tongyiKey,
|
|
)
|
|
llmVision = ChatOpenAI(
|
|
api_key=tongyiKey,
|
|
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
|
|
model="qwen-vl-plus",
|
|
)
|
|
|
|
# from langchain_deepseek import ChatDeepSeek
|
|
# llm = ChatDeepSeek(
|
|
# model="deepseek-reasoner",
|
|
# api_key=deepseekKey,
|
|
# api_base="https://api.deepseek.com"
|
|
# )
|