Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAI Responses support #44616

Merged
merged 60 commits into from
Mar 14, 2025
Merged
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
a37f90d
Added responses as a subpackage
jpalvarezl Feb 27, 2025
dad5eec
Added test and sample
jpalvarezl Feb 27, 2025
251c3b3
Streaming works
jpalvarezl Feb 27, 2025
bfee8df
not sure why this file gets constantly modified
jpalvarezl Mar 3, 2025
46ffa70
Added tests for SSE implementation
jpalvarezl Mar 4, 2025
3c8846d
Added more convenience methods
jpalvarezl Mar 4, 2025
4b250a8
Added more convenience methods
jpalvarezl Mar 4, 2025
2763b11
Adding customization for service version add when necessary
jpalvarezl Mar 4, 2025
2fa86ee
Fixed wrongfully named variant
jpalvarezl Mar 4, 2025
7bdf9e2
Added sync test file for non-Azure OpenAI
jpalvarezl Mar 4, 2025
f3b6f33
WIP: adding support for non-Azure OpenAI
jpalvarezl Mar 5, 2025
8e4c52e
Code gen responses latest
jpalvarezl Mar 5, 2025
64f2b03
Codegen for inference, still ok
jpalvarezl Mar 5, 2025
50d1572
Merge branch 'main' into jpalvarezl/responses
jpalvarezl Mar 5, 2025
903945f
fixed client impl and sample returns 200
jpalvarezl Mar 5, 2025
10e8d16
Added azure/non-azure mode
jpalvarezl Mar 6, 2025
215643c
Compiling again with latest TSP definitions
jpalvarezl Mar 6, 2025
a852497
Up to date with PR with feedback
jpalvarezl Mar 6, 2025
9cd5a35
Cleanup
jpalvarezl Mar 7, 2025
427bf6b
Models updated
jpalvarezl Mar 7, 2025
9f3475a
Added custom constructor for request object and adjusted tests and sa…
jpalvarezl Mar 7, 2025
ed9dcf3
Some class renaming
jpalvarezl Mar 7, 2025
9ef48f3
Added unit tests for OAI and added spell check ex
jpalvarezl Mar 7, 2025
a1ab4d9
Added missing async convenience methods and added full test coverage …
jpalvarezl Mar 7, 2025
5e9ae00
Added async tests
jpalvarezl Mar 7, 2025
f45686c
style and bug checks passing
jpalvarezl Mar 7, 2025
4692477
Test cleanup and re-enabled azure
jpalvarezl Mar 7, 2025
daed899
Refreshed spec
jpalvarezl Mar 11, 2025
50b96f2
PR feedback
jpalvarezl Mar 11, 2025
dd2802d
Style checks
jpalvarezl Mar 11, 2025
b697774
Renamed stream classes
jpalvarezl Mar 11, 2025
3d7f2ad
Latest spec
jpalvarezl Mar 12, 2025
3289614
Project compiles, fixed imports
jpalvarezl Mar 12, 2025
8799f3d
Corrected type for ResponsesComputerTool
jpalvarezl Mar 12, 2025
495339a
Added tests
jpalvarezl Mar 12, 2025
177d80a
Cleanup and regen
jpalvarezl Mar 12, 2025
0380178
Refactored test base, added test recordings
jpalvarezl Mar 12, 2025
0afd10f
style checks
jpalvarezl Mar 12, 2025
32ebc54
small correction in indentation
jpalvarezl Mar 12, 2025
19c4807
Reverted assistants changes
jpalvarezl Mar 12, 2025
2940a34
Revert "not sure why this file gets constantly modified"
jpalvarezl Mar 12, 2025
3e9c67d
Restored file
jpalvarezl Mar 12, 2025
156e42a
Merge branch 'main' into jpalvarezl/responses
jpalvarezl Mar 12, 2025
c9ddae3
Style checks and new word
jpalvarezl Mar 13, 2025
ae5ad19
spec regen
jpalvarezl Mar 13, 2025
bdac814
reverted tsp-location.yaml changes
jpalvarezl Mar 13, 2025
11c9537
Code cleanup
jpalvarezl Mar 13, 2025
8c07aab
README, changelog
jpalvarezl Mar 13, 2025
e27eefa
Added async sample
jpalvarezl Mar 13, 2025
2d65e8e
Added PagedFlux and PagedIterable usage
jpalvarezl Mar 13, 2025
4ff0aa7
Moved changelog entry to correct section
jpalvarezl Mar 13, 2025
548f9ca
PLAYBACK mode working
mssfang Mar 13, 2025
852cfa7
Fixed tests
jpalvarezl Mar 13, 2025
91d62bb
Comments in progress
jpalvarezl Mar 13, 2025
2a62f59
PR comments and final test recordings
jpalvarezl Mar 13, 2025
f10d9ab
Adding agentic to repo dictionary
jpalvarezl Mar 13, 2025
d47a5f3
reverted
jpalvarezl Mar 14, 2025
b3b8758
code regen and made methods private
jpalvarezl Mar 14, 2025
a4f6088
Corrected SSE impl breaking tests
jpalvarezl Mar 14, 2025
ea0216f
Added missing docs
jpalvarezl Mar 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
PR feedback
jpalvarezl committed Mar 11, 2025
commit 50b96f2916b1bfe301a475f57b4ad286fab3ae98
Original file line number Diff line number Diff line change
@@ -46,8 +46,4 @@ public static void addAzureVersionToRequestOptions(String endpoint, RequestOptio
public static boolean useAzureOpenAIService(String endpoint) {
return endpoint != null && !endpoint.startsWith(OPEN_AI_ENDPOINT);
}

public static String getOpenAIEndpoint() {
return OPEN_AI_ENDPOINT;
}
}
Original file line number Diff line number Diff line change
@@ -202,8 +202,8 @@ public final class ResponsesAsyncClient {
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> createResponseWithResponse(String accept, BinaryData requestBody,
RequestOptions requestOptions) {
if (this.nonAzureServiceClient != null) {
return this.nonAzureServiceClient.createResponseWithResponseAsync(accept, requestBody, requestOptions);
if (nonAzureServiceClient != null) {
return nonAzureServiceClient.createResponseWithResponseAsync(accept, requestBody, requestOptions);
} else {
addAzureVersionToRequestOptions(serviceClient.getEndpoint(), requestOptions,
serviceClient.getServiceVersion());
@@ -299,8 +299,8 @@ public Mono<Response<BinaryData>> createResponseWithResponse(String accept, Bina
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> getResponseWithResponse(String responseId, RequestOptions requestOptions) {
if (this.nonAzureServiceClient != null) {
return this.nonAzureServiceClient.getResponseWithResponseAsync(responseId, requestOptions);
if (nonAzureServiceClient != null) {
return nonAzureServiceClient.getResponseWithResponseAsync(responseId, requestOptions);
} else {
addAzureVersionToRequestOptions(serviceClient.getEndpoint(), requestOptions,
serviceClient.getServiceVersion());
@@ -344,8 +344,8 @@ public Mono<Response<BinaryData>> getResponseWithResponse(String responseId, Req
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> listInputItemsWithResponse(String responseId, int limit, String order,
String after, String before, RequestOptions requestOptions) {
if (this.nonAzureServiceClient != null) {
return this.nonAzureServiceClient.listInputItemsWithResponseAsync(responseId, limit, order, after, before,
if (nonAzureServiceClient != null) {
return nonAzureServiceClient.listInputItemsWithResponseAsync(responseId, limit, order, after, before,
requestOptions);
} else {
addAzureVersionToRequestOptions(serviceClient.getEndpoint(), requestOptions,
@@ -564,8 +564,8 @@ public Flux<ResponsesResponseStreamEvent> createResponseStream(CreateResponsesRe
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> deleteResponseWithResponse(String responseId, RequestOptions requestOptions) {
if (this.nonAzureServiceClient != null) {
return this.nonAzureServiceClient.deleteResponseWithResponseAsync(responseId, requestOptions);
if (nonAzureServiceClient != null) {
return nonAzureServiceClient.deleteResponseWithResponseAsync(responseId, requestOptions);
} else {
addAzureVersionToRequestOptions(serviceClient.getEndpoint(), requestOptions,
serviceClient.getServiceVersion());
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@
import com.azure.ai.openai.responses.models.DeleteResponseResponse;
import com.azure.ai.openai.responses.models.ListInputItemsRequestOrder;
import com.azure.ai.openai.responses.models.ResponsesInputItemList;
import com.azure.ai.openai.responses.models.ResponsesItem;
import com.azure.ai.openai.responses.models.ResponsesResponse;
import com.azure.ai.openai.responses.models.ResponsesResponseStreamEvent;
import com.azure.core.annotation.Generated;
@@ -24,6 +25,8 @@
import com.azure.core.exception.HttpResponseException;
import com.azure.core.exception.ResourceModifiedException;
import com.azure.core.exception.ResourceNotFoundException;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.RequestOptions;
import com.azure.core.http.rest.Response;
import com.azure.core.util.BinaryData;
@@ -277,7 +280,7 @@ public Response<BinaryData> getResponseWithResponse(String responseId, RequestOp
* @return the response body along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<BinaryData> listInputItemsWithResponse(String responseId, int limit, String order, String after,
private Response<BinaryData> listInputItemsWithResponse(String responseId, int limit, String order, String after,
String before, RequestOptions requestOptions) {
if (nonAzureServiceClient != null) {
return nonAzureServiceClient.listInputItemsWithResponse(responseId, limit, order, after, before,
@@ -354,11 +357,9 @@ public ResponsesResponse getResponse(String responseId) {
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public ResponsesInputItemList listInputItems(String responseId, int limit, ListInputItemsRequestOrder order,
String after, String before) {
// Generated convenience method for listInputItemsWithResponse
String after, String before) {
RequestOptions requestOptions = new RequestOptions();
return listInputItemsWithResponse(responseId, limit, order.toString(), after, before, requestOptions).getValue()
.toObject(ResponsesInputItemList.class);