Interface ChatHandle


public interface ChatHandle
Handle returned by ChatStreamer.stream(com.axelor.ai.chat.ChatRequest, com.axelor.ai.chat.stream.StreamWriter) — allows cancellation and awaiting completion.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    await(Duration timeout)
    Blocks until the streaming loop finishes or the timeout elapses.
    void
    Requests cooperative cancellation of the streaming loop.
  • Method Details

    • cancel

      void cancel()
      Requests cooperative cancellation of the streaming loop. The current LLM turn or tool execution will complete, but no further steps will start. An StreamEvent.Abort event is written before the stream closes.
    • await

      boolean await(Duration timeout) throws InterruptedException
      Blocks until the streaming loop finishes or the timeout elapses.
      Parameters:
      timeout - maximum time to wait
      Returns:
      true if the loop completed, false if the timeout elapsed
      Throws:
      InterruptedException - if the waiting thread is interrupted