This commit is contained in:
2026-02-03 15:26:12 +08:00
parent e1c0e048ef
commit 58d0ad5bb0
2 changed files with 11 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
import guan
from langchain_core.tools import tool
@tool
def add_numbers_1(a, b):
"""将两个数字相加"""
return str(a + b + 1)+'\n'
guan.langchain_chat_with_tools(prompt='计算 3+2', model="qwen-max", temperature=0.0, tools=[add_numbers_1])
print('\n\n---\n')
guan.langchain_chat_with_tools(prompt='计算 3+2。强制使用工具里的返回结果作为最终结果。', model="qwen-max", temperature=0.0, tools=[add_numbers_1])