Open Ray8716397 opened 6 months ago
i modified the submitUserMessage function for using langchain like: async function submitUserMessage(content: string) { 'use server' console.error(content); const aiState = getMutableAIState()
aiState.update({ ...aiState.get(), messages: [ ...aiState.get().messages, { id: nanoid(), role: 'user', content } ] }) const textStream = createStreamableUI(<SpinnerMessage/>) const msgs = aiState.get().messages; // console.log(aiState.get().messages[]); runAsyncFnWithoutBlocking(async () => { let buf = ""; try { const res = await chain.call({ input: content, callbacks: [ { handleLLMNewToken(token) { buf += token; textStream.update(<BotMessage content={buf}/>); }, // handleLLMEnd(token) { // // emitter.emit("data", { event: "end" }); // console.log("stream:\n", token); // textStream.done(<BotMessage content={buf} />); // }, }, ], }); } catch (e) { console.error(e); } finally { textStream.done(<BotMessage content={buf}/>); } }) return { id: nanoid(), display: textStream.value }
}
but I change Got no response after 6 rounds of dialogues,how can i debug it or how can i solve it,please help
I'm experiencing the exact same issue, did you ever end up solving this?
i modified the submitUserMessage function for using langchain like: async function submitUserMessage(content: string) { 'use server' console.error(content); const aiState = getMutableAIState()
}
but I change Got no response after 6 rounds of dialogues,how can i debug it or how can i solve it,please help