i have been using function call in ChatGPT 3.5 ( in prompt )
now i switching to Official Method, function in API.
------ lets start the discussion with this sample :
{
“model”: “gpt-3.5-turbo-0613”,
“messages”: [{“role” : “user” , “content” : “i need you to send a email to zhihong, telling him we cancel meeting today” }],
“functions” : [{
“name” : “send_email”,
“description” : “Help drafting email and send the email”,
“parameters”: { “type”: “object”, “properties” : {
“email” : { “type” : “string” , “description” : “receipient email address” },
“subject” : { “type” : “string” , “description” : “Email Subject” },
“content” : { “type” : “string” , “description” : “Email content with html formatted” }
},
“required” : [“email”]
}
}],
“temperature” : 0.5,
“max_tokens” : 500
}
ChatGPT response :
“index”: 0,
“message”: {
“role”: “assistant”,
“content”: null,
“function_call”: {
“name”: “send_email”,
“arguments”: “{\n "email": "[my email]",\n "subject": "Meeting Cancellation",\n "content": "
Dear Zhihong,
I hope this email finds you well. I wanted to inform you that we have decided to cancel the meeting scheduled for today. I apologize for any inconvenience this may cause.
Best regards,
Your Name
"\n}”}
},
“finish_reason”: “function_call”
My Question :
All work well EXCEPT :
In my prompt, i didnt give chatGPT the receipient email address.
and i did mentioned Required = Email
Need any forumer give some input how to improve this.