New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gpt-4-vision-preview does not work as expected. #573
Comments
Without stream it doesn't work as well. |
Hmm, it may be that your program is exiting because you're not waiting for the stream to complete. Try this: const testVision = async () => {
const stream = await openai.beta.chat.completions.stream({
model: 'gpt-4-vision-preview',
messages: [
{
role: 'user',
content: [{
type: 'image_url',
image_url: convertImageToDataURLSync('1.png'),
}],
}
],
stream: true,
});
stream.on('content', (delta, snapshot) => {
process.stdout.write(delta)
});
await stream.finalChatCompletion();
console.log();
} Does that help? |
I tried this one with the same result. const testVision = async () => {
const stream = await openai.chat.completions.create({
model: 'gpt-4-vision-preview',
messages: [
{
role: 'user',
content: [{
type: 'image_url',
image_url: convertImageToDataURLSync('1.png'),
}],
}
],
});
console.log('Not a stream', stream.choices[0].message.content);
} as well i tested you version of my code, the same result. |
… On Fri, Dec 15 2023 at 10:29 PM, iterprise ***@***.***> wrote:
I tried this one with the same result.
const testVision = async () => {
const stream = await openai.chat.completions.create({
model: 'gpt-4-vision-preview',
messages: [
{
role: 'user',
content: [{
type: 'image_url',
image_url: convertImageToDataURLSync('1.png'),
}],
}
],
});
console.log('Not a stream', stream.choices[0].message.content);
}
as well i tested you version of my code, the same result.
—
Reply to this email directly, view it on GitHub
<#573 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFL6LQM26FPFLILWZ7LOU3YJUIS7AVCNFSM6AAAAABAXA6RCKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJYG4YDAMBUGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
@rattrayalex |
It's probably a problem with the underlying API, not a bug in the Node SDK. |
Hi @iterprise, thanks for the report. We can confirm this is an issue in the API and are working on addressing it. As a workaround, you can manually set the value of |
Confirm this is a Node library issue and not an underlying OpenAI API issue
Describe the bug
The response from ChatGPT unexpectedly cuts off if using stream. The response via API does not match the request through chat; through the API, I only receive the beginning of the response which unexpectedly cuts off. I think this is related to the bug below."
#499
To Reproduce
openai.beta.chat.completions.stream with image_url
I use the following image.
From API I got only
The instructions are asking for a modification of the SQL
CREATE TABLEstatement for
From chat I got much more.
Code snippets
OS
Linux
Node version
Node v18.16.0
Library version
openai 4.22.0
The text was updated successfully, but these errors were encountered: