Package com.azure.ai.inference
Class ChatCompletionsAsyncClient
java.lang.Object
com.azure.ai.inference.ChatCompletionsAsyncClient
Initializes a new instance of the asynchronous ChatCompletionsClient type.
-
Method Summary
Modifier and TypeMethodDescriptioncomplete(ChatCompletionsOptions options) Gets chat completions for the provided chat messages.Gets completions for the provided input prompt.completeStream(ChatCompletionsOptions options) Gets chat completions for the provided chat messages.Returns information about the AI model.
-
Method Details
-
completeStream
Gets chat completions for the provided chat messages. Chat completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.- Parameters:
options- The configuration information for a chat completions request. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.- Returns:
- chat completions stream for the provided chat messages. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.
- Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
complete
Gets completions for the provided input prompt. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.- Parameters:
prompt- The prompt to generate completion text from.- Returns:
- completions for the provided input prompts. Completions support a wide variety of tasks and generate text
that continues from or "completes" provided prompt data on successful completion of
Mono. - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
complete
Gets chat completions for the provided chat messages. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data. The method makes a REST API call to the `/chat/completions` route on the given endpoint.- Parameters:
options- Options for complete API.- Returns:
- chat completions for the provided chat messages.
Completions support a wide variety of tasks and generate text that continues from or "completes"
provided prompt data on successful completion of
Mono. - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getModelInfo
Returns information about the AI model. The method makes a REST API call to the `/info` route on the given endpoint.- Returns:
- represents some basic information about the AI model on successful completion of
Mono. - Throws:
com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-