Hi all,
When I use this script with a valid bearer token,
with open('test.json', 'r') as f:
jsonReport = json.load(f)
# print(jsonReport)
data = {
"input": jsonReport,
"model": "text-embedding-ada-002",
"encoding_format": "float"
}
headers = {'Content-Type':'application/json', 'Authorization':'Bearer ' }
x = requests.post(url, data=json.dumps(data), headers=headers)
print(x.text)
I receive this error:
{
"error": {
"message": "'$.input' is invalid. Please check the API reference: https://platform.openai.com/docs/api-reference.",
"type": "invalid_request_error",
"param": null,
"code": null
}
}
this is an example json I am using so its not filesize related…
{
"element1": ["value1", "value2", "value3"],
"element2": ["value4", "value5", "value6"],
"element3": ["value7", "value8", "value9"],
"element4": ["value10", "value11", "value12"]
}
I have also tried reading the json as a string and using a var, same issue.
its late and I suspect its my python thats the issue?
thanks