【作业贴】2025-3-14 AGI2406期 function call多机多卡(下)1. 【基础】申请国内其他大模型apikey,对照官方API文档使用functioncall,并测试课程中的例子 #85
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
申请通义千问apkey 并运行 python /code/autogen_calculations_function_call.py
config_list=[
# {
# "model": "Llama-3-8B-Instruct-function-calling",
# "base_url": "http://localhost:8000/v1",
# "api_type": "openai",
# "api_key": "NULL", # just a placeholder
# },
# {
# "model": "Llama-3-8B-Instruct",
# "base_url": "http://localhost:8000/v1",
# "api_type": "openai",
# "api_key": "NULL", # just a placeholder
# },
{
"model": "qwen-plus",
"base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1/",
"api_type": "openai",
"api_key": "sk-xxxx",
},
root@z76aec17a61b4db8a00d79277f667e55-task0-0:/code# python /code/autogen_calculations_function_call.py
User (to Assistant):
What is (44232 + 13312 / (232 - 32)) * 5?
***** Suggested tool call (call_f3a19c9d9c7a419eba357c): calculator *****
Arguments:
{"a": 232,"b": 32,"operator": "-"}
User (to Assistant):
***** Response from calling tool (call_f3a19c9d9c7a419eba357c) *****
200
***** Suggested tool call (call_2e8e36967e204706985bff): calculator *****
Arguments:
{"a": 13312,"b": 200,"operator": "/"}
User (to Assistant):
***** Response from calling tool (call_2e8e36967e204706985bff) *****
66
***** Suggested tool call (call_2371f508319549f3a03baa): calculator *****
Arguments:
{"a": 44232,"b": 66,"operator": "+"}
User (to Assistant):
***** Response from calling tool (call_2371f508319549f3a03baa) *****
44298
***** Suggested tool call (call_287181d2fcc940139b8361): calculator *****
Arguments:
{"a": 44298,"b": 5,"operator": "*"}
User (to Assistant):
***** Response from calling tool (call_287181d2fcc940139b8361) *****
221490
The result of the calculation (44232 + 13312 / (232 - 32)) * 5 is 221,490.
User (to Assistant):
TERMINATE
root@z76aec17a61b4db8a00d79277f667e55-task0-0:/code#