INNER CODE UNIT · Java

createStream

sashirestela/simple-openai · src/main/java/io/github/sashirestela/openai/OpenAI.java:835

        default CompletableFuture<Stream<Event>> createStream(ResponseRequest responseRequest) {
            var newResponseRequest = responseRequest.withStream(Boolean.TRUE);
            return createStreamPrimitive(newResponseRequest);
        }

        /**
         * Retrieves a model response with the given ID (don't call it directly).
         * 
         * @param responseId    The ID of the response to retrieve.
         * @param include       Additional fields to include in the response.
         * @param startingAfter The sequence number of the event after which to start streaming.
         * @param stream        If set to true, the model response data will be streamed to the client.
         * @return The Response object matching the specified ID.
         */
        @GET("/{responseId}")
        CompletableFuture<Response> getOnePrimitive(@Path("responseId") String responseId,
                @Query("include") List<ResponseInclude> include, @Query("starting_after") Integer startingAfter,
                @Query("stream") Boolean stream);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…