Skip to content

Conversation

@hhaAndroid
Copy link
Collaborator

@hhaAndroid hhaAndroid commented Dec 25, 2025

chatml_messages = {
    "messages": [
        {"role": "system", "content": "这是系统消息"},
        {"role": "user", "content": "Hey, what's the temperature in Paris right now?"},
        {"role": "assistant", "content": "你是对的",
                    "tool_calls": [
                            {
                                "id": "call_123",
                                "type": "function",
                                "function": {
                                    "name": "get_weather",
                                    "arguments": "{\"location\": \"Boston\"}"
                                }
                            },
                            {
                                "id": "call_456",
                                "type": "function",
                                "function": {
                                    "name": "get_weather",
                                    "arguments": "{\"location\": \"beijing \"}"
                                }
                            }
                        ],
                        "reasoning_content": ""},
        {"role": "tool", "content": "22"},
        {"role": "assistant", "content": "你问的特别好"}
        ],
    "tools": [{
                "type": "function",
                "function": {
                    "name": "get_current_temperature",
                    "description": "Gets the temperature at a given location.",
                    "parameters": {
                        "type": "object",
                        "properties": {
                            "location": {
                                "type": "string",
                                "description": "The location to get the temperature for"
                            }
                        },
                        "required": [
                            "location"
                        ]
                    }
                }
            },
            {"type": "function", "function": {"name": "get_current_wind_speed", "description": "Get the current wind speed in km/h at a given location.", "parameters": {"type": "object", "properties": {"location": {"type": "string", "description": "The location to get the wind speed for, in the format \"City, Country\""}}, "required": ["location"]}}}
              ],
}
chat_template = CHAT_TEMPLATE_MAP['qwen3-vl']
_messages = ChatMessages(**chatml_messages)
prompt = _messages.get_prompt(chat_template)
image

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

Successfully merging this pull request may close these issues.

1 participant