Class CompletionServiceImpl
-
- All Implemented Interfaces:
-
com.openai.services.blocking.chat.CompletionService
public final class CompletionServiceImpl implements CompletionService
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classCompletionServiceImpl.WithRawResponseImpl
-
Method Summary
Modifier and Type Method Description CompletionService.WithRawResponsewithRawResponse()Returns a view of this service that provides access to raw HTTP responses for each method. MessageServicemessages()ChatCompletioncreate(ChatCompletionCreateParams params, RequestOptions requestOptions)Creates a model response for the given chat conversation. StreamResponse<ChatCompletionChunk>createStreaming(ChatCompletionCreateParams params, RequestOptions requestOptions)Creates a model response for the given chat conversation. ChatCompletionretrieve(ChatCompletionRetrieveParams params, RequestOptions requestOptions)Get a stored chat completion. ChatCompletionupdate(ChatCompletionUpdateParams params, RequestOptions requestOptions)Modify a stored chat completion. ChatCompletionDeleteddelete(ChatCompletionDeleteParams params, RequestOptions requestOptions)Delete a stored chat completion. -
-
Method Detail
-
withRawResponse
CompletionService.WithRawResponse withRawResponse()
Returns a view of this service that provides access to raw HTTP responses for each method.
-
messages
MessageService messages()
-
create
ChatCompletion create(ChatCompletionCreateParams params, RequestOptions requestOptions)
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
StreamResponse<ChatCompletionChunk> createStreaming(ChatCompletionCreateParams params, RequestOptions requestOptions)
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.
-
retrieve
ChatCompletion retrieve(ChatCompletionRetrieveParams params, RequestOptions requestOptions)
Get a stored chat completion. Only chat completions that have been created with the
storeparameter set totruewill be returned.
-
update
ChatCompletion update(ChatCompletionUpdateParams params, RequestOptions requestOptions)
Modify a stored chat completion. Only chat completions that have been created with the
storeparameter set totruecan be modified. Currently, the only supported modification is to update themetadatafield.
-
delete
ChatCompletionDeleted delete(ChatCompletionDeleteParams params, RequestOptions requestOptions)
Delete a stored chat completion. Only chat completions that have been created with the
storeparameter set totruecan be deleted.
-
-
-
-