Nutlope / twitterbio

Generate your Twitter bio with Mixtral and GPT-3.5.
https://www.twitterbio.io
MIT License
1.66k stars 465 forks source link

TypeError: res.body is not async iterable #43

Closed satpalsr closed 1 year ago

satpalsr commented 1 year ago

I copied OpenAIStream and generate.ts to implement it my codebase but getting below error

OpenAIStream.ts:73 Uncaught (in promise) TypeError: res.body is not async iterable
    at Object.start (webpack-internal:///(app-client)/./utils/OpenAIStream.ts:52:43)
    at OpenAIStream (webpack-internal:///(app-client)/./utils/OpenAIStream.ts:20:20)
    at async generate (webpack-internal:///(app-client)/./app/gen/generate.ts:37:20)
    at async sendMessage (webpack-internal:///(app-client)/./app/chat/page.tsx:30:26)

in line https://github.com/Nutlope/twitterbio/blob/e799871764e559cd96608bfefcc3976e7daf346a/utils/OpenAIStream.ts#L73

Not sure, what should I change. May be some package version? but which

satpalsr commented 1 year ago

Not sure but I probably did something wrong in defining functions. I started from scratch with new route handlers and used export async function POST(req: NextRequest) { for generate.ts it's working great.