Request Body Schema
* *@@ -3341,7 +3355,7 @@ public Mono> deleteSessionFileWithResponse(String agentName, Stri * hyphens allowed in the middle. * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity * verification. - * @param content The content parameter. + * @param content The content multipart request content. * @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. @@ -3380,7 +3394,7 @@ Mono createAgentFromCode(String agentName, String codeZipSha256, C * - Must not exceed 63 characters. * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity * verification. - * @param content The content parameter. + * @param content The content multipart request content. * @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. @@ -3455,7 +3469,7 @@ public Mono updateAgentDetails(String agentName, UpdateAgentDetail * - Must not exceed 63 characters. * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity * verification. - * @param content The content parameter. + * @param content The content multipart request content. * @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. @@ -3642,7 +3656,7 @@ public Mono downloadAgentCode(String agentName) { * * Creates a new session for an agent endpoint. * The endpoint resolves the backing agent version from `version_indicator` and - * enforces session ownership using the provided isolation key for session-mutating operations. + * enforces session ownership using the provided user identity for session-mutating operations. * * @param agentName The name of the agent to create a session for. * @param versionIndicator Determines which agent version backs the session. @@ -4018,7 +4032,7 @@ public Mono disableAgent(String agentName) { * * Creates a new session for an agent endpoint. * The endpoint resolves the backing agent version from `version_indicator` and - * enforces session ownership using the provided isolation key for session-mutating operations. + * enforces session ownership using the provided user identity for session-mutating operations. * * @param agentName The name of the agent to create a session for. * @param versionIndicator Determines which agent version backs the session. 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 a254bbb6ec49..23cf6b9f87ea 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 @@ -98,6 +98,7 @@ public final class AgentsClient { * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -228,6 +229,7 @@ public Response getAgentWithResponse(String agentName, RequestOption * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -357,6 +359,7 @@ public void deleteAgentVersion(String agentName, String agentVersion) { * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -585,6 +588,7 @@ public AgentVersionDetails createAgentVersion(String agentName, AgentDefinition * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -719,6 +723,7 @@ Response createAgentWithResponse(BinaryData createAgentRequest, Requ * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -887,6 +892,7 @@ AgentDetails updateAgent(String agentName, AgentDefinition definition) { * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -1017,6 +1023,7 @@ Response createAgentFromManifestWithResponse(BinaryData createAgentF * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -1142,6 +1149,7 @@ Response updateAgentFromManifestWithResponse(String agentName, * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -1373,6 +1381,7 @@ public AgentVersionDetails createAgentVersionFromManifest(String agentName, Stri * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -1533,6 +1542,7 @@ public PagedIterable listAgents(AgentKind kind, Integer limit, Pag * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -2145,6 +2155,7 @@ AgentDetails updateAgent(String agentName, AgentDefinition definition, Map createAgentFromCodeWithResponse(String agentName, String co * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -2335,7 +2347,7 @@ Response createAgentFromCodeWithResponse(String agentName, String co * - Must not exceed 63 characters. * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity * verification. - * @param content The content parameter. + * @param content The content multipart request content. * @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. @@ -2443,6 +2455,7 @@ Response updateAgentFromCodeWithResponse(String agentName, String co * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -2557,6 +2570,7 @@ public Response updateAgentDetailsWithResponse(String agentName, Bin * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -2573,7 +2587,7 @@ public Response updateAgentDetailsWithResponse(String agentName, Bin * - Must not exceed 63 characters. * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity * verification. - * @param content The content parameter. + * @param content The content multipart request content. * @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. @@ -2709,7 +2723,7 @@ public Response downloadAgentCodeWithResponse(String agentName, String fil * * Creates a new session for an agent endpoint. * The endpoint resolves the backing agent version from `version_indicator` and - * enforces session ownership using the provided isolation key for session-mutating operations. + * enforces session ownership using the provided user identity for session-mutating operations. * Request Body Schema
* *@@ -3247,7 +3261,7 @@ public ResponsedeleteSessionFileWithResponse(String agentName, String ses * hyphens allowed in the middle. * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity * verification. - * @param content The content parameter. + * @param content The content multipart request content. * @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. @@ -3285,7 +3299,7 @@ AgentDetails createAgentFromCode(String agentName, String codeZipSha256, CreateA * - Must not exceed 63 characters. * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity * verification. - * @param content The content parameter. + * @param content The content multipart request content. * @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. @@ -3358,7 +3372,7 @@ public AgentDetails updateAgentDetails(String agentName, UpdateAgentDetailsOptio * - Must not exceed 63 characters. * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity * verification. - * @param content The content parameter. + * @param content The content multipart request content. * @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. @@ -3543,7 +3557,7 @@ public BinaryData downloadAgentCode(String agentName) { * * Creates a new session for an agent endpoint. * The endpoint resolves the backing agent version from `version_indicator` and - * enforces session ownership using the provided isolation key for session-mutating operations. + * enforces session ownership using the provided user identity for session-mutating operations. * * @param agentName The name of the agent to create a session for. * @param versionIndicator Determines which agent version backs the session. @@ -3888,7 +3902,7 @@ public void disableAgent(String agentName) { * * Creates a new session for an agent endpoint. * The endpoint resolves the backing agent version from `version_indicator` and - * enforces session ownership using the provided isolation key for session-mutating operations. + * enforces session ownership using the provided user identity for session-mutating operations. * * @param agentName The name of the agent to create a session for. * @param versionIndicator Determines which agent version backs the session. diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaAgentsAsyncClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaAgentsAsyncClient.java index 9d45e16255b7..31e2d4866b29 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaAgentsAsyncClient.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaAgentsAsyncClient.java @@ -8,6 +8,7 @@ import com.azure.ai.agents.models.JobStatus; import com.azure.ai.agents.models.OptimizationJob; import com.azure.ai.agents.models.OptimizationJobListItem; +import com.azure.ai.agents.models.OptimizationJobResult; import com.azure.ai.agents.models.PageOrder; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; @@ -25,6 +26,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; import java.util.stream.Collectors; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -50,203 +52,9 @@ public final class BetaAgentsAsyncClient { } /** - * Creates an agent optimization job. + * Get an agent optimization job * - * Create an optimization job. Returns 201 with the queued job. Honours `Operation-Id` for idempotent retry. - * Header Parameters
- *- *
- * You can add these to a request with {@link RequestOptions#addHeader} - *Header Parameters - *- * Name Type Required Description - * Operation-Id String No Client-generated unique ID for idempotent retries. When - * absent, the server creates the job unconditionally. Request Body Schema
- * - *- * {@code - * { - * id: String (Required) - * inputs (Optional): { - * agent (Required): { - * agent_name: String (Required) - * agent_version: String (Optional) - * } - * train_dataset (Required): { - * type: String(inline/reference) (Required) - * } - * validation_dataset (Optional): (recursive schema, see validation_dataset above) - * evaluators (Required): [ - * (Required){ - * name: String (Required) - * version: String (Optional) - * } - * ] - * options (Optional): { - * max_candidates: Integer (Optional) - * optimization_config (Optional): { - * String: BinaryData (Required) - * } - * eval_model: String (Optional) - * optimization_model: String (Optional) - * evaluation_level: String(turn/conversation) (Optional) - * } - * } - * result (Optional): { - * baseline: String (Optional) - * best: String (Optional) - * candidates (Optional): [ - * (Optional){ - * candidate_id: String (Optional) - * name: String (Required) - * mutations (Optional): { - * String: BinaryData (Required) - * } - * avg_score: double (Required) - * avg_tokens: double (Required) - * eval_id: String (Optional) - * eval_run_id: String (Optional) - * promotion (Optional): { - * promoted_at: long (Required) - * agent_name: String (Required) - * agent_version: String (Required) - * } - * } - * ] - * } - * status: String(queued/in_progress/succeeded/failed/cancelled) (Required) - * error (Optional): { - * code: String (Required) - * message: String (Required) - * param: String (Optional) - * type: String (Optional) - * details (Optional): [ - * (recursive schema, see above) - * ] - * additionalInfo (Optional): { - * String: BinaryData (Required) - * } - * debugInfo (Optional): { - * String: BinaryData (Required) - * } - * } - * created_at: long (Required) - * updated_at: long (Required) - * progress (Optional): { - * candidates_completed: int (Required) - * best_score: double (Required) - * elapsed_seconds: double (Required) - * } - * warnings (Optional): [ - * String (Optional) - * ] - * } - * } - *- * - *Response Body Schema
- * - *- * {@code - * { - * id: String (Required) - * inputs (Optional): { - * agent (Required): { - * agent_name: String (Required) - * agent_version: String (Optional) - * } - * train_dataset (Required): { - * type: String(inline/reference) (Required) - * } - * validation_dataset (Optional): (recursive schema, see validation_dataset above) - * evaluators (Required): [ - * (Required){ - * name: String (Required) - * version: String (Optional) - * } - * ] - * options (Optional): { - * max_candidates: Integer (Optional) - * optimization_config (Optional): { - * String: BinaryData (Required) - * } - * eval_model: String (Optional) - * optimization_model: String (Optional) - * evaluation_level: String(turn/conversation) (Optional) - * } - * } - * result (Optional): { - * baseline: String (Optional) - * best: String (Optional) - * candidates (Optional): [ - * (Optional){ - * candidate_id: String (Optional) - * name: String (Required) - * mutations (Optional): { - * String: BinaryData (Required) - * } - * avg_score: double (Required) - * avg_tokens: double (Required) - * eval_id: String (Optional) - * eval_run_id: String (Optional) - * promotion (Optional): { - * promoted_at: long (Required) - * agent_name: String (Required) - * agent_version: String (Required) - * } - * } - * ] - * } - * status: String(queued/in_progress/succeeded/failed/cancelled) (Required) - * error (Optional): { - * code: String (Required) - * message: String (Required) - * param: String (Optional) - * type: String (Optional) - * details (Optional): [ - * (recursive schema, see above) - * ] - * additionalInfo (Optional): { - * String: BinaryData (Required) - * } - * debugInfo (Optional): { - * String: BinaryData (Required) - * } - * } - * created_at: long (Required) - * updated_at: long (Required) - * progress (Optional): { - * candidates_completed: int (Required) - * best_score: double (Required) - * elapsed_seconds: double (Required) - * } - * warnings (Optional): [ - * String (Optional) - * ] - * } - * } - *- * - * @param job The job to create. - * @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 agent optimization job resource — a long-running job that optimizes an agent's configuration - * (instructions, model, skills, tools) to maximize evaluation scores along with {@link Response} on successful - * completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOptimizationJobWithResponse(BinaryData job, RequestOptions requestOptions) { - return this.serviceClient.createOptimizationJobWithResponseAsync(job, requestOptions); - } - - /** - * Get info about an agent optimization job. - * - * Get an optimization job by id. + * Retrieves an optimization job by its identifier. * Response Body Schema
* *@@ -276,6 +84,7 @@ public Mono> createOptimizationJobWithResponse(BinaryData j * eval_model: String (Optional) * optimization_model: String (Optional) * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) * } * } * result (Optional): { @@ -336,9 +145,10 @@ public Mono > createOptimizationJobWithResponse(BinaryData j * @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 info about an agent optimization job. + * @return an agent optimization job * - * Get an optimization job by id along with {@link Response} on successful completion of {@link Mono}. + * Retrieves an optimization job by its identifier along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -347,9 +157,9 @@ public Mono > getOptimizationJobWithResponse(String jobId, R } /** - * Returns a list of agent optimization jobs. + * List agent optimization jobs * - * List optimization jobs. Supports cursor pagination and optional status / agent_name filters. + * Lists optimization jobs with cursor pagination and optional status or agent name filters. * Query Parameters
**
Query Parameters @@ -424,9 +234,9 @@ public PagedFluxlistOptimizationJobs(RequestOptions requestOptions) } /** - * Cancels an agent optimization job. + * Cancel an agent optimization job * - * Request cancellation of a running or queued job. Returns an error if the job is already in a terminal state. + * Requests cancellation of a running or queued job and returns an error if the job is already in a terminal state. * Response Body Schema
* *@@ -456,6 +266,7 @@ public PagedFluxlistOptimizationJobs(RequestOptions requestOptions) * eval_model: String (Optional) * optimization_model: String (Optional) * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) * } * } * result (Optional): { @@ -527,9 +338,9 @@ public Mono > cancelOptimizationJobWithResponse(String jobId } /** - * Deletes an agent optimization job. + * Delete an agent optimization job * - * Delete the job and its candidate artifacts. Cancels first if non-terminal. + * Deletes the job and its candidate artifacts, canceling the job first if it is non-terminal. * * @param jobId The ID of the job to delete. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -546,9 +357,9 @@ public Mono > deleteOptimizationJobWithResponse(String jobId, Requ } /** - * Get info about an agent optimization job. + * Get an agent optimization job * - * Get an optimization job by id. + * Retrieves an optimization job by its identifier. * * @param jobId The ID of the job. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -557,9 +368,9 @@ public Mono > deleteOptimizationJobWithResponse(String jobId, Requ * @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 info about an agent optimization job. + * @return an agent optimization job * - * Get an optimization job by id on successful completion of {@link Mono}. + * Retrieves an optimization job by its identifier on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -571,9 +382,9 @@ public Mono getOptimizationJob(String jobId) { } /** - * Returns a list of agent optimization jobs. + * List agent optimization jobs * - * List optimization jobs. Supports cursor pagination and optional status / agent_name filters. + * Lists optimization jobs with cursor pagination and optional status or agent name filters. * * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 20. @@ -636,9 +447,9 @@ public PagedFlux listOptimizationJobs(Integer limit, Pa } /** - * Returns a list of agent optimization jobs. + * List agent optimization jobs * - * List optimization jobs. Supports cursor pagination and optional status / agent_name filters. + * Lists optimization jobs with cursor pagination and optional status or agent name filters. * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -669,9 +480,9 @@ public PagedFlux listOptimizationJobs() { } /** - * Cancels an agent optimization job. + * Cancel an agent optimization job * - * Request cancellation of a running or queued job. Returns an error if the job is already in a terminal state. + * Requests cancellation of a running or queued job and returns an error if the job is already in a terminal state. * * @param jobId The ID of the job to cancel. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -693,9 +504,9 @@ public Mono cancelOptimizationJob(String jobId) { } /** - * Deletes an agent optimization job. + * Delete an agent optimization job * - * Delete the job and its candidate artifacts. Cancels first if non-terminal. + * Deletes the job and its candidate artifacts, canceling the job first if it is non-terminal. * * @param jobId The ID of the job to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -715,9 +526,205 @@ public Mono deleteOptimizationJob(String jobId) { } /** - * Creates an agent optimization job. + * Create an agent optimization job + * + * Creates an optimization job and returns the queued job. Honors `Operation-Id` for idempotent retry. + * Header Parameters
+ *+ *
+ * You can add these to a request with {@link RequestOptions#addHeader} + *Header Parameters + *+ * Name Type Required Description + * Operation-Id String No Client-generated unique ID for idempotent retries. When + * absent, the server creates the job unconditionally. Request Body Schema
+ * + *+ * {@code + * { + * id: String (Required) + * inputs (Optional): { + * agent (Required): { + * agent_name: String (Required) + * agent_version: String (Optional) + * } + * train_dataset (Required): { + * type: String(inline/reference) (Required) + * } + * validation_dataset (Optional): (recursive schema, see validation_dataset above) + * evaluators (Required): [ + * (Required){ + * name: String (Required) + * version: String (Optional) + * } + * ] + * options (Optional): { + * max_candidates: Integer (Optional) + * optimization_config (Optional): { + * String: BinaryData (Required) + * } + * eval_model: String (Optional) + * optimization_model: String (Optional) + * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) + * } + * } + * result (Optional): { + * baseline: String (Optional) + * best: String (Optional) + * candidates (Optional): [ + * (Optional){ + * candidate_id: String (Optional) + * name: String (Required) + * mutations (Optional): { + * String: BinaryData (Required) + * } + * avg_score: double (Required) + * avg_tokens: double (Required) + * eval_id: String (Optional) + * eval_run_id: String (Optional) + * promotion (Optional): { + * promoted_at: long (Required) + * agent_name: String (Required) + * agent_version: String (Required) + * } + * } + * ] + * } + * status: String(queued/in_progress/succeeded/failed/cancelled) (Required) + * error (Optional): { + * code: String (Required) + * message: String (Required) + * param: String (Optional) + * type: String (Optional) + * details (Optional): [ + * (recursive schema, see above) + * ] + * additionalInfo (Optional): { + * String: BinaryData (Required) + * } + * debugInfo (Optional): { + * String: BinaryData (Required) + * } + * } + * created_at: long (Required) + * updated_at: long (Required) + * progress (Optional): { + * candidates_completed: int (Required) + * best_score: double (Required) + * elapsed_seconds: double (Required) + * } + * warnings (Optional): [ + * String (Optional) + * ] + * } + * } + *+ * + *Response Body Schema
+ * + *+ * {@code + * { + * id: String (Required) + * inputs (Optional): { + * agent (Required): { + * agent_name: String (Required) + * agent_version: String (Optional) + * } + * train_dataset (Required): { + * type: String(inline/reference) (Required) + * } + * validation_dataset (Optional): (recursive schema, see validation_dataset above) + * evaluators (Required): [ + * (Required){ + * name: String (Required) + * version: String (Optional) + * } + * ] + * options (Optional): { + * max_candidates: Integer (Optional) + * optimization_config (Optional): { + * String: BinaryData (Required) + * } + * eval_model: String (Optional) + * optimization_model: String (Optional) + * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) + * } + * } + * result (Optional): { + * baseline: String (Optional) + * best: String (Optional) + * candidates (Optional): [ + * (Optional){ + * candidate_id: String (Optional) + * name: String (Required) + * mutations (Optional): { + * String: BinaryData (Required) + * } + * avg_score: double (Required) + * avg_tokens: double (Required) + * eval_id: String (Optional) + * eval_run_id: String (Optional) + * promotion (Optional): { + * promoted_at: long (Required) + * agent_name: String (Required) + * agent_version: String (Required) + * } + * } + * ] + * } + * status: String(queued/in_progress/succeeded/failed/cancelled) (Required) + * error (Optional): { + * code: String (Required) + * message: String (Required) + * param: String (Optional) + * type: String (Optional) + * details (Optional): [ + * (recursive schema, see above) + * ] + * additionalInfo (Optional): { + * String: BinaryData (Required) + * } + * debugInfo (Optional): { + * String: BinaryData (Required) + * } + * } + * created_at: long (Required) + * updated_at: long (Required) + * progress (Optional): { + * candidates_completed: int (Required) + * best_score: double (Required) + * elapsed_seconds: double (Required) + * } + * warnings (Optional): [ + * String (Optional) + * ] + * } + * } + *+ * + * @param job The job to create. + * @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 {@link PollerFlux} for polling of agent optimization job resource — a long-running job that optimizes + * an agent's configuration (instructions, model, skills, tools) to maximize evaluation scores. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFluxbeginCreateOptimizationJob(BinaryData job, + RequestOptions requestOptions) { + return this.serviceClient.beginCreateOptimizationJobAsync(job, requestOptions); + } + + /** + * Create an agent optimization job * - * Create an optimization job. Returns 201 with the queued job. Honours `Operation-Id` for idempotent retry. + * Creates an optimization job and returns the queued job. Honors `Operation-Id` for idempotent retry. * * @param job The job to create. * @param operationId Client-generated unique ID for idempotent retries. When absent, the server creates the job @@ -728,25 +735,25 @@ public Mono deleteOptimizationJob(String jobId) { * @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 agent optimization job resource — a long-running job that optimizes an agent's configuration - * (instructions, model, skills, tools) to maximize evaluation scores on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of agent optimization job resource — a long-running job that optimizes + * an agent's configuration (instructions, model, skills, tools) to maximize evaluation scores. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOptimizationJob(OptimizationJob job, String operationId) { - // Generated convenience method for createOptimizationJobWithResponse + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateOptimizationJob(OptimizationJob job, + String operationId) { + // Generated convenience method for beginCreateOptimizationJobWithModel RequestOptions requestOptions = new RequestOptions(); if (operationId != null) { requestOptions.setHeader(HttpHeaderName.fromString("Operation-Id"), operationId); } - return createOptimizationJobWithResponse(BinaryData.fromObject(job), requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(OptimizationJob.class)); + return serviceClient.beginCreateOptimizationJobWithModelAsync(BinaryData.fromObject(job), requestOptions); } /** - * Creates an agent optimization job. + * Create an agent optimization job * - * Create an optimization job. Returns 201 with the queued job. Honours `Operation-Id` for idempotent retry. + * Creates an optimization job and returns the queued job. Honors `Operation-Id` for idempotent retry. * * @param job The job to create. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -755,15 +762,14 @@ public Mono createOptimizationJob(OptimizationJob job, String o * @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 agent optimization job resource — a long-running job that optimizes an agent's configuration - * (instructions, model, skills, tools) to maximize evaluation scores on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of agent optimization job resource — a long-running job that optimizes + * an agent's configuration (instructions, model, skills, tools) to maximize evaluation scores. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOptimizationJob(OptimizationJob job) { - // Generated convenience method for createOptimizationJobWithResponse + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateOptimizationJob(OptimizationJob job) { + // Generated convenience method for beginCreateOptimizationJobWithModel RequestOptions requestOptions = new RequestOptions(); - return createOptimizationJobWithResponse(BinaryData.fromObject(job), requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(OptimizationJob.class)); + return serviceClient.beginCreateOptimizationJobWithModelAsync(BinaryData.fromObject(job), requestOptions); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaAgentsClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaAgentsClient.java index 7dc8c04b36de..2cabcf8779d2 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaAgentsClient.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaAgentsClient.java @@ -8,6 +8,7 @@ import com.azure.ai.agents.models.JobStatus; import com.azure.ai.agents.models.OptimizationJob; import com.azure.ai.agents.models.OptimizationJobListItem; +import com.azure.ai.agents.models.OptimizationJobResult; import com.azure.ai.agents.models.PageOrder; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; @@ -22,6 +23,7 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import com.azure.core.util.polling.SyncPoller; /** * Initializes a new instance of the synchronous AgentsClient type. @@ -44,202 +46,9 @@ public final class BetaAgentsClient { } /** - * Creates an agent optimization job. + * Get an agent optimization job * - * Create an optimization job. Returns 201 with the queued job. Honours `Operation-Id` for idempotent retry. - * Header Parameters
- *- *
- * You can add these to a request with {@link RequestOptions#addHeader} - *Header Parameters - *- * Name Type Required Description - * Operation-Id String No Client-generated unique ID for idempotent retries. When - * absent, the server creates the job unconditionally. Request Body Schema
- * - *- * {@code - * { - * id: String (Required) - * inputs (Optional): { - * agent (Required): { - * agent_name: String (Required) - * agent_version: String (Optional) - * } - * train_dataset (Required): { - * type: String(inline/reference) (Required) - * } - * validation_dataset (Optional): (recursive schema, see validation_dataset above) - * evaluators (Required): [ - * (Required){ - * name: String (Required) - * version: String (Optional) - * } - * ] - * options (Optional): { - * max_candidates: Integer (Optional) - * optimization_config (Optional): { - * String: BinaryData (Required) - * } - * eval_model: String (Optional) - * optimization_model: String (Optional) - * evaluation_level: String(turn/conversation) (Optional) - * } - * } - * result (Optional): { - * baseline: String (Optional) - * best: String (Optional) - * candidates (Optional): [ - * (Optional){ - * candidate_id: String (Optional) - * name: String (Required) - * mutations (Optional): { - * String: BinaryData (Required) - * } - * avg_score: double (Required) - * avg_tokens: double (Required) - * eval_id: String (Optional) - * eval_run_id: String (Optional) - * promotion (Optional): { - * promoted_at: long (Required) - * agent_name: String (Required) - * agent_version: String (Required) - * } - * } - * ] - * } - * status: String(queued/in_progress/succeeded/failed/cancelled) (Required) - * error (Optional): { - * code: String (Required) - * message: String (Required) - * param: String (Optional) - * type: String (Optional) - * details (Optional): [ - * (recursive schema, see above) - * ] - * additionalInfo (Optional): { - * String: BinaryData (Required) - * } - * debugInfo (Optional): { - * String: BinaryData (Required) - * } - * } - * created_at: long (Required) - * updated_at: long (Required) - * progress (Optional): { - * candidates_completed: int (Required) - * best_score: double (Required) - * elapsed_seconds: double (Required) - * } - * warnings (Optional): [ - * String (Optional) - * ] - * } - * } - *- * - *Response Body Schema
- * - *- * {@code - * { - * id: String (Required) - * inputs (Optional): { - * agent (Required): { - * agent_name: String (Required) - * agent_version: String (Optional) - * } - * train_dataset (Required): { - * type: String(inline/reference) (Required) - * } - * validation_dataset (Optional): (recursive schema, see validation_dataset above) - * evaluators (Required): [ - * (Required){ - * name: String (Required) - * version: String (Optional) - * } - * ] - * options (Optional): { - * max_candidates: Integer (Optional) - * optimization_config (Optional): { - * String: BinaryData (Required) - * } - * eval_model: String (Optional) - * optimization_model: String (Optional) - * evaluation_level: String(turn/conversation) (Optional) - * } - * } - * result (Optional): { - * baseline: String (Optional) - * best: String (Optional) - * candidates (Optional): [ - * (Optional){ - * candidate_id: String (Optional) - * name: String (Required) - * mutations (Optional): { - * String: BinaryData (Required) - * } - * avg_score: double (Required) - * avg_tokens: double (Required) - * eval_id: String (Optional) - * eval_run_id: String (Optional) - * promotion (Optional): { - * promoted_at: long (Required) - * agent_name: String (Required) - * agent_version: String (Required) - * } - * } - * ] - * } - * status: String(queued/in_progress/succeeded/failed/cancelled) (Required) - * error (Optional): { - * code: String (Required) - * message: String (Required) - * param: String (Optional) - * type: String (Optional) - * details (Optional): [ - * (recursive schema, see above) - * ] - * additionalInfo (Optional): { - * String: BinaryData (Required) - * } - * debugInfo (Optional): { - * String: BinaryData (Required) - * } - * } - * created_at: long (Required) - * updated_at: long (Required) - * progress (Optional): { - * candidates_completed: int (Required) - * best_score: double (Required) - * elapsed_seconds: double (Required) - * } - * warnings (Optional): [ - * String (Optional) - * ] - * } - * } - *- * - * @param job The job to create. - * @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 agent optimization job resource — a long-running job that optimizes an agent's configuration - * (instructions, model, skills, tools) to maximize evaluation scores along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponsecreateOptimizationJobWithResponse(BinaryData job, RequestOptions requestOptions) { - return this.serviceClient.createOptimizationJobWithResponse(job, requestOptions); - } - - /** - * Get info about an agent optimization job. - * - * Get an optimization job by id. + * Retrieves an optimization job by its identifier. * Response Body Schema
* *@@ -269,6 +78,7 @@ public ResponsecreateOptimizationJobWithResponse(BinaryData job, Re * eval_model: String (Optional) * optimization_model: String (Optional) * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) * } * } * result (Optional): { @@ -329,9 +139,9 @@ public Response createOptimizationJobWithResponse(BinaryData job, Re * @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 info about an agent optimization job. + * @return an agent optimization job * - * Get an optimization job by id along with {@link Response}. + * Retrieves an optimization job by its identifier along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -340,9 +150,9 @@ public Response getOptimizationJobWithResponse(String jobId, Request } /** - * Returns a list of agent optimization jobs. + * List agent optimization jobs * - * List optimization jobs. Supports cursor pagination and optional status / agent_name filters. + * Lists optimization jobs with cursor pagination and optional status or agent name filters. * Query Parameters
**
Query Parameters @@ -417,9 +227,9 @@ public PagedIterablelistOptimizationJobs(RequestOptions requestOpti } /** - * Cancels an agent optimization job. + * Cancel an agent optimization job * - * Request cancellation of a running or queued job. Returns an error if the job is already in a terminal state. + * Requests cancellation of a running or queued job and returns an error if the job is already in a terminal state. * Response Body Schema
* *@@ -449,6 +259,7 @@ public PagedIterablelistOptimizationJobs(RequestOptions requestOpti * eval_model: String (Optional) * optimization_model: String (Optional) * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) * } * } * result (Optional): { @@ -519,9 +330,9 @@ public Response cancelOptimizationJobWithResponse(String jobId, Requ } /** - * Deletes an agent optimization job. + * Delete an agent optimization job * - * Delete the job and its candidate artifacts. Cancels first if non-terminal. + * Deletes the job and its candidate artifacts, canceling the job first if it is non-terminal. * * @param jobId The ID of the job to delete. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -538,9 +349,9 @@ public Response deleteOptimizationJobWithResponse(String jobId, RequestOpt } /** - * Get info about an agent optimization job. + * Get an agent optimization job * - * Get an optimization job by id. + * Retrieves an optimization job by its identifier. * * @param jobId The ID of the job. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -549,9 +360,9 @@ public Response deleteOptimizationJobWithResponse(String jobId, RequestOpt * @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 info about an agent optimization job. + * @return an agent optimization job * - * Get an optimization job by id. + * Retrieves an optimization job by its identifier. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -562,9 +373,9 @@ public OptimizationJob getOptimizationJob(String jobId) { } /** - * Returns a list of agent optimization jobs. + * List agent optimization jobs * - * List optimization jobs. Supports cursor pagination and optional status / agent_name filters. + * Lists optimization jobs with cursor pagination and optional status or agent name filters. * * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 20. @@ -615,9 +426,9 @@ public PagedIterable listOptimizationJobs(Integer limit } /** - * Returns a list of agent optimization jobs. + * List agent optimization jobs * - * List optimization jobs. Supports cursor pagination and optional status / agent_name filters. + * Lists optimization jobs with cursor pagination and optional status or agent name filters. * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -636,9 +447,9 @@ public PagedIterable listOptimizationJobs() { } /** - * Cancels an agent optimization job. + * Cancel an agent optimization job * - * Request cancellation of a running or queued job. Returns an error if the job is already in a terminal state. + * Requests cancellation of a running or queued job and returns an error if the job is already in a terminal state. * * @param jobId The ID of the job to cancel. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -659,9 +470,9 @@ public OptimizationJob cancelOptimizationJob(String jobId) { } /** - * Deletes an agent optimization job. + * Delete an agent optimization job * - * Delete the job and its candidate artifacts. Cancels first if non-terminal. + * Deletes the job and its candidate artifacts, canceling the job first if it is non-terminal. * * @param jobId The ID of the job to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -680,9 +491,205 @@ public void deleteOptimizationJob(String jobId) { } /** - * Creates an agent optimization job. + * Create an agent optimization job * - * Create an optimization job. Returns 201 with the queued job. Honours `Operation-Id` for idempotent retry. + * Creates an optimization job and returns the queued job. Honors `Operation-Id` for idempotent retry. + * Header Parameters
+ *+ *
+ * You can add these to a request with {@link RequestOptions#addHeader} + *Header Parameters + *+ * Name Type Required Description + * Operation-Id String No Client-generated unique ID for idempotent retries. When + * absent, the server creates the job unconditionally. Request Body Schema
+ * + *+ * {@code + * { + * id: String (Required) + * inputs (Optional): { + * agent (Required): { + * agent_name: String (Required) + * agent_version: String (Optional) + * } + * train_dataset (Required): { + * type: String(inline/reference) (Required) + * } + * validation_dataset (Optional): (recursive schema, see validation_dataset above) + * evaluators (Required): [ + * (Required){ + * name: String (Required) + * version: String (Optional) + * } + * ] + * options (Optional): { + * max_candidates: Integer (Optional) + * optimization_config (Optional): { + * String: BinaryData (Required) + * } + * eval_model: String (Optional) + * optimization_model: String (Optional) + * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) + * } + * } + * result (Optional): { + * baseline: String (Optional) + * best: String (Optional) + * candidates (Optional): [ + * (Optional){ + * candidate_id: String (Optional) + * name: String (Required) + * mutations (Optional): { + * String: BinaryData (Required) + * } + * avg_score: double (Required) + * avg_tokens: double (Required) + * eval_id: String (Optional) + * eval_run_id: String (Optional) + * promotion (Optional): { + * promoted_at: long (Required) + * agent_name: String (Required) + * agent_version: String (Required) + * } + * } + * ] + * } + * status: String(queued/in_progress/succeeded/failed/cancelled) (Required) + * error (Optional): { + * code: String (Required) + * message: String (Required) + * param: String (Optional) + * type: String (Optional) + * details (Optional): [ + * (recursive schema, see above) + * ] + * additionalInfo (Optional): { + * String: BinaryData (Required) + * } + * debugInfo (Optional): { + * String: BinaryData (Required) + * } + * } + * created_at: long (Required) + * updated_at: long (Required) + * progress (Optional): { + * candidates_completed: int (Required) + * best_score: double (Required) + * elapsed_seconds: double (Required) + * } + * warnings (Optional): [ + * String (Optional) + * ] + * } + * } + *+ * + *Response Body Schema
+ * + *+ * {@code + * { + * id: String (Required) + * inputs (Optional): { + * agent (Required): { + * agent_name: String (Required) + * agent_version: String (Optional) + * } + * train_dataset (Required): { + * type: String(inline/reference) (Required) + * } + * validation_dataset (Optional): (recursive schema, see validation_dataset above) + * evaluators (Required): [ + * (Required){ + * name: String (Required) + * version: String (Optional) + * } + * ] + * options (Optional): { + * max_candidates: Integer (Optional) + * optimization_config (Optional): { + * String: BinaryData (Required) + * } + * eval_model: String (Optional) + * optimization_model: String (Optional) + * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) + * } + * } + * result (Optional): { + * baseline: String (Optional) + * best: String (Optional) + * candidates (Optional): [ + * (Optional){ + * candidate_id: String (Optional) + * name: String (Required) + * mutations (Optional): { + * String: BinaryData (Required) + * } + * avg_score: double (Required) + * avg_tokens: double (Required) + * eval_id: String (Optional) + * eval_run_id: String (Optional) + * promotion (Optional): { + * promoted_at: long (Required) + * agent_name: String (Required) + * agent_version: String (Required) + * } + * } + * ] + * } + * status: String(queued/in_progress/succeeded/failed/cancelled) (Required) + * error (Optional): { + * code: String (Required) + * message: String (Required) + * param: String (Optional) + * type: String (Optional) + * details (Optional): [ + * (recursive schema, see above) + * ] + * additionalInfo (Optional): { + * String: BinaryData (Required) + * } + * debugInfo (Optional): { + * String: BinaryData (Required) + * } + * } + * created_at: long (Required) + * updated_at: long (Required) + * progress (Optional): { + * candidates_completed: int (Required) + * best_score: double (Required) + * elapsed_seconds: double (Required) + * } + * warnings (Optional): [ + * String (Optional) + * ] + * } + * } + *+ * + * @param job The job to create. + * @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 {@link SyncPoller} for polling of agent optimization job resource — a long-running job that optimizes + * an agent's configuration (instructions, model, skills, tools) to maximize evaluation scores. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPollerbeginCreateOptimizationJob(BinaryData job, + RequestOptions requestOptions) { + return this.serviceClient.beginCreateOptimizationJob(job, requestOptions); + } + + /** + * Create an agent optimization job + * + * Creates an optimization job and returns the queued job. Honors `Operation-Id` for idempotent retry. * * @param job The job to create. * @param operationId Client-generated unique ID for idempotent retries. When absent, the server creates the job @@ -693,25 +700,25 @@ public void deleteOptimizationJob(String jobId) { * @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 agent optimization job resource — a long-running job that optimizes an agent's configuration - * (instructions, model, skills, tools) to maximize evaluation scores. + * @return the {@link SyncPoller} for polling of agent optimization job resource — a long-running job that optimizes + * an agent's configuration (instructions, model, skills, tools) to maximize evaluation scores. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public OptimizationJob createOptimizationJob(OptimizationJob job, String operationId) { - // Generated convenience method for createOptimizationJobWithResponse + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreateOptimizationJob(OptimizationJob job, + String operationId) { + // Generated convenience method for beginCreateOptimizationJobWithModel RequestOptions requestOptions = new RequestOptions(); if (operationId != null) { requestOptions.setHeader(HttpHeaderName.fromString("Operation-Id"), operationId); } - return createOptimizationJobWithResponse(BinaryData.fromObject(job), requestOptions).getValue() - .toObject(OptimizationJob.class); + return serviceClient.beginCreateOptimizationJobWithModel(BinaryData.fromObject(job), requestOptions); } /** - * Creates an agent optimization job. + * Create an agent optimization job * - * Create an optimization job. Returns 201 with the queued job. Honours `Operation-Id` for idempotent retry. + * Creates an optimization job and returns the queued job. Honors `Operation-Id` for idempotent retry. * * @param job The job to create. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -720,15 +727,14 @@ public OptimizationJob createOptimizationJob(OptimizationJob job, String operati * @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 agent optimization job resource — a long-running job that optimizes an agent's configuration - * (instructions, model, skills, tools) to maximize evaluation scores. + * @return the {@link SyncPoller} for polling of agent optimization job resource — a long-running job that optimizes + * an agent's configuration (instructions, model, skills, tools) to maximize evaluation scores. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public OptimizationJob createOptimizationJob(OptimizationJob job) { - // Generated convenience method for createOptimizationJobWithResponse + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreateOptimizationJob(OptimizationJob job) { + // Generated convenience method for beginCreateOptimizationJobWithModel RequestOptions requestOptions = new RequestOptions(); - return createOptimizationJobWithResponse(BinaryData.fromObject(job), requestOptions).getValue() - .toObject(OptimizationJob.class); + return serviceClient.beginCreateOptimizationJobWithModel(BinaryData.fromObject(job), requestOptions); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaMemoryStoresAsyncClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaMemoryStoresAsyncClient.java index 745e8651acc3..41abc82dc9e2 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaMemoryStoresAsyncClient.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaMemoryStoresAsyncClient.java @@ -372,6 +372,7 @@ public Mono deleteMemoryStore(String name) { * input_tokens: long (Required) * input_tokens_details (Required): { * cached_tokens: long (Required) + * cache_write_tokens: long (Required) * } * output_tokens: long (Required) * output_tokens_details (Required): { @@ -514,6 +515,7 @@ public Mono > searchMemoriesWithResponse(String name, Binary * input_tokens: long (Required) * input_tokens_details (Required): { * cached_tokens: long (Required) + * cache_write_tokens: long (Required) * } * output_tokens: long (Required) * output_tokens_details (Required): { @@ -634,6 +636,7 @@ public PollerFlux b * input_tokens: long (Required) * input_tokens_details (Required): { * cached_tokens: long (Required) + * cache_write_tokens: long (Required) * } * output_tokens: long (Required) * output_tokens_details (Required): { diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaMemoryStoresClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaMemoryStoresClient.java index 21efb65cfbec..40c6ab22d207 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaMemoryStoresClient.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/BetaMemoryStoresClient.java @@ -389,6 +389,7 @@ public void deleteMemoryStore(String name) { * input_tokens: long (Required) * input_tokens_details (Required): { * cached_tokens: long (Required) + * cache_write_tokens: long (Required) * } * output_tokens: long (Required) * output_tokens_details (Required): { @@ -462,6 +463,7 @@ Response internalSearchMemoriesWithResponse(String name, BinaryData * input_tokens: long (Required) * input_tokens_details (Required): { * cached_tokens: long (Required) + * cache_write_tokens: long (Required) * } * output_tokens: long (Required) * output_tokens_details (Required): { @@ -582,6 +584,7 @@ public SyncPoller b * input_tokens: long (Required) * input_tokens_details (Required): { * cached_tokens: long (Required) + * cache_write_tokens: long (Required) * } * output_tokens: long (Required) * output_tokens_details (Required): { diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ToolboxesAsyncClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ToolboxesAsyncClient.java index 283bbfe5edb6..372e83e55099 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ToolboxesAsyncClient.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ToolboxesAsyncClient.java @@ -67,7 +67,7 @@ public final class ToolboxesAsyncClient { * } * tools (Required): [ * (Required){ - * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview) (Required) + * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview) (Required) * name: String (Optional) * description: String (Optional) * tool_configs (Optional): { @@ -107,7 +107,7 @@ public final class ToolboxesAsyncClient { * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview) (Required) + * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview) (Required) * name: String (Optional) * description: String (Optional) * tool_configs (Optional): { @@ -268,7 +268,7 @@ public PagedFlux listToolboxes(RequestOptions requestOptions) { * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview) (Required) + * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview) (Required) * name: String (Optional) * description: String (Optional) * tool_configs (Optional): { @@ -326,7 +326,7 @@ public PagedFlux listToolboxVersions(String name, RequestOptions req * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview) (Required) + * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview) (Required) * name: String (Optional) * description: String (Optional) * tool_configs (Optional): { diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ToolboxesClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ToolboxesClient.java index c399a333750d..399d98f5b50e 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ToolboxesClient.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/ToolboxesClient.java @@ -61,7 +61,7 @@ public final class ToolboxesClient { * } * tools (Required): [ * (Required){ - * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview) (Required) + * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview) (Required) * name: String (Optional) * description: String (Optional) * tool_configs (Optional): { @@ -101,7 +101,7 @@ public final class ToolboxesClient { * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview) (Required) + * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview) (Required) * name: String (Optional) * description: String (Optional) * tool_configs (Optional): { @@ -260,7 +260,7 @@ public PagedIterable listToolboxes(RequestOptions requestOptions) { * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview) (Required) + * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview) (Required) * name: String (Optional) * description: String (Optional) * tool_configs (Optional): { @@ -318,7 +318,7 @@ public PagedIterable listToolboxVersions(String name, RequestOptions * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview) (Required) + * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview) (Required) * name: String (Optional) * description: String (Optional) * tool_configs (Optional): { 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 f649441cb467..613aca24defb 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 @@ -780,6 +780,7 @@ Response listAgentConversationsSync(@HostParam("endpoint") String en * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -895,6 +896,7 @@ public Mono > getAgentWithResponseAsync(String agentName, Re * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -1081,6 +1083,7 @@ public Response getAgentWithResponse(String agentName, RequestOption * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -1268,6 +1271,7 @@ public Mono > createAgentWithResponseAsync(BinaryData create * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -1386,6 +1390,7 @@ public Response createAgentWithResponse(BinaryData createAgentReques * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -1452,7 +1457,7 @@ public Response createAgentWithResponse(BinaryData createAgentReques * hyphens allowed in the middle. * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity * verification. - * @param content The content parameter. + * @param content The content multipart request content. * @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. @@ -1510,6 +1515,7 @@ public Mono > createAgentFromCodeWithResponseAsync(String ag * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -1576,7 +1582,7 @@ public Mono > createAgentFromCodeWithResponseAsync(String ag * hyphens allowed in the middle. * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity * verification. - * @param content The content parameter. + * @param content The content multipart request content. * @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. @@ -1651,6 +1657,7 @@ public Response createAgentFromCodeWithResponse(String agentName, St * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -1790,6 +1797,7 @@ public Mono > updateAgentWithResponseAsync(String agentName, * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -1910,6 +1918,7 @@ public Response updateAgentWithResponse(String agentName, BinaryData * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -1978,7 +1987,7 @@ public Response updateAgentWithResponse(String agentName, BinaryData * - Must not exceed 63 characters. * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity * verification. - * @param content The content parameter. + * @param content The content multipart request content. * @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. @@ -2035,6 +2044,7 @@ public Mono > updateAgentFromCodeWithResponseAsync(String ag * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -2103,7 +2113,7 @@ public Mono > updateAgentFromCodeWithResponseAsync(String ag * - Must not exceed 63 characters. * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity * verification. - * @param content The content parameter. + * @param content The content multipart request content. * @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. @@ -2173,6 +2183,7 @@ public Response updateAgentFromCodeWithResponse(String agentName, St * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -2306,6 +2317,7 @@ public Mono > createAgentFromManifestWithResponseAsync( * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -2439,6 +2451,7 @@ public Response createAgentFromManifestWithResponse(BinaryData creat * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -2573,6 +2586,7 @@ public Mono > updateAgentFromManifestWithResponseAsync(Strin * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -2796,6 +2810,7 @@ public Response internalDeleteAgentWithResponse(String agentName, Re * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -2933,6 +2948,7 @@ private Mono > listAgentsSinglePageAsync(RequestOptions * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -3064,6 +3080,7 @@ public PagedFlux listAgentsAsync(RequestOptions requestOptions) { * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -3199,6 +3216,7 @@ private PagedResponse listAgentsSinglePage(RequestOptions requestOpt * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -3325,6 +3343,7 @@ public PagedIterable listAgents(RequestOptions requestOptions) { * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -3409,6 +3428,7 @@ public Mono > createAgentVersionWithResponseAsync(String age * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -3487,6 +3507,7 @@ public Response createAgentVersionWithResponse(String agentName, Bin * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -3565,6 +3586,7 @@ public Mono > createAgentVersionFromManifestWithResponseAsyn * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -3626,6 +3648,7 @@ public Response createAgentVersionFromManifestWithResponse(String ag * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -3685,6 +3708,7 @@ public Mono > getAgentVersionDetailsWithResponseAsync(String * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -3856,6 +3880,7 @@ public Response internalDeleteAgentVersionWithResponse(String agentN * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -3938,6 +3963,7 @@ private Mono > listAgentVersionsSinglePageAsync(String * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -4013,6 +4039,7 @@ public PagedFlux listAgentVersionsAsync(String agentName, RequestOpt * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -4092,6 +4119,7 @@ private PagedResponse listAgentVersionsSinglePage(String agentName, * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -4206,6 +4234,7 @@ public PagedIterable listAgentVersions(String agentName, RequestOpti * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -4380,6 +4409,7 @@ public Mono > updateAgentDetailsWithResponseAsync(String age * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -4497,6 +4527,7 @@ public Response updateAgentDetailsWithResponse(String agentName, Bin * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -4513,7 +4544,7 @@ public Response updateAgentDetailsWithResponse(String agentName, Bin * - Must not exceed 63 characters. * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity * verification. - * @param content The content parameter. + * @param content The content multipart request content. * @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. @@ -4565,6 +4596,7 @@ public Mono > createAgentVersionFromCodeWithResponseAsync(St * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) + * status: String(active/disabled) (Optional) * } * blueprint (Optional): (recursive schema, see blueprint above) * blueprint_reference (Optional): { @@ -4581,7 +4613,7 @@ public Mono > createAgentVersionFromCodeWithResponseAsync(St * - Must not exceed 63 characters. * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity * verification. - * @param content The content parameter. + * @param content The content multipart request content. * @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. @@ -4772,7 +4804,7 @@ public Response disableAgentWithResponse(String agentName, RequestOptions * * Creates a new session for an agent endpoint. * The endpoint resolves the backing agent version from `version_indicator` and - * enforces session ownership using the provided isolation key for session-mutating operations. + * enforces session ownership using the provided user identity for session-mutating operations. * Request Body Schema
* *@@ -4828,7 +4860,7 @@ public Mono> createSessionWithResponseAsync(String agentNam * * Creates a new session for an agent endpoint. * The endpoint resolves the backing agent version from `version_indicator` and - * enforces session ownership using the provided isolation key for session-mutating operations. + * enforces session ownership using the provided user identity for session-mutating operations. * Request Body Schema
* *@@ -6116,20 +6148,26 @@ public PagedIterablelistAgentConversations(RequestOptions requestOp return new PagedIterable<>(() -> listAgentConversationsSinglePage(requestOptions)); } - private List getValues(BinaryData binaryData, String path) { + private List getValues(BinaryData binaryData, String... path) { try { - Map, ?> obj = binaryData.toObject(Map.class); - List> values = (List>) obj.get(path); + Object value = binaryData.toObject(Map.class); + for (String segment : path) { + value = ((Map, ?>) value).get(segment); + } + List> values = (List>) value; return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); } catch (RuntimeException e) { return null; } } - private String getNextLink(BinaryData binaryData, String path) { + private String getNextLink(BinaryData binaryData, String... path) { try { - Map, ?> obj = binaryData.toObject(Map.class); - return (String) obj.get(path); + Object value = binaryData.toObject(Map.class); + for (String segment : path) { + value = ((Map, ?>) value).get(segment); + } + return (String) value; } catch (RuntimeException e) { return null; } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentsServicePollUtils.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentsServicePollUtils.java index 5e6504d3de68..35f75eba7c0b 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentsServicePollUtils.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentsServicePollUtils.java @@ -3,15 +3,9 @@ package com.azure.ai.agents.implementation; -import com.azure.ai.agents.implementation.models.FoundryFeaturesOptInKeys; import com.azure.ai.agents.models.MemoryStoreUpdateStatus; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.util.Context; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollResponse; -import com.azure.core.util.polling.PollingStrategyOptions; /** * Shared polling helpers for the Agents SDK. @@ -24,42 +18,18 @@ */ final class AgentsServicePollUtils { - /** Required preview-feature header for Memory Stores operations. */ - private static final HttpHeaderName FOUNDRY_FEATURES = HttpHeaderName.fromString("Foundry-Features"); - private static final String FOUNDRY_FEATURES_VALUE = FoundryFeaturesOptInKeys.MEMORY_STORES_V1_PREVIEW.toString(); - private AgentsServicePollUtils() { } - /** - * Adds the {@code Foundry-Features} header to the given {@link PollingStrategyOptions}'s - * {@link Context}. If the context already carries {@link HttpHeaders} under the - * {@link AddHeadersFromContextPolicy} key they are preserved; the {@code Foundry-Features} - * entry is merged in. Because the pipeline already contains - * {@link AddHeadersFromContextPolicy}, the header is automatically added to every HTTP - * request the parent strategy makes (initial, poll, and final-result GETs). - * - * Note: this method mutates and returns the same - * {@code PollingStrategyOptions} instance.
- */ - static PollingStrategyOptions withFoundryFeatures(PollingStrategyOptions options) { - Context context = options.getContext() != null ? options.getContext() : Context.NONE; - Object existing = context.getData(AddHeadersFromContextPolicy.AZURE_REQUEST_HTTP_HEADERS_KEY).orElse(null); - HttpHeaders headers - = (existing instanceof HttpHeaders) ? new HttpHeaders((HttpHeaders) existing) : new HttpHeaders(); - headers.set(FOUNDRY_FEATURES, FOUNDRY_FEATURES_VALUE); - return options.setContext(context.addData(AddHeadersFromContextPolicy.AZURE_REQUEST_HTTP_HEADERS_KEY, headers)); - } - /** * Remaps a {@link PollResponse} whose status may contain a custom service terminal state * ({@code "completed"}, {@code "superseded"}) that the base {@code OperationResourcePollingStrategy} * cannot recognize. If no remapping is needed the original response is returned as-is. * - *The Memory Stores Azure core defines:
+ *The Memory Stores service defines:
*- *
*/ static- {@code "completed"} {@link LongRunningOperationStatus#SUCCESSFULLY_COMPLETED}
- *- {@code "superseded"} {@link LongRunningOperationStatus#USER_CANCELLED}
+ *- {@code "completed"} {@link LongRunningOperationStatus#SUCCESSFULLY_COMPLETED}
+ *- {@code "superseded"} {@link LongRunningOperationStatus#USER_CANCELLED}
*PollResponse remapStatus(PollResponse response) { diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/BetaAgentsImpl.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/BetaAgentsImpl.java index 4a9bb81cd701..6a7973c54496 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/BetaAgentsImpl.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/BetaAgentsImpl.java @@ -5,6 +5,8 @@ package com.azure.ai.agents.implementation; import com.azure.ai.agents.AgentsServiceVersion; +import com.azure.ai.agents.models.OptimizationJob; +import com.azure.ai.agents.models.OptimizationJobResult; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; @@ -33,6 +35,11 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.PollingStrategyOptions; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.TypeReference; +import java.time.Duration; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -183,9 +190,9 @@ Response deleteOptimizationJobSync(@HostParam("endpoint") String endpoint, } /** - * Creates an agent optimization job. + * Create an agent optimization job * - * Create an optimization job. Returns 201 with the queued job. Honours `Operation-Id` for idempotent retry. + * Creates an optimization job and returns the queued job. Honors `Operation-Id` for idempotent retry. * Header Parameters
**
Header Parameters @@ -223,6 +230,7 @@ ResponsedeleteOptimizationJobSync(@HostParam("endpoint") String endpoint, * eval_model: String (Optional) * optimization_model: String (Optional) * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) * } * } * result (Optional): { @@ -306,6 +314,7 @@ Response deleteOptimizationJobSync(@HostParam("endpoint") String endpoint, * eval_model: String (Optional) * optimization_model: String (Optional) * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) * } * } * result (Optional): { @@ -371,7 +380,7 @@ Response deleteOptimizationJobSync(@HostParam("endpoint") String endpoint, * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono > createOptimizationJobWithResponseAsync(BinaryData job, + private Mono > createOptimizationJobWithResponseAsync(BinaryData job, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; @@ -380,9 +389,9 @@ public Mono > createOptimizationJobWithResponseAsync(BinaryD } /** - * Creates an agent optimization job. + * Create an agent optimization job * - * Create an optimization job. Returns 201 with the queued job. Honours `Operation-Id` for idempotent retry. + * Creates an optimization job and returns the queued job. Honors `Operation-Id` for idempotent retry. * Header Parameters
**
Header Parameters @@ -420,6 +429,7 @@ public Mono> createOptimizationJobWithResponseAsync(BinaryD * eval_model: String (Optional) * optimization_model: String (Optional) * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) * } * } * result (Optional): { @@ -503,6 +513,7 @@ public Mono > createOptimizationJobWithResponseAsync(BinaryD * eval_model: String (Optional) * optimization_model: String (Optional) * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) * } * } * result (Optional): { @@ -567,7 +578,7 @@ public Mono > createOptimizationJobWithResponseAsync(BinaryD * (instructions, model, skills, tools) to maximize evaluation scores along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOptimizationJobWithResponse(BinaryData job, RequestOptions requestOptions) { + private Response createOptimizationJobWithResponse(BinaryData job, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; return service.createOptimizationJobSync(this.client.getEndpoint(), @@ -575,9 +586,831 @@ public Response createOptimizationJobWithResponse(BinaryData job, Re } /** - * Get info about an agent optimization job. + * Create an agent optimization job * - * Get an optimization job by id. + * Creates an optimization job and returns the queued job. Honors `Operation-Id` for idempotent retry. + * Header Parameters
+ *+ *
+ * You can add these to a request with {@link RequestOptions#addHeader} + *Header Parameters + *+ * Name Type Required Description + * Operation-Id String No Client-generated unique ID for idempotent retries. When + * absent, the server creates the job unconditionally. Request Body Schema
+ * + *+ * {@code + * { + * id: String (Required) + * inputs (Optional): { + * agent (Required): { + * agent_name: String (Required) + * agent_version: String (Optional) + * } + * train_dataset (Required): { + * type: String(inline/reference) (Required) + * } + * validation_dataset (Optional): (recursive schema, see validation_dataset above) + * evaluators (Required): [ + * (Required){ + * name: String (Required) + * version: String (Optional) + * } + * ] + * options (Optional): { + * max_candidates: Integer (Optional) + * optimization_config (Optional): { + * String: BinaryData (Required) + * } + * eval_model: String (Optional) + * optimization_model: String (Optional) + * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) + * } + * } + * result (Optional): { + * baseline: String (Optional) + * best: String (Optional) + * candidates (Optional): [ + * (Optional){ + * candidate_id: String (Optional) + * name: String (Required) + * mutations (Optional): { + * String: BinaryData (Required) + * } + * avg_score: double (Required) + * avg_tokens: double (Required) + * eval_id: String (Optional) + * eval_run_id: String (Optional) + * promotion (Optional): { + * promoted_at: long (Required) + * agent_name: String (Required) + * agent_version: String (Required) + * } + * } + * ] + * } + * status: String(queued/in_progress/succeeded/failed/cancelled) (Required) + * error (Optional): { + * code: String (Required) + * message: String (Required) + * param: String (Optional) + * type: String (Optional) + * details (Optional): [ + * (recursive schema, see above) + * ] + * additionalInfo (Optional): { + * String: BinaryData (Required) + * } + * debugInfo (Optional): { + * String: BinaryData (Required) + * } + * } + * created_at: long (Required) + * updated_at: long (Required) + * progress (Optional): { + * candidates_completed: int (Required) + * best_score: double (Required) + * elapsed_seconds: double (Required) + * } + * warnings (Optional): [ + * String (Optional) + * ] + * } + * } + *+ * + *Response Body Schema
+ * + *+ * {@code + * { + * id: String (Required) + * inputs (Optional): { + * agent (Required): { + * agent_name: String (Required) + * agent_version: String (Optional) + * } + * train_dataset (Required): { + * type: String(inline/reference) (Required) + * } + * validation_dataset (Optional): (recursive schema, see validation_dataset above) + * evaluators (Required): [ + * (Required){ + * name: String (Required) + * version: String (Optional) + * } + * ] + * options (Optional): { + * max_candidates: Integer (Optional) + * optimization_config (Optional): { + * String: BinaryData (Required) + * } + * eval_model: String (Optional) + * optimization_model: String (Optional) + * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) + * } + * } + * result (Optional): { + * baseline: String (Optional) + * best: String (Optional) + * candidates (Optional): [ + * (Optional){ + * candidate_id: String (Optional) + * name: String (Required) + * mutations (Optional): { + * String: BinaryData (Required) + * } + * avg_score: double (Required) + * avg_tokens: double (Required) + * eval_id: String (Optional) + * eval_run_id: String (Optional) + * promotion (Optional): { + * promoted_at: long (Required) + * agent_name: String (Required) + * agent_version: String (Required) + * } + * } + * ] + * } + * status: String(queued/in_progress/succeeded/failed/cancelled) (Required) + * error (Optional): { + * code: String (Required) + * message: String (Required) + * param: String (Optional) + * type: String (Optional) + * details (Optional): [ + * (recursive schema, see above) + * ] + * additionalInfo (Optional): { + * String: BinaryData (Required) + * } + * debugInfo (Optional): { + * String: BinaryData (Required) + * } + * } + * created_at: long (Required) + * updated_at: long (Required) + * progress (Optional): { + * candidates_completed: int (Required) + * best_score: double (Required) + * elapsed_seconds: double (Required) + * } + * warnings (Optional): [ + * String (Optional) + * ] + * } + * } + *+ * + * @param job The job to create. + * @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 {@link PollerFlux} for polling of agent optimization job resource — a long-running job that optimizes + * an agent's configuration (instructions, model, skills, tools) to maximize evaluation scores. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFluxbeginCreateOptimizationJobWithModelAsync(BinaryData job, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.createOptimizationJobWithResponseAsync(job, requestOptions), + new com.azure.ai.agents.implementation.OperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{endpoint}".replace("{endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(OptimizationJob.class), + TypeReference.createInstance(OptimizationJobResult.class)); + } + + /** + * Create an agent optimization job + * + * Creates an optimization job and returns the queued job. Honors `Operation-Id` for idempotent retry. + * Header Parameters
+ *+ *
+ * You can add these to a request with {@link RequestOptions#addHeader} + *Header Parameters + *+ * Name Type Required Description + * Operation-Id String No Client-generated unique ID for idempotent retries. When + * absent, the server creates the job unconditionally. Request Body Schema
+ * + *+ * {@code + * { + * id: String (Required) + * inputs (Optional): { + * agent (Required): { + * agent_name: String (Required) + * agent_version: String (Optional) + * } + * train_dataset (Required): { + * type: String(inline/reference) (Required) + * } + * validation_dataset (Optional): (recursive schema, see validation_dataset above) + * evaluators (Required): [ + * (Required){ + * name: String (Required) + * version: String (Optional) + * } + * ] + * options (Optional): { + * max_candidates: Integer (Optional) + * optimization_config (Optional): { + * String: BinaryData (Required) + * } + * eval_model: String (Optional) + * optimization_model: String (Optional) + * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) + * } + * } + * result (Optional): { + * baseline: String (Optional) + * best: String (Optional) + * candidates (Optional): [ + * (Optional){ + * candidate_id: String (Optional) + * name: String (Required) + * mutations (Optional): { + * String: BinaryData (Required) + * } + * avg_score: double (Required) + * avg_tokens: double (Required) + * eval_id: String (Optional) + * eval_run_id: String (Optional) + * promotion (Optional): { + * promoted_at: long (Required) + * agent_name: String (Required) + * agent_version: String (Required) + * } + * } + * ] + * } + * status: String(queued/in_progress/succeeded/failed/cancelled) (Required) + * error (Optional): { + * code: String (Required) + * message: String (Required) + * param: String (Optional) + * type: String (Optional) + * details (Optional): [ + * (recursive schema, see above) + * ] + * additionalInfo (Optional): { + * String: BinaryData (Required) + * } + * debugInfo (Optional): { + * String: BinaryData (Required) + * } + * } + * created_at: long (Required) + * updated_at: long (Required) + * progress (Optional): { + * candidates_completed: int (Required) + * best_score: double (Required) + * elapsed_seconds: double (Required) + * } + * warnings (Optional): [ + * String (Optional) + * ] + * } + * } + *+ * + *Response Body Schema
+ * + *+ * {@code + * { + * id: String (Required) + * inputs (Optional): { + * agent (Required): { + * agent_name: String (Required) + * agent_version: String (Optional) + * } + * train_dataset (Required): { + * type: String(inline/reference) (Required) + * } + * validation_dataset (Optional): (recursive schema, see validation_dataset above) + * evaluators (Required): [ + * (Required){ + * name: String (Required) + * version: String (Optional) + * } + * ] + * options (Optional): { + * max_candidates: Integer (Optional) + * optimization_config (Optional): { + * String: BinaryData (Required) + * } + * eval_model: String (Optional) + * optimization_model: String (Optional) + * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) + * } + * } + * result (Optional): { + * baseline: String (Optional) + * best: String (Optional) + * candidates (Optional): [ + * (Optional){ + * candidate_id: String (Optional) + * name: String (Required) + * mutations (Optional): { + * String: BinaryData (Required) + * } + * avg_score: double (Required) + * avg_tokens: double (Required) + * eval_id: String (Optional) + * eval_run_id: String (Optional) + * promotion (Optional): { + * promoted_at: long (Required) + * agent_name: String (Required) + * agent_version: String (Required) + * } + * } + * ] + * } + * status: String(queued/in_progress/succeeded/failed/cancelled) (Required) + * error (Optional): { + * code: String (Required) + * message: String (Required) + * param: String (Optional) + * type: String (Optional) + * details (Optional): [ + * (recursive schema, see above) + * ] + * additionalInfo (Optional): { + * String: BinaryData (Required) + * } + * debugInfo (Optional): { + * String: BinaryData (Required) + * } + * } + * created_at: long (Required) + * updated_at: long (Required) + * progress (Optional): { + * candidates_completed: int (Required) + * best_score: double (Required) + * elapsed_seconds: double (Required) + * } + * warnings (Optional): [ + * String (Optional) + * ] + * } + * } + *+ * + * @param job The job to create. + * @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 {@link SyncPoller} for polling of agent optimization job resource — a long-running job that optimizes + * an agent's configuration (instructions, model, skills, tools) to maximize evaluation scores. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPollerbeginCreateOptimizationJobWithModel(BinaryData job, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.createOptimizationJobWithResponse(job, requestOptions), + new com.azure.ai.agents.implementation.SyncOperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{endpoint}".replace("{endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(OptimizationJob.class), + TypeReference.createInstance(OptimizationJobResult.class)); + } + + /** + * Create an agent optimization job + * + * Creates an optimization job and returns the queued job. Honors `Operation-Id` for idempotent retry. + * Header Parameters
+ *+ *
+ * You can add these to a request with {@link RequestOptions#addHeader} + *Header Parameters + *+ * Name Type Required Description + * Operation-Id String No Client-generated unique ID for idempotent retries. When + * absent, the server creates the job unconditionally. Request Body Schema
+ * + *+ * {@code + * { + * id: String (Required) + * inputs (Optional): { + * agent (Required): { + * agent_name: String (Required) + * agent_version: String (Optional) + * } + * train_dataset (Required): { + * type: String(inline/reference) (Required) + * } + * validation_dataset (Optional): (recursive schema, see validation_dataset above) + * evaluators (Required): [ + * (Required){ + * name: String (Required) + * version: String (Optional) + * } + * ] + * options (Optional): { + * max_candidates: Integer (Optional) + * optimization_config (Optional): { + * String: BinaryData (Required) + * } + * eval_model: String (Optional) + * optimization_model: String (Optional) + * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) + * } + * } + * result (Optional): { + * baseline: String (Optional) + * best: String (Optional) + * candidates (Optional): [ + * (Optional){ + * candidate_id: String (Optional) + * name: String (Required) + * mutations (Optional): { + * String: BinaryData (Required) + * } + * avg_score: double (Required) + * avg_tokens: double (Required) + * eval_id: String (Optional) + * eval_run_id: String (Optional) + * promotion (Optional): { + * promoted_at: long (Required) + * agent_name: String (Required) + * agent_version: String (Required) + * } + * } + * ] + * } + * status: String(queued/in_progress/succeeded/failed/cancelled) (Required) + * error (Optional): { + * code: String (Required) + * message: String (Required) + * param: String (Optional) + * type: String (Optional) + * details (Optional): [ + * (recursive schema, see above) + * ] + * additionalInfo (Optional): { + * String: BinaryData (Required) + * } + * debugInfo (Optional): { + * String: BinaryData (Required) + * } + * } + * created_at: long (Required) + * updated_at: long (Required) + * progress (Optional): { + * candidates_completed: int (Required) + * best_score: double (Required) + * elapsed_seconds: double (Required) + * } + * warnings (Optional): [ + * String (Optional) + * ] + * } + * } + *+ * + *Response Body Schema
+ * + *+ * {@code + * { + * id: String (Required) + * inputs (Optional): { + * agent (Required): { + * agent_name: String (Required) + * agent_version: String (Optional) + * } + * train_dataset (Required): { + * type: String(inline/reference) (Required) + * } + * validation_dataset (Optional): (recursive schema, see validation_dataset above) + * evaluators (Required): [ + * (Required){ + * name: String (Required) + * version: String (Optional) + * } + * ] + * options (Optional): { + * max_candidates: Integer (Optional) + * optimization_config (Optional): { + * String: BinaryData (Required) + * } + * eval_model: String (Optional) + * optimization_model: String (Optional) + * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) + * } + * } + * result (Optional): { + * baseline: String (Optional) + * best: String (Optional) + * candidates (Optional): [ + * (Optional){ + * candidate_id: String (Optional) + * name: String (Required) + * mutations (Optional): { + * String: BinaryData (Required) + * } + * avg_score: double (Required) + * avg_tokens: double (Required) + * eval_id: String (Optional) + * eval_run_id: String (Optional) + * promotion (Optional): { + * promoted_at: long (Required) + * agent_name: String (Required) + * agent_version: String (Required) + * } + * } + * ] + * } + * status: String(queued/in_progress/succeeded/failed/cancelled) (Required) + * error (Optional): { + * code: String (Required) + * message: String (Required) + * param: String (Optional) + * type: String (Optional) + * details (Optional): [ + * (recursive schema, see above) + * ] + * additionalInfo (Optional): { + * String: BinaryData (Required) + * } + * debugInfo (Optional): { + * String: BinaryData (Required) + * } + * } + * created_at: long (Required) + * updated_at: long (Required) + * progress (Optional): { + * candidates_completed: int (Required) + * best_score: double (Required) + * elapsed_seconds: double (Required) + * } + * warnings (Optional): [ + * String (Optional) + * ] + * } + * } + *+ * + * @param job The job to create. + * @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 {@link PollerFlux} for polling of agent optimization job resource — a long-running job that optimizes + * an agent's configuration (instructions, model, skills, tools) to maximize evaluation scores. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFluxbeginCreateOptimizationJobAsync(BinaryData job, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.createOptimizationJobWithResponseAsync(job, requestOptions), + new com.azure.ai.agents.implementation.OperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{endpoint}".replace("{endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Create an agent optimization job + * + * Creates an optimization job and returns the queued job. Honors `Operation-Id` for idempotent retry. + * Header Parameters
+ *+ *
+ * You can add these to a request with {@link RequestOptions#addHeader} + *Header Parameters + *+ * Name Type Required Description + * Operation-Id String No Client-generated unique ID for idempotent retries. When + * absent, the server creates the job unconditionally. Request Body Schema
+ * + *+ * {@code + * { + * id: String (Required) + * inputs (Optional): { + * agent (Required): { + * agent_name: String (Required) + * agent_version: String (Optional) + * } + * train_dataset (Required): { + * type: String(inline/reference) (Required) + * } + * validation_dataset (Optional): (recursive schema, see validation_dataset above) + * evaluators (Required): [ + * (Required){ + * name: String (Required) + * version: String (Optional) + * } + * ] + * options (Optional): { + * max_candidates: Integer (Optional) + * optimization_config (Optional): { + * String: BinaryData (Required) + * } + * eval_model: String (Optional) + * optimization_model: String (Optional) + * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) + * } + * } + * result (Optional): { + * baseline: String (Optional) + * best: String (Optional) + * candidates (Optional): [ + * (Optional){ + * candidate_id: String (Optional) + * name: String (Required) + * mutations (Optional): { + * String: BinaryData (Required) + * } + * avg_score: double (Required) + * avg_tokens: double (Required) + * eval_id: String (Optional) + * eval_run_id: String (Optional) + * promotion (Optional): { + * promoted_at: long (Required) + * agent_name: String (Required) + * agent_version: String (Required) + * } + * } + * ] + * } + * status: String(queued/in_progress/succeeded/failed/cancelled) (Required) + * error (Optional): { + * code: String (Required) + * message: String (Required) + * param: String (Optional) + * type: String (Optional) + * details (Optional): [ + * (recursive schema, see above) + * ] + * additionalInfo (Optional): { + * String: BinaryData (Required) + * } + * debugInfo (Optional): { + * String: BinaryData (Required) + * } + * } + * created_at: long (Required) + * updated_at: long (Required) + * progress (Optional): { + * candidates_completed: int (Required) + * best_score: double (Required) + * elapsed_seconds: double (Required) + * } + * warnings (Optional): [ + * String (Optional) + * ] + * } + * } + *+ * + *Response Body Schema
+ * + *+ * {@code + * { + * id: String (Required) + * inputs (Optional): { + * agent (Required): { + * agent_name: String (Required) + * agent_version: String (Optional) + * } + * train_dataset (Required): { + * type: String(inline/reference) (Required) + * } + * validation_dataset (Optional): (recursive schema, see validation_dataset above) + * evaluators (Required): [ + * (Required){ + * name: String (Required) + * version: String (Optional) + * } + * ] + * options (Optional): { + * max_candidates: Integer (Optional) + * optimization_config (Optional): { + * String: BinaryData (Required) + * } + * eval_model: String (Optional) + * optimization_model: String (Optional) + * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) + * } + * } + * result (Optional): { + * baseline: String (Optional) + * best: String (Optional) + * candidates (Optional): [ + * (Optional){ + * candidate_id: String (Optional) + * name: String (Required) + * mutations (Optional): { + * String: BinaryData (Required) + * } + * avg_score: double (Required) + * avg_tokens: double (Required) + * eval_id: String (Optional) + * eval_run_id: String (Optional) + * promotion (Optional): { + * promoted_at: long (Required) + * agent_name: String (Required) + * agent_version: String (Required) + * } + * } + * ] + * } + * status: String(queued/in_progress/succeeded/failed/cancelled) (Required) + * error (Optional): { + * code: String (Required) + * message: String (Required) + * param: String (Optional) + * type: String (Optional) + * details (Optional): [ + * (recursive schema, see above) + * ] + * additionalInfo (Optional): { + * String: BinaryData (Required) + * } + * debugInfo (Optional): { + * String: BinaryData (Required) + * } + * } + * created_at: long (Required) + * updated_at: long (Required) + * progress (Optional): { + * candidates_completed: int (Required) + * best_score: double (Required) + * elapsed_seconds: double (Required) + * } + * warnings (Optional): [ + * String (Optional) + * ] + * } + * } + *+ * + * @param job The job to create. + * @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 {@link SyncPoller} for polling of agent optimization job resource — a long-running job that optimizes + * an agent's configuration (instructions, model, skills, tools) to maximize evaluation scores. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPollerbeginCreateOptimizationJob(BinaryData job, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.createOptimizationJobWithResponse(job, requestOptions), + new com.azure.ai.agents.implementation.SyncOperationLocationPollingStrategy<>( + new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("{endpoint}".replace("{endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion()), + "result"), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Get an agent optimization job + * + * Retrieves an optimization job by its identifier. * Response Body Schema
* *@@ -607,6 +1440,7 @@ public ResponsecreateOptimizationJobWithResponse(BinaryData job, Re * eval_model: String (Optional) * optimization_model: String (Optional) * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) * } * } * result (Optional): { @@ -667,9 +1501,10 @@ public Response createOptimizationJobWithResponse(BinaryData job, Re * @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 info about an agent optimization job. + * @return an agent optimization job * - * Get an optimization job by id along with {@link Response} on successful completion of {@link Mono}. + * Retrieves an optimization job by its identifier along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono > getOptimizationJobWithResponseAsync(String jobId, RequestOptions requestOptions) { @@ -679,9 +1514,9 @@ public Mono > getOptimizationJobWithResponseAsync(String job } /** - * Get info about an agent optimization job. + * Get an agent optimization job * - * Get an optimization job by id. + * Retrieves an optimization job by its identifier. * Response Body Schema
* *@@ -711,6 +1546,7 @@ public Mono> getOptimizationJobWithResponseAsync(String job * eval_model: String (Optional) * optimization_model: String (Optional) * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) * } * } * result (Optional): { @@ -771,9 +1607,9 @@ public Mono > getOptimizationJobWithResponseAsync(String job * @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 info about an agent optimization job. + * @return an agent optimization job * - * Get an optimization job by id along with {@link Response}. + * Retrieves an optimization job by its identifier along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getOptimizationJobWithResponse(String jobId, RequestOptions requestOptions) { @@ -783,9 +1619,9 @@ public Response getOptimizationJobWithResponse(String jobId, Request } /** - * Returns a list of agent optimization jobs. + * List agent optimization jobs * - * List optimization jobs. Supports cursor pagination and optional status / agent_name filters. + * Lists optimization jobs with cursor pagination and optional status or agent name filters. * Query Parameters
**
Query Parameters @@ -865,9 +1701,9 @@ private Mono> listOptimizationJobsSinglePageAsync(Requ } /** - * Returns a list of agent optimization jobs. + * List agent optimization jobs * - * List optimization jobs. Supports cursor pagination and optional status / agent_name filters. + * Lists optimization jobs with cursor pagination and optional status or agent name filters. * Query Parameters
**
Query Parameters @@ -941,9 +1777,9 @@ public PagedFluxlistOptimizationJobsAsync(RequestOptions requestOpt } /** - * Returns a list of agent optimization jobs. + * List agent optimization jobs * - * List optimization jobs. Supports cursor pagination and optional status / agent_name filters. + * Lists optimization jobs with cursor pagination and optional status or agent name filters. * Query Parameters
**
Query Parameters @@ -1021,9 +1857,9 @@ private PagedResponselistOptimizationJobsSinglePage(RequestOptions } /** - * Returns a list of agent optimization jobs. + * List agent optimization jobs * - * List optimization jobs. Supports cursor pagination and optional status / agent_name filters. + * Lists optimization jobs with cursor pagination and optional status or agent name filters. * Query Parameters
**
Query Parameters @@ -1097,9 +1933,9 @@ public PagedIterablelistOptimizationJobs(RequestOptions requestOpti } /** - * Cancels an agent optimization job. + * Cancel an agent optimization job * - * Request cancellation of a running or queued job. Returns an error if the job is already in a terminal state. + * Requests cancellation of a running or queued job and returns an error if the job is already in a terminal state. * Response Body Schema
* *@@ -1129,6 +1965,7 @@ public PagedIterablelistOptimizationJobs(RequestOptions requestOpti * eval_model: String (Optional) * optimization_model: String (Optional) * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) * } * } * result (Optional): { @@ -1202,9 +2039,9 @@ public Mono > cancelOptimizationJobWithResponseAsync(String } /** - * Cancels an agent optimization job. + * Cancel an agent optimization job * - * Request cancellation of a running or queued job. Returns an error if the job is already in a terminal state. + * Requests cancellation of a running or queued job and returns an error if the job is already in a terminal state. * Response Body Schema
* *@@ -1234,6 +2071,7 @@ public Mono> cancelOptimizationJobWithResponseAsync(String * eval_model: String (Optional) * optimization_model: String (Optional) * evaluation_level: String(turn/conversation) (Optional) + * max_stalls: Integer (Optional) * } * } * result (Optional): { @@ -1305,9 +2143,9 @@ public Response cancelOptimizationJobWithResponse(String jobId, Requ } /** - * Deletes an agent optimization job. + * Delete an agent optimization job * - * Delete the job and its candidate artifacts. Cancels first if non-terminal. + * Deletes the job and its candidate artifacts, canceling the job first if it is non-terminal. * * @param jobId The ID of the job to delete. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1324,9 +2162,9 @@ public Mono > deleteOptimizationJobWithResponseAsync(String jobId, } /** - * Deletes an agent optimization job. + * Delete an agent optimization job * - * Delete the job and its candidate artifacts. Cancels first if non-terminal. + * Deletes the job and its candidate artifacts, canceling the job first if it is non-terminal. * * @param jobId The ID of the job to delete. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1342,20 +2180,26 @@ public Response deleteOptimizationJobWithResponse(String jobId, RequestOpt this.client.getServiceVersion().getVersion(), requestOptions, Context.NONE); } - private List getValues(BinaryData binaryData, String path) { + private List getValues(BinaryData binaryData, String... path) { try { - Map, ?> obj = binaryData.toObject(Map.class); - List> values = (List>) obj.get(path); + Object value = binaryData.toObject(Map.class); + for (String segment : path) { + value = ((Map, ?>) value).get(segment); + } + List> values = (List>) value; return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); } catch (RuntimeException e) { return null; } } - private String getNextLink(BinaryData binaryData, String path) { + private String getNextLink(BinaryData binaryData, String... path) { try { - Map, ?> obj = binaryData.toObject(Map.class); - return (String) obj.get(path); + Object value = binaryData.toObject(Map.class); + for (String segment : path) { + value = ((Map, ?>) value).get(segment); + } + return (String) value; } catch (RuntimeException e) { return null; } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/BetaMemoryStoresImpl.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/BetaMemoryStoresImpl.java index 7ec942f53c5d..a0d5f5f6d079 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/BetaMemoryStoresImpl.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/BetaMemoryStoresImpl.java @@ -1060,6 +1060,7 @@ public Response internalDeleteMemoryStoreWithResponse(String name, R * input_tokens: long (Required) * input_tokens_details (Required): { * cached_tokens: long (Required) + * cache_write_tokens: long (Required) * } * output_tokens: long (Required) * output_tokens_details (Required): { @@ -1133,6 +1134,7 @@ public Mono > internalSearchMemoriesWithResponseAsync(String * input_tokens: long (Required) * input_tokens_details (Required): { * cached_tokens: long (Required) + * cache_write_tokens: long (Required) * } * output_tokens: long (Required) * output_tokens_details (Required): { @@ -1209,6 +1211,7 @@ public Response internalSearchMemoriesWithResponse(String name, Bina * input_tokens: long (Required) * input_tokens_details (Required): { * cached_tokens: long (Required) + * cache_write_tokens: long (Required) * } * output_tokens: long (Required) * output_tokens_details (Required): { @@ -1302,6 +1305,7 @@ private Mono > internalUpdateMemoriesWithResponseAsync(Strin * input_tokens: long (Required) * input_tokens_details (Required): { * cached_tokens: long (Required) + * cache_write_tokens: long (Required) * } * output_tokens: long (Required) * output_tokens_details (Required): { @@ -1394,6 +1398,7 @@ private Response internalUpdateMemoriesWithResponse(String name, Bin * input_tokens: long (Required) * input_tokens_details (Required): { * cached_tokens: long (Required) + * cache_write_tokens: long (Required) * } * output_tokens: long (Required) * output_tokens_details (Required): { @@ -1494,6 +1499,7 @@ private Response internalUpdateMemoriesWithResponse(String name, Bin * input_tokens: long (Required) * input_tokens_details (Required): { * cached_tokens: long (Required) + * cache_write_tokens: long (Required) * } * output_tokens: long (Required) * output_tokens_details (Required): { @@ -1593,6 +1599,7 @@ public SyncPoller b * input_tokens: long (Required) * input_tokens_details (Required): { * cached_tokens: long (Required) + * cache_write_tokens: long (Required) * } * output_tokens: long (Required) * output_tokens_details (Required): { @@ -1691,6 +1698,7 @@ public PollerFlux beginInternalUpdateMemoriesAsync(Strin * input_tokens: long (Required) * input_tokens_details (Required): { * cached_tokens: long (Required) + * cache_write_tokens: long (Required) * } * output_tokens: long (Required) * output_tokens_details (Required): { @@ -1773,6 +1781,7 @@ public SyncPoller beginInternalUpdateMemories(String nam * input_tokens: long (Required) * input_tokens_details (Required): { * cached_tokens: long (Required) + * cache_write_tokens: long (Required) * } * output_tokens: long (Required) * output_tokens_details (Required): { @@ -1850,6 +1859,7 @@ public Mono > getUpdateResultWithResponseAsync(String name, * input_tokens: long (Required) * input_tokens_details (Required): { * cached_tokens: long (Required) + * cache_write_tokens: long (Required) * } * output_tokens: long (Required) * output_tokens_details (Required): { @@ -2597,20 +2607,26 @@ public Response internalDeleteMemoryWithResponse(String name, String this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } - private List getValues(BinaryData binaryData, String path) { + private List getValues(BinaryData binaryData, String... path) { try { - Map, ?> obj = binaryData.toObject(Map.class); - List> values = (List>) obj.get(path); + Object value = binaryData.toObject(Map.class); + for (String segment : path) { + value = ((Map, ?>) value).get(segment); + } + List> values = (List>) value; return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); } catch (RuntimeException e) { return null; } } - private String getNextLink(BinaryData binaryData, String path) { + private String getNextLink(BinaryData binaryData, String... path) { try { - Map, ?> obj = binaryData.toObject(Map.class); - return (String) obj.get(path); + Object value = binaryData.toObject(Map.class); + for (String segment : path) { + value = ((Map, ?>) value).get(segment); + } + return (String) value; } catch (RuntimeException e) { return null; } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/OperationLocationPollingStrategy.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/OperationLocationPollingStrategy.java index 6dc846c0de9b..f07bb0e69d2a 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/OperationLocationPollingStrategy.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/OperationLocationPollingStrategy.java @@ -56,8 +56,7 @@ public OperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOp * @throws NullPointerException if {@code pollingStrategyOptions} is null. */ public OperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions, String propertyName) { - super(PollingUtils.OPERATION_LOCATION_HEADER, - AgentsServicePollUtils.withFoundryFeatures(pollingStrategyOptions)); + super(PollingUtils.OPERATION_LOCATION_HEADER, pollingStrategyOptions); this.propertyName = propertyName; this.endpoint = pollingStrategyOptions.getEndpoint(); this.serializer = pollingStrategyOptions.getSerializer() != null diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/SyncOperationLocationPollingStrategy.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/SyncOperationLocationPollingStrategy.java index 5d8c3582180f..53d935775f63 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/SyncOperationLocationPollingStrategy.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/SyncOperationLocationPollingStrategy.java @@ -57,8 +57,7 @@ public SyncOperationLocationPollingStrategy(PollingStrategyOptions pollingStrate * @throws NullPointerException if {@code pollingStrategyOptions} is null. */ public SyncOperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions, String propertyName) { - super(PollingUtils.OPERATION_LOCATION_HEADER, - AgentsServicePollUtils.withFoundryFeatures(pollingStrategyOptions)); + super(PollingUtils.OPERATION_LOCATION_HEADER, pollingStrategyOptions); this.propertyName = propertyName; this.endpoint = pollingStrategyOptions.getEndpoint(); this.serializer = pollingStrategyOptions.getSerializer() != null diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/ToolboxesImpl.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/ToolboxesImpl.java index 5b95381f5988..aa64e68052d7 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/ToolboxesImpl.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/ToolboxesImpl.java @@ -262,7 +262,7 @@ Response deleteToolboxVersionSync(@HostParam("endpoint") String endpoint, * } * tools (Required): [ * (Required){ - * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview) (Required) + * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview) (Required) * name: String (Optional) * description: String (Optional) * tool_configs (Optional): { @@ -302,7 +302,7 @@ Response deleteToolboxVersionSync(@HostParam("endpoint") String endpoint, * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview) (Required) + * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview) (Required) * name: String (Optional) * description: String (Optional) * tool_configs (Optional): { @@ -361,7 +361,7 @@ public Mono > createToolboxVersionWithResponseAsync(String n * } * tools (Required): [ * (Required){ - * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview) (Required) + * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview) (Required) * name: String (Optional) * description: String (Optional) * tool_configs (Optional): { @@ -401,7 +401,7 @@ public Mono > createToolboxVersionWithResponseAsync(String n * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview) (Required) + * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview) (Required) * name: String (Optional) * description: String (Optional) * tool_configs (Optional): { @@ -749,7 +749,7 @@ public PagedIterable listToolboxes(RequestOptions requestOptions) { * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview) (Required) + * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview) (Required) * name: String (Optional) * description: String (Optional) * tool_configs (Optional): { @@ -833,7 +833,7 @@ private Mono > listToolboxVersionsSinglePageAsync(Strin * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview) (Required) + * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview) (Required) * name: String (Optional) * description: String (Optional) * tool_configs (Optional): { @@ -910,7 +910,7 @@ public PagedFlux listToolboxVersionsAsync(String name, RequestOption * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview) (Required) + * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview) (Required) * name: String (Optional) * description: String (Optional) * tool_configs (Optional): { @@ -991,7 +991,7 @@ private PagedResponse listToolboxVersionsSinglePage(String name, Req * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview) (Required) + * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview) (Required) * name: String (Optional) * description: String (Optional) * tool_configs (Optional): { @@ -1048,7 +1048,7 @@ public PagedIterable listToolboxVersions(String name, RequestOptions * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview) (Required) + * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview) (Required) * name: String (Optional) * description: String (Optional) * tool_configs (Optional): { @@ -1109,7 +1109,7 @@ public Mono > getToolboxVersionWithResponseAsync(String name * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview) (Required) + * type: String(code_interpreter/file_search/web_search/mcp/azure_ai_search/openapi/a2a_preview/browser_automation_preview/reminder_preview/work_iq_preview/fabric_iq_preview/toolbox_search/toolbox_search_preview) (Required) * name: String (Optional) * description: String (Optional) * tool_configs (Optional): { @@ -1320,20 +1320,26 @@ public Response deleteToolboxVersionWithResponse(String name, String versi this.client.getServiceVersion().getVersion(), requestOptions, Context.NONE); } - private List getValues(BinaryData binaryData, String path) { + private List getValues(BinaryData binaryData, String... path) { try { - Map, ?> obj = binaryData.toObject(Map.class); - List> values = (List>) obj.get(path); + Object value = binaryData.toObject(Map.class); + for (String segment : path) { + value = ((Map, ?>) value).get(segment); + } + List> values = (List>) value; return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); } catch (RuntimeException e) { return null; } } - private String getNextLink(BinaryData binaryData, String path) { + private String getNextLink(BinaryData binaryData, String... path) { try { - Map, ?> obj = binaryData.toObject(Map.class); - return (String) obj.get(path); + Object value = binaryData.toObject(Map.class); + for (String segment : path) { + value = ((Map, ?>) value).get(segment); + } + return (String) value; } catch (RuntimeException e) { return null; } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2APreviewTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2APreviewTool.java index 5799d2ef62c2..2af49d62266f 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2APreviewTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2APreviewTool.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.models; +import com.azure.ai.agents.implementation.utils.Beta; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.azure.json.JsonReader; @@ -14,6 +15,7 @@ * An agent implementing the A2A protocol. */ @Fluent +@Beta(warningText = "Preview API. preview_tool") public final class A2APreviewTool extends Tool { /* diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2APreviewToolboxTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2APreviewToolboxTool.java index 3a41d946d56f..893bb398afbb 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2APreviewToolboxTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2APreviewToolboxTool.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.models; +import com.azure.ai.agents.implementation.utils.Beta; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.azure.json.JsonReader; @@ -15,6 +16,7 @@ * An A2A tool stored in a toolbox. */ @Fluent +@Beta(warningText = "Preview API. preview_tool") public final class A2APreviewToolboxTool extends ToolboxTool { /* diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2AToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2AToolCall.java index 5a49fbba0373..1212c02e5309 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2AToolCall.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2AToolCall.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.models; +import com.azure.ai.agents.implementation.utils.Beta; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -15,6 +16,7 @@ * An A2A (Agent-to-Agent) tool call. */ @Immutable +@Beta(warningText = "Preview API. preview_tool") public final class A2AToolCall implements JsonSerializable { /* diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2AToolCallOutput.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2AToolCallOutput.java index 5c7c8e518553..b19790e724a7 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2AToolCallOutput.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2AToolCallOutput.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.models; +import com.azure.ai.agents.implementation.utils.Beta; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.azure.core.util.BinaryData; @@ -16,6 +17,7 @@ * The output of an A2A (Agent-to-Agent) tool call. */ @Fluent +@Beta(warningText = "Preview API. preview_tool") public final class A2AToolCallOutput implements JsonSerializable { /* diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentDefinition.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentDefinition.java index d4a5d4667ce4..bd2b34456daa 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentDefinition.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentDefinition.java @@ -3,7 +3,6 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.models; -import com.azure.ai.agents.implementation.utils.Beta; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.azure.json.JsonReader; @@ -16,7 +15,6 @@ * The AgentDefinition model. */ @Fluent -@Beta(warningText = "Preview API. DraftAgents=V1Preview, ExternalAgents=V1Preview, WorkflowAgents=V1Preview") public class AgentDefinition implements JsonSerializable { /* diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentIdentity.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentIdentity.java index a07fe8a68e3c..53b8c8b19b09 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentIdentity.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentIdentity.java @@ -70,6 +70,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("principal_id", this.principalId); jsonWriter.writeStringField("client_id", this.clientId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); return jsonWriter.writeEndObject(); } @@ -87,6 +88,7 @@ public static AgentIdentity fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String principalId = null; String clientId = null; + AgentIdentityStatus status = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -94,11 +96,32 @@ public static AgentIdentity fromJson(JsonReader jsonReader) throws IOException { principalId = reader.getString(); } else if ("client_id".equals(fieldName)) { clientId = reader.getString(); + } else if ("status".equals(fieldName)) { + status = AgentIdentityStatus.fromString(reader.getString()); } else { reader.skipChildren(); } } - return new AgentIdentity(principalId, clientId); + AgentIdentity deserializedAgentIdentity = new AgentIdentity(principalId, clientId); + deserializedAgentIdentity.status = status; + return deserializedAgentIdentity; }); } + + /* + * The status of the agent identity. Present for both the agent instance identity and the agent blueprint. + */ + @Generated + private AgentIdentityStatus status; + + /** + * Get the status property: The status of the agent identity. Present for both the agent instance identity and the + * agent blueprint. + * + * @return the status value. + */ + @Generated + public AgentIdentityStatus getStatus() { + return this.status; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentIdentityStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentIdentityStatus.java new file mode 100644 index 000000000000..15d0592561af --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentIdentityStatus.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.agents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of an agent identity, applicable to both the agent instance identity and the agent blueprint. + */ +public final class AgentIdentityStatus extends ExpandableStringEnum { + + /** + * The agent identity is active and can be used to access resources. + */ + @Generated + public static final AgentIdentityStatus ACTIVE = fromString("active"); + + /** + * The agent identity is disabled and cannot be used to access resources. + */ + @Generated + public static final AgentIdentityStatus DISABLED = fromString("disabled"); + + /** + * Creates a new instance of AgentIdentityStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public AgentIdentityStatus() { + } + + /** + * Creates or finds a AgentIdentityStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AgentIdentityStatus. + */ + @Generated + public static AgentIdentityStatus fromString(String name) { + return fromString(name, AgentIdentityStatus.class); + } + + /** + * Gets known AgentIdentityStatus values. + * + * @return known AgentIdentityStatus values. + */ + @Generated + public static Collection values() { + return values(AgentIdentityStatus.class); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchToolParameter.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchToolParameter.java index 12380ef7b574..72f7556f0659 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchToolParameter.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchToolParameter.java @@ -3,19 +3,20 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.models; +import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.List; /** * Apply patch tool * * Allows the assistant to create, delete, or update files using unified diffs. */ -@Immutable +@Fluent public final class ApplyPatchToolParameter extends Tool { /* @@ -50,6 +51,8 @@ public ToolType getType() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeArrayField("allowed_callers", this.allowedCallers, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); return jsonWriter.writeEndObject(); } @@ -70,6 +73,10 @@ public static ApplyPatchToolParameter fromJson(JsonReader jsonReader) throws IOE reader.nextToken(); if ("type".equals(fieldName)) { deserializedApplyPatchToolParameter.type = ToolType.fromString(reader.getString()); + } else if ("allowed_callers".equals(fieldName)) { + List allowedCallers + = reader.readArray(reader1 -> CallableToolAllowedCaller.fromString(reader1.getString())); + deserializedApplyPatchToolParameter.allowedCallers = allowedCallers; } else { reader.skipChildren(); } @@ -77,4 +84,32 @@ public static ApplyPatchToolParameter fromJson(JsonReader jsonReader) throws IOE return deserializedApplyPatchToolParameter; }); } + + /* + * The allowed_callers property. + */ + @Generated + private List allowedCallers; + + /** + * Get the allowedCallers property: The allowed_callers property. + * + * @return the allowedCallers value. + */ + @Generated + public List getAllowedCallers() { + return this.allowedCallers; + } + + /** + * Set the allowedCallers property: The allowed_callers property. + * + * @param allowedCallers the allowedCallers value to set. + * @return the ApplyPatchToolParameter object itself. + */ + @Generated + public ApplyPatchToolParameter setAllowedCallers(List allowedCallers) { + this.allowedCallers = allowedCallers; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureCreateResponseOptions.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureCreateResponseOptions.java index adfba6066b20..78e21d1ec267 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureCreateResponseOptions.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureCreateResponseOptions.java @@ -100,6 +100,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { element.writeTo(writer); } }); + jsonWriter.writeJsonField("user_security_context", this.userSecurityContext); return jsonWriter.writeEndObject(); } @@ -124,6 +125,9 @@ public static AzureCreateResponseOptions fromJson(JsonReader jsonReader) throws Map structuredInputs = reader.readMap(reader1 -> reader1 .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); deserializedAzureCreateResponseOptions.structuredInputs = structuredInputs; + } else if ("user_security_context".equals(fieldName)) { + deserializedAzureCreateResponseOptions.userSecurityContext + = AzureUserSecurityContext.fromJson(reader); } else { reader.skipChildren(); } @@ -131,4 +135,44 @@ public static AzureCreateResponseOptions fromJson(JsonReader jsonReader) throws return deserializedAzureCreateResponseOptions; }); } + + /* + * User security context contains several parameters that describe the application itself, and the end user that + * interacts with the application. These fields assist your security operations teams to investigate and mitigate + * security incidents by providing a comprehensive approach to protecting your AI applications. [Learn + * more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft + * Defender for Cloud. + */ + @Generated + private AzureUserSecurityContext userSecurityContext; + + /** + * Get the userSecurityContext property: User security context contains several parameters that describe the + * application itself, and the end user that interacts with the application. These fields assist your security + * operations teams to investigate and mitigate security incidents by providing a comprehensive approach to + * protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting + * AI applications using Microsoft Defender for Cloud. + * + * @return the userSecurityContext value. + */ + @Generated + public AzureUserSecurityContext getUserSecurityContext() { + return this.userSecurityContext; + } + + /** + * Set the userSecurityContext property: User security context contains several parameters that describe the + * application itself, and the end user that interacts with the application. These fields assist your security + * operations teams to investigate and mitigate security incidents by providing a comprehensive approach to + * protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting + * AI applications using Microsoft Defender for Cloud. + * + * @param userSecurityContext the userSecurityContext value to set. + * @return the AzureCreateResponseOptions object itself. + */ + @Generated + public AzureCreateResponseOptions setUserSecurityContext(AzureUserSecurityContext userSecurityContext) { + this.userSecurityContext = userSecurityContext; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureUserSecurityContext.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureUserSecurityContext.java new file mode 100644 index 000000000000..01230513a1cf --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureUserSecurityContext.java @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.agents.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * User security context contains several parameters that describe the application itself, and the end user that + * interacts with the application. These fields assist your security operations teams to investigate and mitigate + * security incidents by providing a comprehensive approach to protecting your AI applications. [Learn + * more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender + * for Cloud. + */ +@Fluent +public final class AzureUserSecurityContext implements JsonSerializable { + + /* + * The name of the application. Sensitive personal information should not be included in this field. + */ + @Generated + private String applicationName; + + /* + * This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate + * end-users within the generative AI application. Sensitive personal information should not be included in this + * field. + */ + @Generated + private String endUserId; + + /* + * The Microsoft 365 tenant ID the end user belongs to. It's required when the generative AI application is + * multitenant. + */ + @Generated + private String endUserTenantId; + + /* + * Captures the original client's IP address. + */ + @Generated + private String sourceIp; + + /** + * Creates an instance of AzureUserSecurityContext class. + */ + @Generated + public AzureUserSecurityContext() { + } + + /** + * Get the applicationName property: The name of the application. Sensitive personal information should not be + * included in this field. + * + * @return the applicationName value. + */ + @Generated + public String getApplicationName() { + return this.applicationName; + } + + /** + * Set the applicationName property: The name of the application. Sensitive personal information should not be + * included in this field. + * + * @param applicationName the applicationName value to set. + * @return the AzureUserSecurityContext object itself. + */ + @Generated + public AzureUserSecurityContext setApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get the endUserId property: This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user + * object ID used to authenticate end-users within the generative AI application. Sensitive personal information + * should not be included in this field. + * + * @return the endUserId value. + */ + @Generated + public String getEndUserId() { + return this.endUserId; + } + + /** + * Set the endUserId property: This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user + * object ID used to authenticate end-users within the generative AI application. Sensitive personal information + * should not be included in this field. + * + * @param endUserId the endUserId value to set. + * @return the AzureUserSecurityContext object itself. + */ + @Generated + public AzureUserSecurityContext setEndUserId(String endUserId) { + this.endUserId = endUserId; + return this; + } + + /** + * Get the endUserTenantId property: The Microsoft 365 tenant ID the end user belongs to. It's required when the + * generative AI application is multitenant. + * + * @return the endUserTenantId value. + */ + @Generated + public String getEndUserTenantId() { + return this.endUserTenantId; + } + + /** + * Set the endUserTenantId property: The Microsoft 365 tenant ID the end user belongs to. It's required when the + * generative AI application is multitenant. + * + * @param endUserTenantId the endUserTenantId value to set. + * @return the AzureUserSecurityContext object itself. + */ + @Generated + public AzureUserSecurityContext setEndUserTenantId(String endUserTenantId) { + this.endUserTenantId = endUserTenantId; + return this; + } + + /** + * Get the sourceIp property: Captures the original client's IP address. + * + * @return the sourceIp value. + */ + @Generated + public String getSourceIp() { + return this.sourceIp; + } + + /** + * Set the sourceIp property: Captures the original client's IP address. + * + * @param sourceIp the sourceIp value to set. + * @return the AzureUserSecurityContext object itself. + */ + @Generated + public AzureUserSecurityContext setSourceIp(String sourceIp) { + this.sourceIp = sourceIp; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("application_name", this.applicationName); + jsonWriter.writeStringField("end_user_id", this.endUserId); + jsonWriter.writeStringField("end_user_tenant_id", this.endUserTenantId); + jsonWriter.writeStringField("source_ip", this.sourceIp); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureUserSecurityContext from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureUserSecurityContext if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AzureUserSecurityContext. + */ + @Generated + public static AzureUserSecurityContext fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureUserSecurityContext deserializedAzureUserSecurityContext = new AzureUserSecurityContext(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("application_name".equals(fieldName)) { + deserializedAzureUserSecurityContext.applicationName = reader.getString(); + } else if ("end_user_id".equals(fieldName)) { + deserializedAzureUserSecurityContext.endUserId = reader.getString(); + } else if ("end_user_tenant_id".equals(fieldName)) { + deserializedAzureUserSecurityContext.endUserTenantId = reader.getString(); + } else if ("source_ip".equals(fieldName)) { + deserializedAzureUserSecurityContext.sourceIp = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedAzureUserSecurityContext; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchConfiguration.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchConfiguration.java index 91d8e3bc633a..88416f28defa 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchConfiguration.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchConfiguration.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.models; +import com.azure.ai.agents.implementation.utils.Beta; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.azure.json.JsonReader; @@ -15,6 +16,7 @@ * A bing custom search configuration. */ @Fluent +@Beta(warningText = "Preview API. preview_tool") public final class BingCustomSearchConfiguration implements JsonSerializable { /* diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchPreviewTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchPreviewTool.java index 624f62aa3864..c9a07a06b454 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchPreviewTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchPreviewTool.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.models; +import com.azure.ai.agents.implementation.utils.Beta; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -14,6 +15,7 @@ * The input definition information for a Bing custom search tool as used to configure an agent. */ @Immutable +@Beta(warningText = "Preview API. preview_tool") public final class BingCustomSearchPreviewTool extends Tool { /* diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchToolCall.java index 56ad1b6713cf..60a657f6e13f 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchToolCall.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchToolCall.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.models; +import com.azure.ai.agents.implementation.utils.Beta; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -15,6 +16,7 @@ * A Bing custom search tool call. */ @Immutable +@Beta(warningText = "Preview API. preview_tool") public final class BingCustomSearchToolCall implements JsonSerializable { /* diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchToolCallOutput.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchToolCallOutput.java index 3150656bb66c..b76d4d7352b9 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchToolCallOutput.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchToolCallOutput.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.models; +import com.azure.ai.agents.implementation.utils.Beta; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.azure.core.util.BinaryData; @@ -16,6 +17,7 @@ * The output of a Bing custom search tool call. */ @Fluent +@Beta(warningText = "Preview API. preview_tool") public final class BingCustomSearchToolCallOutput implements JsonSerializable { /* diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchToolParameters.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchToolParameters.java index 76b80fad578b..d1a2c1fb2ad7 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchToolParameters.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchToolParameters.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.models; +import com.azure.ai.agents.implementation.utils.Beta; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -16,6 +17,7 @@ * The bing custom search tool parameters. */ @Immutable +@Beta(warningText = "Preview API. preview_tool") public final class BingCustomSearchToolParameters implements JsonSerializable { /* diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationPreviewTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationPreviewTool.java index 5e5867c33e7b..0ed9792c1cc0 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationPreviewTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationPreviewTool.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.models; +import com.azure.ai.agents.implementation.utils.Beta; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -14,6 +15,7 @@ * The input definition information for a Browser Automation Tool, as used to configure an Agent. */ @Immutable +@Beta(warningText = "Preview API. preview_tool") public final class BrowserAutomationPreviewTool extends Tool { /* diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationPreviewToolboxTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationPreviewToolboxTool.java index 3f76ce57039c..4ead661c6559 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationPreviewToolboxTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationPreviewToolboxTool.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.models; +import com.azure.ai.agents.implementation.utils.Beta; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.azure.json.JsonReader; @@ -15,6 +16,7 @@ * A browser automation tool stored in a toolbox. */ @Fluent +@Beta(warningText = "Preview API. preview_tool") public final class BrowserAutomationPreviewToolboxTool extends ToolboxTool { /* diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationToolCall.java index cffa1cbdc749..3fb3fe20d9b7 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationToolCall.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationToolCall.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.models; +import com.azure.ai.agents.implementation.utils.Beta; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -15,6 +16,7 @@ * A browser automation tool call. */ @Immutable +@Beta(warningText = "Preview API. preview_tool") public final class BrowserAutomationToolCall implements JsonSerializable { /* diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationToolCallOutput.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationToolCallOutput.java index 83b824ace482..2649123f61a5 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationToolCallOutput.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationToolCallOutput.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.models; +import com.azure.ai.agents.implementation.utils.Beta; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.azure.core.util.BinaryData; @@ -16,6 +17,7 @@ * The output of a browser automation tool call. */ @Fluent +@Beta(warningText = "Preview API. preview_tool") public final class BrowserAutomationToolCallOutput implements JsonSerializable { /* diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationToolConnectionParameters.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationToolConnectionParameters.java index 2ec768f9d3bf..729740a0a935 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationToolConnectionParameters.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationToolConnectionParameters.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.models; +import com.azure.ai.agents.implementation.utils.Beta; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -15,6 +16,7 @@ * Definition of input parameters for the connection used by the Browser Automation Tool. */ @Immutable +@Beta(warningText = "Preview API. preview_tool") public final class BrowserAutomationToolConnectionParameters implements JsonSerializable { diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationToolParameters.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationToolParameters.java index 72280f17ef86..9f0bb642fb58 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationToolParameters.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationToolParameters.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.models; +import com.azure.ai.agents.implementation.utils.Beta; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -15,6 +16,7 @@ * Definition of input parameters for the Browser Automation Tool. */ @Immutable +@Beta(warningText = "Preview API. preview_tool") public final class BrowserAutomationToolParameters implements JsonSerializable { /* diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CallableToolAllowedCaller.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CallableToolAllowedCaller.java new file mode 100644 index 000000000000..fda729b58f4d --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CallableToolAllowedCaller.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.agents.models; + +/** + * Defines values for CallableToolAllowedCaller. + */ +public enum CallableToolAllowedCaller { + /** + * Enum value direct. + */ + DIRECT("direct"), + + /** + * Enum value programmatic. + */ + PROGRAMMATIC("programmatic"); + + /** + * The actual serialized value for a CallableToolAllowedCaller instance. + */ + private final String value; + + CallableToolAllowedCaller(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a CallableToolAllowedCaller instance. + * + * @param value the serialized value to parse. + * @return the parsed CallableToolAllowedCaller object, or null if unable to parse. + */ + public static CallableToolAllowedCaller fromString(String value) { + if (value == null) { + return null; + } + CallableToolAllowedCaller[] items = CallableToolAllowedCaller.values(); + for (CallableToolAllowedCaller item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterTool.java index 063dc6db6934..a570d2083f30 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterTool.java @@ -10,6 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.List; import java.util.Map; /** @@ -67,6 +68,8 @@ BinaryData getContainer() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeArrayField("allowed_callers", this.allowedCallers, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); jsonWriter.writeStringField("name", this.name); jsonWriter.writeStringField("description", this.description); jsonWriter.writeMapField("tool_configs", this.toolConfigs, (writer, element) -> writer.writeJson(element)); @@ -94,6 +97,10 @@ public static CodeInterpreterTool fromJson(JsonReader jsonReader) throws IOExcep reader.nextToken(); if ("type".equals(fieldName)) { deserializedCodeInterpreterTool.type = ToolType.fromString(reader.getString()); + } else if ("allowed_callers".equals(fieldName)) { + List allowedCallers + = reader.readArray(reader1 -> CallableToolAllowedCaller.fromString(reader1.getString())); + deserializedCodeInterpreterTool.allowedCallers = allowedCallers; } else if ("name".equals(fieldName)) { deserializedCodeInterpreterTool.name = reader.getString(); } else if ("description".equals(fieldName)) { @@ -279,4 +286,32 @@ public CodeInterpreterTool setToolConfigs(Map toolConfigs) { this.toolConfigs = toolConfigs; return this; } + + /* + * The allowed_callers property. + */ + @Generated + private List allowedCallers; + + /** + * Get the allowedCallers property: The allowed_callers property. + * + * @return the allowedCallers value. + */ + @Generated + public List getAllowedCallers() { + return this.allowedCallers; + } + + /** + * Set the allowedCallers property: The allowed_callers property. + * + * @param allowedCallers the allowedCallers value to set. + * @return the CodeInterpreterTool object itself. + */ + @Generated + public CodeInterpreterTool setAllowedCallers(List allowedCallers) { + this.allowedCallers = allowedCallers; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterToolboxTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterToolboxTool.java index ec0d45c99fe6..8d05b5c50208 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterToolboxTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterToolboxTool.java @@ -10,6 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.List; import java.util.Map; /** @@ -120,6 +121,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("description", getDescription()); jsonWriter.writeMapField("tool_configs", getToolConfigs(), (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeArrayField("allowed_callers", this.allowedCallers, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); if (this.container != null) { jsonWriter.writeFieldName("container"); this.container.writeTo(jsonWriter); @@ -151,6 +154,10 @@ public static CodeInterpreterToolboxTool fromJson(JsonReader jsonReader) throws deserializedCodeInterpreterToolboxTool.setToolConfigs(toolConfigs); } else if ("type".equals(fieldName)) { deserializedCodeInterpreterToolboxTool.type = ToolboxToolType.fromString(reader.getString()); + } else if ("allowed_callers".equals(fieldName)) { + List allowedCallers + = reader.readArray(reader1 -> CallableToolAllowedCaller.fromString(reader1.getString())); + deserializedCodeInterpreterToolboxTool.allowedCallers = allowedCallers; } else if ("container".equals(fieldName)) { deserializedCodeInterpreterToolboxTool.container = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); @@ -161,4 +168,32 @@ public static CodeInterpreterToolboxTool fromJson(JsonReader jsonReader) throws return deserializedCodeInterpreterToolboxTool; }); } + + /* + * The allowed_callers property. + */ + @Generated + private List allowedCallers; + + /** + * Get the allowedCallers property: The allowed_callers property. + * + * @return the allowedCallers value. + */ + @Generated + public List getAllowedCallers() { + return this.allowedCallers; + } + + /** + * Set the allowedCallers property: The allowed_callers property. + * + * @param allowedCallers the allowedCallers value to set. + * @return the CodeInterpreterToolboxTool object itself. + */ + @Generated + public CodeInterpreterToolboxTool setAllowedCallers(List allowedCallers) { + this.allowedCallers = allowedCallers; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CreateAgentVersionInput.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CreateAgentVersionInput.java index a3d48ccf0afe..8bc5ee275f4b 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CreateAgentVersionInput.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CreateAgentVersionInput.java @@ -17,7 +17,6 @@ * The CreateAgentVersionInput model. */ @Fluent -@Beta(warningText = "Preview API. DraftAgents=V1Preview, ExternalAgents=V1Preview, WorkflowAgents=V1Preview") public final class CreateAgentVersionInput implements JsonSerializable { /* @@ -41,6 +40,7 @@ public final class CreateAgentVersionInput implements JsonSerializable writer.writeString(element == null ? null : element.toString())); return jsonWriter.writeEndObject(); } @@ -150,6 +153,7 @@ public static CustomToolParameter fromJson(JsonReader jsonReader) throws IOExcep String description = null; CustomToolParamFormat format = null; Boolean deferLoading = null; + List allowedCallers = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -163,6 +167,9 @@ public static CustomToolParameter fromJson(JsonReader jsonReader) throws IOExcep format = CustomToolParamFormat.fromJson(reader); } else if ("defer_loading".equals(fieldName)) { deferLoading = reader.getNullable(JsonReader::getBoolean); + } else if ("allowed_callers".equals(fieldName)) { + allowedCallers + = reader.readArray(reader1 -> CallableToolAllowedCaller.fromString(reader1.getString())); } else { reader.skipChildren(); } @@ -172,6 +179,7 @@ public static CustomToolParameter fromJson(JsonReader jsonReader) throws IOExcep deserializedCustomToolParameter.description = description; deserializedCustomToolParameter.format = format; deserializedCustomToolParameter.deferLoading = deferLoading; + deserializedCustomToolParameter.allowedCallers = allowedCallers; return deserializedCustomToolParameter; }); } @@ -203,4 +211,32 @@ public CustomToolParameter setDeferLoading(Boolean deferLoading) { this.deferLoading = deferLoading; return this; } + + /* + * The allowed_callers property. + */ + @Generated + private List allowedCallers; + + /** + * Get the allowedCallers property: The allowed_callers property. + * + * @return the allowedCallers value. + */ + @Generated + public List getAllowedCallers() { + return this.allowedCallers; + } + + /** + * Set the allowedCallers property: The allowed_callers property. + * + * @param allowedCallers the allowedCallers value to set. + * @return the CustomToolParameter object itself. + */ + @Generated + public CustomToolParameter setAllowedCallers(List allowedCallers) { + this.allowedCallers = allowedCallers; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FabricDataAgentToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FabricDataAgentToolCall.java index 13cb085a551b..80cb290bd76c 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FabricDataAgentToolCall.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FabricDataAgentToolCall.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.models; +import com.azure.ai.agents.implementation.utils.Beta; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -15,6 +16,7 @@ * A Fabric data agent tool call. */ @Immutable +@Beta(warningText = "Preview API. preview_tool") public final class FabricDataAgentToolCall implements JsonSerializable { /* diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FabricDataAgentToolCallOutput.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FabricDataAgentToolCallOutput.java index 44a81a6d12a2..22e3d9853d32 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FabricDataAgentToolCallOutput.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FabricDataAgentToolCallOutput.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.models; +import com.azure.ai.agents.implementation.utils.Beta; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.azure.core.util.BinaryData; @@ -16,6 +17,7 @@ * The output of a Fabric data agent tool call. */ @Fluent +@Beta(warningText = "Preview API. preview_tool") public final class FabricDataAgentToolCallOutput implements JsonSerializable