Package com.azure.ai.openai.responses
Class ResponsesClient
java.lang.Object
com.azure.ai.openai.responses.ResponsesClient
Initializes a new instance of the synchronous ResponsesClient type.
-
Method Summary
Modifier and TypeMethodDescriptioncreateResponse(CreateResponsesRequest requestBody) Creates a model response.createResponse(CreateResponsesRequest requestBody, com.azure.core.http.rest.RequestOptions requestOptions) Creates a model response.com.azure.core.util.IterableStream<ResponsesStreamEvent> createResponseStreaming(CreateResponsesRequest requestBody) Creates a model response.com.azure.core.util.IterableStream<ResponsesStreamEvent> createResponseStreaming(CreateResponsesRequest requestBody, com.azure.core.http.rest.RequestOptions requestOptions) Creates a model response.deleteResponse(String responseId) Deletes a response by ID.deleteResponse(String responseId, com.azure.core.http.rest.RequestOptions requestOptions) Deletes a response by ID.getResponse(String responseId) Retrieves a model response with the given ID.getResponse(String responseId, List<CreateResponsesRequestIncludable> includables) Retrieves a model response with the given ID.com.azure.core.http.rest.PagedIterable<ResponsesItem> listInputItems(String responseId, Integer limit, ListInputItemsRequestOrder order) Returns a list of input items for a given response.
-
Method Details
-
getResponse
public ResponsesResponse getResponse(String responseId, List<CreateResponsesRequestIncludable> includables) Retrieves a model response with the given ID.- Parameters:
responseId- The ID of the response to retrieve.includables- The includables parameter.- Returns:
- the response.
- 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.
-
getResponse
Retrieves a model response with the given ID.- Parameters:
responseId- The ID of the response to retrieve.- Returns:
- the response.
- 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.
-
listInputItems
public com.azure.core.http.rest.PagedIterable<ResponsesItem> listInputItems(String responseId, Integer limit, ListInputItemsRequestOrder order) Returns a list of input items for a given response.- Parameters:
responseId- The ID of the response to retrieve.limit- The maximum number of input items to return.order- The order in which to return the input items.- Returns:
- the response.
- 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.
-
createResponse
public ResponsesResponse createResponse(CreateResponsesRequest requestBody, com.azure.core.http.rest.RequestOptions requestOptions) Creates a model response.- Parameters:
requestBody- The requestBody parameter.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
- the response.
- 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.
-
createResponse
Creates a model response.- Parameters:
requestBody- The requestBody parameter.- Returns:
- the response.
- 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.
-
createResponseStreaming
public com.azure.core.util.IterableStream<ResponsesStreamEvent> createResponseStreaming(CreateResponsesRequest requestBody, com.azure.core.http.rest.RequestOptions requestOptions) Creates a model response.- Parameters:
requestBody- The requestBody parameter.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
- the response.
- 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.
-
createResponseStreaming
public com.azure.core.util.IterableStream<ResponsesStreamEvent> createResponseStreaming(CreateResponsesRequest requestBody) Creates a model response.- Parameters:
requestBody- The requestBody parameter.- Returns:
- the response.
- 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.
-
deleteResponse
public DeleteResponseResponse deleteResponse(String responseId, com.azure.core.http.rest.RequestOptions requestOptions) Deletes a response by ID.- Parameters:
responseId- The responseId parameter.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
- the response.
- 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.
-
deleteResponse
Deletes a response by ID.- Parameters:
responseId- The responseId parameter.- Returns:
- the response.
- 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.
-