I’m running into an interesting issue with a GET request defined in my Swagger spec. The name of the GET query parameter contains curly braces. The parameter is called zip (that square is supposed to be an open bracket followed by a close bracket). While the parameter is explicitly defined as a string, GPT treats it as an array. Here’s the Swagger definition:
{
"name": "zip[]",
"in": "query",
"required": false,
"schema": {
"type": "string"
},
"description": "The zip code."
},
And here is an example of GPT trying to pass the parameter:
I’ve tried escaping the brackets with backslashes, although that doesn’t work. I don’t believe you need to escape brackets provided they within quotes in a JSON…
{
"name": "zip[]",
"in": "query",
"required": false,
"schema": {
"type": "string"
},
"description": "The person's zip code. This parameter can be used more than once in the URL, for example: /endpoint?zip[]=11001&zip[]=11002"
},
No, I mean in the system prompt area, include an example of how you want the function returned, see if that influences the reply formatting, unless I have read this wrong, it looks like the model is returning the syntax incorrectly?
I’m not sure what you mean by system prompt area…do you mean in the message sent when interacting with ChatGPT? And yes, ChatGPT is sending something like this to the API: