OpenAI Fine Tuning with Function Calls - Arguments...
# support
c
Hello! I'm working on a fine tuning data set that includes function calls as part of the training data, however, I get this error when using the Vapi preferred parameters: The job failed due to an invalid training file. Invalid file format. Line 1, message 13, key "function_call.arguments": Field required Apparently it wants me to replace parameters with arguments, however, that isn't compatible with how Vapi wants the function call. Here's the code I'm trying to use: { "function": { "name": "identify_transfer_type", "parameters": { "classificationId": "Lookup classificationId based on query" } } }, { "function": { "name": "send_message", "parameters": { "callerName": "Emma Smith", "classificationId": "use the classificationId parameter from the identify_transfer_type function", "membershipId": "use the membershipId parameter from the identify_transfer_type function", "message": "Caller Emma Smith requested an appointment. The best callback number for her is 555-547-1124." } } } What's the correct way to format for fine tuning data with functions for OpenAI? Thanks!
v
You can continue this conversation by mentioning me in the message.
@ccmenshealth Hello! It seems like you're encountering an issue with the format expected by OpenAI's fine-tuning process. While I can't directly resolve issues related to OpenAI's fine-tuning, I can certainly help you understand how to format function calls for VAPI. For VAPI, you're using the correct format with "parameters" as the key for passing arguments to functions. However, for OpenAI's fine-tuning, it appears that the expected key is "arguments" instead of "parameters". To resolve the issue, you should adjust your training data to match the expected format for OpenAI's fine-tuning. Here's how you might adjust your code:
Copy code
json
{
    "function": {
        "name": "identify_transfer_type",
        "arguments": {
            "classificationId": "Lookup classificationId based on query"
        }
    }
},
{
    "function": {
        "name": "send_message",
        "arguments": {
            "callerName": "Emma Smith",
            "classificationId": "use the classificationId argument from the identify_transfer_type function",
            "membershipId": "use the membershipId argument from the identify_transfer_type function",
            "message": "Caller Emma Smith requested an appointment. The best callback number for her is 555-547-1124."
        }
    }
}
Please note that you should replace "parameters" with "arguments" to match the expected format for fine-tuning. If you have further questions or need assistance with VAPI functions, feel free to ask!
c
But wouldn't the output of the fine tuned model then be incompatible with Vapi?
s
@ccmenshealth To convert your VAPI function schema to OpenAI's format, follow these steps: Wrap Functions in an Array: OpenAI expects functions to be listed in a functions array. Define Each Function: Name: The function's name. Description: A brief explanation of what the function does. Parameters: Use JSON Schema to detail expected parameters. Structure Parameters with JSON Schema: Type: Set to "object". Properties: List each parameter with its type and description. Required: Specify which parameters are mandatory. Use arguments Instead of parameters in Function Calls: When calling functions, use the arguments field to pass parameters as a JSON-formatted string.
Do let me know if you require further help!!
52 Views