I’m trying to use the new parameters variable to pass along functions for chatGPT to use, but the values I pass for the "sort " property using “enum” are being overwritten, and I get values that were not in the enum array that I pass.
Example:
'name'=> 'getOrders',
'description'=> 'Get all Wix orders in an unsorted array',
'parameters'=> [
'type'=> 'object',
'properties'=> [
'returnFields'=> [
'type'=> 'string',
'enum' => ['id', 'number' ,'dateCreated' ,'buyerInfo.id' ,'buyerInfo.identityType' ,'buyerInfo.firstName' ,'buyerInfo.lastName' ,'buyerInfo.phone' ,'buyerInfo.email']
],
'sort' => [
'type' => 'string',
'enum' => ['dateCreated','lastUpdated','number']
]
],
'required'=> ['returnFields']
]
The response I get is
Response: Array
(
[role] => assistant
[content] =>
[function_call] => Array
(
[name] => getOrders
[arguments] => {
"returnFields": "totals.total,buyerInfo.email,buyerInfo.fullName",
"sort": "totals.total"
}
)
)```
Both buyerInfo.fullName and totals.total are not a part of the definition enum, but they end up in the response.
Anyone else experience something like that (or otherwise sees what I'm doing wrong)
Thanks!