Hi, I have this tools (function calling)
const tools = [
{
"type": "function",
"function": {
"name": "extractShoppingDetail",
"description": "Extract shopping detail from the user prompt",
"parameters": {
"type": "object",
"properties": {
"item": {
"type": "string",
"description": "The item name"
},
"amount": {
"type": "number",
"description": "The amount of the item. Default to 1"
},
"brand": {
"type": "string",
"description": "The brand of the item. Return null if not specified",
},
"price": {
"type": "number",
"description": "The price of the item. Return null if not specified"
}
},
"required": ["query"]
}
}
}
]
If my user’s prompt like this
const userPrompt = `I need a running tshirt for my son for this holiday, and my budget is $50`
The returned value only
{
"item": "running t-shirt",
"price": 50
}
Which is missing the brand and amount of information.
How can I give a default value in this case?