-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Feedback for “Getting Started” - Failed to convert the response to stream. #472
Comments
Thank you, this should be fixed now. But all I did was adjust the types and it worked, so I'm unsure about your error. Are you on the most up-to-date |
"next": "13.4.19", Met the similar problem from this get start, this line
|
I get the same error, using the exact same versions of the packages. Maybe this issue should be re-opened. |
Hello, did you manage to get over the error? |
I used |
You can also //tsignore in the line above to ignore the type error. Code runs just fine.
…________________________________
From: Kuiliang Zhang ***@***.***>
Sent: Friday, September 29, 2023 10:30 PM
To: vercel/ai ***@***.***>
Cc: bigxalx ***@***.***>; Comment ***@***.***>
Subject: Re: [vercel/ai] Feedback for “Getting Started” - Failed to convert the response to stream. (Issue #472)
"next": "13.4.19", "openai": "^4.10.0", "ai": "^2.2.13",
Met the similar problem from this get start, this line const stream = OpenAIStream(response);
Argument of type 'Stream<Completion>' is not assignable to parameter of type 'Response | AsyncIterableOpenAIStreamReturnTypes'.
Type 'Stream<Completion>' is not assignable to type 'AsyncIterable<Completion>'.
The types returned by '[Symbol.asyncIterator]().next(...)' are incompatible between these types.
Type 'Promise<IteratorResult<import("/Users/leonz/Github/positive-diary/node_modules/openai/resources/completions").Completion, any>>' is not assignable to type 'Promise<IteratorResult<Completion, any>>'.
...
```
Hello, did you manage to get over the error?
I used openai.chat.completions.create rather than openai.completions.create then problem solved. you can see the example here https://sdk.vercel.ai/docs/guides/providers/openai
—
Reply to this email directly, view it on GitHub<#472 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAD42YWLVO67DVVSMH7VPALX44VUXANCNFSM6AAAAAA3VWSID4>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Next: 13.4.18
OpenAI: 4.0.0
Basic route from /getting-started docs:
Causing the following error:
Failed to convert the response to stream. Received status code: undefined
TypeScript errors for
OpenAIStream(response)
:The text was updated successfully, but these errors were encountered: