Interface ResponseServiceAsync
-
- All Implemented Interfaces:
public interface ResponseServiceAsync
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
ResponseServiceAsync.WithRawResponse
A view of ResponseServiceAsync that provides access to raw HTTP responses for each method.
-
Method Summary
-
-
Method Detail
-
withRawResponse
abstract ResponseServiceAsync.WithRawResponse withRawResponse()
Returns a view of this service that provides access to raw HTTP responses for each method.
-
withOptions
abstract ResponseServiceAsync withOptions(Consumer<ClientOptions.Builder> modifier)
Returns a view of this service with the given option modifications applied.
The original service is not modified.
-
inputItems
abstract InputItemServiceAsync inputItems()
-
create
CompletableFuture<Response> create()
Creates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model's response.
-
create
abstract CompletableFuture<Response> create(ResponseCreateParams params, RequestOptions requestOptions)
-
create
CompletableFuture<Response> create(ResponseCreateParams params)
-
create
CompletableFuture<Response> create(RequestOptions requestOptions)
-
create
<T extends Any> CompletableFuture<StructuredResponse<T>> create(StructuredResponseCreateParams<T> params)
Creates a model response. The model's structured output in JSON form will be deserialized automatically into an instance of the class
T
. See the SDK documentation for more details.
-
create
<T extends Any> CompletableFuture<StructuredResponse<T>> create(StructuredResponseCreateParams<T> params, RequestOptions requestOptions)
Creates a model response. The model's structured output in JSON form will be deserialized automatically into an instance of the class
T
. See the SDK documentation for more details.
-
createStreaming
AsyncStreamResponse<ResponseStreamEvent> createStreaming()
Creates a model response. Provide text or image inputs to generate text or JSON outputs. Have the model call your own custom code or use built-in tools like web search or file search to use your own data as input for the model's response.
-
createStreaming
abstract AsyncStreamResponse<ResponseStreamEvent> createStreaming(ResponseCreateParams params, RequestOptions requestOptions)
-
createStreaming
AsyncStreamResponse<ResponseStreamEvent> createStreaming(ResponseCreateParams params)
-
createStreaming
AsyncStreamResponse<ResponseStreamEvent> createStreaming(RequestOptions requestOptions)
-
createStreaming
AsyncStreamResponse<ResponseStreamEvent> createStreaming(StructuredResponseCreateParams<?> params)
Creates a streaming model response for the given response conversation. The input parameters can define a JSON schema derived automatically from an arbitrary class to request a structured output in JSON form. However, that structured output is split over multiple streamed events, so it will not be deserialized automatically into an instance of that class. To deserialize the output, first use a helper class to accumulate the stream of events into a single output value. See the SDK documentation for full details.
-
createStreaming
AsyncStreamResponse<ResponseStreamEvent> createStreaming(StructuredResponseCreateParams<?> params, RequestOptions requestOptions)
-
retrieve
CompletableFuture<Response> retrieve(String responseId)
Retrieves a model response with the given ID.
-
retrieve
CompletableFuture<Response> retrieve(String responseId, ResponseRetrieveParams params, RequestOptions requestOptions)
-
retrieve
CompletableFuture<Response> retrieve(String responseId, ResponseRetrieveParams params)
-
retrieve
abstract CompletableFuture<Response> retrieve(ResponseRetrieveParams params, RequestOptions requestOptions)
-
retrieve
CompletableFuture<Response> retrieve(ResponseRetrieveParams params)
-
retrieve
CompletableFuture<Response> retrieve(String responseId, RequestOptions requestOptions)
-
retrieveStreaming
AsyncStreamResponse<ResponseStreamEvent> retrieveStreaming(String responseId)
Retrieves a model response with the given ID.
-
retrieveStreaming
AsyncStreamResponse<ResponseStreamEvent> retrieveStreaming(String responseId, ResponseRetrieveParams params, RequestOptions requestOptions)
-
retrieveStreaming
AsyncStreamResponse<ResponseStreamEvent> retrieveStreaming(String responseId, ResponseRetrieveParams params)
-
retrieveStreaming
abstract AsyncStreamResponse<ResponseStreamEvent> retrieveStreaming(ResponseRetrieveParams params, RequestOptions requestOptions)
-
retrieveStreaming
AsyncStreamResponse<ResponseStreamEvent> retrieveStreaming(ResponseRetrieveParams params)
-
retrieveStreaming
AsyncStreamResponse<ResponseStreamEvent> retrieveStreaming(String responseId, RequestOptions requestOptions)
-
delete
CompletableFuture<Void> delete(String responseId)
Deletes a model response with the given ID.
-
delete
CompletableFuture<Void> delete(String responseId, ResponseDeleteParams params, RequestOptions requestOptions)
-
delete
CompletableFuture<Void> delete(String responseId, ResponseDeleteParams params)
-
delete
abstract CompletableFuture<Void> delete(ResponseDeleteParams params, RequestOptions requestOptions)
-
delete
CompletableFuture<Void> delete(ResponseDeleteParams params)
-
delete
CompletableFuture<Void> delete(String responseId, RequestOptions requestOptions)
-
cancel
CompletableFuture<Response> cancel(String responseId)
Cancels a model response with the given ID. Only responses created with the
background
parameter set totrue
can be cancelled. Learn more.
-
cancel
CompletableFuture<Response> cancel(String responseId, ResponseCancelParams params, RequestOptions requestOptions)
-
cancel
CompletableFuture<Response> cancel(String responseId, ResponseCancelParams params)
-
cancel
abstract CompletableFuture<Response> cancel(ResponseCancelParams params, RequestOptions requestOptions)
-
cancel
CompletableFuture<Response> cancel(ResponseCancelParams params)
-
cancel
CompletableFuture<Response> cancel(String responseId, RequestOptions requestOptions)
-
-
-
-