Skip to content

onFinish | React #638

Closed Answered by peterdresslar
Ali-Hussein-dev asked this question in Help
Discussion options

You must be logged in to vote

I think @MaxLeiter for useCompletion, there are two variables. (I could be misunderstanding the question)

So for instance this works fine:

export default function Completion() {
  const {
    completion,
    input,
    handleInputChange,
    handleSubmit,
  } = useCompletion({
    api: '/api/completion/openai',
    onFinish: (prompt: string, completion: string) => {
      console.log('onFinish is', completion);
    }
  });

Using the example onFinish: (message) => console.log(message)

... I just get the prompt back.

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@MaxLeiter
Comment options

Answer selected by MaxLeiter
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants