XD2Sketch / react-chat-stream

⚛️ React Hook to add 🤖 ChatGPT-like word-by-word event streams
https://www.npmjs.com/package/@magicul/react-chat-stream
MIT License
49 stars 10 forks source link

fix crash when not using query #21

Closed lfuelling closed 2 months ago

lfuelling commented 7 months ago

This PR fixes the Something went wrong fetching AI response. error before any request happens.

This appears for example with the example code in the readme.

niels-bosman commented 4 months ago

@lfuelling We use body in this way and we are not getting any errors, can you check if this is still happening?

const chat = useChatStream({
    options: {
      url: 'URL',
      method: 'POST',
      body: {
        email: email,
      },
    },
    method: { type: 'body', key: 'query' },
  });