Skip to content
Draft
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
5 changes: 0 additions & 5 deletions sdk/ai/azure-ai-agents/_tsp-location.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,6 @@ public class AgentsCustomizations extends Customization {

@Override
public void customize(LibraryCustomization libraryCustomization, Logger logger) {
renameImageGenSizeEnums(libraryCustomization, logger);
}

/**
* Customization for enum values that are originally numbers and get transliterated by the emitter.
* @param customization
* @param logger
*/
private void renameImageGenSizeEnums(LibraryCustomization customization, Logger logger) {
logger.info("Renaming enum ImageGenToolSize variants");
customization.getClass("com.azure.ai.agents.models", "ImageGenToolSize").customizeAst(ast -> ast.getEnumByName("ImageGenToolSize")
.ifPresent(clazz -> clazz.getEntries().stream()
.filter(entry -> "ONE_ZERO_TWO_FOURX_ONE_ZERO_TWO_FOUR".equals(entry.getName().getIdentifier()))
.forEach(entry -> entry.setName("SIZE_1024X1024"))));

customization.getClass("com.azure.ai.agents.models", "ImageGenToolSize").customizeAst(ast -> ast.getEnumByName("ImageGenToolSize")
.ifPresent(clazz -> clazz.getEntries().stream()
.filter(entry -> "ONE_ZERO_TWO_FOURX_ONE_FIVE_THREE_SIX".equals(entry.getName().getIdentifier()))
.forEach(entry -> entry.setName("SIZE_1024X1536"))));

customization.getClass("com.azure.ai.agents.models", "ImageGenToolSize").customizeAst(ast -> ast.getEnumByName("ImageGenToolSize")
.ifPresent(clazz -> clazz.getEntries().stream()
.filter(entry -> "ONE_FIVE_THREE_SIXX_ONE_ZERO_TWO_FOUR".equals(entry.getName().getIdentifier()))
.forEach(entry -> entry.setName("SIZE_1536X1024"))));

customization.getClass("com.azure.ai.agents.models", "ComputerActionType").customizeAst(ast -> ast.getEnumByName("ComputerActionType")
.ifPresent(clazz -> clazz.getEntries().stream()
.filter(entry -> "KEYPRESS".equals(entry.getName().getIdentifier()))
.forEach(entry -> entry.setName("KEY_PRESS"))));

customization.getClass("com.azure.ai.agents.models", "ComputerActionKeyPress")
.customizeAst(ast -> ast.getClassByName("ComputerActionKeyPress")
.flatMap(clazz -> clazz.getFieldByName("type"))
.ifPresent(barField ->
barField.getVariables().forEach(var -> {
if (var.getNameAsString().equals("type")) {
var.setInitializer("ComputerActionType.KEY_PRESS");
}
})));
// no-op: reserved for future use
}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.client.okhttp.OpenAIOkHttpClientAsync;
import com.openai.credential.BearerTokenCredential;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@
* Service version of AgentsClient.
*/
public enum AgentsServiceVersion implements ServiceVersion {
/**
* Enum value 2025-05-01.
*/
V2025_05_01("2025-05-01"),

/**
* Enum value 2025-05-15-preview.
*/
V2025_05_15_PREVIEW("2025-05-15-preview"),

/**
* Enum value 2025-11-15-preview.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
import com.azure.ai.agents.implementation.models.UpdateMemoriesRequest;
import com.azure.ai.agents.implementation.models.UpdateMemoryStoreRequest;
import com.azure.ai.agents.models.DeleteMemoryStoreResponse;
import com.azure.ai.agents.models.ItemParam;
import com.azure.ai.agents.models.ListAgentsRequestOrder;
import com.azure.ai.agents.models.Item;
import com.azure.ai.agents.models.MemorySearchOptions;
import com.azure.ai.agents.models.MemoryStoreDefinition;
import com.azure.ai.agents.models.MemoryStoreDeleteScopeResponse;
import com.azure.ai.agents.models.MemoryStoreDetails;
import com.azure.ai.agents.models.MemoryStoreSearchResponse;
import com.azure.ai.agents.models.MemoryStoreUpdateCompletedResult;
import com.azure.ai.agents.models.MemoryStoreUpdateResponse;
import com.azure.ai.agents.models.PageOrder;
import com.azure.core.annotation.Generated;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceClient;
Expand Down Expand Up @@ -301,7 +301,7 @@ public Mono<Response<BinaryData>> deleteMemoryStoreWithResponse(String name, Req
* scope: String (Required)
* items (Optional): [
* (Optional){
* type: String(message/file_search_call/function_call/function_call_output/computer_call/computer_call_output/web_search_call/reasoning/item_reference/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/structured_outputs/workflow_action/memory_search_call/oauth_consent_request) (Required)
* type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/structured_outputs/workflow_action/memory_search_call/oauth_consent_request) (Required)
* }
* ]
* previous_search_id: String (Optional)
Expand Down Expand Up @@ -331,15 +331,15 @@ public Mono<Response<BinaryData>> deleteMemoryStoreWithResponse(String name, Req
* ]
* usage (Required): {
* embedding_tokens: int (Required)
* input_tokens: int (Required)
* input_tokens: long (Required)
* input_tokens_details (Required): {
* cached_tokens: int (Required)
* cached_tokens: long (Required)
* }
* output_tokens: int (Required)
* output_tokens: long (Required)
* output_tokens_details (Required): {
* reasoning_tokens: int (Required)
* reasoning_tokens: long (Required)
* }
* total_tokens: int (Required)
* total_tokens: long (Required)
* }
* }
* }
Expand Down Expand Up @@ -371,7 +371,7 @@ public Mono<Response<BinaryData>> searchMemoriesWithResponse(String name, Binary
* scope: String (Required)
* items (Optional): [
* (Optional){
* type: String(message/file_search_call/function_call/function_call_output/computer_call/computer_call_output/web_search_call/reasoning/item_reference/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/structured_outputs/workflow_action/memory_search_call/oauth_consent_request) (Required)
* type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/structured_outputs/workflow_action/memory_search_call/oauth_consent_request) (Required)
* }
* ]
* previous_update_id: String (Optional)
Expand Down Expand Up @@ -403,15 +403,15 @@ public Mono<Response<BinaryData>> searchMemoriesWithResponse(String name, Binary
* ]
* usage (Required): {
* embedding_tokens: int (Required)
* input_tokens: int (Required)
* input_tokens: long (Required)
* input_tokens_details (Required): {
* cached_tokens: int (Required)
* cached_tokens: long (Required)
* }
* output_tokens: int (Required)
* output_tokens: long (Required)
* output_tokens_details (Required): {
* reasoning_tokens: int (Required)
* reasoning_tokens: long (Required)
* }
* total_tokens: int (Required)
* total_tokens: long (Required)
* }
* }
* error (Optional): {
Expand Down Expand Up @@ -474,15 +474,15 @@ public PollerFlux<BinaryData, BinaryData> beginUpdateMemories(String name, Binar
* ]
* usage (Required): {
* embedding_tokens: int (Required)
* input_tokens: int (Required)
* input_tokens: long (Required)
* input_tokens_details (Required): {
* cached_tokens: int (Required)
* cached_tokens: long (Required)
* }
* output_tokens: int (Required)
* output_tokens: long (Required)
* output_tokens_details (Required): {
* reasoning_tokens: int (Required)
* reasoning_tokens: long (Required)
* }
* total_tokens: int (Required)
* total_tokens: long (Required)
* }
* }
* error (Optional): {
Expand Down Expand Up @@ -593,60 +593,6 @@ public Mono<MemoryStoreDetails> getMemoryStore(String name) {
.map(protocolMethodData -> protocolMethodData.toObject(MemoryStoreDetails.class));
}

/**
* List all memory stores.
*
* @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
* default is 20.
* @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
* for descending order.
* @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list.
* For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
* subsequent call can include after=obj_foo in order to fetch the next page of the list.
* @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list.
* For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
* subsequent call can include before=obj_foo in order to fetch the previous page of the list.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response data for a requested list of items as paginated response with {@link PagedFlux}.
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux<MemoryStoreDetails> listMemoryStores(Integer limit, ListAgentsRequestOrder order, String after,
String before) {
// Generated convenience method for listMemoryStores
RequestOptions requestOptions = new RequestOptions();
if (limit != null) {
requestOptions.addQueryParam("limit", String.valueOf(limit), false);
}
if (order != null) {
requestOptions.addQueryParam("order", order.toString(), false);
}
if (after != null) {
requestOptions.addQueryParam("after", after, false);
}
if (before != null) {
requestOptions.addQueryParam("before", before, false);
}
PagedFlux<BinaryData> pagedFluxResponse = listMemoryStores(requestOptions);
return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
Flux<PagedResponse<BinaryData>> flux = (continuationTokenParam == null)
? pagedFluxResponse.byPage().take(1)
: pagedFluxResponse.byPage(continuationTokenParam).take(1);
return flux.map(pagedResponse -> new PagedResponseBase<Void, MemoryStoreDetails>(pagedResponse.getRequest(),
pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
pagedResponse.getValue()
.stream()
.map(protocolMethodData -> protocolMethodData.toObject(MemoryStoreDetails.class))
.collect(Collectors.toList()),
pagedResponse.getContinuationToken(), null));
});
}

/**
* List all memory stores.
*
Expand Down Expand Up @@ -902,7 +848,7 @@ public Mono<MemoryStoreDeleteScopeResponse> deleteScope(String name, String scop
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<MemoryStoreSearchResponse> searchMemories(String name, String scope, List<ItemParam> items,
public Mono<MemoryStoreSearchResponse> searchMemories(String name, String scope, List<Item> items,
String previousSearchId, MemorySearchOptions options) {
// Generated convenience method for searchMemoriesWithResponse
RequestOptions requestOptions = new RequestOptions();
Expand Down Expand Up @@ -937,7 +883,7 @@ public Mono<MemoryStoreSearchResponse> searchMemories(String name, String scope,
@Generated
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux<MemoryStoreUpdateResponse, MemoryStoreUpdateCompletedResult> beginUpdateMemories(String name,
String scope, List<ItemParam> items, String previousUpdateId, Integer updateDelay) {
String scope, List<Item> items, String previousUpdateId, Integer updateDelay) {
// Generated convenience method for beginUpdateMemoriesWithModel
RequestOptions requestOptions = new RequestOptions();
UpdateMemoriesRequest updateMemoriesRequestObj = new UpdateMemoriesRequest(scope).setItems(items)
Expand All @@ -946,4 +892,57 @@ public PollerFlux<MemoryStoreUpdateResponse, MemoryStoreUpdateCompletedResult> b
BinaryData updateMemoriesRequest = BinaryData.fromObject(updateMemoriesRequestObj);
return serviceClient.beginUpdateMemoriesWithModelAsync(name, updateMemoriesRequest, requestOptions);
}

/**
* List all memory stores.
*
* @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
* default is 20.
* @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
* for descending order.
* @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list.
* For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
* subsequent call can include after=obj_foo in order to fetch the next page of the list.
* @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list.
* For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
* subsequent call can include before=obj_foo in order to fetch the previous page of the list.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response data for a requested list of items as paginated response with {@link PagedFlux}.
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux<MemoryStoreDetails> listMemoryStores(Integer limit, PageOrder order, String after, String before) {
// Generated convenience method for listMemoryStores
RequestOptions requestOptions = new RequestOptions();
if (limit != null) {
requestOptions.addQueryParam("limit", String.valueOf(limit), false);
}
if (order != null) {
requestOptions.addQueryParam("order", order.toString(), false);
}
if (after != null) {
requestOptions.addQueryParam("after", after, false);
}
if (before != null) {
requestOptions.addQueryParam("before", before, false);
}
PagedFlux<BinaryData> pagedFluxResponse = listMemoryStores(requestOptions);
return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
Flux<PagedResponse<BinaryData>> flux = (continuationTokenParam == null)
? pagedFluxResponse.byPage().take(1)
: pagedFluxResponse.byPage(continuationTokenParam).take(1);
return flux.map(pagedResponse -> new PagedResponseBase<Void, MemoryStoreDetails>(pagedResponse.getRequest(),
pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
pagedResponse.getValue()
.stream()
.map(protocolMethodData -> protocolMethodData.toObject(MemoryStoreDetails.class))
.collect(Collectors.toList()),
pagedResponse.getContinuationToken(), null));
});
}
}
Loading
Loading