qwen function call(huggingface)
环境安装
下载文件
1 | git clone https://github.com/QwenLM/Qwen-main.git |
安装依赖
1 | conda create -n qwen python=3.10 |
Qwen-14B-Chat模型
qwen openai_api服务启动
测试脚本如下
openai.py代码
1 | # Requirement: |
qwen openai_api服务调用

postman服务调用
Qwen1.5-14B-Chat模型
qwen openai_api服务启动
测试脚本为qw.py
qw.py代码
1 | # Requirement: |
1 | { |
postman调用
接口返回
1 | { |
python调用方式
1 | import requests |
function call功能测试

接口入参
1 | { |
postman调用
接口返回
1 | { |
python 调用
1 | import requests |
物联网数据测试
function函数如下
1 | [ |
message输入如下
1 | { |
postman接口调用

成功命中函数iot_device_info_query

