Interface ChatCompletionService
-
- All Implemented Interfaces:
public interface ChatCompletionService
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
ChatCompletionService.WithRawResponse
A view of ChatCompletionService that provides access to raw HTTP responses for each method.
-
Method Summary
-
-
Method Detail
-
withRawResponse
abstract ChatCompletionService.WithRawResponse withRawResponse()
Returns a view of this service that provides access to raw HTTP responses for each method.
-
messages
abstract MessageService messages()
-
create
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 ChatCompletion create(ChatCompletionCreateParams params, RequestOptions requestOptions)
-
createStreaming
@MustBeClosed() StreamResponse<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
@MustBeClosed() abstract StreamResponse<ChatCompletionChunk> createStreaming(ChatCompletionCreateParams params, RequestOptions requestOptions)
-
retrieve
ChatCompletion retrieve(ChatCompletionRetrieveParams params)
Get a stored chat completion. Only Chat Completions that have been created with the
store
parameter set totrue
will be returned.
-
retrieve
abstract ChatCompletion retrieve(ChatCompletionRetrieveParams params, RequestOptions requestOptions)
-
update
ChatCompletion update(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
abstract ChatCompletion update(ChatCompletionUpdateParams params, RequestOptions requestOptions)
-
list
ChatCompletionListPage list()
List stored Chat Completions. Only Chat Completions that have been stored with the
store
parameter set totrue
will be returned.
-
list
abstract ChatCompletionListPage list(ChatCompletionListParams params, RequestOptions requestOptions)
-
list
ChatCompletionListPage list(ChatCompletionListParams params)
-
list
ChatCompletionListPage list(RequestOptions requestOptions)
-
delete
ChatCompletionDeleted delete(ChatCompletionDeleteParams params)
Delete a stored chat completion. Only Chat Completions that have been created with the
store
parameter set totrue
can be deleted.
-
delete
abstract ChatCompletionDeleted delete(ChatCompletionDeleteParams params, RequestOptions requestOptions)
-
-
-
-