Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

代码中没有调用tools,怎么自动调用了 #419

Open
XIEDEI opened this issue Dec 23, 2024 · 1 comment
Open

代码中没有调用tools,怎么自动调用了 #419

XIEDEI opened this issue Dec 23, 2024 · 1 comment

Comments

@XIEDEI
Copy link

XIEDEI commented Dec 23, 2024

我看代码中也没有Assistant也没有写function_list=tools,但是还是能自动调用工具,为什么

from qwen_agent.agents import Assistant

def test():
llm_cfg = {
# Use the model service provided by DashScope:
# 'model_type': 'qwen_dashscope',
'model': 'qwen2_72b',
# 'model_server': 'dashscope',
# Use your own model service compatible with OpenAI API:
# 'model': 'Qwen',
'model_server': 'http://127.0.0.1:1025/v1',
# (Optional) LLM hyper-paramters:
'generate_cfg': {
'top_p': 0.8,
# 'stream': False
}
}
bot = Assistant(llm=llm_cfg)
messages = [{'role': 'user', 'content': [{'text': '介绍图一'}, {'file': 'https://arxiv.org/pdf/1706.03762.pdf'}]}]
for rsp in bot.run(messages):
print(rsp)
if name == 'main':
test()

@tuhahaha
Copy link
Collaborator

这个例子是因为传了文件,Assistant会默认使用rag工具来解析和处理文件

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants