mirror of
https://github.com/RYDE-WORK/Langchain-Chatchat.git
synced 2026-01-29 10:13:20 +08:00
21 lines
676 B
Python
21 lines
676 B
Python
import sys
|
|
from pathlib import Path
|
|
sys.path.append(str(Path(__file__).parent.parent))
|
|
|
|
from server.utils import get_ChatOpenAI
|
|
from server.agent.tools_factory.tools_registry import all_tools
|
|
from server.agent.agent_factory.qwen_agent import initialize_qwen_agent
|
|
from langchain import globals
|
|
|
|
globals.set_debug(True)
|
|
globals.set_verbose(True)
|
|
|
|
|
|
qwen_model = get_ChatOpenAI("Qwen-1_8B-Chat", 0.01, streaming=False)
|
|
executor = initialize_qwen_agent(tools=all_tools, llm=qwen_model)
|
|
|
|
# ret = executor.invoke("苏州今天冷吗")
|
|
ret = executor.invoke("从知识库samples中查询chatchat项目简介")
|
|
# ret = executor.invoke("chatchat项目主要issue有哪些")
|
|
print(ret)
|