Closed JpEncausse closed 1 month ago
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @glharper.
According to the code there is an error with variable : image_url
versus imageUrl
return {
type: obj["type"],
image_url: { url: obj.imageUrl["url"], detail: obj.imageUrl["detail"] },
};
Replacing the query with camelcase fix the issue
{
"type": "image_url",
"imageUrl": {
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
}
}
Setting options in getChatCompletions() will send the image and text but trigger also errors. Removing all options Fix it but ... how do you know if the user set an image ??
I use :
const options = {
"temperature": 0.7,
"top_p": 0.95,
"frequency_penalty": 0,
"presence_penalty": 0,
"max_tokens": 800,
"stop": null,
"tools": msg.llm.tools,
};
It is the stop attribute that trigger the error from server
I am glad this issue has been resolved. We strongly recommend that you migrate to using the AzureOpenAI
client exported by the official OpenAI client library for JavaScript. Please checkout the migration guide for information on how to do so.
@deyaaeldeen I was using the latest version (from NPM @azure/openai) and the migration doc you point sems to be a beta version ?
@JpEncausse To give more context, the latest of @azure/openai is v2.0.0-beta.1: https://www.npmjs.com/package/@azure/openai/v/2.0.0-beta.1. The migration guide asks you to migrate from @azure/openai@1.0.0-beta.12 to both [openai@^4.42.0] (https://www.npmjs.com/package/openai) and @azure/openai@1.0.0-beta.1. Please let me know if you have any questions about the migration process.
Describe the bug Following the documentation on ChatGPT-Vision Preview I got the message from OpenAI
TypeError: Cannot read properties of undefined (reading 'url')
To Reproduce Steps to reproduce the behavior:
Expected behavior Should return a description of the image and/or a better error description
Additional context I run this code on Node-RED. Everything works with various Model and Text but not with image.
StackTrace