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

onFinish is called twice #980

Open
Ali-Hussein-dev opened this issue Feb 18, 2024 · 1 comment
Open

onFinish is called twice #980

Ali-Hussein-dev opened this issue Feb 18, 2024 · 1 comment
Labels
ai/ui bug Something isn't working

Comments

@Ali-Hussein-dev
Copy link

Description

Version: 2.2.35
Nextjs: 14.1.0
React: 18.2.0
after updating from 2.2.27 I found the onFinish (useCompletion) is called twice which is triggering a bug in my app.

Code example

  const res = useCompletion({
    api: "...",
    onFinish: (prompt, completion) => {
      console.log("onFinish running...") // runs twice
  });
  return { };
};

Additional context

No response

@trulymittal
Copy link

@Ali-Hussein-dev Did you find a solution, i am experiencing this on "ai": "^3.2.37",

@lgrammel lgrammel added bug Something isn't working ai/ui labels Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai/ui bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants