Interface ChatCompletionServiceAsync
-
- All Implemented Interfaces:
public interface ChatCompletionServiceAsync
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
ChatCompletionServiceAsync.WithRawResponse
A view of ChatCompletionServiceAsync that provides access to raw HTTP responses for each method.
-
Method Summary
-
-
Method Detail
-
withRawResponse
abstract ChatCompletionServiceAsync.WithRawResponse withRawResponse()
Returns a view of this service that provides access to raw HTTP responses for each method.
-
messages
abstract MessageServiceAsync messages()
-
create
CompletableFuture<ChatCompletion> create(ChatCompletionCreateParams params)
Starting a new project? We recommend trying Responses to take advantage of the latest OpenAI platform features. Compare Chat Completions with Responses.
Creates a model response for the given chat conversation. Learn more in the text generation, vision, and audio guides.
Parameter support can differ depending on the model used to generate the response, particularly for newer reasoning models. Parameters that are only supported for reasoning models are noted below. For the current state of unsupported parameters in reasoning models, refer to the reasoning guide.
-
create
abstract CompletableFuture<ChatCompletion> create(ChatCompletionCreateParams params, RequestOptions requestOptions)
-
createStreaming
AsyncStreamResponse<ChatCompletionChunk> createStreaming(ChatCompletionCreateParams params)
Starting a new project? We recommend trying Responses to take advantage of the latest OpenAI platform features. Compare Chat Completions with Responses.
Creates a model response for the given chat conversation. Learn more in the text generation, vision, and audio guides.
Parameter support can differ depending on the model used to generate the response, particularly for newer reasoning models. Parameters that are only supported for reasoning models are noted below. For the current state of unsupported parameters in reasoning models, refer to the reasoning guide.
-
createStreaming
abstract AsyncStreamResponse<ChatCompletionChunk> createStreaming(ChatCompletionCreateParams params, RequestOptions requestOptions)
-
retrieve
CompletableFuture<ChatCompletion> retrieve(String completionId)
Get a stored chat completion. Only Chat Completions that have been created with the
store
parameter set totrue
will be returned.
-
retrieve
CompletableFuture<ChatCompletion> retrieve(String completionId, ChatCompletionRetrieveParams params, RequestOptions requestOptions)
-
retrieve
CompletableFuture<ChatCompletion> retrieve(String completionId, ChatCompletionRetrieveParams params)
-
retrieve
abstract CompletableFuture<ChatCompletion> retrieve(ChatCompletionRetrieveParams params, RequestOptions requestOptions)
-
retrieve
CompletableFuture<ChatCompletion> retrieve(ChatCompletionRetrieveParams params)
-
retrieve
CompletableFuture<ChatCompletion> retrieve(String completionId, RequestOptions requestOptions)
-
update
CompletableFuture<ChatCompletion> update(String completionId, ChatCompletionUpdateParams params)
Modify a stored chat completion. Only Chat Completions that have been created with the
store
parameter set totrue
can be modified. Currently, the only supported modification is to update themetadata
field.
-
update
CompletableFuture<ChatCompletion> update(String completionId, ChatCompletionUpdateParams params, RequestOptions requestOptions)
-
update
CompletableFuture<ChatCompletion> update(ChatCompletionUpdateParams params)
-
update
abstract CompletableFuture<ChatCompletion> update(ChatCompletionUpdateParams params, RequestOptions requestOptions)
-
list
CompletableFuture<ChatCompletionListPageAsync> list()
List stored Chat Completions. Only Chat Completions that have been stored with the
store
parameter set totrue
will be returned.
-
list
abstract CompletableFuture<ChatCompletionListPageAsync> list(ChatCompletionListParams params, RequestOptions requestOptions)
-
list
CompletableFuture<ChatCompletionListPageAsync> list(RequestOptions requestOptions)
-
delete
CompletableFuture<ChatCompletionDeleted> delete(String completionId)
Delete a stored chat completion. Only Chat Completions that have been created with the
store
parameter set totrue
can be deleted.
-
delete
CompletableFuture<ChatCompletionDeleted> delete(String completionId, ChatCompletionDeleteParams params, RequestOptions requestOptions)
-
delete
CompletableFuture<ChatCompletionDeleted> delete(String completionId, ChatCompletionDeleteParams params)
-
delete
abstract CompletableFuture<ChatCompletionDeleted> delete(ChatCompletionDeleteParams params, RequestOptions requestOptions)
-
delete
CompletableFuture<ChatCompletionDeleted> delete(ChatCompletionDeleteParams params)
-
delete
CompletableFuture<ChatCompletionDeleted> delete(String completionId, RequestOptions requestOptions)
-
-
-
-