Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions sdk/ai/azure-ai-agents/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- `deleteMemoryStore(String)` on `MemoryStoresClient` now returns `void` instead of `DeleteMemoryStoreResult`. The corresponding async method on `MemoryStoresAsyncClient` now returns `Mono<Void>` instead of `Mono<DeleteMemoryStoreResult>`.
- `deleteScope(String, String)` on `MemoryStoresClient` now returns `void` instead of `MemoryStoreDeleteScopeResponse`. The corresponding async method on `MemoryStoresAsyncClient` now returns `Mono<Void>` instead of `Mono<MemoryStoreDeleteScopeResponse>`.
- `DeleteMemoryStoreResult` and `MemoryStoreDeleteScopeResponse` removed from `com.azure.ai.agents.models` and are no longer part of the public API.
- `ResponsesUtils` class has been removed. Use `ResponsesClient.getAzureFields(Response)` instead of `ResponsesUtils.getAzureFields(Response)` to extract Azure-specific fields from a response.

### Bugs Fixed

Expand Down
2 changes: 1 addition & 1 deletion sdk/ai/azure-ai-agents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ Response response = responsesClient.createAzureResponse(
new AzureCreateResponseOptions().setAgentReference(agentReference),
ResponseCreateParams.builder().conversation(conversation.id()));
// To extract Azure-specific response details:
AzureCreateResponseDetails azureResults = ResponsesUtils.getAzureFields(response);
AzureCreateResponseDetails azureResults = ResponsesClient.getAzureFields(response);
```

### Using Agent tools
Expand Down
1 change: 0 additions & 1 deletion sdk/ai/azure-ai-agents/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<suppress files="com.azure.ai.agents.models.WorkflowActionOutputItemResource.java" checks="io.clientcore.linting.extensions.checkstyle.checks.EnforceFinalFieldsCheck" />
<suppress files="com.azure.ai.agents.ResponsesAsyncClient.java" checks="io.clientcore.linting.extensions.checkstyle.checks.ExternalDependencyExposedCheck" />
<suppress files="com.azure.ai.agents.ResponsesClient.java" checks="io.clientcore.linting.extensions.checkstyle.checks.ExternalDependencyExposedCheck" />
<suppress files="com.azure.ai.agents.ResponsesUtils.java" checks="io.clientcore.linting.extensions.checkstyle.checks.ExternalDependencyExposedCheck" />
<suppress files="com.azure.ai.agents.ConversationsAsyncClient.java" checks="io.clientcore.linting.extensions.checkstyle.checks.ExternalDependencyExposedCheck" />
<suppress files="com.azure.ai.agents.ConversationsClient.java" checks="io.clientcore.linting.extensions.checkstyle.checks.ExternalDependencyExposedCheck" />
<suppress files="com.azure.ai.agents.MemoryStoresAsyncClient.java" checks="io.clientcore.linting.extensions.checkstyle.checks.ExternalDependencyExposedCheck" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import com.azure.ai.agents.implementation.OpenAIJsonHelper;
import com.azure.ai.agents.implementation.StreamingUtils;
import com.azure.ai.agents.models.AzureCreateResponseDetails;
import com.azure.ai.agents.models.AzureCreateResponseOptions;
import com.azure.core.annotation.ServiceClient;
import com.azure.core.annotation.ServiceMethod;
Expand Down Expand Up @@ -84,4 +85,16 @@ public IterableStream<ResponseStreamEvent> createStreamingAzureResponse(AzureCre
return StreamingUtils.toIterableStream(this.responseService.createStreaming(params.build()));
}

/**
* Extracts Azure-specific fields from a Response's additional properties.
*
* @param response the OpenAI response.
* @return the Azure-specific create response result, or null if not present.
*/
public static AzureCreateResponseDetails getAzureFields(Response response) {
Comment thread
kaylieee marked this conversation as resolved.
Objects.requireNonNull(response, "response cannot be null");
return OpenAIJsonHelper.fromAdditionalProperties(response._additionalProperties(),
AzureCreateResponseDetails::fromJson);
}
Comment thread
kaylieee marked this conversation as resolved.

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static void main(String[] args) {
System.out.println("Response model: " + response.model());

// Extract Azure-specific fields from the response
AzureCreateResponseDetails azureResult = ResponsesUtils.getAzureFields(response);
AzureCreateResponseDetails azureResult = ResponsesClient.getAzureFields(response);
if (azureResult != null && azureResult.getAgentReference() != null) {
AgentReference ref = azureResult.getAgentReference();
System.out.println("Azure agent_reference.type: " + ref.getType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void readmeSamples() {
new AzureCreateResponseOptions().setAgentReference(agentReference),
ResponseCreateParams.builder().conversation(conversation.id()));
// To extract Azure-specific response details:
AzureCreateResponseDetails azureResults = ResponsesUtils.getAzureFields(response);
AzureCreateResponseDetails azureResults = ResponsesClient.getAzureFields(response);
// END: com.azure.ai.agents.create_response

// BEGIN: com.azure.ai.agents.openai_official_library
Expand Down