ollama 部署
qwen2.5:3b
0.3.11版本
agents使用
https://qwen.readthedocs.io/en/latest/framework/function_call.html
from openai import OpenAI
import json
def send_messages(messages):
response = client.chat.completions.create(
model="qwen2.5:3b",
messages=messages,
tools=tools,
tool_choice="auto",
)
return response.choices[0].message
def get_weather(location):
weather_data = {
"杭州": "24℃",