diff --git a/.vscode/cspell.json b/.vscode/cspell.json
index dbfcd99e83ab..55e8d97e2907 100644
--- a/.vscode/cspell.json
+++ b/.vscode/cspell.json
@@ -360,6 +360,7 @@
"Mordor",
"mosca",
"mpga",
+ "mpkjc",
"msal",
"msix",
"MSRC",
diff --git a/sdk/ai/azure-ai-agents/_tsp-location.yaml b/sdk/ai/azure-ai-agents/_tsp-location.yaml
deleted file mode 100644
index 63abffbdc08c..000000000000
--- a/sdk/ai/azure-ai-agents/_tsp-location.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-directory: specification/ai/Azure.AI.Agents.V2.java
-commit: 203d09050acd4d23496c0da4aaff9c6bb83097aa
-repo: Azure/azure-rest-api-specs-pr
-additionalDirectories:
- - specification/ai/Azure.AI.Projects
diff --git a/sdk/ai/azure-ai-agents/assets.json b/sdk/ai/azure-ai-agents/assets.json
index 2b1a3831f771..5335d7f8704c 100644
--- a/sdk/ai/azure-ai-agents/assets.json
+++ b/sdk/ai/azure-ai-agents/assets.json
@@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "java",
"TagPrefix": "java/ai/azure-ai-agents",
- "Tag": "java/ai/azure-ai-agents_3f32cd8dff"
+ "Tag": "java/ai/azure-ai-agents_ab6a883fcd"
}
\ No newline at end of file
diff --git a/sdk/ai/azure-ai-agents/checkstyle-suppressions.xml b/sdk/ai/azure-ai-agents/checkstyle-suppressions.xml
index cfbc68cba182..2c4cb5fb2631 100644
--- a/sdk/ai/azure-ai-agents/checkstyle-suppressions.xml
+++ b/sdk/ai/azure-ai-agents/checkstyle-suppressions.xml
@@ -19,4 +19,6 @@
* {@code
* {
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* versions (Required): {
@@ -61,7 +62,7 @@ public final class AgentsAsyncClient {
* metadata (Required): {
* String: String (Required)
* }
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* version: String (Required)
@@ -100,7 +101,7 @@ public Mono> getAgentWithResponse(String agentName, Request
*
* {@code
* {
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* name: String (Required)
* deleted: boolean (Required)
* }
@@ -122,75 +123,15 @@ public Mono> deleteAgentWithResponse(String agentName, Requ
}
/**
- * Returns the list of all agents.
- * Query Parameters
+ * Create a new agent version.
+ * Header Parameters
*
- * Query Parameters
+ * Header Parameters
* Name Type Required Description
- * kind String No Filter agents by kind. If not provided, all agents are returned.
- * Allowed values: "prompt", "hosted", "container_app", "workflow".
- * limit Integer No A limit on the number of objects to be returned. Limit can range
- * between 1 and 100, and the
- * default is 20.
- * order String No Sort order by the `created_at` timestamp of the objects. `asc`
- * for ascending order and`desc`
- * for descending order. Allowed values: "asc", "desc".
- * after String No 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.
- * before String No 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.
+ * Foundry-Features BinaryData No A feature flag opt-in required when using preview
+ * operations or modifying persisted preview resources.
*
- * You can add these to a request with {@link RequestOptions#addQueryParam}
- * Response Body Schema
- *
- *
- * {@code
- * {
- * object: String (Required)
- * id: String (Required)
- * name: String (Required)
- * versions (Required): {
- * latest (Required): {
- * metadata (Required): {
- * String: String (Required)
- * }
- * object: String (Required)
- * id: String (Required)
- * name: String (Required)
- * version: String (Required)
- * description: String (Optional)
- * created_at: long (Required)
- * definition (Required): {
- * kind: String(prompt/hosted/container_app/workflow) (Required)
- * rai_config (Optional): {
- * rai_policy_name: String (Required)
- * }
- * }
- * }
- * }
- * }
- * }
- *
- *
- * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
- * @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.
- * @return the response data for a requested list of items as paginated response with {@link PagedFlux}.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedFlux listAgents(RequestOptions requestOptions) {
- return this.serviceClient.listAgentsAsync(requestOptions);
- }
-
- /**
- * Create a new agent version.
+ * You can add these to a request with {@link RequestOptions#addHeader}
* Request Body Schema
*
*
@@ -218,7 +159,7 @@ public PagedFlux listAgents(RequestOptions requestOptions) {
* metadata (Required): {
* String: String (Required)
* }
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* version: String (Required)
@@ -261,7 +202,7 @@ public Mono> createAgentVersionWithResponse(String agentNam
*
* {@code
* {
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* name: String (Required)
* version: String (Required)
* deleted: boolean (Required)
@@ -315,7 +256,7 @@ public Mono> deleteAgentVersionWithResponse(String agentNam
* metadata (Required): {
* String: String (Required)
* }
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* version: String (Required)
@@ -472,120 +413,6 @@ public PagedFlux listAgentVersions(String agentName) {
});
}
- /**
- * Returns the list of all agents.
- *
- * @param kind Filter agents by kind. If not provided, all agents are returned.
- * @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 listAgents(AgentKind kind, Integer limit, ListAgentsRequestOrder order, String after,
- String before) {
- // Generated convenience method for listAgents
- RequestOptions requestOptions = new RequestOptions();
- if (kind != null) {
- requestOptions.addQueryParam("kind", kind.toString(), false);
- }
- 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 pagedFluxResponse = listAgents(requestOptions);
- return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
- Flux> flux = (continuationTokenParam == null)
- ? pagedFluxResponse.byPage().take(1)
- : pagedFluxResponse.byPage(continuationTokenParam).take(1);
- return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
- pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
- pagedResponse.getValue()
- .stream()
- .map(protocolMethodData -> protocolMethodData.toObject(AgentDetails.class))
- .collect(Collectors.toList()),
- pagedResponse.getContinuationToken(), null));
- });
- }
-
- /**
- * Returns the list of versions of an agent.
- *
- * @param agentName The name of the agent to retrieve versions for.
- * @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 listAgentVersions(String agentName, Integer limit,
- ListAgentsRequestOrder order, String after, String before) {
- // Generated convenience method for listAgentVersions
- 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 pagedFluxResponse = listAgentVersions(agentName, requestOptions);
- return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
- Flux> flux = (continuationTokenParam == null)
- ? pagedFluxResponse.byPage().take(1)
- : pagedFluxResponse.byPage(continuationTokenParam).take(1);
- return flux
- .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
- pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
- pagedResponse.getValue()
- .stream()
- .map(protocolMethodData -> protocolMethodData.toObject(AgentVersionDetails.class))
- .collect(Collectors.toList()),
- pagedResponse.getContinuationToken(), null));
- });
- }
-
/**
* Create a new agent version.
*
@@ -616,6 +443,14 @@ public Mono createAgentVersion(String agentName, AgentDefin
/**
* Creates the agent.
+ * Header Parameters
+ *
+ * Header Parameters
+ * Name Type Required Description
+ * Foundry-Features BinaryData No A feature flag opt-in required when using preview
+ * operations or modifying persisted preview resources.
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
* Request Body Schema
*
*
@@ -641,7 +476,7 @@ public Mono createAgentVersion(String agentName, AgentDefin
*
* {@code
* {
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* versions (Required): {
@@ -649,7 +484,7 @@ public Mono createAgentVersion(String agentName, AgentDefin
* metadata (Required): {
* String: String (Required)
* }
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* version: String (Required)
@@ -685,6 +520,14 @@ public Mono> createAgentWithResponse(BinaryData createAgent
/**
* Updates the agent by adding a new version if there are any changes to the agent definition.
* If no changes, returns the existing agent version.
+ * Header Parameters
+ *
+ * Header Parameters
+ * Name Type Required Description
+ * Foundry-Features BinaryData No A feature flag opt-in required when using preview
+ * operations or modifying persisted preview resources.
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
* Request Body Schema
*
*
@@ -709,7 +552,7 @@ public Mono> createAgentWithResponse(BinaryData createAgent
*
* {@code
* {
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* versions (Required): {
@@ -717,7 +560,7 @@ public Mono> createAgentWithResponse(BinaryData createAgent
* metadata (Required): {
* String: String (Required)
* }
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* version: String (Required)
@@ -838,7 +681,7 @@ public Mono updateAgent(String agentName, AgentDefinition definiti
*
* {@code
* {
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* versions (Required): {
@@ -846,7 +689,7 @@ public Mono updateAgent(String agentName, AgentDefinition definiti
* metadata (Required): {
* String: String (Required)
* }
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* version: String (Required)
@@ -905,7 +748,7 @@ public Mono> createAgentFromManifestWithResponse(BinaryData
*
* {@code
* {
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* versions (Required): {
@@ -913,7 +756,7 @@ public Mono> createAgentFromManifestWithResponse(BinaryData
* metadata (Required): {
* String: String (Required)
* }
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* version: String (Required)
@@ -975,7 +818,7 @@ public Mono> updateAgentFromManifestWithResponse(String age
* metadata (Required): {
* String: String (Required)
* }
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* version: String (Required)
@@ -1104,47 +947,12 @@ public Mono createAgentVersionFromManifest(String agentName
}
/**
- * Creates the agent.
- *
- * @param name The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
- * - Must start and end with alphanumeric characters,
- * - Can contain hyphens in the middle
- * - Must not exceed 63 characters.
- * @param definition The agent definition. This can be a workflow, hosted agent, or a simple agent definition.
- * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be
- * useful for storing additional information about the object in a structured
- * format, and querying for objects via API or the dashboard.
- *
- * Keys are strings with a maximum length of 64 characters. Values are strings
- * with a maximum length of 512 characters.
- * @param description A human-readable description of the agent.
- * @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 body on successful completion of {@link Mono}.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono createAgent(String name, AgentDefinition definition, Map metadata,
- String description) {
- // Generated convenience method for createAgentWithResponse
- RequestOptions requestOptions = new RequestOptions();
- CreateAgentRequest1 createAgentRequest1Obj
- = new CreateAgentRequest1(name, definition).setMetadata(metadata).setDescription(description);
- BinaryData createAgentRequest1 = BinaryData.fromObject(createAgentRequest1Obj);
- return createAgentWithResponse(createAgentRequest1, requestOptions).flatMap(FluxUtil::toMono)
- .map(protocolMethodData -> protocolMethodData.toObject(AgentDetails.class));
- }
-
- /**
- * Updates the agent by adding a new version if there are any changes to the agent definition.
+ * Updates the agent from a manifest by adding a new version if there are any changes to the agent definition.
* If no changes, returns the existing agent version.
*
- * @param agentName The name of the agent to retrieve.
- * @param definition The agent definition. This can be a workflow, hosted agent, or a simple agent definition.
+ * @param agentName The name of the agent to update.
+ * @param manifestId The manifest ID to import the agent version from.
+ * @param parameterValues The inputs to the manifest that will result in a fully materialized Agent.
* @param metadata Set of 16 key-value pairs that can be attached to an object. This can be
* useful for storing additional information about the object in a structured
* format, and querying for objects via API or the dashboard.
@@ -1162,21 +970,23 @@ public Mono createAgent(String name, AgentDefinition definition, M
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono updateAgent(String agentName, AgentDefinition definition, Map metadata,
- String description) {
- // Generated convenience method for updateAgentWithResponse
+ public Mono updateAgentFromManifest(String agentName, String manifestId,
+ Map parameterValues, Map metadata, String description) {
+ // Generated convenience method for updateAgentFromManifestWithResponse
RequestOptions requestOptions = new RequestOptions();
- UpdateAgentRequest1 updateAgentRequest1Obj
- = new UpdateAgentRequest1(definition).setMetadata(metadata).setDescription(description);
- BinaryData updateAgentRequest1 = BinaryData.fromObject(updateAgentRequest1Obj);
- return updateAgentWithResponse(agentName, updateAgentRequest1, requestOptions).flatMap(FluxUtil::toMono)
+ UpdateAgentFromManifestRequest1 updateAgentFromManifestRequest1Obj
+ = new UpdateAgentFromManifestRequest1(manifestId, parameterValues).setMetadata(metadata)
+ .setDescription(description);
+ BinaryData updateAgentFromManifestRequest1 = BinaryData.fromObject(updateAgentFromManifestRequest1Obj);
+ return updateAgentFromManifestWithResponse(agentName, updateAgentFromManifestRequest1, requestOptions)
+ .flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(AgentDetails.class));
}
/**
- * Creates an agent from a manifest.
+ * Create a new agent version from a manifest.
*
- * @param name The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
+ * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
* - Must start and end with alphanumeric characters,
* - Can contain hyphens in the middle
* - Must not exceed 63 characters.
@@ -1199,33 +1009,67 @@ public Mono updateAgent(String agentName, AgentDefinition definiti
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono createAgentFromManifest(String name, String manifestId,
+ public Mono createAgentVersionFromManifest(String agentName, String manifestId,
Map parameterValues, Map metadata, String description) {
- // Generated convenience method for createAgentFromManifestWithResponse
+ // Generated convenience method for createAgentVersionFromManifestWithResponse
RequestOptions requestOptions = new RequestOptions();
- CreateAgentFromManifestRequest1 createAgentFromManifestRequest1Obj
- = new CreateAgentFromManifestRequest1(name, manifestId, parameterValues).setMetadata(metadata)
+ CreateAgentVersionFromManifestRequest1 createAgentVersionFromManifestRequest1Obj
+ = new CreateAgentVersionFromManifestRequest1(manifestId, parameterValues).setMetadata(metadata)
.setDescription(description);
- BinaryData createAgentFromManifestRequest1 = BinaryData.fromObject(createAgentFromManifestRequest1Obj);
- return createAgentFromManifestWithResponse(createAgentFromManifestRequest1, requestOptions)
- .flatMap(FluxUtil::toMono)
- .map(protocolMethodData -> protocolMethodData.toObject(AgentDetails.class));
- }
-
- /**
- * Updates the agent from a manifest by adding a new version if there are any changes to the agent definition.
- * If no changes, returns the existing agent version.
+ BinaryData createAgentVersionFromManifestRequest1
+ = BinaryData.fromObject(createAgentVersionFromManifestRequest1Obj);
+ return createAgentVersionFromManifestWithResponse(agentName, createAgentVersionFromManifestRequest1,
+ requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(AgentVersionDetails.class));
+ }
+
+ /**
+ * Retrieves a specific version of an agent.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * metadata (Required): {
+ * String: String (Required)
+ * }
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+ * id: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * description: String (Optional)
+ * created_at: long (Required)
+ * definition (Required): {
+ * kind: String(prompt/hosted/container_app/workflow) (Required)
+ * rai_config (Optional): {
+ * rai_policy_name: String (Required)
+ * }
+ * }
+ * }
+ * }
+ *
*
- * @param agentName The name of the agent to update.
- * @param manifestId The manifest ID to import the agent version from.
- * @param parameterValues The inputs to the manifest that will result in a fully materialized Agent.
- * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be
- * useful for storing additional information about the object in a structured
- * format, and querying for objects via API or the dashboard.
+ * @param agentName The name of the agent to retrieve.
+ * @param agentVersion The version of the agent to retrieve.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @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.
+ * @return the response body along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getAgentVersionDetailsWithResponse(String agentName, String agentVersion,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getAgentVersionDetailsWithResponseAsync(agentName, agentVersion, requestOptions);
+ }
+
+ /**
+ * Retrieves a specific version of an agent.
*
- * Keys are strings with a maximum length of 64 characters. Values are strings
- * with a maximum length of 512 characters.
- * @param description A human-readable description of the agent.
+ * @param agentName The name of the agent to retrieve.
+ * @param agentVersion The version of the agent to retrieve.
* @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.
@@ -1236,27 +1080,204 @@ public Mono createAgentFromManifest(String name, String manifestId
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono updateAgentFromManifest(String agentName, String manifestId,
- Map parameterValues, Map metadata, String description) {
- // Generated convenience method for updateAgentFromManifestWithResponse
+ public Mono getAgentVersionDetails(String agentName, String agentVersion) {
+ // Generated convenience method for getAgentVersionDetailsWithResponse
RequestOptions requestOptions = new RequestOptions();
- UpdateAgentFromManifestRequest1 updateAgentFromManifestRequest1Obj
- = new UpdateAgentFromManifestRequest1(manifestId, parameterValues).setMetadata(metadata)
- .setDescription(description);
- BinaryData updateAgentFromManifestRequest1 = BinaryData.fromObject(updateAgentFromManifestRequest1Obj);
- return updateAgentFromManifestWithResponse(agentName, updateAgentFromManifestRequest1, requestOptions)
- .flatMap(FluxUtil::toMono)
- .map(protocolMethodData -> protocolMethodData.toObject(AgentDetails.class));
+ return getAgentVersionDetailsWithResponse(agentName, agentVersion, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(AgentVersionDetails.class));
}
/**
- * Create a new agent version.
+ * Returns the list of all agents.
*
- * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
+ * @param kind Filter agents by kind. If not provided, all agents are returned.
+ * @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 listAgents(AgentKind kind, Integer limit, PageOrder order, String after,
+ String before) {
+ // Generated convenience method for listAgents
+ RequestOptions requestOptions = new RequestOptions();
+ if (kind != null) {
+ requestOptions.addQueryParam("kind", kind.toString(), false);
+ }
+ 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 pagedFluxResponse = listAgents(requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(AgentDetails.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * Returns the list of versions of an agent.
+ *
+ * @param agentName The name of the agent to retrieve versions for.
+ * @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 listAgentVersions(String agentName, Integer limit, PageOrder order,
+ String after, String before) {
+ // Generated convenience method for listAgentVersions
+ 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 pagedFluxResponse = listAgentVersions(agentName, requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux
+ .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(AgentVersionDetails.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * Returns the list of all agents.
+ * Query Parameters
+ *
+ * Query Parameters
+ * Name Type Required Description
+ * kind String No Filter agents by kind. If not provided, all agents are returned.
+ * Allowed values: "prompt", "hosted", "container_app", "workflow".
+ * limit Integer No A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the
+ * default is 20.
+ * order String No Sort order by the `created_at` timestamp of the objects. `asc`
+ * for ascending order and`desc`
+ * for descending order. Allowed values: "asc", "desc".
+ * after String No 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.
+ * before String No 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.
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+ * id: String (Required)
+ * name: String (Required)
+ * versions (Required): {
+ * latest (Required): {
+ * metadata (Required): {
+ * String: String (Required)
+ * }
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+ * id: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * description: String (Optional)
+ * created_at: long (Required)
+ * definition (Required): {
+ * kind: String(prompt/hosted/container_app/workflow) (Required)
+ * rai_config (Optional): {
+ * rai_policy_name: String (Required)
+ * }
+ * }
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @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.
+ * @return the response data for a requested list of items as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAgents(RequestOptions requestOptions) {
+ return this.serviceClient.listAgentsAsync(requestOptions);
+ }
+
+ /**
+ * Creates an agent from a manifest.
+ *
+ * @param name The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
* - Must start and end with alphanumeric characters,
* - Can contain hyphens in the middle
* - Must not exceed 63 characters.
- * @param definition The agent definition. This can be a workflow, hosted agent, or a simple agent definition.
+ * @param manifestId The manifest ID to import the agent version from.
+ * @param parameterValues The inputs to the manifest that will result in a fully materialized Agent.
* @param metadata Set of 16 key-value pairs that can be attached to an object. This can be
* useful for storing additional information about the object in a structured
* format, and querying for objects via API or the dashboard.
@@ -1274,27 +1295,29 @@ public Mono updateAgentFromManifest(String agentName, String manif
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono createAgentVersion(String agentName, AgentDefinition definition,
- Map metadata, String description) {
- // Generated convenience method for createAgentVersionWithResponse
+ public Mono createAgentFromManifest(String name, String manifestId,
+ Map parameterValues, Map metadata, String description) {
+ // Generated convenience method for createAgentFromManifestWithResponse
RequestOptions requestOptions = new RequestOptions();
- CreateAgentVersionRequest1 createAgentVersionRequest1Obj
- = new CreateAgentVersionRequest1(definition).setMetadata(metadata).setDescription(description);
- BinaryData createAgentVersionRequest1 = BinaryData.fromObject(createAgentVersionRequest1Obj);
- return createAgentVersionWithResponse(agentName, createAgentVersionRequest1, requestOptions)
+ CreateAgentFromManifestRequest1 createAgentFromManifestRequest1Obj
+ = new CreateAgentFromManifestRequest1(name, manifestId, parameterValues).setMetadata(metadata)
+ .setDescription(description);
+ BinaryData createAgentFromManifestRequest1 = BinaryData.fromObject(createAgentFromManifestRequest1Obj);
+ return createAgentFromManifestWithResponse(createAgentFromManifestRequest1, requestOptions)
.flatMap(FluxUtil::toMono)
- .map(protocolMethodData -> protocolMethodData.toObject(AgentVersionDetails.class));
+ .map(protocolMethodData -> protocolMethodData.toObject(AgentDetails.class));
}
/**
- * Create a new agent version from a manifest.
+ * Creates the agent.
*
- * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
+ * @param name The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
* - Must start and end with alphanumeric characters,
* - Can contain hyphens in the middle
* - Must not exceed 63 characters.
- * @param manifestId The manifest ID to import the agent version from.
- * @param parameterValues The inputs to the manifest that will result in a fully materialized Agent.
+ * @param definition The agent definition. This can be a workflow, hosted agent, or a simple agent definition.
+ * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted
+ * preview resources.
* @param metadata Set of 16 key-value pairs that can be attached to an object. This can be
* useful for storing additional information about the object in a structured
* format, and querying for objects via API or the dashboard.
@@ -1312,67 +1335,76 @@ public Mono createAgentVersion(String agentName, AgentDefin
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono createAgentVersionFromManifest(String agentName, String manifestId,
- Map parameterValues, Map metadata, String description) {
- // Generated convenience method for createAgentVersionFromManifestWithResponse
+ public Mono createAgent(String name, AgentDefinition definition, BinaryData foundryFeatures,
+ Map metadata, String description) {
+ // Generated convenience method for createAgentWithResponse
RequestOptions requestOptions = new RequestOptions();
- CreateAgentVersionFromManifestRequest1 createAgentVersionFromManifestRequest1Obj
- = new CreateAgentVersionFromManifestRequest1(manifestId, parameterValues).setMetadata(metadata)
- .setDescription(description);
- BinaryData createAgentVersionFromManifestRequest1
- = BinaryData.fromObject(createAgentVersionFromManifestRequest1Obj);
- return createAgentVersionFromManifestWithResponse(agentName, createAgentVersionFromManifestRequest1,
- requestOptions).flatMap(FluxUtil::toMono)
- .map(protocolMethodData -> protocolMethodData.toObject(AgentVersionDetails.class));
+ CreateAgentRequest1 createAgentRequest1Obj
+ = new CreateAgentRequest1(name, definition).setMetadata(metadata).setDescription(description);
+ BinaryData createAgentRequest1 = BinaryData.fromObject(createAgentRequest1Obj);
+ if (foundryFeatures != null) {
+ requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), String.valueOf(foundryFeatures));
+ }
+ return createAgentWithResponse(createAgentRequest1, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(AgentDetails.class));
}
/**
- * Retrieves a specific version of an agent.
- * Response Body Schema
- *
- *
- * {@code
- * {
- * metadata (Required): {
- * String: String (Required)
- * }
- * object: String (Required)
- * id: String (Required)
- * name: String (Required)
- * version: String (Required)
- * description: String (Optional)
- * created_at: long (Required)
- * definition (Required): {
- * kind: String(prompt/hosted/container_app/workflow) (Required)
- * rai_config (Optional): {
- * rai_policy_name: String (Required)
- * }
- * }
- * }
- * }
- *
+ * Updates the agent by adding a new version if there are any changes to the agent definition.
+ * If no changes, returns the existing agent version.
*
* @param agentName The name of the agent to retrieve.
- * @param agentVersion The version of the agent to retrieve.
- * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @param definition The agent definition. This can be a workflow, hosted agent, or a simple agent definition.
+ * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted
+ * preview resources.
+ * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be
+ * useful for storing additional information about the object in a structured
+ * format, and querying for objects via API or the dashboard.
+ *
+ * Keys are strings with a maximum length of 64 characters. Values are strings
+ * with a maximum length of 512 characters.
+ * @param description A human-readable description of the agent.
+ * @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.
- * @return the response body along with {@link Response} on successful completion of {@link Mono}.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response body on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> getAgentVersionDetailsWithResponse(String agentName, String agentVersion,
- RequestOptions requestOptions) {
- return this.serviceClient.getAgentVersionDetailsWithResponseAsync(agentName, agentVersion, requestOptions);
+ public Mono updateAgent(String agentName, AgentDefinition definition, BinaryData foundryFeatures,
+ Map metadata, String description) {
+ // Generated convenience method for updateAgentWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ UpdateAgentRequest1 updateAgentRequest1Obj
+ = new UpdateAgentRequest1(definition).setMetadata(metadata).setDescription(description);
+ BinaryData updateAgentRequest1 = BinaryData.fromObject(updateAgentRequest1Obj);
+ if (foundryFeatures != null) {
+ requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), String.valueOf(foundryFeatures));
+ }
+ return updateAgentWithResponse(agentName, updateAgentRequest1, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(AgentDetails.class));
}
/**
- * Retrieves a specific version of an agent.
+ * Create a new agent version.
*
- * @param agentName The name of the agent to retrieve.
- * @param agentVersion The version of the agent to retrieve.
+ * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
+ * - Must start and end with alphanumeric characters,
+ * - Can contain hyphens in the middle
+ * - Must not exceed 63 characters.
+ * @param definition The agent definition. This can be a workflow, hosted agent, or a simple agent definition.
+ * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted
+ * preview resources.
+ * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be
+ * useful for storing additional information about the object in a structured
+ * format, and querying for objects via API or the dashboard.
+ *
+ * Keys are strings with a maximum length of 64 characters. Values are strings
+ * with a maximum length of 512 characters.
+ * @param description A human-readable description of the agent.
* @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.
@@ -1383,10 +1415,18 @@ public Mono> getAgentVersionDetailsWithResponse(String agen
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono getAgentVersionDetails(String agentName, String agentVersion) {
- // Generated convenience method for getAgentVersionDetailsWithResponse
+ public Mono createAgentVersion(String agentName, AgentDefinition definition,
+ BinaryData foundryFeatures, Map metadata, String description) {
+ // Generated convenience method for createAgentVersionWithResponse
RequestOptions requestOptions = new RequestOptions();
- return getAgentVersionDetailsWithResponse(agentName, agentVersion, requestOptions).flatMap(FluxUtil::toMono)
+ CreateAgentVersionRequest1 createAgentVersionRequest1Obj
+ = new CreateAgentVersionRequest1(definition).setMetadata(metadata).setDescription(description);
+ BinaryData createAgentVersionRequest1 = BinaryData.fromObject(createAgentVersionRequest1Obj);
+ if (foundryFeatures != null) {
+ requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), String.valueOf(foundryFeatures));
+ }
+ return createAgentVersionWithResponse(agentName, createAgentVersionRequest1, requestOptions)
+ .flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(AgentVersionDetails.class));
}
}
diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClient.java
index 9b3d92f09365..0387d75e9578 100644
--- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClient.java
+++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClient.java
@@ -16,7 +16,7 @@
import com.azure.ai.agents.models.AgentVersionDetails;
import com.azure.ai.agents.models.DeleteAgentResponse;
import com.azure.ai.agents.models.DeleteAgentVersionResponse;
-import com.azure.ai.agents.models.ListAgentsRequestOrder;
+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;
@@ -25,6 +25,7 @@
import com.azure.core.exception.HttpResponseException;
import com.azure.core.exception.ResourceModifiedException;
import com.azure.core.exception.ResourceNotFoundException;
+import com.azure.core.http.HttpHeaderName;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.RequestOptions;
import com.azure.core.http.rest.Response;
@@ -47,7 +48,7 @@ public final class AgentsClient {
*
* {@code
* {
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* versions (Required): {
@@ -55,7 +56,7 @@ public final class AgentsClient {
* metadata (Required): {
* String: String (Required)
* }
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* version: String (Required)
@@ -94,7 +95,7 @@ public Response getAgentWithResponse(String agentName, RequestOption
*
* {@code
* {
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* name: String (Required)
* deleted: boolean (Required)
* }
@@ -116,75 +117,15 @@ public Response deleteAgentWithResponse(String agentName, RequestOpt
}
/**
- * Returns the list of all agents.
- * Query Parameters
+ * Create a new agent version.
+ * Header Parameters
*
- * Query Parameters
+ * Header Parameters
* Name Type Required Description
- * kind String No Filter agents by kind. If not provided, all agents are returned.
- * Allowed values: "prompt", "hosted", "container_app", "workflow".
- * limit Integer No A limit on the number of objects to be returned. Limit can range
- * between 1 and 100, and the
- * default is 20.
- * order String No Sort order by the `created_at` timestamp of the objects. `asc`
- * for ascending order and`desc`
- * for descending order. Allowed values: "asc", "desc".
- * after String No 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.
- * before String No 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.
+ * Foundry-Features BinaryData No A feature flag opt-in required when using preview
+ * operations or modifying persisted preview resources.
*
- * You can add these to a request with {@link RequestOptions#addQueryParam}
- * Response Body Schema
- *
- *
- * {@code
- * {
- * object: String (Required)
- * id: String (Required)
- * name: String (Required)
- * versions (Required): {
- * latest (Required): {
- * metadata (Required): {
- * String: String (Required)
- * }
- * object: String (Required)
- * id: String (Required)
- * name: String (Required)
- * version: String (Required)
- * description: String (Optional)
- * created_at: long (Required)
- * definition (Required): {
- * kind: String(prompt/hosted/container_app/workflow) (Required)
- * rai_config (Optional): {
- * rai_policy_name: String (Required)
- * }
- * }
- * }
- * }
- * }
- * }
- *
- *
- * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
- * @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.
- * @return the response data for a requested list of items as paginated response with {@link PagedIterable}.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable listAgents(RequestOptions requestOptions) {
- return this.serviceClient.listAgents(requestOptions);
- }
-
- /**
- * Create a new agent version.
+ * You can add these to a request with {@link RequestOptions#addHeader}
* Request Body Schema
*
*
@@ -212,7 +153,7 @@ public PagedIterable listAgents(RequestOptions requestOptions) {
* metadata (Required): {
* String: String (Required)
* }
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* version: String (Required)
@@ -254,7 +195,7 @@ public Response createAgentVersionWithResponse(String agentName, Bin
*
* {@code
* {
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* name: String (Required)
* version: String (Required)
* deleted: boolean (Required)
@@ -308,7 +249,7 @@ public Response deleteAgentVersionWithResponse(String agentName, Str
* metadata (Required): {
* String: String (Required)
* }
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* version: String (Required)
@@ -440,97 +381,6 @@ public PagedIterable listAgentVersions(String agentName) {
.mapPage(bodyItemValue -> bodyItemValue.toObject(AgentVersionDetails.class));
}
- /**
- * Returns the list of all agents.
- *
- * @param kind Filter agents by kind. If not provided, all agents are returned.
- * @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 PagedIterable}.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable listAgents(AgentKind kind, Integer limit, ListAgentsRequestOrder order,
- String after, String before) {
- // Generated convenience method for listAgents
- RequestOptions requestOptions = new RequestOptions();
- if (kind != null) {
- requestOptions.addQueryParam("kind", kind.toString(), false);
- }
- 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);
- }
- return serviceClient.listAgents(requestOptions)
- .mapPage(bodyItemValue -> bodyItemValue.toObject(AgentDetails.class));
- }
-
- /**
- * Returns the list of versions of an agent.
- *
- * @param agentName The name of the agent to retrieve versions for.
- * @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 PagedIterable}.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable listAgentVersions(String agentName, Integer limit,
- ListAgentsRequestOrder order, String after, String before) {
- // Generated convenience method for listAgentVersions
- 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);
- }
- return serviceClient.listAgentVersions(agentName, requestOptions)
- .mapPage(bodyItemValue -> bodyItemValue.toObject(AgentVersionDetails.class));
- }
-
/**
* Create a new agent version.
*
@@ -560,6 +410,14 @@ public AgentVersionDetails createAgentVersion(String agentName, AgentDefinition
/**
* Creates the agent.
+ * Header Parameters
+ *
+ * Header Parameters
+ * Name Type Required Description
+ * Foundry-Features BinaryData No A feature flag opt-in required when using preview
+ * operations or modifying persisted preview resources.
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
* Request Body Schema
*
*
@@ -585,7 +443,7 @@ public AgentVersionDetails createAgentVersion(String agentName, AgentDefinition
*
* {@code
* {
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* versions (Required): {
@@ -593,7 +451,7 @@ public AgentVersionDetails createAgentVersion(String agentName, AgentDefinition
* metadata (Required): {
* String: String (Required)
* }
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* version: String (Required)
@@ -628,6 +486,14 @@ public Response createAgentWithResponse(BinaryData createAgentReques
/**
* Updates the agent by adding a new version if there are any changes to the agent definition.
* If no changes, returns the existing agent version.
+ * Header Parameters
+ *
+ * Header Parameters
+ * Name Type Required Description
+ * Foundry-Features BinaryData No A feature flag opt-in required when using preview
+ * operations or modifying persisted preview resources.
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
* Request Body Schema
*
*
@@ -652,7 +518,7 @@ public Response createAgentWithResponse(BinaryData createAgentReques
*
* {@code
* {
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* versions (Required): {
@@ -660,7 +526,7 @@ public Response createAgentWithResponse(BinaryData createAgentReques
* metadata (Required): {
* String: String (Required)
* }
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* version: String (Required)
@@ -780,7 +646,7 @@ public AgentDetails updateAgent(String agentName, AgentDefinition definition) {
*
* {@code
* {
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* versions (Required): {
@@ -788,7 +654,7 @@ public AgentDetails updateAgent(String agentName, AgentDefinition definition) {
* metadata (Required): {
* String: String (Required)
* }
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* version: String (Required)
@@ -846,7 +712,7 @@ public Response createAgentFromManifestWithResponse(BinaryData creat
*
* {@code
* {
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* versions (Required): {
@@ -854,7 +720,7 @@ public Response createAgentFromManifestWithResponse(BinaryData creat
* metadata (Required): {
* String: String (Required)
* }
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* version: String (Required)
@@ -916,7 +782,7 @@ public Response updateAgentFromManifestWithResponse(String agentName
* metadata (Required): {
* String: String (Required)
* }
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* version: String (Required)
@@ -1043,46 +909,12 @@ public AgentVersionDetails createAgentVersionFromManifest(String agentName, Stri
}
/**
- * Creates the agent.
- *
- * @param name The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
- * - Must start and end with alphanumeric characters,
- * - Can contain hyphens in the middle
- * - Must not exceed 63 characters.
- * @param definition The agent definition. This can be a workflow, hosted agent, or a simple agent definition.
- * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be
- * useful for storing additional information about the object in a structured
- * format, and querying for objects via API or the dashboard.
- *
- * Keys are strings with a maximum length of 64 characters. Values are strings
- * with a maximum length of 512 characters.
- * @param description A human-readable description of the agent.
- * @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.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.SINGLE)
- public AgentDetails createAgent(String name, AgentDefinition definition, Map metadata,
- String description) {
- // Generated convenience method for createAgentWithResponse
- RequestOptions requestOptions = new RequestOptions();
- CreateAgentRequest1 createAgentRequest1Obj
- = new CreateAgentRequest1(name, definition).setMetadata(metadata).setDescription(description);
- BinaryData createAgentRequest1 = BinaryData.fromObject(createAgentRequest1Obj);
- return createAgentWithResponse(createAgentRequest1, requestOptions).getValue().toObject(AgentDetails.class);
- }
-
- /**
- * Updates the agent by adding a new version if there are any changes to the agent definition.
+ * Updates the agent from a manifest by adding a new version if there are any changes to the agent definition.
* If no changes, returns the existing agent version.
*
- * @param agentName The name of the agent to retrieve.
- * @param definition The agent definition. This can be a workflow, hosted agent, or a simple agent definition.
+ * @param agentName The name of the agent to update.
+ * @param manifestId The manifest ID to import the agent version from.
+ * @param parameterValues The inputs to the manifest that will result in a fully materialized Agent.
* @param metadata Set of 16 key-value pairs that can be attached to an object. This can be
* useful for storing additional information about the object in a structured
* format, and querying for objects via API or the dashboard.
@@ -1100,21 +932,23 @@ public AgentDetails createAgent(String name, AgentDefinition definition, Map metadata,
- String description) {
- // Generated convenience method for updateAgentWithResponse
+ public AgentDetails updateAgentFromManifest(String agentName, String manifestId,
+ Map parameterValues, Map metadata, String description) {
+ // Generated convenience method for updateAgentFromManifestWithResponse
RequestOptions requestOptions = new RequestOptions();
- UpdateAgentRequest1 updateAgentRequest1Obj
- = new UpdateAgentRequest1(definition).setMetadata(metadata).setDescription(description);
- BinaryData updateAgentRequest1 = BinaryData.fromObject(updateAgentRequest1Obj);
- return updateAgentWithResponse(agentName, updateAgentRequest1, requestOptions).getValue()
+ UpdateAgentFromManifestRequest1 updateAgentFromManifestRequest1Obj
+ = new UpdateAgentFromManifestRequest1(manifestId, parameterValues).setMetadata(metadata)
+ .setDescription(description);
+ BinaryData updateAgentFromManifestRequest1 = BinaryData.fromObject(updateAgentFromManifestRequest1Obj);
+ return updateAgentFromManifestWithResponse(agentName, updateAgentFromManifestRequest1, requestOptions)
+ .getValue()
.toObject(AgentDetails.class);
}
/**
- * Creates an agent from a manifest.
+ * Create a new agent version from a manifest.
*
- * @param name The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
+ * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
* - Must start and end with alphanumeric characters,
* - Can contain hyphens in the middle
* - Must not exceed 63 characters.
@@ -1137,63 +971,251 @@ public AgentDetails updateAgent(String agentName, AgentDefinition definition, Ma
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public AgentDetails createAgentFromManifest(String name, String manifestId, Map parameterValues,
- Map metadata, String description) {
- // Generated convenience method for createAgentFromManifestWithResponse
+ public AgentVersionDetails createAgentVersionFromManifest(String agentName, String manifestId,
+ Map parameterValues, Map metadata, String description) {
+ // Generated convenience method for createAgentVersionFromManifestWithResponse
RequestOptions requestOptions = new RequestOptions();
- CreateAgentFromManifestRequest1 createAgentFromManifestRequest1Obj
- = new CreateAgentFromManifestRequest1(name, manifestId, parameterValues).setMetadata(metadata)
+ CreateAgentVersionFromManifestRequest1 createAgentVersionFromManifestRequest1Obj
+ = new CreateAgentVersionFromManifestRequest1(manifestId, parameterValues).setMetadata(metadata)
.setDescription(description);
- BinaryData createAgentFromManifestRequest1 = BinaryData.fromObject(createAgentFromManifestRequest1Obj);
- return createAgentFromManifestWithResponse(createAgentFromManifestRequest1, requestOptions).getValue()
- .toObject(AgentDetails.class);
+ BinaryData createAgentVersionFromManifestRequest1
+ = BinaryData.fromObject(createAgentVersionFromManifestRequest1Obj);
+ return createAgentVersionFromManifestWithResponse(agentName, createAgentVersionFromManifestRequest1,
+ requestOptions).getValue().toObject(AgentVersionDetails.class);
}
/**
- * Updates the agent from a manifest by adding a new version if there are any changes to the agent definition.
- * If no changes, returns the existing agent version.
- *
- * @param agentName The name of the agent to update.
- * @param manifestId The manifest ID to import the agent version from.
- * @param parameterValues The inputs to the manifest that will result in a fully materialized Agent.
- * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be
- * useful for storing additional information about the object in a structured
- * format, and querying for objects via API or the dashboard.
- *
- * Keys are strings with a maximum length of 64 characters. Values are strings
- * with a maximum length of 512 characters.
- * @param description A human-readable description of the agent.
- * @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.
- */
- @Generated
+ * Retrieves a specific version of an agent.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * metadata (Required): {
+ * String: String (Required)
+ * }
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+ * id: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * description: String (Optional)
+ * created_at: long (Required)
+ * definition (Required): {
+ * kind: String(prompt/hosted/container_app/workflow) (Required)
+ * rai_config (Optional): {
+ * rai_policy_name: String (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param agentName The name of the agent to retrieve.
+ * @param agentVersion The version of the agent to retrieve.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @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.
+ * @return the response body along with {@link Response}.
+ */
+ @Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public AgentDetails updateAgentFromManifest(String agentName, String manifestId,
- Map parameterValues, Map metadata, String description) {
- // Generated convenience method for updateAgentFromManifestWithResponse
+ public Response getAgentVersionDetailsWithResponse(String agentName, String agentVersion,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getAgentVersionDetailsWithResponse(agentName, agentVersion, requestOptions);
+ }
+
+ /**
+ * Retrieves a specific version of an agent.
+ *
+ * @param agentName The name of the agent to retrieve.
+ * @param agentVersion The version of the agent to retrieve.
+ * @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.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AgentVersionDetails getAgentVersionDetails(String agentName, String agentVersion) {
+ // Generated convenience method for getAgentVersionDetailsWithResponse
RequestOptions requestOptions = new RequestOptions();
- UpdateAgentFromManifestRequest1 updateAgentFromManifestRequest1Obj
- = new UpdateAgentFromManifestRequest1(manifestId, parameterValues).setMetadata(metadata)
- .setDescription(description);
- BinaryData updateAgentFromManifestRequest1 = BinaryData.fromObject(updateAgentFromManifestRequest1Obj);
- return updateAgentFromManifestWithResponse(agentName, updateAgentFromManifestRequest1, requestOptions)
- .getValue()
- .toObject(AgentDetails.class);
+ return getAgentVersionDetailsWithResponse(agentName, agentVersion, requestOptions).getValue()
+ .toObject(AgentVersionDetails.class);
}
/**
- * Create a new agent version.
+ * Returns the list of all agents.
*
- * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
+ * @param kind Filter agents by kind. If not provided, all agents are returned.
+ * @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 PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAgents(AgentKind kind, Integer limit, PageOrder order, String after,
+ String before) {
+ // Generated convenience method for listAgents
+ RequestOptions requestOptions = new RequestOptions();
+ if (kind != null) {
+ requestOptions.addQueryParam("kind", kind.toString(), false);
+ }
+ 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);
+ }
+ return serviceClient.listAgents(requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(AgentDetails.class));
+ }
+
+ /**
+ * Returns the list of versions of an agent.
+ *
+ * @param agentName The name of the agent to retrieve versions for.
+ * @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 PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAgentVersions(String agentName, Integer limit, PageOrder order,
+ String after, String before) {
+ // Generated convenience method for listAgentVersions
+ 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);
+ }
+ return serviceClient.listAgentVersions(agentName, requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(AgentVersionDetails.class));
+ }
+
+ /**
+ * Returns the list of all agents.
+ * Query Parameters
+ *
+ * Query Parameters
+ * Name Type Required Description
+ * kind String No Filter agents by kind. If not provided, all agents are returned.
+ * Allowed values: "prompt", "hosted", "container_app", "workflow".
+ * limit Integer No A limit on the number of objects to be returned. Limit can range
+ * between 1 and 100, and the
+ * default is 20.
+ * order String No Sort order by the `created_at` timestamp of the objects. `asc`
+ * for ascending order and`desc`
+ * for descending order. Allowed values: "asc", "desc".
+ * after String No 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.
+ * before String No 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.
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+ * id: String (Required)
+ * name: String (Required)
+ * versions (Required): {
+ * latest (Required): {
+ * metadata (Required): {
+ * String: String (Required)
+ * }
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+ * id: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * description: String (Optional)
+ * created_at: long (Required)
+ * definition (Required): {
+ * kind: String(prompt/hosted/container_app/workflow) (Required)
+ * rai_config (Optional): {
+ * rai_policy_name: String (Required)
+ * }
+ * }
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @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.
+ * @return the response data for a requested list of items as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAgents(RequestOptions requestOptions) {
+ return this.serviceClient.listAgents(requestOptions);
+ }
+
+ /**
+ * Creates an agent from a manifest.
+ *
+ * @param name The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
* - Must start and end with alphanumeric characters,
* - Can contain hyphens in the middle
* - Must not exceed 63 characters.
- * @param definition The agent definition. This can be a workflow, hosted agent, or a simple agent definition.
+ * @param manifestId The manifest ID to import the agent version from.
+ * @param parameterValues The inputs to the manifest that will result in a fully materialized Agent.
* @param metadata Set of 16 key-value pairs that can be attached to an object. This can be
* useful for storing additional information about the object in a structured
* format, and querying for objects via API or the dashboard.
@@ -1211,26 +1233,28 @@ public AgentDetails updateAgentFromManifest(String agentName, String manifestId,
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public AgentVersionDetails createAgentVersion(String agentName, AgentDefinition definition,
+ public AgentDetails createAgentFromManifest(String name, String manifestId, Map parameterValues,
Map metadata, String description) {
- // Generated convenience method for createAgentVersionWithResponse
+ // Generated convenience method for createAgentFromManifestWithResponse
RequestOptions requestOptions = new RequestOptions();
- CreateAgentVersionRequest1 createAgentVersionRequest1Obj
- = new CreateAgentVersionRequest1(definition).setMetadata(metadata).setDescription(description);
- BinaryData createAgentVersionRequest1 = BinaryData.fromObject(createAgentVersionRequest1Obj);
- return createAgentVersionWithResponse(agentName, createAgentVersionRequest1, requestOptions).getValue()
- .toObject(AgentVersionDetails.class);
+ CreateAgentFromManifestRequest1 createAgentFromManifestRequest1Obj
+ = new CreateAgentFromManifestRequest1(name, manifestId, parameterValues).setMetadata(metadata)
+ .setDescription(description);
+ BinaryData createAgentFromManifestRequest1 = BinaryData.fromObject(createAgentFromManifestRequest1Obj);
+ return createAgentFromManifestWithResponse(createAgentFromManifestRequest1, requestOptions).getValue()
+ .toObject(AgentDetails.class);
}
/**
- * Create a new agent version from a manifest.
+ * Creates the agent.
*
- * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
+ * @param name The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
* - Must start and end with alphanumeric characters,
* - Can contain hyphens in the middle
* - Must not exceed 63 characters.
- * @param manifestId The manifest ID to import the agent version from.
- * @param parameterValues The inputs to the manifest that will result in a fully materialized Agent.
+ * @param definition The agent definition. This can be a workflow, hosted agent, or a simple agent definition.
+ * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted
+ * preview resources.
* @param metadata Set of 16 key-value pairs that can be attached to an object. This can be
* useful for storing additional information about the object in a structured
* format, and querying for objects via API or the dashboard.
@@ -1248,66 +1272,75 @@ public AgentVersionDetails createAgentVersion(String agentName, AgentDefinition
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public AgentVersionDetails createAgentVersionFromManifest(String agentName, String manifestId,
- Map parameterValues, Map metadata, String description) {
- // Generated convenience method for createAgentVersionFromManifestWithResponse
+ public AgentDetails createAgent(String name, AgentDefinition definition, BinaryData foundryFeatures,
+ Map metadata, String description) {
+ // Generated convenience method for createAgentWithResponse
RequestOptions requestOptions = new RequestOptions();
- CreateAgentVersionFromManifestRequest1 createAgentVersionFromManifestRequest1Obj
- = new CreateAgentVersionFromManifestRequest1(manifestId, parameterValues).setMetadata(metadata)
- .setDescription(description);
- BinaryData createAgentVersionFromManifestRequest1
- = BinaryData.fromObject(createAgentVersionFromManifestRequest1Obj);
- return createAgentVersionFromManifestWithResponse(agentName, createAgentVersionFromManifestRequest1,
- requestOptions).getValue().toObject(AgentVersionDetails.class);
+ CreateAgentRequest1 createAgentRequest1Obj
+ = new CreateAgentRequest1(name, definition).setMetadata(metadata).setDescription(description);
+ BinaryData createAgentRequest1 = BinaryData.fromObject(createAgentRequest1Obj);
+ if (foundryFeatures != null) {
+ requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), String.valueOf(foundryFeatures));
+ }
+ return createAgentWithResponse(createAgentRequest1, requestOptions).getValue().toObject(AgentDetails.class);
}
/**
- * Retrieves a specific version of an agent.
- * Response Body Schema
- *
- *
- * {@code
- * {
- * metadata (Required): {
- * String: String (Required)
- * }
- * object: String (Required)
- * id: String (Required)
- * name: String (Required)
- * version: String (Required)
- * description: String (Optional)
- * created_at: long (Required)
- * definition (Required): {
- * kind: String(prompt/hosted/container_app/workflow) (Required)
- * rai_config (Optional): {
- * rai_policy_name: String (Required)
- * }
- * }
- * }
- * }
- *
+ * Updates the agent by adding a new version if there are any changes to the agent definition.
+ * If no changes, returns the existing agent version.
*
* @param agentName The name of the agent to retrieve.
- * @param agentVersion The version of the agent to retrieve.
- * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @param definition The agent definition. This can be a workflow, hosted agent, or a simple agent definition.
+ * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted
+ * preview resources.
+ * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be
+ * useful for storing additional information about the object in a structured
+ * format, and querying for objects via API or the dashboard.
+ *
+ * Keys are strings with a maximum length of 64 characters. Values are strings
+ * with a maximum length of 512 characters.
+ * @param description A human-readable description of the agent.
+ * @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.
- * @return the response body along with {@link Response}.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response getAgentVersionDetailsWithResponse(String agentName, String agentVersion,
- RequestOptions requestOptions) {
- return this.serviceClient.getAgentVersionDetailsWithResponse(agentName, agentVersion, requestOptions);
+ public AgentDetails updateAgent(String agentName, AgentDefinition definition, BinaryData foundryFeatures,
+ Map metadata, String description) {
+ // Generated convenience method for updateAgentWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ UpdateAgentRequest1 updateAgentRequest1Obj
+ = new UpdateAgentRequest1(definition).setMetadata(metadata).setDescription(description);
+ BinaryData updateAgentRequest1 = BinaryData.fromObject(updateAgentRequest1Obj);
+ if (foundryFeatures != null) {
+ requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), String.valueOf(foundryFeatures));
+ }
+ return updateAgentWithResponse(agentName, updateAgentRequest1, requestOptions).getValue()
+ .toObject(AgentDetails.class);
}
/**
- * Retrieves a specific version of an agent.
+ * Create a new agent version.
*
- * @param agentName The name of the agent to retrieve.
- * @param agentVersion The version of the agent to retrieve.
+ * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
+ * - Must start and end with alphanumeric characters,
+ * - Can contain hyphens in the middle
+ * - Must not exceed 63 characters.
+ * @param definition The agent definition. This can be a workflow, hosted agent, or a simple agent definition.
+ * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted
+ * preview resources.
+ * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be
+ * useful for storing additional information about the object in a structured
+ * format, and querying for objects via API or the dashboard.
+ *
+ * Keys are strings with a maximum length of 64 characters. Values are strings
+ * with a maximum length of 512 characters.
+ * @param description A human-readable description of the agent.
* @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.
@@ -1318,10 +1351,17 @@ public Response getAgentVersionDetailsWithResponse(String agentName,
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public AgentVersionDetails getAgentVersionDetails(String agentName, String agentVersion) {
- // Generated convenience method for getAgentVersionDetailsWithResponse
+ public AgentVersionDetails createAgentVersion(String agentName, AgentDefinition definition,
+ BinaryData foundryFeatures, Map metadata, String description) {
+ // Generated convenience method for createAgentVersionWithResponse
RequestOptions requestOptions = new RequestOptions();
- return getAgentVersionDetailsWithResponse(agentName, agentVersion, requestOptions).getValue()
+ CreateAgentVersionRequest1 createAgentVersionRequest1Obj
+ = new CreateAgentVersionRequest1(definition).setMetadata(metadata).setDescription(description);
+ BinaryData createAgentVersionRequest1 = BinaryData.fromObject(createAgentVersionRequest1Obj);
+ if (foundryFeatures != null) {
+ requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), String.valueOf(foundryFeatures));
+ }
+ return createAgentVersionWithResponse(agentName, createAgentVersionRequest1, requestOptions).getValue()
.toObject(AgentVersionDetails.class);
}
}
diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClientBuilder.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClientBuilder.java
index cd1e70bb3a1c..e92c4283f361 100644
--- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClientBuilder.java
+++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClientBuilder.java
@@ -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;
diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsServiceVersion.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsServiceVersion.java
index 828ce8b686f9..4047ea5b5e01 100644
--- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsServiceVersion.java
+++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsServiceVersion.java
@@ -11,19 +11,9 @@
*/
public enum AgentsServiceVersion implements ServiceVersion {
/**
- * Enum value 2025-05-01.
+ * Enum value v1.
*/
- 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.
- */
- V2025_11_15_PREVIEW("2025-11-15-preview");
+ V1("v1");
private final String version;
@@ -45,6 +35,6 @@ public String getVersion() {
* @return The latest {@link AgentsServiceVersion}.
*/
public static AgentsServiceVersion getLatest() {
- return V2025_11_15_PREVIEW;
+ return V1;
}
}
diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresAsyncClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresAsyncClient.java
index cb6b0f3b54a4..3b22841d96f5 100644
--- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresAsyncClient.java
+++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresAsyncClient.java
@@ -4,14 +4,14 @@
package com.azure.ai.agents;
import com.azure.ai.agents.implementation.MemoryStoresImpl;
+import com.azure.ai.agents.implementation.OpenAIJsonHelper;
import com.azure.ai.agents.implementation.models.CreateMemoryStoreRequest;
import com.azure.ai.agents.implementation.models.DeleteScopeRequest;
import com.azure.ai.agents.implementation.models.SearchMemoriesRequest;
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.InputItem;
import com.azure.ai.agents.models.MemorySearchOptions;
import com.azure.ai.agents.models.MemoryStoreDefinition;
import com.azure.ai.agents.models.MemoryStoreDeleteScopeResponse;
@@ -19,6 +19,7 @@
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;
@@ -35,6 +36,7 @@
import com.azure.core.util.BinaryData;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.polling.PollerFlux;
+import com.openai.models.responses.ResponseInputItem;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@@ -84,7 +86,7 @@ public final class MemoryStoresAsyncClient {
*
* {@code
* {
- * object: String (Required)
+ * object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
* id: String (Required)
* created_at: long (Required)
* updated_at: long (Required)
@@ -136,7 +138,7 @@ public Mono> createMemoryStoreWithResponse(BinaryData creat
*
* {@code
* {
- * object: String (Required)
+ * object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
* id: String (Required)
* created_at: long (Required)
* updated_at: long (Required)
@@ -176,7 +178,7 @@ public Mono> updateMemoryStoreWithResponse(String name, Bin
*
* {@code
* {
- * object: String (Required)
+ * object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
* id: String (Required)
* created_at: long (Required)
* updated_at: long (Required)
@@ -234,7 +236,7 @@ public Mono> getMemoryStoreWithResponse(String name, Reques
*
* {@code
* {
- * object: String (Required)
+ * object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
* id: String (Required)
* created_at: long (Required)
* updated_at: long (Required)
@@ -270,7 +272,7 @@ public PagedFlux listMemoryStores(RequestOptions requestOptions) {
*
* {@code
* {
- * object: String (Required)
+ * object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
* name: String (Required)
* deleted: boolean (Required)
* }
@@ -301,7 +303,7 @@ public Mono> 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/item_reference) (Required)
* }
* ]
* previous_search_id: String (Optional)
@@ -331,15 +333,15 @@ public Mono> 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)
* }
* }
* }
@@ -371,7 +373,7 @@ public Mono> 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/item_reference) (Required)
* }
* ]
* previous_update_id: String (Optional)
@@ -403,15 +405,15 @@ public Mono> 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): {
@@ -474,15 +476,15 @@ public PollerFlux 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): {
@@ -593,60 +595,6 @@ public Mono 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 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 pagedFluxResponse = listMemoryStores(requestOptions);
- return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
- Flux> flux = (continuationTokenParam == null)
- ? pagedFluxResponse.byPage().take(1)
- : pagedFluxResponse.byPage(continuationTokenParam).take(1);
- return flux.map(pagedResponse -> new PagedResponseBase(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.
*
@@ -785,7 +733,7 @@ public Mono getUpdateResult(String name, String updat
*
* {@code
* {
- * object: String (Required)
+ * object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
* name: String (Required)
* scope: String (Required)
* deleted: boolean (Required)
@@ -900,9 +848,8 @@ public Mono deleteScope(String name, String scop
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return memory search response on successful completion of {@link Mono}.
*/
- @Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono searchMemories(String name, String scope, List items,
+ Mono internalSearchMemories(String name, String scope, List items,
String previousSearchId, MemorySearchOptions options) {
// Generated convenience method for searchMemoriesWithResponse
RequestOptions requestOptions = new RequestOptions();
@@ -914,6 +861,31 @@ public Mono searchMemories(String name, String scope,
.map(protocolMethodData -> protocolMethodData.toObject(MemoryStoreSearchResponse.class));
}
+ /**
+ * Search for relevant memories from a memory store based on conversation context.
+ *
+ * @param name The name of the memory store to search.
+ * @param scope The namespace that logically groups and isolates memories, such as a user ID.
+ * @param items Items for which to search for relevant memories.
+ * @param previousSearchId The unique ID of the previous search request, enabling incremental memory search from
+ * where the last operation left off.
+ * @param options Memory search options.
+ * @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 memory search response on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono searchMemories(String name, String scope, List items,
+ String previousSearchId, MemorySearchOptions options) {
+ // Convert OpenAI ResponseInputItem list to Azure SDK InputItem list
+ List inputItems = OpenAIJsonHelper.toAzureTypeList(items, InputItem::fromJson);
+ return internalSearchMemories(name, scope, inputItems, previousSearchId, options);
+ }
+
/**
* Update memory store with conversation memories.
*
@@ -934,10 +906,9 @@ public Mono searchMemories(String name, String scope,
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of provides the status of a memory store update operation.
*/
- @Generated
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public PollerFlux beginUpdateMemories(String name,
- String scope, List items, String previousUpdateId, Integer updateDelay) {
+ PollerFlux internalBeginUpdateMemories(String name,
+ String scope, List items, String previousUpdateId, Integer updateDelay) {
// Generated convenience method for beginUpdateMemoriesWithModel
RequestOptions requestOptions = new RequestOptions();
UpdateMemoriesRequest updateMemoriesRequestObj = new UpdateMemoriesRequest(scope).setItems(items)
@@ -946,4 +917,85 @@ public PollerFlux b
BinaryData updateMemoriesRequest = BinaryData.fromObject(updateMemoriesRequestObj);
return serviceClient.beginUpdateMemoriesWithModelAsync(name, updateMemoriesRequest, requestOptions);
}
+
+ /**
+ * Update memory store with conversation memories.
+ *
+ * @param name The name of the memory store to update.
+ * @param scope The namespace that logically groups and isolates memories, such as a user ID.
+ * @param items Conversation items from which to extract memories (OpenAI SDK type).
+ * @param previousUpdateId The unique ID of the previous update request, enabling incremental memory updates from
+ * where the last operation left off.
+ * @param updateDelay Timeout period before processing the memory update in seconds.
+ * If a new update request is received during this period, it will cancel the current request and reset the timeout.
+ * Set to 0 to immediately trigger the update without delay.
+ * Defaults to 300 (5 minutes).
+ * @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 {@link PollerFlux} for polling of provides the status of a memory store update operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginUpdateMemories(String name,
+ String scope, List items, String previousUpdateId, int updateDelay) {
+ // Convert OpenAI ResponseInputItem list to Azure SDK InputItem list
+ List inputItems = OpenAIJsonHelper.toAzureTypeList(items, InputItem::fromJson);
+ return internalBeginUpdateMemories(name, scope, inputItems, previousUpdateId, updateDelay);
+ }
+
+ /**
+ * 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 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 pagedFluxResponse = listMemoryStores(requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(MemoryStoreDetails.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
}
diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresClient.java
index dda6f861558a..046a13bac318 100644
--- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresClient.java
+++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresClient.java
@@ -4,14 +4,14 @@
package com.azure.ai.agents;
import com.azure.ai.agents.implementation.MemoryStoresImpl;
+import com.azure.ai.agents.implementation.OpenAIJsonHelper;
import com.azure.ai.agents.implementation.models.CreateMemoryStoreRequest;
import com.azure.ai.agents.implementation.models.DeleteScopeRequest;
import com.azure.ai.agents.implementation.models.SearchMemoriesRequest;
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.InputItem;
import com.azure.ai.agents.models.MemorySearchOptions;
import com.azure.ai.agents.models.MemoryStoreDefinition;
import com.azure.ai.agents.models.MemoryStoreDeleteScopeResponse;
@@ -19,6 +19,7 @@
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;
@@ -32,6 +33,7 @@
import com.azure.core.http.rest.Response;
import com.azure.core.util.BinaryData;
import com.azure.core.util.polling.SyncPoller;
+import com.openai.models.responses.ResponseInputItem;
import java.util.List;
import java.util.Map;
@@ -78,7 +80,7 @@ public final class MemoryStoresClient {
*
* {@code
* {
- * object: String (Required)
+ * object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
* id: String (Required)
* created_at: long (Required)
* updated_at: long (Required)
@@ -129,7 +131,7 @@ public Response createMemoryStoreWithResponse(BinaryData createMemor
*
* {@code
* {
- * object: String (Required)
+ * object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
* id: String (Required)
* created_at: long (Required)
* updated_at: long (Required)
@@ -168,7 +170,7 @@ public Response updateMemoryStoreWithResponse(String name, BinaryDat
*
* {@code
* {
- * object: String (Required)
+ * object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
* id: String (Required)
* created_at: long (Required)
* updated_at: long (Required)
@@ -225,7 +227,7 @@ public Response getMemoryStoreWithResponse(String name, RequestOptio
*
* {@code
* {
- * object: String (Required)
+ * object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
* id: String (Required)
* created_at: long (Required)
* updated_at: long (Required)
@@ -261,7 +263,7 @@ public PagedIterable listMemoryStores(RequestOptions requestOptions)
*
* {@code
* {
- * object: String (Required)
+ * object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
* name: String (Required)
* deleted: boolean (Required)
* }
@@ -292,7 +294,7 @@ public Response deleteMemoryStoreWithResponse(String name, RequestOp
* 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/item_reference) (Required)
* }
* ]
* previous_search_id: String (Optional)
@@ -322,15 +324,15 @@ public Response deleteMemoryStoreWithResponse(String name, RequestOp
* ]
* 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)
* }
* }
* }
@@ -362,7 +364,7 @@ public Response searchMemoriesWithResponse(String name, BinaryData s
* 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/item_reference) (Required)
* }
* ]
* previous_update_id: String (Optional)
@@ -394,15 +396,15 @@ public Response searchMemoriesWithResponse(String name, BinaryData s
* ]
* 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): {
@@ -465,15 +467,15 @@ public SyncPoller 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): {
@@ -583,49 +585,6 @@ public MemoryStoreDetails getMemoryStore(String name) {
return getMemoryStoreWithResponse(name, requestOptions).getValue().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 PagedIterable}.
- */
- @Generated
- @ServiceMethod(returns = ReturnType.COLLECTION)
- public PagedIterable 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);
- }
- return serviceClient.listMemoryStores(requestOptions)
- .mapPage(bodyItemValue -> bodyItemValue.toObject(MemoryStoreDetails.class));
- }
-
/**
* List all memory stores.
*
@@ -752,7 +711,7 @@ public MemoryStoreUpdateResponse getUpdateResult(String name, String updateId) {
*
* {@code
* {
- * object: String (Required)
+ * object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
* name: String (Required)
* scope: String (Required)
* deleted: boolean (Required)
@@ -866,9 +825,8 @@ public MemoryStoreDeleteScopeResponse deleteScope(String name, String scope) {
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return memory search response.
*/
- @Generated
@ServiceMethod(returns = ReturnType.SINGLE)
- public MemoryStoreSearchResponse searchMemories(String name, String scope, List items,
+ MemoryStoreSearchResponse internalSearchMemories(String name, String scope, List items,
String previousSearchId, MemorySearchOptions options) {
// Generated convenience method for searchMemoriesWithResponse
RequestOptions requestOptions = new RequestOptions();
@@ -880,6 +838,31 @@ public MemoryStoreSearchResponse searchMemories(String name, String scope, List<
.toObject(MemoryStoreSearchResponse.class);
}
+ /**
+ * Search for relevant memories from a memory store based on conversation context.
+ *
+ * @param name The name of the memory store to search.
+ * @param scope The namespace that logically groups and isolates memories, such as a user ID.
+ * @param items Items for which to search for relevant memories.
+ * @param previousSearchId The unique ID of the previous search request, enabling incremental memory search from
+ * where the last operation left off.
+ * @param options Memory search options.
+ * @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 memory search response.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public MemoryStoreSearchResponse searchMemories(String name, String scope, List items,
+ String previousSearchId, MemorySearchOptions options) {
+ // Convert OpenAI ResponseInputItem list to Azure SDK InputItem list
+ List inputItems = OpenAIJsonHelper.toAzureTypeList(items, InputItem::fromJson);
+ return internalSearchMemories(name, scope, inputItems, previousSearchId, options);
+ }
+
/**
* Update memory store with conversation memories.
*
@@ -900,10 +883,9 @@ public MemoryStoreSearchResponse searchMemories(String name, String scope, List<
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of provides the status of a memory store update operation.
*/
- @Generated
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
- public SyncPoller beginUpdateMemories(String name,
- String scope, List items, String previousUpdateId, Integer updateDelay) {
+ SyncPoller internalBeginUpdateMemories(String name,
+ String scope, List items, String previousUpdateId, Integer updateDelay) {
// Generated convenience method for beginUpdateMemoriesWithModel
RequestOptions requestOptions = new RequestOptions();
UpdateMemoriesRequest updateMemoriesRequestObj = new UpdateMemoriesRequest(scope).setItems(items)
@@ -912,4 +894,75 @@ public SyncPoller b
BinaryData updateMemoriesRequest = BinaryData.fromObject(updateMemoriesRequestObj);
return serviceClient.beginUpdateMemoriesWithModel(name, updateMemoriesRequest, requestOptions);
}
+
+ /**
+ * Update memory store with conversation memories.
+ *
+ * @param name The name of the memory store to update.
+ * @param scope The namespace that logically groups and isolates memories, such as a user ID.
+ * @param items Conversation items from which to extract memories (OpenAI SDK type).
+ * @param previousUpdateId The unique ID of the previous update request, enabling incremental memory updates from
+ * where the last operation left off.
+ * @param updateDelay Timeout period before processing the memory update in seconds.
+ * If a new update request is received during this period, it will cancel the current request and reset the timeout.
+ * Set to 0 to immediately trigger the update without delay.
+ * Defaults to 300 (5 minutes).
+ * @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 {@link SyncPoller} for polling of provides the status of a memory store update operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginUpdateMemories(String name,
+ String scope, List items, String previousUpdateId, int updateDelay) {
+ // Convert OpenAI ResponseInputItem list to Azure SDK InputItem list
+ List inputItems = OpenAIJsonHelper.toAzureTypeList(items, InputItem::fromJson);
+ return internalBeginUpdateMemories(name, scope, inputItems, previousUpdateId, updateDelay);
+ }
+
+ /**
+ * 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 PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable 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);
+ }
+ return serviceClient.listMemoryStores(requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(MemoryStoreDetails.class));
+ }
}
diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ResponsesAsyncClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ResponsesAsyncClient.java
index db8b790ea3e7..56d798336e33 100644
--- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ResponsesAsyncClient.java
+++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ResponsesAsyncClient.java
@@ -66,4 +66,35 @@ public Mono createWithAgentConversation(AgentReference agentReference,
params.additionalBodyProperties(additionalBodyProperties);
return Mono.fromFuture(this.openAIResponsesClientAsync.create(params.build()));
}
+
+ /**
+ * Creates a response with an agent conversation.
+ *
+ * @param agentReference The agent reference.
+ * @param params The parameters to create the response.
+ * @return The created Response.
+ */
+ public Mono createWithAgent(AgentReference agentReference,
+ ResponseCreateParams.Builder params) {
+ Objects.requireNonNull(agentReference, "agentReference cannot be null");
+ Objects.requireNonNull(params, "params cannot be null");
+
+ JsonValue agentRefJsonValue = OpenAIJsonHelper.toJsonValue(agentReference);
+
+ Map additionalBodyProperties = new HashMap<>();
+ additionalBodyProperties.put("agent", agentRefJsonValue);
+
+ params.additionalBodyProperties(additionalBodyProperties);
+ return Mono.fromFuture(this.openAIResponsesClientAsync.create(params.build()));
+ }
+
+ /**
+ * Creates a response with an agent conversation.
+ *
+ * @param agentReference The agent reference.
+ * @return The created Response.
+ */
+ public Mono createWithAgent(AgentReference agentReference) {
+ return createWithAgent(agentReference, new ResponseCreateParams.Builder());
+ }
}
diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ResponsesClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ResponsesClient.java
index 244f558cb4e1..7bb0ca93110e 100644
--- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ResponsesClient.java
+++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ResponsesClient.java
@@ -77,4 +77,34 @@ public Response createWithAgentConversation(AgentReference agentReference, Strin
return this.openAIResponsesClient.create(params.build());
}
+ /**
+ * Creates a response with an agent conversation.
+ *
+ * @param agentReference The agent reference.
+ * @param params The parameters to create the response.
+ * @return The created Response.
+ */
+ public Response createWithAgent(AgentReference agentReference,
+ ResponseCreateParams.Builder params) {
+ Objects.requireNonNull(agentReference, "agentReference cannot be null");
+ Objects.requireNonNull(params, "params cannot be null");
+
+ JsonValue agentRefJsonValue = OpenAIJsonHelper.toJsonValue(agentReference);
+
+ Map additionalBodyProperties = new HashMap<>();
+ additionalBodyProperties.put("agent", agentRefJsonValue);
+
+ params.additionalBodyProperties(additionalBodyProperties);
+ return this.openAIResponsesClient.create(params.build());
+ }
+
+ /**
+ * Creates a response with an agent conversation.
+ *
+ * @param agentReference The agent reference.
+ * @return The created Response.
+ */
+ public Response createWithAgent(AgentReference agentReference) {
+ return createWithAgent(agentReference, new ResponseCreateParams.Builder());
+ }
}
diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentsImpl.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentsImpl.java
index 8b378141f73b..69f0a9bec048 100644
--- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentsImpl.java
+++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentsImpl.java
@@ -85,7 +85,7 @@ public interface AgentsService {
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> getAgent(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("agent_name") String agentName,
+ @PathParam("agent_name") String agentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
@Get("/agents/{agent_name}")
@@ -95,7 +95,7 @@ Mono> getAgent(@HostParam("endpoint") String endpoint,
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response getAgentSync(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("agent_name") String agentName,
+ @PathParam("agent_name") String agentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
@Post("/agents")
@@ -127,7 +127,7 @@ Response createAgentSync(@HostParam("endpoint") String endpoint,
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> updateAgent(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("agent_name") String agentName,
+ @PathParam("agent_name") String agentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
@BodyParam("application/json") BinaryData updateAgentRequest1, RequestOptions requestOptions,
Context context);
@@ -139,7 +139,7 @@ Mono> updateAgent(@HostParam("endpoint") String endpoint,
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response updateAgentSync(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("agent_name") String agentName,
+ @PathParam("agent_name") String agentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
@BodyParam("application/json") BinaryData updateAgentRequest1, RequestOptions requestOptions,
Context context);
@@ -175,7 +175,7 @@ Response createAgentFromManifestSync(@HostParam("endpoint") String e
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> updateAgentFromManifest(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("agent_name") String agentName,
+ @PathParam("agent_name") String agentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
@BodyParam("application/json") BinaryData updateAgentFromManifestRequest1, RequestOptions requestOptions,
Context context);
@@ -187,7 +187,7 @@ Mono> updateAgentFromManifest(@HostParam("endpoint") String
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response updateAgentFromManifestSync(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("agent_name") String agentName,
+ @PathParam("agent_name") String agentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
@BodyParam("application/json") BinaryData updateAgentFromManifestRequest1, RequestOptions requestOptions,
Context context);
@@ -199,7 +199,7 @@ Response updateAgentFromManifestSync(@HostParam("endpoint") String e
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> deleteAgent(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("agent_name") String agentName,
+ @PathParam("agent_name") String agentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
@Delete("/agents/{agent_name}")
@@ -209,7 +209,7 @@ Mono> deleteAgent(@HostParam("endpoint") String endpoint,
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response deleteAgentSync(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("agent_name") String agentName,
+ @PathParam("agent_name") String agentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
@Get("/agents")
@@ -239,7 +239,7 @@ Response listAgentsSync(@HostParam("endpoint") String endpoint,
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> createAgentVersion(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("agent_name") String agentName,
+ @PathParam("agent_name") String agentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
@BodyParam("application/json") BinaryData createAgentVersionRequest1, RequestOptions requestOptions,
Context context);
@@ -251,7 +251,7 @@ Mono> createAgentVersion(@HostParam("endpoint") String endp
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response createAgentVersionSync(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("agent_name") String agentName,
+ @PathParam("agent_name") String agentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
@BodyParam("application/json") BinaryData createAgentVersionRequest1, RequestOptions requestOptions,
Context context);
@@ -263,7 +263,7 @@ Response createAgentVersionSync(@HostParam("endpoint") String endpoi
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> createAgentVersionFromManifest(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("agent_name") String agentName,
+ @PathParam("agent_name") String agentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
@BodyParam("application/json") BinaryData createAgentVersionFromManifestRequest1,
RequestOptions requestOptions, Context context);
@@ -275,7 +275,7 @@ Mono> createAgentVersionFromManifest(@HostParam("endpoint")
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response createAgentVersionFromManifestSync(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("agent_name") String agentName,
+ @PathParam("agent_name") String agentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
@BodyParam("application/json") BinaryData createAgentVersionFromManifestRequest1,
RequestOptions requestOptions, Context context);
@@ -287,8 +287,8 @@ Response createAgentVersionFromManifestSync(@HostParam("endpoint") S
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> getAgentVersionDetails(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("agent_name") String agentName,
- @PathParam("agent_version") String agentVersion, @HeaderParam("Accept") String accept,
+ @PathParam("agent_name") String agentName, @PathParam("agent_version") String agentVersion,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
RequestOptions requestOptions, Context context);
@Get("/agents/{agent_name}/versions/{agent_version}")
@@ -298,8 +298,8 @@ Mono> getAgentVersionDetails(@HostParam("endpoint") String
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response getAgentVersionDetailsSync(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("agent_name") String agentName,
- @PathParam("agent_version") String agentVersion, @HeaderParam("Accept") String accept,
+ @PathParam("agent_name") String agentName, @PathParam("agent_version") String agentVersion,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
RequestOptions requestOptions, Context context);
@Delete("/agents/{agent_name}/versions/{agent_version}")
@@ -309,8 +309,8 @@ Response getAgentVersionDetailsSync(@HostParam("endpoint") String en
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> deleteAgentVersion(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("agent_name") String agentName,
- @PathParam("agent_version") String agentVersion, @HeaderParam("Accept") String accept,
+ @PathParam("agent_name") String agentName, @PathParam("agent_version") String agentVersion,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
RequestOptions requestOptions, Context context);
@Delete("/agents/{agent_name}/versions/{agent_version}")
@@ -320,8 +320,8 @@ Mono> deleteAgentVersion(@HostParam("endpoint") String endp
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response deleteAgentVersionSync(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("agent_name") String agentName,
- @PathParam("agent_version") String agentVersion, @HeaderParam("Accept") String accept,
+ @PathParam("agent_name") String agentName, @PathParam("agent_version") String agentVersion,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
RequestOptions requestOptions, Context context);
@Get("/agents/{agent_name}/versions")
@@ -331,7 +331,7 @@ Response deleteAgentVersionSync(@HostParam("endpoint") String endpoi
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Mono> listAgentVersions(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("agent_name") String agentName,
+ @PathParam("agent_name") String agentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
@Get("/agents/{agent_name}/versions")
@@ -341,7 +341,7 @@ Mono> listAgentVersions(@HostParam("endpoint") String endpo
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
@UnexpectedResponseExceptionType(HttpResponseException.class)
Response listAgentVersionsSync(@HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion, @PathParam("agent_name") String agentName,
+ @PathParam("agent_name") String agentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
}
@@ -352,7 +352,7 @@ Response listAgentVersionsSync(@HostParam("endpoint") String endpoin
*
* {@code
* {
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* versions (Required): {
@@ -360,7 +360,7 @@ Response listAgentVersionsSync(@HostParam("endpoint") String endpoin
* metadata (Required): {
* String: String (Required)
* }
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* version: String (Required)
@@ -389,8 +389,8 @@ Response listAgentVersionsSync(@HostParam("endpoint") String endpoin
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getAgentWithResponseAsync(String agentName, RequestOptions requestOptions) {
final String accept = "application/json";
- return FluxUtil.withContext(context -> service.getAgent(this.client.getEndpoint(),
- this.client.getServiceVersion().getVersion(), agentName, accept, requestOptions, context));
+ return FluxUtil.withContext(context -> service.getAgent(this.client.getEndpoint(), agentName,
+ this.client.getServiceVersion().getVersion(), accept, requestOptions, context));
}
/**
@@ -400,7 +400,7 @@ public Mono> getAgentWithResponseAsync(String agentName, Re
*
* {@code
* {
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* versions (Required): {
@@ -408,7 +408,7 @@ public Mono> getAgentWithResponseAsync(String agentName, Re
* metadata (Required): {
* String: String (Required)
* }
- * object: String (Required)
+ * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
* id: String (Required)
* name: String (Required)
* version: String (Required)
@@ -437,12 +437,20 @@ public Mono> getAgentWithResponseAsync(String agentName, Re
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getAgentWithResponse(String agentName, RequestOptions requestOptions) {
final String accept = "application/json";
- return service.getAgentSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), agentName,
+ return service.getAgentSync(this.client.getEndpoint(), agentName, this.client.getServiceVersion().getVersion(),
accept, requestOptions, Context.NONE);
}
/**
* Creates the agent.
+ *