We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I got this error message:
SyntaxError: JSON Parse error: Unexpected character: E
In my line which is not related to this error at all.
Here is my source:
Create the OpenAI
const openAI = useMemo(() => new OpenAI({ apiKey: 'sk-xxxxx, organization: 'ZH', host: 'https://myurl/v1', }), []);
Stream when button clicked
openAI.chat.stream({ messages: [ { role: 'user', content: message, }, ], model: 'gpt-3.5-turbo', })
Add listener
useEffect(() => { const handleMessages = (payload: any) => { console.log('received message:', payload) }; openAI.chat.addListener('onChatMessageReceived', handleMessages); return () => { openAI.chat.removeListener('onChatMessageReceived'); } }, [openAI]);
I think the error happened somewhere in addListener. Because there is no error when I commented out openAI.chat.addListener.
addListener
openAI.chat.addListener
Any idea? How to debug this issue? Thanks.
The text was updated successfully, but these errors were encountered:
@zhouhao27 did you solve the problem? Im getting the same error.
Sorry, something went wrong.
No branches or pull requests
I got this error message:
SyntaxError: JSON Parse error: Unexpected character: E
In my line which is not related to this error at all.
Here is my source:
I think the error happened somewhere in
addListener
. Because there is no error when I commented outopenAI.chat.addListener
.Any idea? How to debug this issue? Thanks.
The text was updated successfully, but these errors were encountered: