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
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class AgentsCustomizations extends Customization {
public void customize(LibraryCustomization libraryCustomization, Logger logger) {
renameImageGenToolSize(libraryCustomization, logger);
modifyPollingStrategies(libraryCustomization, logger);
addToolboxesV1PreviewEnumValue(libraryCustomization, logger);
}

private void renameImageGenToolSize(LibraryCustomization customization, Logger logger) {
Expand Down Expand Up @@ -53,4 +54,19 @@ private void modifyPollingStrategies(LibraryCustomization customization, Logger
clazz.addMember(StaticJavaParser.parseMethodDeclaration("@Override public PollResponse<T> poll(PollingContext<T> pollingContext, TypeReference<T> pollResponseType) { return AgentsServicePollUtils.remapStatus(super.poll(pollingContext, pollResponseType)); }"));
}));
}

private void addToolboxesV1PreviewEnumValue(LibraryCustomization customization, Logger logger) {
customization.getClass("com.azure.ai.agents.models", "FoundryFeaturesOptInKeys")
.customizeAst(ast -> ast.getEnumByName("FoundryFeaturesOptInKeys")
.ifPresent(clazz -> {
// Add TOOLBOXES_V1_PREVIEW enum constant if not already present
boolean alreadyExists = clazz.getEntries().stream()
.anyMatch(entry -> "TOOLBOXES_V1_PREVIEW".equals(entry.getName().getIdentifier()));
if (!alreadyExists) {
clazz.addEnumConstant("TOOLBOXES_V1_PREVIEW")
.addArgument("\"Toolboxes=V1Preview\"")
.setJavadocComment("Toolboxes V1 Preview.");
}
}));
}
}
2,173 changes: 1,090 additions & 1,083 deletions sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsAsyncClient.java

Large diffs are not rendered by default.

1,952 changes: 975 additions & 977 deletions sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClient.java

Large diffs are not rendered by default.

Large diffs are not rendered by default.

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 @@ -263,6 +263,11 @@ Response<Void> deleteToolboxVersionSync(@HostParam("endpoint") String endpoint,
* type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required)
* }
* ]
* skills (Optional): [
* (Optional){
* type: String (Required)
* }
* ]
* policies (Optional): {
* rai_config (Optional): {
* rai_policy_name: String (Required)
Expand Down Expand Up @@ -290,6 +295,11 @@ Response<Void> deleteToolboxVersionSync(@HostParam("endpoint") String endpoint,
* type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required)
* }
* ]
* skills (Optional): [
* (Optional){
* type: String (Required)
* }
* ]
* policies (Optional): {
* rai_config (Optional): {
* rai_policy_name: String (Required)
Expand Down Expand Up @@ -334,6 +344,11 @@ public Mono<Response<BinaryData>> createToolboxVersionWithResponseAsync(String n
* type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required)
* }
* ]
* skills (Optional): [
* (Optional){
* type: String (Required)
* }
* ]
* policies (Optional): {
* rai_config (Optional): {
* rai_policy_name: String (Required)
Expand Down Expand Up @@ -361,6 +376,11 @@ public Mono<Response<BinaryData>> createToolboxVersionWithResponseAsync(String n
* type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required)
* }
* ]
* skills (Optional): [
* (Optional){
* type: String (Required)
* }
* ]
* policies (Optional): {
* rai_config (Optional): {
* rai_policy_name: String (Required)
Expand Down Expand Up @@ -682,6 +702,11 @@ public PagedIterable<BinaryData> listToolboxes(RequestOptions requestOptions) {
* type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required)
* }
* ]
* skills (Optional): [
* (Optional){
* type: String (Required)
* }
* ]
* policies (Optional): {
* rai_config (Optional): {
* rai_policy_name: String (Required)
Expand Down Expand Up @@ -751,6 +776,11 @@ private Mono<PagedResponse<BinaryData>> listToolboxVersionsSinglePageAsync(Strin
* type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required)
* }
* ]
* skills (Optional): [
* (Optional){
* type: String (Required)
* }
* ]
* policies (Optional): {
* rai_config (Optional): {
* rai_policy_name: String (Required)
Expand Down Expand Up @@ -813,6 +843,11 @@ public PagedFlux<BinaryData> listToolboxVersionsAsync(String name, RequestOption
* type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required)
* }
* ]
* skills (Optional): [
* (Optional){
* type: String (Required)
* }
* ]
* policies (Optional): {
* rai_config (Optional): {
* rai_policy_name: String (Required)
Expand Down Expand Up @@ -879,6 +914,11 @@ private PagedResponse<BinaryData> listToolboxVersionsSinglePage(String name, Req
* type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required)
* }
* ]
* skills (Optional): [
* (Optional){
* type: String (Required)
* }
* ]
* policies (Optional): {
* rai_config (Optional): {
* rai_policy_name: String (Required)
Expand Down Expand Up @@ -921,6 +961,11 @@ public PagedIterable<BinaryData> listToolboxVersions(String name, RequestOptions
* type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required)
* }
* ]
* skills (Optional): [
* (Optional){
* type: String (Required)
* }
* ]
* policies (Optional): {
* rai_config (Optional): {
* rai_policy_name: String (Required)
Expand Down Expand Up @@ -967,6 +1012,11 @@ public Mono<Response<BinaryData>> getToolboxVersionWithResponseAsync(String name
* type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required)
* }
* ]
* skills (Optional): [
* (Optional){
* type: String (Required)
* }
* ]
* policies (Optional): {
* rai_config (Optional): {
* rai_policy_name: String (Required)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import com.azure.ai.agents.models.Tool;
import com.azure.ai.agents.models.ToolboxPolicies;
import com.azure.ai.agents.models.ToolboxSkill;
import com.azure.core.annotation.Fluent;
import com.azure.core.annotation.Generated;
import com.azure.json.JsonReader;
Expand Down Expand Up @@ -141,6 +142,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeArrayField("tools", this.tools, (writer, element) -> writer.writeJson(element));
jsonWriter.writeStringField("description", this.description);
jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element));
jsonWriter.writeArrayField("skills", this.skills, (writer, element) -> writer.writeJson(element));
jsonWriter.writeJsonField("policies", this.policies);
return jsonWriter.writeEndObject();
}
Expand All @@ -160,6 +162,7 @@ public static CreateToolboxVersionRequest fromJson(JsonReader jsonReader) throws
List<Tool> tools = null;
String description = null;
Map<String, String> metadata = null;
List<ToolboxSkill> skills = null;
ToolboxPolicies policies = null;
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
Expand All @@ -170,6 +173,8 @@ public static CreateToolboxVersionRequest fromJson(JsonReader jsonReader) throws
description = reader.getString();
} else if ("metadata".equals(fieldName)) {
metadata = reader.readMap(reader1 -> reader1.getString());
} else if ("skills".equals(fieldName)) {
skills = reader.readArray(reader1 -> ToolboxSkill.fromJson(reader1));
} else if ("policies".equals(fieldName)) {
policies = ToolboxPolicies.fromJson(reader);
} else {
Expand All @@ -180,8 +185,40 @@ public static CreateToolboxVersionRequest fromJson(JsonReader jsonReader) throws
= new CreateToolboxVersionRequest(tools);
deserializedCreateToolboxVersionRequest.description = description;
deserializedCreateToolboxVersionRequest.metadata = metadata;
deserializedCreateToolboxVersionRequest.skills = skills;
deserializedCreateToolboxVersionRequest.policies = policies;
return deserializedCreateToolboxVersionRequest;
});
}

/*
* The list of skill sources to include in this version. A skill reference specifies a skill name and optionally a
* version. If version is omitted, the skill's default version is used.
*/
@Generated
private List<ToolboxSkill> skills;

/**
* Get the skills property: The list of skill sources to include in this version. A skill reference specifies a
* skill name and optionally a version. If version is omitted, the skill's default version is used.
*
* @return the skills value.
*/
@Generated
public List<ToolboxSkill> getSkills() {
return this.skills;
}

/**
* Set the skills property: The list of skill sources to include in this version. A skill reference specifies a
* skill name and optionally a version. If version is omitted, the skill's default version is used.
*
* @param skills the skills value to set.
* @return the CreateToolboxVersionRequest object itself.
*/
@Generated
public CreateToolboxVersionRequest setSkills(List<ToolboxSkill> skills) {
this.skills = skills;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,10 @@ public static Collection<AgentEndpointProtocol> values() {
*/
@Generated
public static final AgentEndpointProtocol MCP = fromString("mcp");

/**
* WebSocket-based protocol for hosted voice and real-time streaming agents.
*/
@Generated
public static final AgentEndpointProtocol INVOCATIONS_WS = fromString("invocations_ws");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.ai.agents.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.annotation.Generated;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
* Identifies the registered Foundry agent to optimize (request-only). Skills, tools, and systemPrompt are specified in
* options.optimizationConfig.
*/
@Fluent
public final class AgentIdentifier implements JsonSerializable<AgentIdentifier> {

/*
* Registered Foundry agent name (required).
*/
@Generated
private final String agentName;

/*
* Pinned agent version. Defaults to latest if omitted.
*/
@Generated
private String agentVersion;

/**
* Creates an instance of AgentIdentifier class.
*
* @param agentName the agentName value to set.
*/
@Generated
public AgentIdentifier(String agentName) {
this.agentName = agentName;
}

/**
* Get the agentName property: Registered Foundry agent name (required).
*
* @return the agentName value.
*/
@Generated
public String getAgentName() {
return this.agentName;
}

/**
* Get the agentVersion property: Pinned agent version. Defaults to latest if omitted.
*
* @return the agentVersion value.
*/
@Generated
public String getAgentVersion() {
return this.agentVersion;
}

/**
* Set the agentVersion property: Pinned agent version. Defaults to latest if omitted.
*
* @param agentVersion the agentVersion value to set.
* @return the AgentIdentifier object itself.
*/
@Generated
public AgentIdentifier setAgentVersion(String agentVersion) {
this.agentVersion = agentVersion;
return this;
}

/**
* {@inheritDoc}
*/
@Generated
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("agentName", this.agentName);
jsonWriter.writeStringField("agentVersion", this.agentVersion);
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of AgentIdentifier from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AgentIdentifier if the JsonReader was pointing to an instance of it, or null if it was
* pointing to JSON null.
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
* @throws IOException If an error occurs while reading the AgentIdentifier.
*/
@Generated
public static AgentIdentifier fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
String agentName = null;
String agentVersion = null;
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("agentName".equals(fieldName)) {
agentName = reader.getString();
} else if ("agentVersion".equals(fieldName)) {
agentVersion = reader.getString();
} else {
reader.skipChildren();
}
}
AgentIdentifier deserializedAgentIdentifier = new AgentIdentifier(agentName);
deserializedAgentIdentifier.agentVersion = agentVersion;
return deserializedAgentIdentifier;
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,10 @@ public static Collection<AgentProtocol> values() {
*/
@Generated
public static final AgentProtocol MCP = fromString("mcp");

/**
* WebSocket-based protocol for hosted voice and real-time streaming agents.
*/
@Generated
public static final AgentProtocol INVOCATIONS_WS = fromString("invocations_ws");
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,10 @@ public static AgentSessionStatus fromString(String name) {
public static Collection<AgentSessionStatus> values() {
return values(AgentSessionStatus.class);
}

/**
* Session is being stopped.
*/
@Generated
public static final AgentSessionStatus STOPPING = fromString("stopping");
}
Loading