Hi, could it be that there has been some kind of change to the GPT-4-Vision-Preview API? It now throws an error: Analysis: {“error”:{“code”:null,“message”:“2 validation errors for Request\nbody → prompt\n field required (type=value_error.missing)\nbody → messages\n extra fields not permitted (type=value_error.extra)”,“param”:null,“type”:“invalid_request_error”}}
Suggesting that a needs a “prompt” field and no longer accepts “messages”.
I have not been able to find any docs on this.
My code used is:
headers = {
“Content-Type”: “application/json”,
“Authorization”: f"Bearer {ahead_openai_api_key}"
}
payload = {
"model": "gpt-4-vision-preview",
"messages": [
{
"role": "user",
"content": [
{
"type":"text",
"text":"Please describe this picture."
},
{
"type": "image",
"data": image_data
}
]
}
],
"max_tokens": 300
}
analysis_response = requests.post("https://api.openai.com/v1/completions", headers=headers, json=payload)