Skip to content

How to interrupt a streaming output? #427

Answered by giladgd
gy9527 asked this question in Q&A
Discussion options

You must be logged in to vote

You can pass a signal option to the .prompt(...) method on a LlamaChatSession instance to abort the current generation.
To keep the current partial generated response, you can also set stopOnAbortSignal to true, which will make the main .prompt() call not throw an error.

It works the same way with LlamaChat's .generateResponse(...) method as well.

I'll make sure to add an example of this in the documentation.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by giladgd
# for free to join this conversation on GitHub. Already have an account? # to comment
Category
Q&A
Labels
None yet
3 participants