Skip to content
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

No response after 6 rounds of dialogues #335

Open
Ray8716397 opened this issue May 10, 2024 · 0 comments
Open

No response after 6 rounds of dialogues #335

Ray8716397 opened this issue May 10, 2024 · 0 comments

Comments

@Ray8716397
Copy link

Screenshot from 2024-05-10 10-21-42

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant