Skip to content
Open
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

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.

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 @@ -6,9 +6,8 @@

import com.azure.ai.agents.models.AgentCard;
import com.azure.ai.agents.models.AgentCardSkill;
import com.azure.ai.agents.models.AgentEndpoint;
import com.azure.ai.agents.models.AgentEndpointAuthorizationScheme;
import com.azure.ai.agents.models.IsolationKeySource;
import com.azure.ai.agents.models.AgentEndpointConfig;
import com.azure.ai.agents.models.UpdateAgentDetailsPatchRequest;
import com.azure.ai.agents.models.VersionSelectionRule;
import com.azure.ai.agents.models.VersionSelector;
Expand All @@ -17,20 +16,21 @@
* This is the Helper class to enable json merge patch serialization for a model.
*/
public class JsonMergePatchHelper {
private static AgentEndpointAccessor agentEndpointAccessor;
private static AgentEndpointConfigAccessor agentEndpointConfigAccessor;

public interface AgentEndpointAccessor {
AgentEndpoint prepareModelForJsonMergePatch(AgentEndpoint agentEndpoint, boolean jsonMergePatchEnabled);
public interface AgentEndpointConfigAccessor {
AgentEndpointConfig prepareModelForJsonMergePatch(AgentEndpointConfig agentEndpointConfig,
boolean jsonMergePatchEnabled);

boolean isJsonMergePatch(AgentEndpoint agentEndpoint);
boolean isJsonMergePatch(AgentEndpointConfig agentEndpointConfig);
}

public static void setAgentEndpointAccessor(AgentEndpointAccessor accessor) {
agentEndpointAccessor = accessor;
public static void setAgentEndpointConfigAccessor(AgentEndpointConfigAccessor accessor) {
agentEndpointConfigAccessor = accessor;
}

public static AgentEndpointAccessor getAgentEndpointAccessor() {
return agentEndpointAccessor;
public static AgentEndpointConfigAccessor getAgentEndpointConfigAccessor() {
return agentEndpointConfigAccessor;
}

private static VersionSelectorAccessor versionSelectorAccessor;
Expand Down Expand Up @@ -85,23 +85,6 @@ public static AgentEndpointAuthorizationSchemeAccessor getAgentEndpointAuthoriza
return agentEndpointAuthorizationSchemeAccessor;
}

private static IsolationKeySourceAccessor isolationKeySourceAccessor;

public interface IsolationKeySourceAccessor {
IsolationKeySource prepareModelForJsonMergePatch(IsolationKeySource isolationKeySource,
boolean jsonMergePatchEnabled);

boolean isJsonMergePatch(IsolationKeySource isolationKeySource);
}

public static void setIsolationKeySourceAccessor(IsolationKeySourceAccessor accessor) {
isolationKeySourceAccessor = accessor;
}

public static IsolationKeySourceAccessor getIsolationKeySourceAccessor() {
return isolationKeySourceAccessor;
}

private static AgentCardAccessor agentCardAccessor;

public interface AgentCardAccessor {
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.azure.ai.agents.models.AgentCard;
import com.azure.ai.agents.models.AgentDefinition;
import com.azure.ai.agents.models.AgentDefinitionOptInKeys;
import com.azure.ai.agents.models.AgentEndpoint;
import com.azure.ai.agents.models.AgentEndpointConfig;
import com.azure.core.annotation.Fluent;
import com.azure.core.annotation.Generated;
import java.util.Map;
Expand Down Expand Up @@ -66,7 +66,7 @@ public final class CreateAgentOptions {
* An optional endpoint configuration. If not specified, a default endpoint configuration will be set for the agent
*/
@Generated
private AgentEndpoint agentEndpoint;
private AgentEndpointConfig agentEndpoint;

/*
* Optional agent card for the agent
Expand Down Expand Up @@ -218,23 +218,10 @@ public CreateAgentOptions setBlueprintReference(AgentBlueprintReference blueprin
* @return the agentEndpoint value.
*/
@Generated
public AgentEndpoint getAgentEndpoint() {
public AgentEndpointConfig getAgentEndpoint() {
return this.agentEndpoint;
}

/**
* Set the agentEndpoint property: An optional endpoint configuration. If not specified, a default endpoint
* configuration will be set for the agent.
*
* @param agentEndpoint the agentEndpoint value to set.
* @return the CreateAgentOptions object itself.
*/
@Generated
public CreateAgentOptions setAgentEndpoint(AgentEndpoint agentEndpoint) {
this.agentEndpoint = agentEndpoint;
return this;
}

/**
* Get the agentCard property: Optional agent card for the agent.
*
Expand All @@ -256,4 +243,17 @@ public CreateAgentOptions setAgentCard(AgentCard agentCard) {
this.agentCard = agentCard;
return this;
}

/**
* Set the agentEndpoint property: An optional endpoint configuration. If not specified, a default endpoint
* configuration will be set for the agent.
*
* @param agentEndpoint the agentEndpoint value to set.
* @return the CreateAgentOptions object itself.
*/
@Generated
public CreateAgentOptions setAgentEndpoint(AgentEndpointConfig agentEndpoint) {
this.agentEndpoint = agentEndpoint;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.azure.ai.agents.models.AgentBlueprintReference;
import com.azure.ai.agents.models.AgentCard;
import com.azure.ai.agents.models.AgentDefinition;
import com.azure.ai.agents.models.AgentEndpoint;
import com.azure.ai.agents.models.AgentEndpointConfig;
import com.azure.core.annotation.Fluent;
import com.azure.core.annotation.Generated;
import com.azure.json.JsonReader;
Expand Down Expand Up @@ -179,7 +179,7 @@ public static CreateAgentRequest fromJson(JsonReader jsonReader) throws IOExcept
Map<String, String> metadata = null;
String description = null;
AgentBlueprintReference blueprintReference = null;
AgentEndpoint agentEndpoint = null;
AgentEndpointConfig agentEndpoint = null;
AgentCard agentCard = null;
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
Expand All @@ -195,7 +195,7 @@ public static CreateAgentRequest fromJson(JsonReader jsonReader) throws IOExcept
} else if ("blueprint_reference".equals(fieldName)) {
blueprintReference = AgentBlueprintReference.fromJson(reader);
} else if ("agent_endpoint".equals(fieldName)) {
agentEndpoint = AgentEndpoint.fromJson(reader);
agentEndpoint = AgentEndpointConfig.fromJson(reader);
} else if ("agent_card".equals(fieldName)) {
agentCard = AgentCard.fromJson(reader);
} else {
Expand All @@ -222,7 +222,7 @@ public static CreateAgentRequest fromJson(JsonReader jsonReader) throws IOExcept
* An optional endpoint configuration. If not specified, a default endpoint configuration will be set for the agent
*/
@Generated
private AgentEndpoint agentEndpoint;
private AgentEndpointConfig agentEndpoint;

/*
* Optional agent card for the agent
Expand Down Expand Up @@ -259,23 +259,10 @@ public CreateAgentRequest setBlueprintReference(AgentBlueprintReference blueprin
* @return the agentEndpoint value.
*/
@Generated
public AgentEndpoint getAgentEndpoint() {
public AgentEndpointConfig getAgentEndpoint() {
return this.agentEndpoint;
}

/**
* Set the agentEndpoint property: An optional endpoint configuration. If not specified, a default endpoint
* configuration will be set for the agent.
*
* @param agentEndpoint the agentEndpoint value to set.
* @return the CreateAgentRequest object itself.
*/
@Generated
public CreateAgentRequest setAgentEndpoint(AgentEndpoint agentEndpoint) {
this.agentEndpoint = agentEndpoint;
return this;
}

/**
* Get the agentCard property: Optional agent card for the agent.
*
Expand All @@ -297,4 +284,17 @@ public CreateAgentRequest setAgentCard(AgentCard agentCard) {
this.agentCard = agentCard;
return this;
}

/**
* Set the agentEndpoint property: An optional endpoint configuration. If not specified, a default endpoint
* configuration will be set for the agent.
*
* @param agentEndpoint the agentEndpoint value to set.
* @return the CreateAgentRequest object itself.
*/
@Generated
public CreateAgentRequest setAgentEndpoint(AgentEndpointConfig agentEndpoint) {
this.agentEndpoint = agentEndpoint;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ public A2APreviewTool setProjectConnectionId(String projectConnectionId) {
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString());
jsonWriter.writeStringField("name", this.name);
jsonWriter.writeStringField("description", this.description);
jsonWriter.writeStringField("base_url", this.baseUrl);
jsonWriter.writeStringField("agent_card_path", this.agentCardPath);
jsonWriter.writeStringField("project_connection_id", this.projectConnectionId);
Expand All @@ -161,6 +163,10 @@ public static A2APreviewTool fromJson(JsonReader jsonReader) throws IOException
reader.nextToken();
if ("type".equals(fieldName)) {
deserializedA2APreviewTool.type = ToolType.fromString(reader.getString());
} else if ("name".equals(fieldName)) {
deserializedA2APreviewTool.name = reader.getString();
} else if ("description".equals(fieldName)) {
deserializedA2APreviewTool.description = reader.getString();
} else if ("base_url".equals(fieldName)) {
deserializedA2APreviewTool.baseUrl = reader.getString();
} else if ("agent_card_path".equals(fieldName)) {
Expand All @@ -174,4 +180,60 @@ public static A2APreviewTool fromJson(JsonReader jsonReader) throws IOException
return deserializedA2APreviewTool;
});
}

/*
* Optional user-defined name for this tool or configuration.
*/
@Generated
private String name;

/*
* Optional user-defined description for this tool or configuration.
*/
@Generated
private String description;

/**
* Get the name property: Optional user-defined name for this tool or configuration.
*
* @return the name value.
*/
@Generated
public String getName() {
return this.name;
}

/**
* Set the name property: Optional user-defined name for this tool or configuration.
*
* @param name the name value to set.
* @return the A2APreviewTool object itself.
*/
@Generated
public A2APreviewTool setName(String name) {
this.name = name;
return this;
}

/**
* Get the description property: Optional user-defined description for this tool or configuration.
*
* @return the description value.
*/
@Generated
public String getDescription() {
return this.description;
}

/**
* Set the description property: Optional user-defined description for this tool or configuration.
*
* @param description the description value to set.
* @return the A2APreviewTool object itself.
*/
@Generated
public A2APreviewTool setDescription(String description) {
this.description = description;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public static AgentDetails fromJson(JsonReader jsonReader) throws IOException {
String id = null;
String name = null;
AgentDetailsVersions versions = null;
AgentEndpoint agentEndpoint = null;
AgentEndpointConfig agentEndpoint = null;
AgentIdentity instanceIdentity = null;
AgentIdentity blueprint = null;
AgentBlueprintReference blueprintReference = null;
Expand All @@ -111,7 +111,7 @@ public static AgentDetails fromJson(JsonReader jsonReader) throws IOException {
} else if ("versions".equals(fieldName)) {
versions = AgentDetailsVersions.fromJson(reader);
} else if ("agent_endpoint".equals(fieldName)) {
agentEndpoint = AgentEndpoint.fromJson(reader);
agentEndpoint = AgentEndpointConfig.fromJson(reader);
} else if ("instance_identity".equals(fieldName)) {
instanceIdentity = AgentIdentity.fromJson(reader);
} else if ("blueprint".equals(fieldName)) {
Expand Down Expand Up @@ -168,7 +168,7 @@ public AgentObjectType getObjectType() {
* The endpoint configuration for the agent
*/
@Generated
private AgentEndpoint agentEndpoint;
private AgentEndpointConfig agentEndpoint;

/*
* The instance identity of the agent
Expand Down Expand Up @@ -200,7 +200,7 @@ public AgentObjectType getObjectType() {
* @return the agentEndpoint value.
*/
@Generated
public AgentEndpoint getAgentEndpoint() {
public AgentEndpointConfig getAgentEndpoint() {
return this.agentEndpoint;
}

Expand Down
Loading