Interface GPTCompletionCallback

  • All Known Implementing Classes:
    GPTCompletionCallback.GPTCompletionCollector

    public interface GPTCompletionCallback
    For a streaming mode this is given as parameter for the method call and receives the streamed data; the method returns only when the response is complete.
    • Method Detail

      • onNext

        void onNext​(String chars)
        Called when a couple of characters come in.
      • onError

        void onError​(Throwable throwable)
        Called when an error occurs.
      • setLoggingId

        void setLoggingId​(String loggingId)
        For debugging: this sets the internal ID that is used for logging purposes. Not a good ID give to the world, though.
      • setRequest

        default void setRequest​(String json)
        For debugging - the request that was sent to ChatGPT as JSON.