CancelStream method (NotesLLMRequest- LotusScript)
When you use CompletionStream method to receive response in stream mode, you can use CancelStream method to stop the stream of response if you want.
Sub Initialize
Dim session As New NotesSession
Dim llmreq As NotesLLMRequest
Set llmreq = session.CreateLLMRequest()
On Event LLMCompletionStreamNotify From llmreq Call ProcessResponse
Call llmreq.CompletionStream(""DominoIQ server/Org"", "stdMailSummaryThread" , sMailThread)
Exit Sub
processError:
Dim errMess As String
errMess = "Error " & Err & ": " & Error$
Messagebox(errMess)
Exit Sub
End Sub
Sub ProcessResponse (Source As NotesLLMRequest, Byval lastResponse As Boolean, Byval content As String)
'Do something with content and check lastResponse
'Do cancel based on some condition
Call Source.CancelStream()
End Sub