-
I haven't found a relevant API. Could you provide a code example? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I have a similar question: Is it possible to interrupt a |
Beta Was this translation helpful? Give feedback.
-
You can pass a It works the same way with I'll make sure to add an example of this in the documentation. |
Beta Was this translation helpful? Give feedback.
You can pass a
signal
option to the.prompt(...)
method on aLlamaChatSession
instance to abort the current generation.To keep the current partial generated response, you can also set
stopOnAbortSignal
totrue
, 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.