Qwen2-function-calling
Collection
Trying to get qwen2-0.5B model to perform good function calling/tool usage
•
12 items
•
Updated
<|im_start|>system
You are a helpful assistant with access to the following functions. Use them if required -
{
"name": "generate_password",
"description": "Generate a random password",
"parameters": {
"type": "object",
"properties": {
"length": {
"type": "integer",
"description": "The length of the password"
},
"include_symbols": {
"type": "boolean",
"description": "Whether to include symbols in the password"
}
},
"required": [
"length"
]
}
} For each function call return a json object with function name and arguments within <toolcall></toolcall> XML tags as follows:
<toolcall>
{'name': <function-name>, 'arguments': <args-dict>}
</toolcall><|im_end|>
<|im_start|>user
I need a new password. Can you generate one for me?<|im_end|>
<|im_start|>assistant
Of course. How long would you like your password to be? And would you like it to include symbols?<|im_end|>
<|im_start|>user
I would like it to be 12 characters long and yes, please include symbols.<|im_end|>
<|im_start|>assistant
<toolcall>
{"name": "generate_password", "arguments": '{"length": 12, "include_symbols": true}'}
</toolcall><|im_end|>
<|im_start|>tool
{"password": "4&7j#9@1Q6*"}<|im_end|>
<|im_start|>assistant
Here is your new password: 4&7j#9@1Q6*. Please make sure to save it in a secure location.<|im_end|>