Hi i’m trying to build a API call from openAI to sometime i get an error this error
There was an issue setting up your call.
Raw response for the API
Status code 400
{
“error”: {
“message”: “We could not parse the JSON body of your request. (HINT: This likely means you aren’t using your HTTP library correctly. The OpenAI API expects a JSON payload, but what was sent was not valid JSON. If you have trouble figuring out how to fix this, please send an email to [email protected] and include any relevant code you’d like help with.)”,
“type”: “invalid_request_error”,
“param”: null,
“code”: null
}
}
my API call is the following
{
“model”: “text-davinci-003”,
“prompt”: “Q: can you explain to me this excel \n =INDEX(A1:D10, MATCH(“maximum”, A1:D10, 0), MATCH(“January”, A1:D1, 0)) \n”,
“temperature”: 0.22,
“max_tokens”: 500,
“top_p”: 1,
“frequency_penalty”: 0,
“presence_penalty”: 0
}
where is bold is the dynamic value, to be notice is that if run the call with an other dynamic value
{
“model”: “text-davinci-003”,
“prompt”: “Q: can you explain to me this excel \n =SUM(A1:A2) \n”,
“temperature”: 0.22,
“max_tokens”: 500,
“top_p”: 1,
“frequency_penalty”: 0,
“presence_penalty”: 0
}
the call works.
any tip?